use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCursor;
unsafe impl ClassType for NSCursor {
type Super = NSObject;
type Mutability = Immutable;
}
);
unsafe impl NSCoding for NSCursor {}
unsafe impl NSObjectProtocol for NSCursor {}
unsafe impl NSSecureCoding for NSCursor {}
extern_methods!(
unsafe impl NSCursor {
#[method_id(@__retain_semantics Other currentCursor)]
pub unsafe fn currentCursor() -> Id<NSCursor>;
#[method_id(@__retain_semantics Other currentSystemCursor)]
pub unsafe fn currentSystemCursor() -> Option<Id<NSCursor>>;
#[method_id(@__retain_semantics Other arrowCursor)]
pub fn arrowCursor() -> Id<NSCursor>;
#[method_id(@__retain_semantics Other IBeamCursor)]
pub fn IBeamCursor() -> Id<NSCursor>;
#[method_id(@__retain_semantics Other pointingHandCursor)]
pub fn pointingHandCursor() -> Id<NSCursor>;
#[method_id(@__retain_semantics Other closedHandCursor)]
pub fn closedHandCursor() -> Id<NSCursor>;
#[method_id(@__retain_semantics Other openHandCursor)]
pub fn openHandCursor() -> Id<NSCursor>;
#[method_id(@__retain_semantics Other resizeLeftCursor)]
pub fn resizeLeftCursor() -> Id<NSCursor>;
#[method_id(@__retain_semantics Other resizeRightCursor)]
pub fn resizeRightCursor() -> Id<NSCursor>;
#[method_id(@__retain_semantics Other resizeLeftRightCursor)]
pub fn resizeLeftRightCursor() -> Id<NSCursor>;
#[method_id(@__retain_semantics Other resizeUpCursor)]
pub fn resizeUpCursor() -> Id<NSCursor>;
#[method_id(@__retain_semantics Other resizeDownCursor)]
pub fn resizeDownCursor() -> Id<NSCursor>;
#[method_id(@__retain_semantics Other resizeUpDownCursor)]
pub fn resizeUpDownCursor() -> Id<NSCursor>;
#[method_id(@__retain_semantics Other crosshairCursor)]
pub fn crosshairCursor() -> Id<NSCursor>;
#[method_id(@__retain_semantics Other disappearingItemCursor)]
pub fn disappearingItemCursor() -> Id<NSCursor>;
#[method_id(@__retain_semantics Other operationNotAllowedCursor)]
pub fn operationNotAllowedCursor() -> Id<NSCursor>;
#[method_id(@__retain_semantics Other dragLinkCursor)]
pub fn dragLinkCursor() -> Id<NSCursor>;
#[method_id(@__retain_semantics Other dragCopyCursor)]
pub fn dragCopyCursor() -> Id<NSCursor>;
#[method_id(@__retain_semantics Other contextualMenuCursor)]
pub fn contextualMenuCursor() -> Id<NSCursor>;
#[method_id(@__retain_semantics Other IBeamCursorForVerticalLayout)]
pub fn IBeamCursorForVerticalLayout() -> Id<NSCursor>;
#[cfg(feature = "NSImage")]
#[method_id(@__retain_semantics Init initWithImage:hotSpot:)]
pub fn initWithImage_hotSpot(
this: Allocated<Self>,
new_image: &NSImage,
point: NSPoint,
) -> Id<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Id<Self>;
#[method(hide)]
pub unsafe fn hide();
#[method(unhide)]
pub unsafe fn unhide();
#[method(setHiddenUntilMouseMoves:)]
pub unsafe fn setHiddenUntilMouseMoves(flag: bool);
#[method(pop)]
pub unsafe fn pop_class();
#[cfg(feature = "NSImage")]
#[method_id(@__retain_semantics Other image)]
pub unsafe fn image(&self) -> Id<NSImage>;
#[method(hotSpot)]
pub unsafe fn hotSpot(&self) -> NSPoint;
#[method(push)]
pub unsafe fn push(&self);
#[method(pop)]
pub unsafe fn pop(&self);
#[method(set)]
pub unsafe fn set(&self);
}
);
extern_methods!(
unsafe impl NSCursor {
#[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>;
}
);
#[cfg(feature = "NSApplication")]
pub static NSAppKitVersionNumberWithCursorSizeSupport: NSAppKitVersion = 682.0 as _;
extern_methods!(
unsafe impl NSCursor {
#[cfg(all(feature = "NSColor", feature = "NSImage"))]
#[deprecated = "Color hints are ignored. Use -initWithImage:hotSpot: instead"]
#[method_id(@__retain_semantics Init initWithImage:foregroundColorHint:backgroundColorHint:hotSpot:)]
pub unsafe fn initWithImage_foregroundColorHint_backgroundColorHint_hotSpot(
this: Allocated<Self>,
new_image: &NSImage,
fg: Option<&NSColor>,
bg: Option<&NSColor>,
hot_spot: NSPoint,
) -> Id<Self>;
#[deprecated = "setOnMouseExited is unused and should not be called"]
#[method(setOnMouseExited:)]
pub unsafe fn setOnMouseExited(&self, flag: bool);
#[deprecated = "setOnMouseEntered is unused and should not be called"]
#[method(setOnMouseEntered:)]
pub unsafe fn setOnMouseEntered(&self, flag: bool);
#[deprecated = "isSetOnMouseExited is unused"]
#[method(isSetOnMouseExited)]
pub unsafe fn isSetOnMouseExited(&self) -> bool;
#[deprecated = "isSetOnMouseEntered is unused"]
#[method(isSetOnMouseEntered)]
pub unsafe fn isSetOnMouseEntered(&self) -> bool;
#[cfg(feature = "NSEvent")]
#[deprecated = "mouseEntered: is unused and should not be called"]
#[method(mouseEntered:)]
pub unsafe fn mouseEntered(&self, event: &NSEvent);
#[cfg(feature = "NSEvent")]
#[deprecated = "mouseExited: is unused and should not be called"]
#[method(mouseExited:)]
pub unsafe fn mouseExited(&self, event: &NSEvent);
}
);