objc2_app_kit/generated/
NSTrackingArea.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9#[repr(transparent)]
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
13pub struct NSTrackingAreaOptions(pub NSUInteger);
14bitflags::bitflags! {
15 impl NSTrackingAreaOptions: NSUInteger {
16 #[doc(alias = "NSTrackingMouseEnteredAndExited")]
17 const MouseEnteredAndExited = 0x01;
18 #[doc(alias = "NSTrackingMouseMoved")]
19 const MouseMoved = 0x02;
20 #[doc(alias = "NSTrackingCursorUpdate")]
21 const CursorUpdate = 0x04;
22 #[doc(alias = "NSTrackingActiveWhenFirstResponder")]
23 const ActiveWhenFirstResponder = 0x10;
24 #[doc(alias = "NSTrackingActiveInKeyWindow")]
25 const ActiveInKeyWindow = 0x20;
26 #[doc(alias = "NSTrackingActiveInActiveApp")]
27 const ActiveInActiveApp = 0x40;
28 #[doc(alias = "NSTrackingActiveAlways")]
29 const ActiveAlways = 0x80;
30 #[doc(alias = "NSTrackingAssumeInside")]
31 const AssumeInside = 0x100;
32 #[doc(alias = "NSTrackingInVisibleRect")]
33 const InVisibleRect = 0x200;
34 #[doc(alias = "NSTrackingEnabledDuringMouseDrag")]
35 const EnabledDuringMouseDrag = 0x400;
36 }
37}
38
39unsafe impl Encode for NSTrackingAreaOptions {
40 const ENCODING: Encoding = NSUInteger::ENCODING;
41}
42
43unsafe impl RefEncode for NSTrackingAreaOptions {
44 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
45}
46
47extern_class!(
48 #[unsafe(super(NSObject))]
50 #[derive(Debug, PartialEq, Eq, Hash)]
51 pub struct NSTrackingArea;
52);
53
54extern_conformance!(
55 unsafe impl NSCoding for NSTrackingArea {}
56);
57
58extern_conformance!(
59 unsafe impl NSCopying for NSTrackingArea {}
60);
61
62unsafe impl CopyingHelper for NSTrackingArea {
63 type Result = Self;
64}
65
66extern_conformance!(
67 unsafe impl NSObjectProtocol for NSTrackingArea {}
68);
69
70impl NSTrackingArea {
71 extern_methods!(
72 #[unsafe(method(initWithRect:options:owner:userInfo:))]
73 #[unsafe(method_family = init)]
74 pub unsafe fn initWithRect_options_owner_userInfo(
75 this: Allocated<Self>,
76 rect: NSRect,
77 options: NSTrackingAreaOptions,
78 owner: Option<&AnyObject>,
79 user_info: Option<&NSDictionary<AnyObject, AnyObject>>,
80 ) -> Retained<Self>;
81
82 #[unsafe(method(rect))]
83 #[unsafe(method_family = none)]
84 pub unsafe fn rect(&self) -> NSRect;
85
86 #[unsafe(method(options))]
87 #[unsafe(method_family = none)]
88 pub unsafe fn options(&self) -> NSTrackingAreaOptions;
89
90 #[unsafe(method(owner))]
91 #[unsafe(method_family = none)]
92 pub unsafe fn owner(&self) -> Option<Retained<AnyObject>>;
93
94 #[unsafe(method(userInfo))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn userInfo(&self) -> Option<Retained<NSDictionary<AnyObject, AnyObject>>>;
97 );
98}
99
100impl NSTrackingArea {
102 extern_methods!(
103 #[unsafe(method(init))]
104 #[unsafe(method_family = init)]
105 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
106
107 #[unsafe(method(new))]
108 #[unsafe(method_family = new)]
109 pub unsafe fn new() -> Retained<Self>;
110 );
111}