1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSVisualEffectMaterial(pub NSInteger);
impl NSVisualEffectMaterial {
    #[doc(alias = "NSVisualEffectMaterialTitlebar")]
    pub const Titlebar: Self = Self(3);
    #[doc(alias = "NSVisualEffectMaterialSelection")]
    pub const Selection: Self = Self(4);
    #[doc(alias = "NSVisualEffectMaterialMenu")]
    pub const Menu: Self = Self(5);
    #[doc(alias = "NSVisualEffectMaterialPopover")]
    pub const Popover: Self = Self(6);
    #[doc(alias = "NSVisualEffectMaterialSidebar")]
    pub const Sidebar: Self = Self(7);
    #[doc(alias = "NSVisualEffectMaterialHeaderView")]
    pub const HeaderView: Self = Self(10);
    #[doc(alias = "NSVisualEffectMaterialSheet")]
    pub const Sheet: Self = Self(11);
    #[doc(alias = "NSVisualEffectMaterialWindowBackground")]
    pub const WindowBackground: Self = Self(12);
    #[doc(alias = "NSVisualEffectMaterialHUDWindow")]
    pub const HUDWindow: Self = Self(13);
    #[doc(alias = "NSVisualEffectMaterialFullScreenUI")]
    pub const FullScreenUI: Self = Self(15);
    #[doc(alias = "NSVisualEffectMaterialToolTip")]
    pub const ToolTip: Self = Self(17);
    #[doc(alias = "NSVisualEffectMaterialContentBackground")]
    pub const ContentBackground: Self = Self(18);
    #[doc(alias = "NSVisualEffectMaterialUnderWindowBackground")]
    pub const UnderWindowBackground: Self = Self(21);
    #[doc(alias = "NSVisualEffectMaterialUnderPageBackground")]
    pub const UnderPageBackground: Self = Self(22);
    #[deprecated = "Use a specific semantic material instead."]
    #[doc(alias = "NSVisualEffectMaterialAppearanceBased")]
    pub const AppearanceBased: Self = Self(0);
    #[deprecated = "Use a semantic material instead.  To force the appearance of a view hierarchy, set the `appearance` property to an appropriate NSAppearance value."]
    #[doc(alias = "NSVisualEffectMaterialLight")]
    pub const Light: Self = Self(1);
    #[deprecated = "Use a semantic material instead.  To force the appearance of a view hierarchy, set the `appearance` property to an appropriate NSAppearance value."]
    #[doc(alias = "NSVisualEffectMaterialDark")]
    pub const Dark: Self = Self(2);
    #[deprecated = "Use a semantic material instead.  To force the appearance of a view hierarchy, set the `appearance` property to an appropriate NSAppearance value."]
    #[doc(alias = "NSVisualEffectMaterialMediumLight")]
    pub const MediumLight: Self = Self(8);
    #[deprecated = "Use a semantic material instead.  To force the appearance of a view hierarchy, set the `appearance` property to an appropriate NSAppearance value."]
    #[doc(alias = "NSVisualEffectMaterialUltraDark")]
    pub const UltraDark: Self = Self(9);
}

unsafe impl Encode for NSVisualEffectMaterial {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSVisualEffectMaterial {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSVisualEffectBlendingMode(pub NSInteger);
impl NSVisualEffectBlendingMode {
    #[doc(alias = "NSVisualEffectBlendingModeBehindWindow")]
    pub const BehindWindow: Self = Self(0);
    #[doc(alias = "NSVisualEffectBlendingModeWithinWindow")]
    pub const WithinWindow: Self = Self(1);
}

unsafe impl Encode for NSVisualEffectBlendingMode {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSVisualEffectBlendingMode {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSVisualEffectState(pub NSInteger);
impl NSVisualEffectState {
    #[doc(alias = "NSVisualEffectStateFollowsWindowActiveState")]
    pub const FollowsWindowActiveState: Self = Self(0);
    #[doc(alias = "NSVisualEffectStateActive")]
    pub const Active: Self = Self(1);
    #[doc(alias = "NSVisualEffectStateInactive")]
    pub const Inactive: Self = Self(2);
}

unsafe impl Encode for NSVisualEffectState {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSVisualEffectState {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "NSResponder", feature = "NSView"))]
    pub struct NSVisualEffectView;

