use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSColorWellStyle(pub NSInteger);
impl NSColorWellStyle {
#[doc(alias = "NSColorWellStyleDefault")]
pub const Default: Self = Self(0);
#[doc(alias = "NSColorWellStyleMinimal")]
pub const Minimal: Self = Self(1);
#[doc(alias = "NSColorWellStyleExpanded")]
pub const Expanded: Self = Self(2);
}
unsafe impl Encode for NSColorWellStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSColorWellStyle {
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 NSColorWell;
);
#[cfg(all(
feature = "NSAccessibilityProtocols",
feature = "NSControl",
feature = "NSResponder",
feature = "NSView"
))]
extern_conformance!(
unsafe impl NSAccessibility for NSColorWell {}
);
#[cfg(all(
feature = "NSAccessibilityProtocols",
feature = "NSControl",
feature = "NSResponder",
feature = "NSView"
))]
extern_conformance!(
unsafe impl NSAccessibilityElementProtocol for NSColorWell {}
);
#[cfg(all(
feature = "NSAnimation",
feature = "NSControl",
feature = "NSResponder",
feature = "NSView"
))]
extern_conformance!(
unsafe impl NSAnimatablePropertyContainer for NSColorWell {}
);
#[cfg(all(
feature = "NSAppearance",
feature = "NSControl",
feature = "NSResponder",
feature = "NSView"
))]
extern_conformance!(
unsafe impl NSAppearanceCustomization for NSColorWell {}
);
#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
unsafe impl NSCoding for NSColorWell {}
);
#[cfg(all(
feature = "NSControl",
feature = "NSDragging",
feature = "NSResponder",
feature = "NSView"
))]
extern_conformance!(
unsafe impl NSDraggingDestination for NSColorWell {}
);
#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
unsafe impl NSObjectProtocol for NSColorWell {}
);
#[cfg(all(
feature = "NSControl",
feature = "NSResponder",
feature = "NSUserInterfaceItemIdentification",
feature = "NSView"
))]
extern_conformance!(
unsafe impl NSUserInterfaceItemIdentification for NSColorWell {}
);
#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
impl NSColorWell {
extern_methods!(
#[unsafe(method(colorWellWithStyle:))]
#[unsafe(method_family = none)]
pub fn colorWellWithStyle(style: NSColorWellStyle, mtm: MainThreadMarker)
-> Retained<Self>;
#[unsafe(method(deactivate))]
#[unsafe(method_family = none)]
pub fn deactivate(&self);
#[unsafe(method(activate:))]
#[unsafe(method_family = none)]
pub fn activate(&self, exclusive: bool);
#[unsafe(method(isActive))]
#[unsafe(method_family = none)]
pub fn isActive(&self) -> bool;
#[unsafe(method(drawWellInside:))]
#[unsafe(method_family = none)]
pub fn drawWellInside(&self, inside_rect: NSRect);
#[deprecated = "This property will be deprecated in a future release."]
#[unsafe(method(isBordered))]
#[unsafe(method_family = none)]
pub fn isBordered(&self) -> bool;
#[deprecated = "This property will be deprecated in a future release."]
#[unsafe(method(setBordered:))]
#[unsafe(method_family = none)]
pub fn setBordered(&self, bordered: bool);
#[unsafe(method(takeColorFrom:))]
#[unsafe(method_family = none)]
pub unsafe fn takeColorFrom(&self, sender: Option<&AnyObject>);
#[cfg(feature = "NSColor")]
#[unsafe(method(color))]
#[unsafe(method_family = none)]
pub fn color(&self) -> Retained<NSColor>;
#[cfg(feature = "NSColor")]
#[unsafe(method(setColor:))]
#[unsafe(method_family = none)]
pub fn setColor(&self, color: &NSColor);
#[unsafe(method(colorWellStyle))]
#[unsafe(method_family = none)]
pub fn colorWellStyle(&self) -> NSColorWellStyle;
#[unsafe(method(setColorWellStyle:))]
#[unsafe(method_family = none)]
pub fn setColorWellStyle(&self, color_well_style: NSColorWellStyle);
#[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(pulldownTarget))]
#[unsafe(method_family = none)]
pub fn pulldownTarget(&self) -> Option<Retained<AnyObject>>;
#[unsafe(method(setPulldownTarget:))]
#[unsafe(method_family = none)]
pub unsafe fn setPulldownTarget(&self, pulldown_target: Option<&AnyObject>);
#[unsafe(method(pulldownAction))]
#[unsafe(method_family = none)]
pub fn pulldownAction(&self) -> Option<Sel>;
#[unsafe(method(setPulldownAction:))]
#[unsafe(method_family = none)]
pub unsafe fn setPulldownAction(&self, pulldown_action: Option<Sel>);
#[unsafe(method(supportsAlpha))]
#[unsafe(method_family = none)]
pub fn supportsAlpha(&self) -> bool;
#[unsafe(method(setSupportsAlpha:))]
#[unsafe(method_family = none)]
pub fn setSupportsAlpha(&self, supports_alpha: bool);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(maximumLinearExposure))]
#[unsafe(method_family = none)]
pub fn maximumLinearExposure(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setMaximumLinearExposure:))]
#[unsafe(method_family = none)]
pub fn setMaximumLinearExposure(&self, maximum_linear_exposure: CGFloat);
);
}
#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
impl NSColorWell {
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 NSColorWell {
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 NSColorWell {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}