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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

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

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

unsafe impl NSCopying for NSScrubberLayoutAttributes {}

unsafe impl NSObjectProtocol for NSScrubberLayoutAttributes {}

extern_methods!(
    unsafe impl NSScrubberLayoutAttributes {
        #[method(itemIndex)]
        pub unsafe fn itemIndex(&self) -> NSInteger;

        #[method(setItemIndex:)]
        pub unsafe fn setItemIndex(&self, item_index: NSInteger);

        #[method(frame)]
        pub unsafe fn frame(&self) -> NSRect;

        #[method(setFrame:)]
        pub unsafe fn setFrame(&self, frame: NSRect);

        #[method(alpha)]
        pub unsafe fn alpha(&self) -> CGFloat;

        #[method(setAlpha:)]
        pub unsafe fn setAlpha(&self, alpha: CGFloat);

        #[method_id(@__retain_semantics Other layoutAttributesForItemAtIndex:)]
        pub unsafe fn layoutAttributesForItemAtIndex(index: NSInteger) -> Id<Self>;
    }
);

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

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

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

    unsafe impl ClassType for NSScrubberLayout {
        type Super = NSObject;
        type Mutability = MainThreadOnly;
    }
);

unsafe impl NSCoding for NSScrubberLayout {}

unsafe impl NSObjectProtocol for NSScrubberLayout {}

extern_methods!(
    unsafe impl NSScrubberLayout {
        #[method(layoutAttributesClass)]
        pub unsafe fn layoutAttributesClass(mtm: MainThreadMarker) -> &'static AnyClass;

        #[cfg(all(feature = "NSResponder", feature = "NSScrubber", feature = "NSView"))]
        #[method_id(@__retain_semantics Other scrubber)]
        pub unsafe fn scrubber(&self) -> Option<Id<NSScrubber>>;

        #[method(visibleRect)]
        pub unsafe fn visibleRect(&self) -> NSRect;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Id<Self>;

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

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

        #[method(scrubberContentSize)]
        pub unsafe fn scrubberContentSize(&self) -> NSSize;

        #[method_id(@__retain_semantics Other layoutAttributesForItemAtIndex:)]
        pub unsafe fn layoutAttributesForItemAtIndex(
            &self,
            index: NSInteger,
        ) -> Option<Id<NSScrubberLayoutAttributes>>;

        #[method_id(@__retain_semantics Other layoutAttributesForItemsInRect:)]
        pub unsafe fn layoutAttributesForItemsInRect(
            &self,
            rect: NSRect,
        ) -> Id<NSSet<NSScrubberLayoutAttributes>>;

        #[method(shouldInvalidateLayoutForSelectionChange)]
        pub unsafe fn shouldInvalidateLayoutForSelectionChange(&self) -> bool;

        #[method(shouldInvalidateLayoutForHighlightChange)]
        pub unsafe fn shouldInvalidateLayoutForHighlightChange(&self) -> bool;

        #[method(shouldInvalidateLayoutForChangeFromVisibleRect:toVisibleRect:)]
        pub unsafe fn shouldInvalidateLayoutForChangeFromVisibleRect_toVisibleRect(
            &self,
            from_visible_rect: NSRect,
            to_visible_rect: NSRect,
        ) -> bool;

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

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl NSScrubberLayout {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Id<Self>;
    }
);

extern_protocol!(
    #[cfg(feature = "NSScrubber")]
    pub unsafe trait NSScrubberFlowLayoutDelegate: NSScrubberDelegate {
        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
        #[optional]
        #[method(scrubber:layout:sizeForItemAtIndex:)]
        unsafe fn scrubber_layout_sizeForItemAtIndex(
            &self,
            scrubber: &NSScrubber,
            layout: &NSScrubberFlowLayout,
            item_index: NSInteger,
        ) -> NSSize;
    }

    #[cfg(feature = "NSScrubber")]
    unsafe impl ProtocolType for dyn NSScrubberFlowLayoutDelegate {}
);

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

    unsafe impl ClassType for NSScrubberFlowLayout {
        #[inherits(NSObject)]
        type Super = NSScrubberLayout;
        type Mutability = MainThreadOnly;
    }
);

unsafe impl NSCoding for NSScrubberFlowLayout {}

unsafe impl NSObjectProtocol for NSScrubberFlowLayout {}

extern_methods!(
    unsafe impl NSScrubberFlowLayout {
        #[method(itemSpacing)]
        pub unsafe fn itemSpacing(&self) -> CGFloat;

        #[method(setItemSpacing:)]
        pub unsafe fn setItemSpacing(&self, item_spacing: CGFloat);

        #[method(itemSize)]
        pub unsafe fn itemSize(&self) -> NSSize;

        #[method(setItemSize:)]
        pub unsafe fn setItemSize(&self, item_size: NSSize);

        #[method(invalidateLayoutForItemsAtIndexes:)]
        pub unsafe fn invalidateLayoutForItemsAtIndexes(&self, invalid_item_indexes: &NSIndexSet);
    }
);

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

        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Id<Self>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl NSScrubberFlowLayout {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Id<Self>;
    }
);

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

    unsafe impl ClassType for NSScrubberProportionalLayout {
        #[inherits(NSObject)]
        type Super = NSScrubberLayout;
        type Mutability = MainThreadOnly;
    }
);

unsafe impl NSCoding for NSScrubberProportionalLayout {}

unsafe impl NSObjectProtocol for NSScrubberProportionalLayout {}

extern_methods!(
    unsafe impl NSScrubberProportionalLayout {
        #[method(numberOfVisibleItems)]
        pub unsafe fn numberOfVisibleItems(&self) -> NSInteger;

        #[method(setNumberOfVisibleItems:)]
        pub unsafe fn setNumberOfVisibleItems(&self, number_of_visible_items: NSInteger);

        #[method_id(@__retain_semantics Init initWithNumberOfVisibleItems:)]
        pub unsafe fn initWithNumberOfVisibleItems(
            this: Allocated<Self>,
            number_of_visible_items: NSInteger,
        ) -> Id<Self>;

        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Id<Self>;
    }
);

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

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl NSScrubberProportionalLayout {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Id<Self>;
    }
);