    #[cfg(all(feature = "NSResponder", feature = "NSView"))]
    unsafe impl ClassType for NSVisualEffectView {
        #[inherits(NSResponder, NSObject)]
        type Super = NSView;
        type Mutability = MainThreadOnly;
    }
);

#[cfg(all(
    feature = "NSAccessibilityProtocols",
    feature = "NSResponder",
    feature = "NSView"
))]
unsafe impl NSAccessibility for NSVisualEffectView {}

#[cfg(all(
    feature = "NSAccessibilityProtocols",
    feature = "NSResponder",
    feature = "NSView"
))]
unsafe impl NSAccessibilityElementProtocol for NSVisualEffectView {}

#[cfg(all(feature = "NSAnimation", feature = "NSResponder", feature = "NSView"))]
unsafe impl NSAnimatablePropertyContainer for NSVisualEffectView {}

#[cfg(all(feature = "NSAppearance", feature = "NSResponder", feature = "NSView"))]
unsafe impl NSAppearanceCustomization for NSVisualEffectView {}

#[cfg(all(feature = "NSResponder", feature = "NSView"))]
unsafe impl NSCoding for NSVisualEffectView {}

#[cfg(all(feature = "NSDragging", feature = "NSResponder", feature = "NSView"))]
unsafe impl NSDraggingDestination for NSVisualEffectView {}

#[cfg(all(feature = "NSResponder", feature = "NSView"))]
unsafe impl NSObjectProtocol for NSVisualEffectView {}

#[cfg(all(
    feature = "NSResponder",
    feature = "NSUserInterfaceItemIdentification",
    feature = "NSView"
))]
unsafe impl NSUserInterfaceItemIdentification for NSVisualEffectView {}

extern_methods!(
    #[cfg(all(feature = "NSResponder", feature = "NSView"))]
    unsafe impl NSVisualEffectView {
        #[method(material)]
        pub unsafe fn material(&self) -> NSVisualEffectMaterial;

        #[method(setMaterial:)]
        pub unsafe fn setMaterial(&self, material: NSVisualEffectMaterial);

        #[cfg(feature = "NSCell")]
        #[method(interiorBackgroundStyle)]
        pub unsafe fn interiorBackgroundStyle(&self) -> NSBackgroundStyle;

        #[method(blendingMode)]
        pub unsafe fn blendingMode(&self) -> NSVisualEffectBlendingMode;

        #[method(setBlendingMode:)]
        pub unsafe fn setBlendingMode(&self, blending_mode: NSVisualEffectBlendingMode);

        #[method(state)]
        pub unsafe fn state(&self) -> NSVisualEffectState;

        #[method(setState:)]
        pub unsafe fn setState(&self, state: NSVisualEffectState);

        #[cfg(feature = "NSImage")]
        #[method_id(@__retain_semantics Other maskImage)]
        pub unsafe fn maskImage(&self) -> Option<Retained<NSImage>>;

        #[cfg(feature = "NSImage")]
        #[method(setMaskImage:)]
        pub unsafe fn setMaskImage(&self, mask_image: Option<&NSImage>);

        #[method(isEmphasized)]
        pub unsafe fn isEmphasized(&self) -> bool;

        #[method(setEmphasized:)]
        pub unsafe fn setEmphasized(&self, emphasized: bool);

        #[method(viewDidMoveToWindow)]
        pub unsafe fn viewDidMoveToWindow(&self);

        #[cfg(feature = "NSWindow")]
        #[method(viewWillMoveToWindow:)]
        pub unsafe fn viewWillMoveToWindow(&self, new_window: Option<&NSWindow>);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSView`
    #[cfg(all(feature = "NSResponder", feature = "NSView"))]
    unsafe impl NSVisualEffectView {
        #[method_id(@__retain_semantics Init initWithFrame:)]
        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;

        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSResponder`
    #[cfg(all(feature = "NSResponder", feature = "NSView"))]
    unsafe impl NSVisualEffectView {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(all(feature = "NSResponder", feature = "NSView"))]
    unsafe impl NSVisualEffectView {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    }
);