use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
use objc2_foundation::*;
use crate::*;
#[deprecated = "Use MKPinAnnotationView's pinTintColor instead"]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MKPinAnnotationColor(pub NSUInteger);
impl MKPinAnnotationColor {
#[doc(alias = "MKPinAnnotationColorRed")]
#[deprecated = "Use MKPinAnnotationView's pinTintColor instead"]
pub const Red: Self = Self(0);
#[doc(alias = "MKPinAnnotationColorGreen")]
#[deprecated = "Use MKPinAnnotationView's pinTintColor instead"]
pub const Green: Self = Self(1);
#[doc(alias = "MKPinAnnotationColorPurple")]
#[deprecated = "Use MKPinAnnotationView's pinTintColor instead"]
pub const Purple: Self = Self(2);
}
unsafe impl Encode for MKPinAnnotationColor {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for MKPinAnnotationColor {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(MKAnnotationView, NSView, NSResponder, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
#[deprecated]
pub struct MKPinAnnotationView;
);
#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSAccessibility for MKPinAnnotationView {}
);
#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSAccessibilityElementProtocol for MKPinAnnotationView {}
);
#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSAnimatablePropertyContainer for MKPinAnnotationView {}
);
#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSAppearanceCustomization for MKPinAnnotationView {}
);
#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSCoding for MKPinAnnotationView {}
);
#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSDraggingDestination for MKPinAnnotationView {}
);
#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSObjectProtocol for MKPinAnnotationView {}
);
#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSUserInterfaceItemIdentification for MKPinAnnotationView {}
);
#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
impl MKPinAnnotationView {
extern_methods!(
#[unsafe(method(redPinColor))]
#[unsafe(method_family = none)]
pub unsafe fn redPinColor(mtm: MainThreadMarker) -> Retained<NSColor>;
#[unsafe(method(greenPinColor))]
#[unsafe(method_family = none)]
pub unsafe fn greenPinColor(mtm: MainThreadMarker) -> Retained<NSColor>;
#[unsafe(method(purplePinColor))]
#[unsafe(method_family = none)]
pub unsafe fn purplePinColor(mtm: MainThreadMarker) -> Retained<NSColor>;
#[unsafe(method(pinTintColor))]
#[unsafe(method_family = none)]
pub unsafe fn pinTintColor(&self) -> Option<Retained<NSColor>>;
#[unsafe(method(setPinTintColor:))]
#[unsafe(method_family = none)]
pub unsafe fn setPinTintColor(&self, pin_tint_color: Option<&NSColor>);
#[deprecated]
#[unsafe(method(animatesDrop))]
#[unsafe(method_family = none)]
pub unsafe fn animatesDrop(&self) -> bool;
#[deprecated]
#[unsafe(method(setAnimatesDrop:))]
#[unsafe(method_family = none)]
pub unsafe fn setAnimatesDrop(&self, animates_drop: bool);
#[deprecated = "Use pinTintColor instead"]
#[unsafe(method(pinColor))]
#[unsafe(method_family = none)]
pub unsafe fn pinColor(&self) -> MKPinAnnotationColor;
#[deprecated = "Use pinTintColor instead"]
#[unsafe(method(setPinColor:))]
#[unsafe(method_family = none)]
pub unsafe fn setPinColor(&self, pin_color: MKPinAnnotationColor);
);
}
#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
impl MKPinAnnotationView {
extern_methods!(
#[cfg(feature = "MKAnnotation")]
#[unsafe(method(initWithAnnotation:reuseIdentifier:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithAnnotation_reuseIdentifier(
this: Allocated<Self>,
annotation: Option<&ProtocolObject<dyn MKAnnotation>>,
reuse_identifier: Option<&NSString>,
) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
a_decoder: &NSCoder,
) -> Option<Retained<Self>>;
);
}
#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
impl MKPinAnnotationView {
extern_methods!(
#[unsafe(method(initWithFrame:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
);
}
#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
impl MKPinAnnotationView {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
impl MKPinAnnotationView {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}