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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
use crate::common::*;
use crate::AppKit::*;
use crate::Contacts::*;
use crate::CoreLocation::*;
use crate::Foundation::*;
use crate::MapKit::*;
extern_static!(MKAnnotationCalloutInfoDidChangeNotification: &'static NSString);
ns_enum!(
#[underlying(NSUInteger)]
pub enum MKAnnotationViewDragState {
MKAnnotationViewDragStateNone = 0,
MKAnnotationViewDragStateStarting = 1,
MKAnnotationViewDragStateDragging = 2,
MKAnnotationViewDragStateCanceling = 3,
MKAnnotationViewDragStateEnding = 4,
}
);
typed_extensible_enum!(
pub type MKFeatureDisplayPriority = c_float;
);
extern_static!(MKFeatureDisplayPriorityRequired: MKFeatureDisplayPriority = 1000);
extern_static!(MKFeatureDisplayPriorityDefaultHigh: MKFeatureDisplayPriority = 750);
extern_static!(MKFeatureDisplayPriorityDefaultLow: MKFeatureDisplayPriority = 250);
typed_extensible_enum!(
pub type MKAnnotationViewZPriority = c_float;
);
extern_static!(MKAnnotationViewZPriorityMax: MKAnnotationViewZPriority = 1000);
extern_static!(MKAnnotationViewZPriorityDefaultSelected: MKAnnotationViewZPriority = 1000);
extern_static!(MKAnnotationViewZPriorityDefaultUnselected: MKAnnotationViewZPriority = 500);
extern_static!(MKAnnotationViewZPriorityMin: MKAnnotationViewZPriority = 0);
ns_enum!(
#[underlying(NSInteger)]
pub enum MKAnnotationViewCollisionMode {
MKAnnotationViewCollisionModeRectangle = 0,
MKAnnotationViewCollisionModeCircle = 1,
MKAnnotationViewCollisionModeNone = 2,
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "MapKit_MKAnnotationView")]
pub struct MKAnnotationView;
#[cfg(feature = "MapKit_MKAnnotationView")]
unsafe impl ClassType for MKAnnotationView {
#[inherits(NSResponder, NSObject)]
type Super = NSView;
}
);
#[cfg(feature = "MapKit_MKAnnotationView")]
unsafe impl NSAccessibility for MKAnnotationView {}
#[cfg(feature = "MapKit_MKAnnotationView")]
unsafe impl NSAccessibilityElementProtocol for MKAnnotationView {}
#[cfg(feature = "MapKit_MKAnnotationView")]
unsafe impl NSAnimatablePropertyContainer for MKAnnotationView {}
#[cfg(feature = "MapKit_MKAnnotationView")]
unsafe impl NSAppearanceCustomization for MKAnnotationView {}
#[cfg(feature = "MapKit_MKAnnotationView")]
unsafe impl NSCoding for MKAnnotationView {}
#[cfg(feature = "MapKit_MKAnnotationView")]
unsafe impl NSDraggingDestination for MKAnnotationView {}
#[cfg(feature = "MapKit_MKAnnotationView")]
unsafe impl NSObjectProtocol for MKAnnotationView {}
#[cfg(feature = "MapKit_MKAnnotationView")]
unsafe impl NSUserInterfaceItemIdentification for MKAnnotationView {}
extern_methods!(
#[cfg(feature = "MapKit_MKAnnotationView")]
unsafe impl MKAnnotationView {
#[cfg(feature = "Foundation_NSString")]
#[method_id(@__retain_semantics Init initWithAnnotation:reuseIdentifier:)]
pub unsafe fn initWithAnnotation_reuseIdentifier(
this: Option<Allocated<Self>>,
annotation: Option<&ProtocolObject<dyn MKAnnotation>>,
reuse_identifier: Option<&NSString>,
) -> Id<Self, Shared>;
#[cfg(feature = "Foundation_NSCoder")]
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Option<Allocated<Self>>,
a_decoder: &NSCoder,
) -> Option<Id<Self, Shared>>;
#[cfg(feature = "Foundation_NSString")]
#[method_id(@__retain_semantics Other reuseIdentifier)]
pub unsafe fn reuseIdentifier(&self) -> Option<Id<NSString, Shared>>;
#[method(prepareForReuse)]
pub unsafe fn prepareForReuse(&self);
#[method(prepareForDisplay)]
pub unsafe fn prepareForDisplay(&self);
#[method_id(@__retain_semantics Other annotation)]
pub unsafe fn annotation(&self) -> Option<Id<ProtocolObject<dyn MKAnnotation>, Shared>>;
#[method(setAnnotation:)]
pub unsafe fn setAnnotation(&self, annotation: Option<&ProtocolObject<dyn MKAnnotation>>);
#[cfg(feature = "AppKit_NSImage")]
#[method_id(@__retain_semantics Other image)]
pub unsafe fn image(&self) -> Option<Id<NSImage, Shared>>;
#[cfg(feature = "AppKit_NSImage")]
#[method(setImage:)]
pub unsafe fn setImage(&self, image: Option<&NSImage>);
#[method(centerOffset)]
pub unsafe fn centerOffset(&self) -> CGPoint;
#[method(setCenterOffset:)]
pub unsafe fn setCenterOffset(&self, center_offset: CGPoint);
#[method(calloutOffset)]
pub unsafe fn calloutOffset(&self) -> CGPoint;
#[method(setCalloutOffset:)]
pub unsafe fn setCalloutOffset(&self, callout_offset: CGPoint);
#[method(leftCalloutOffset)]
pub unsafe fn leftCalloutOffset(&self) -> CGPoint;
#[method(setLeftCalloutOffset:)]
pub unsafe fn setLeftCalloutOffset(&self, left_callout_offset: CGPoint);
#[method(rightCalloutOffset)]
pub unsafe fn rightCalloutOffset(&self) -> CGPoint;
#[method(setRightCalloutOffset:)]
pub unsafe fn setRightCalloutOffset(&self, right_callout_offset: CGPoint);
#[method(isEnabled)]
pub unsafe fn isEnabled(&self) -> bool;
#[method(setEnabled:)]
pub unsafe fn setEnabled(&self, enabled: bool);
#[method(isHighlighted)]
pub unsafe fn isHighlighted(&self) -> bool;
#[method(setHighlighted:)]
pub unsafe fn setHighlighted(&self, highlighted: bool);
#[method(isSelected)]
pub unsafe fn isSelected(&self) -> bool;
#[method(setSelected:)]
pub unsafe fn setSelected(&self, selected: bool);
#[method(setSelected:animated:)]
pub unsafe fn setSelected_animated(&self, selected: bool, animated: bool);
#[method(canShowCallout)]
pub unsafe fn canShowCallout(&self) -> bool;
#[method(setCanShowCallout:)]
pub unsafe fn setCanShowCallout(&self, can_show_callout: bool);
#[method_id(@__retain_semantics Other leftCalloutAccessoryView)]
pub unsafe fn leftCalloutAccessoryView(&self) -> Option<Id<NSView, Shared>>;
#[method(setLeftCalloutAccessoryView:)]
pub unsafe fn setLeftCalloutAccessoryView(
&self,
left_callout_accessory_view: Option<&NSView>,
);
#[method_id(@__retain_semantics Other rightCalloutAccessoryView)]
pub unsafe fn rightCalloutAccessoryView(&self) -> Option<Id<NSView, Shared>>;
#[method(setRightCalloutAccessoryView:)]
pub unsafe fn setRightCalloutAccessoryView(
&self,
right_callout_accessory_view: Option<&NSView>,
);
#[method_id(@__retain_semantics Other detailCalloutAccessoryView)]
pub unsafe fn detailCalloutAccessoryView(&self) -> Option<Id<NSView, Shared>>;
#[method(setDetailCalloutAccessoryView:)]
pub unsafe fn setDetailCalloutAccessoryView(
&self,
detail_callout_accessory_view: Option<&NSView>,
);
#[method(isDraggable)]
pub unsafe fn isDraggable(&self) -> bool;
#[method(setDraggable:)]
pub unsafe fn setDraggable(&self, draggable: bool);
#[method(dragState)]
pub unsafe fn dragState(&self) -> MKAnnotationViewDragState;
#[method(setDragState:)]
pub unsafe fn setDragState(&self, drag_state: MKAnnotationViewDragState);
#[method(setDragState:animated:)]
pub unsafe fn setDragState_animated(
&self,
new_drag_state: MKAnnotationViewDragState,
animated: bool,
);
#[cfg(feature = "Foundation_NSString")]
#[method_id(@__retain_semantics Other clusteringIdentifier)]
pub unsafe fn clusteringIdentifier(&self) -> Option<Id<NSString, Shared>>;
#[cfg(feature = "Foundation_NSString")]
#[method(setClusteringIdentifier:)]
pub unsafe fn setClusteringIdentifier(&self, clustering_identifier: Option<&NSString>);
#[method_id(@__retain_semantics Other clusterAnnotationView)]
pub unsafe fn clusterAnnotationView(&self) -> Option<Id<MKAnnotationView, Shared>>;
#[method(displayPriority)]
pub unsafe fn displayPriority(&self) -> MKFeatureDisplayPriority;
#[method(setDisplayPriority:)]
pub unsafe fn setDisplayPriority(&self, display_priority: MKFeatureDisplayPriority);
#[method(zPriority)]
pub unsafe fn zPriority(&self) -> MKAnnotationViewZPriority;
#[method(setZPriority:)]
pub unsafe fn setZPriority(&self, z_priority: MKAnnotationViewZPriority);
#[method(selectedZPriority)]
pub unsafe fn selectedZPriority(&self) -> MKAnnotationViewZPriority;
#[method(setSelectedZPriority:)]
pub unsafe fn setSelectedZPriority(&self, selected_z_priority: MKAnnotationViewZPriority);
#[method(collisionMode)]
pub unsafe fn collisionMode(&self) -> MKAnnotationViewCollisionMode;
#[method(setCollisionMode:)]
pub unsafe fn setCollisionMode(&self, collision_mode: MKAnnotationViewCollisionMode);
}
);
extern_methods!(
#[cfg(feature = "MapKit_MKAnnotationView")]
unsafe impl MKAnnotationView {
#[method_id(@__retain_semantics Init initWithFrame:)]
pub unsafe fn initWithFrame(
this: Option<Allocated<Self>>,
frame_rect: NSRect,
) -> Id<Self, Shared>;
}
);