objc2_app_kit/generated/
NSCachedImageRep.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscachedimagerep?language=objc)
11    #[unsafe(super(NSImageRep, NSObject))]
12    #[derive(Debug, PartialEq, Eq, Hash)]
13    #[cfg(feature = "NSImageRep")]
14    #[deprecated]
15    pub struct NSCachedImageRep;
16);
17
18#[cfg(feature = "NSImageRep")]
19extern_conformance!(
20    unsafe impl NSCoding for NSCachedImageRep {}
21);
22
23#[cfg(feature = "NSImageRep")]
24extern_conformance!(
25    unsafe impl NSCopying for NSCachedImageRep {}
26);
27
28#[cfg(feature = "NSImageRep")]
29unsafe impl CopyingHelper for NSCachedImageRep {
30    type Result = Self;
31}
32
33#[cfg(feature = "NSImageRep")]
34extern_conformance!(
35    unsafe impl NSObjectProtocol for NSCachedImageRep {}
36);
37
38#[cfg(feature = "NSImageRep")]
39impl NSCachedImageRep {
40    extern_methods!(
41        #[cfg(all(feature = "NSResponder", feature = "NSWindow"))]
42        /// # Safety
43        ///
44        /// `win` might not allow `None`.
45        #[deprecated]
46        #[unsafe(method(initWithWindow:rect:))]
47        #[unsafe(method_family = init)]
48        pub unsafe fn initWithWindow_rect(
49            this: Allocated<Self>,
50            win: Option<&NSWindow>,
51            rect: NSRect,
52        ) -> Option<Retained<Self>>;
53
54        #[cfg(feature = "NSGraphics")]
55        #[deprecated]
56        #[unsafe(method(initWithSize:depth:separate:alpha:))]
57        #[unsafe(method_family = init)]
58        pub fn initWithSize_depth_separate_alpha(
59            this: Allocated<Self>,
60            size: NSSize,
61            depth: NSWindowDepth,
62            flag: bool,
63            alpha: bool,
64        ) -> Option<Retained<Self>>;
65
66        #[cfg(all(feature = "NSResponder", feature = "NSWindow"))]
67        #[deprecated]
68        #[unsafe(method(window))]
69        #[unsafe(method_family = none)]
70        pub fn window(&self, mtm: MainThreadMarker) -> Option<Retained<NSWindow>>;
71
72        #[deprecated]
73        #[unsafe(method(rect))]
74        #[unsafe(method_family = none)]
75        pub fn rect(&self) -> NSRect;
76    );
77}
78
79/// Methods declared on superclass `NSImageRep`.
80#[cfg(feature = "NSImageRep")]
81impl NSCachedImageRep {
82    extern_methods!(
83        #[unsafe(method(init))]
84        #[unsafe(method_family = init)]
85        pub fn init(this: Allocated<Self>) -> Retained<Self>;
86
87        /// # Safety
88        ///
89        /// `coder` possibly has further requirements.
90        #[unsafe(method(initWithCoder:))]
91        #[unsafe(method_family = init)]
92        pub unsafe fn initWithCoder(
93            this: Allocated<Self>,
94            coder: &NSCoder,
95        ) -> Option<Retained<Self>>;
96    );
97}
98
99/// Methods declared on superclass `NSObject`.
100#[cfg(feature = "NSImageRep")]
101impl NSCachedImageRep {
102    extern_methods!(
103        #[unsafe(method(new))]
104        #[unsafe(method_family = new)]
105        pub fn new() -> Retained<Self>;
106    );
107}
108
109#[cfg(feature = "NSImageRep")]
110impl DefaultRetained for NSCachedImageRep {
111    #[inline]
112    fn default_retained() -> Retained<Self> {
113        Self::new()
114    }
115}