use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSImageDynamicRange(pub NSInteger);
impl NSImageDynamicRange {
#[doc(alias = "NSImageDynamicRangeUnspecified")]
pub const Unspecified: Self = Self(-1);
#[doc(alias = "NSImageDynamicRangeStandard")]
pub const Standard: Self = Self(0);
#[doc(alias = "NSImageDynamicRangeConstrainedHigh")]
pub const ConstrainedHigh: Self = Self(1);
#[doc(alias = "NSImageDynamicRangeHigh")]
pub const High: Self = Self(2);
}
unsafe impl Encode for NSImageDynamicRange {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSImageDynamicRange {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSControl, NSView, NSResponder, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
pub struct NSImageView;
);
#[cfg(all(
feature = "NSAccessibilityProtocols",
feature = "NSControl",
feature = "NSResponder",
feature = "NSView"
))]
extern_conformance!(
unsafe impl NSAccessibility for NSImageView {}
);
#[cfg(all(
feature = "NSAccessibilityProtocols",
feature = "NSControl",
feature = "NSResponder",
feature = "NSView"
))]
extern_conformance!(
unsafe impl NSAccessibilityElementProtocol for NSImageView {}
);
#[cfg(all(
feature = "NSAccessibilityProtocols",
feature = "NSControl",
feature = "NSResponder",
feature = "NSView"
))]
extern_conformance!(
unsafe impl NSAccessibilityImage for NSImageView {}
);
#[cfg(all(
feature = "NSAnimation",
feature = "NSControl",
feature = "NSResponder",
feature = "NSView"
))]
extern_conformance!(
unsafe impl NSAnimatablePropertyContainer for NSImageView {}
);
#[cfg(all(
feature = "NSAppearance",
feature = "NSControl",
feature = "NSResponder",
feature = "NSView"
))]
extern_conformance!(
unsafe impl NSAppearanceCustomization for NSImageView {}
);
#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
unsafe impl NSCoding for NSImageView {}
);
#[cfg(all(
feature = "NSControl",
feature = "NSDragging",
feature = "NSResponder",
feature = "NSView"
))]
extern_conformance!(
unsafe impl NSDraggingDestination for NSImageView {}
);
#[cfg(all(
feature = "NSControl",
feature = "NSMenu",
feature = "NSResponder",
feature = "NSView"
))]
extern_conformance!(
unsafe impl NSMenuItemValidation for NSImageView {}
);
#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
unsafe impl NSObjectProtocol for NSImageView {}
);
#[cfg(all(
feature = "NSControl",
feature = "NSResponder",
feature = "NSUserInterfaceItemIdentification",
feature = "NSView"
))]
extern_conformance!(
unsafe impl NSUserInterfaceItemIdentification for NSImageView {}
);
#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
impl NSImageView {
extern_methods!(
#[cfg(feature = "NSImage")]
#[unsafe(method(imageViewWithImage:))]
#[unsafe(method_family = none)]
pub fn imageViewWithImage(image: &NSImage, mtm: MainThreadMarker) -> Retained<Self>;
#[cfg(feature = "NSImage")]
#[unsafe(method(image))]
#[unsafe(method_family = none)]
pub fn image(&self) -> Option<Retained<NSImage>>;
#[cfg(feature = "NSImage")]
#[unsafe(method(setImage:))]
#[unsafe(method_family = none)]
pub fn setImage(&self, image: Option<&NSImage>);
#[unsafe(method(isEditable))]
#[unsafe(method_family = none)]
pub fn isEditable(&self) -> bool;
#[unsafe(method(setEditable:))]
#[unsafe(method_family = none)]
pub fn setEditable(&self, editable: bool);
#[cfg(feature = "NSImageCell")]
#[unsafe(method(imageAlignment))]
#[unsafe(method_family = none)]
pub fn imageAlignment(&self) -> NSImageAlignment;
#[cfg(feature = "NSImageCell")]
#[unsafe(method(setImageAlignment:))]
#[unsafe(method_family = none)]
pub fn setImageAlignment(&self, image_alignment: NSImageAlignment);
#[cfg(feature = "NSCell")]
#[unsafe(method(imageScaling))]
#[unsafe(method_family = none)]
pub fn imageScaling(&self) -> NSImageScaling;
#[cfg(feature = "NSCell")]
#[unsafe(method(setImageScaling:))]
#[unsafe(method_family = none)]
pub fn setImageScaling(&self, image_scaling: NSImageScaling);
#[cfg(feature = "NSImageCell")]
#[unsafe(method(imageFrameStyle))]
#[unsafe(method_family = none)]
pub fn imageFrameStyle(&self) -> NSImageFrameStyle;
#[cfg(feature = "NSImageCell")]
#[unsafe(method(setImageFrameStyle:))]
#[unsafe(method_family = none)]
pub fn setImageFrameStyle(&self, image_frame_style: NSImageFrameStyle);
#[cfg(feature = "NSImage")]
#[unsafe(method(symbolConfiguration))]
#[unsafe(method_family = none)]
pub fn symbolConfiguration(&self) -> Option<Retained<NSImageSymbolConfiguration>>;
#[cfg(feature = "NSImage")]
#[unsafe(method(setSymbolConfiguration:))]
#[unsafe(method_family = none)]
pub fn setSymbolConfiguration(
&self,
symbol_configuration: Option<&NSImageSymbolConfiguration>,
);
#[cfg(feature = "NSColor")]
#[unsafe(method(contentTintColor))]
#[unsafe(method_family = none)]
pub fn contentTintColor(&self) -> Option<Retained<NSColor>>;
#[cfg(feature = "NSColor")]
#[unsafe(method(setContentTintColor:))]
#[unsafe(method_family = none)]
pub fn setContentTintColor(&self, content_tint_color: Option<&NSColor>);
#[unsafe(method(animates))]
#[unsafe(method_family = none)]
pub fn animates(&self) -> bool;
#[unsafe(method(setAnimates:))]
#[unsafe(method_family = none)]
pub fn setAnimates(&self, animates: bool);
#[unsafe(method(allowsCutCopyPaste))]
#[unsafe(method_family = none)]
pub fn allowsCutCopyPaste(&self) -> bool;
#[unsafe(method(setAllowsCutCopyPaste:))]
#[unsafe(method_family = none)]
pub fn setAllowsCutCopyPaste(&self, allows_cut_copy_paste: bool);
#[unsafe(method(defaultPreferredImageDynamicRange))]
#[unsafe(method_family = none)]
pub fn defaultPreferredImageDynamicRange(mtm: MainThreadMarker) -> NSImageDynamicRange;
#[unsafe(method(setDefaultPreferredImageDynamicRange:))]
#[unsafe(method_family = none)]
pub fn setDefaultPreferredImageDynamicRange(
default_preferred_image_dynamic_range: NSImageDynamicRange,
mtm: MainThreadMarker,
);
#[unsafe(method(preferredImageDynamicRange))]
#[unsafe(method_family = none)]
pub fn preferredImageDynamicRange(&self) -> NSImageDynamicRange;
#[unsafe(method(setPreferredImageDynamicRange:))]
#[unsafe(method_family = none)]
pub fn setPreferredImageDynamicRange(
&self,
preferred_image_dynamic_range: NSImageDynamicRange,
);
#[unsafe(method(imageDynamicRange))]
#[unsafe(method_family = none)]
pub fn imageDynamicRange(&self) -> NSImageDynamicRange;
);
}
#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
impl NSImageView {
extern_methods!(
#[unsafe(method(initWithFrame:))]
#[unsafe(method_family = init)]
pub fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
);
}
#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
impl NSImageView {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
impl NSImageView {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}