objc2-app-kit 0.2.2

Bindings to the AppKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
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() -> Retained<NSCursor>;

        #[method_id(@__retain_semantics Other currentSystemCursor)]
        pub unsafe fn currentSystemCursor() -> Option<Retained<NSCursor>>;

        #[method_id(@__retain_semantics Other arrowCursor)]
        pub fn arrowCursor() -> Retained<NSCursor>;

        #[method_id(@__retain_semantics Other IBeamCursor)]
        pub fn IBeamCursor() -> Retained<NSCursor>;

        #[method_id(@__retain_semantics Other pointingHandCursor)]
        pub fn pointingHandCursor() -> Retained<NSCursor>;

        #[method_id(@__retain_semantics Other closedHandCursor)]
        pub fn closedHandCursor() -> Retained<NSCursor>;

        #[method_id(@__retain_semantics Other openHandCursor)]
        pub fn openHandCursor() -> Retained<NSCursor>;

        #[method_id(@__retain_semantics Other resizeLeftCursor)]
        pub fn resizeLeftCursor() -> Retained<NSCursor>;

        #[method_id(@__retain_semantics Other resizeRightCursor)]
        pub fn resizeRightCursor() -> Retained<NSCursor>;

        #[method_id(@__retain_semantics Other resizeLeftRightCursor)]
        pub fn resizeLeftRightCursor() -> Retained<NSCursor>;

        #[method_id(@__retain_semantics Other resizeUpCursor)]
        pub fn resizeUpCursor() -> Retained<NSCursor>;

        #[method_id(@__retain_semantics Other resizeDownCursor)]
        pub fn resizeDownCursor() -> Retained<NSCursor>;

        #[method_id(@__retain_semantics Other resizeUpDownCursor)]
        pub fn resizeUpDownCursor() -> Retained<NSCursor>;

        #[method_id(@__retain_semantics Other crosshairCursor)]
        pub fn crosshairCursor() -> Retained<NSCursor>;

        #[method_id(@__retain_semantics Other disappearingItemCursor)]
        pub fn disappearingItemCursor() -> Retained<NSCursor>;

        #[method_id(@__retain_semantics Other operationNotAllowedCursor)]
        pub fn operationNotAllowedCursor() -> Retained<NSCursor>;

        #[method_id(@__retain_semantics Other dragLinkCursor)]
        pub fn dragLinkCursor() -> Retained<NSCursor>;

        #[method_id(@__retain_semantics Other dragCopyCursor)]
        pub fn dragCopyCursor() -> Retained<NSCursor>;

        #[method_id(@__retain_semantics Other contextualMenuCursor)]
        pub fn contextualMenuCursor() -> Retained<NSCursor>;

        #[method_id(@__retain_semantics Other IBeamCursorForVerticalLayout)]
        pub fn IBeamCursorForVerticalLayout() -> Retained<NSCursor>;

        #[cfg(feature = "NSImage")]
        #[method_id(@__retain_semantics Init initWithImage:hotSpot:)]
        pub fn initWithImage_hotSpot(
            this: Allocated<Self>,
            new_image: &NSImage,
            point: NSPoint,
        ) -> Retained<Self>;

        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<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) -> Retained<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!(
    /// Methods declared on superclass `NSObject`
    unsafe impl NSCursor {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

#[cfg(feature = "NSApplication")]
pub static NSAppKitVersionNumberWithCursorSizeSupport: NSAppKitVersion = 682.0 as _;

extern_methods!(
    /// NSDeprecated
    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,
        ) -> Retained<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);
    }
);