use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSTrackingAreaOptions(pub NSUInteger);
impl NSTrackingAreaOptions {
pub const NSTrackingMouseEnteredAndExited: Self = Self(0x01);
pub const NSTrackingMouseMoved: Self = Self(0x02);
pub const NSTrackingCursorUpdate: Self = Self(0x04);
pub const NSTrackingActiveWhenFirstResponder: Self = Self(0x10);
pub const NSTrackingActiveInKeyWindow: Self = Self(0x20);
pub const NSTrackingActiveInActiveApp: Self = Self(0x40);
pub const NSTrackingActiveAlways: Self = Self(0x80);
pub const NSTrackingAssumeInside: Self = Self(0x100);
pub const NSTrackingInVisibleRect: Self = Self(0x200);
pub const NSTrackingEnabledDuringMouseDrag: Self = Self(0x400);
}
unsafe impl Encode for NSTrackingAreaOptions {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSTrackingAreaOptions {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSTrackingArea;
unsafe impl ClassType for NSTrackingArea {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSCoding for NSTrackingArea {}
unsafe impl NSCopying for NSTrackingArea {}
unsafe impl NSObjectProtocol for NSTrackingArea {}
extern_methods!(
unsafe impl NSTrackingArea {
#[method_id(@__retain_semantics Init initWithRect:options:owner:userInfo:)]
pub unsafe fn initWithRect_options_owner_userInfo(
this: Allocated<Self>,
rect: NSRect,
options: NSTrackingAreaOptions,
owner: Option<&AnyObject>,
user_info: Option<&NSDictionary<AnyObject, AnyObject>>,
) -> Id<Self>;
#[method(rect)]
pub unsafe fn rect(&self) -> NSRect;
#[method(options)]
pub unsafe fn options(&self) -> NSTrackingAreaOptions;
#[method_id(@__retain_semantics Other owner)]
pub unsafe fn owner(&self) -> Option<Id<AnyObject>>;
#[method_id(@__retain_semantics Other userInfo)]
pub unsafe fn userInfo(&self) -> Option<Id<NSDictionary<AnyObject, AnyObject>>>;
}
);
extern_methods!(
unsafe impl NSTrackingArea {
#[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>;
}
);