objc2_quartz_core/generated/
CAOpenGLLayer.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8#[cfg(feature = "objc2-core-graphics")]
9use objc2_core_graphics::*;
10#[cfg(feature = "objc2-core-video")]
11use objc2_core_video::*;
12use objc2_foundation::*;
13#[cfg(feature = "objc2-open-gl")]
14#[cfg(target_os = "macos")]
15use objc2_open_gl::*;
16
17use crate::*;
18
19extern_class!(
20    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/caopengllayer?language=objc)
21    #[unsafe(super(CALayer, NSObject))]
22    #[derive(Debug, PartialEq, Eq, Hash)]
23    #[cfg(feature = "CALayer")]
24    #[deprecated = "OpenGL is deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings)"]
25    pub struct CAOpenGLLayer;
26);
27
28#[cfg(all(feature = "CALayer", feature = "CAMediaTiming"))]
29extern_conformance!(
30    unsafe impl CAMediaTiming for CAOpenGLLayer {}
31);
32
33#[cfg(feature = "CALayer")]
34extern_conformance!(
35    unsafe impl NSCoding for CAOpenGLLayer {}
36);
37
38#[cfg(feature = "CALayer")]
39extern_conformance!(
40    unsafe impl NSObjectProtocol for CAOpenGLLayer {}
41);
42
43#[cfg(feature = "CALayer")]
44extern_conformance!(
45    unsafe impl NSSecureCoding for CAOpenGLLayer {}
46);
47
48#[cfg(feature = "CALayer")]
49impl CAOpenGLLayer {
50    extern_methods!(
51        #[deprecated = "OpenGL is deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings)"]
52        #[unsafe(method(isAsynchronous))]
53        #[unsafe(method_family = none)]
54        pub fn isAsynchronous(&self) -> bool;
55
56        /// Setter for [`isAsynchronous`][Self::isAsynchronous].
57        #[deprecated = "OpenGL is deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings)"]
58        #[unsafe(method(setAsynchronous:))]
59        #[unsafe(method_family = none)]
60        pub fn setAsynchronous(&self, asynchronous: bool);
61
62        #[cfg(all(
63            feature = "objc2-core-foundation",
64            feature = "objc2-core-video",
65            feature = "objc2-open-gl"
66        ))]
67        #[cfg(target_os = "macos")]
68        /// # Safety
69        ///
70        /// - `ctx` must be a valid pointer.
71        /// - `pf` must be a valid pointer.
72        /// - `ts` must be a valid pointer or null.
73        #[deprecated = "OpenGL is deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings)"]
74        #[unsafe(method(canDrawInCGLContext:pixelFormat:forLayerTime:displayTime:))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn canDrawInCGLContext_pixelFormat_forLayerTime_displayTime(
77            &self,
78            ctx: CGLContextObj,
79            pf: CGLPixelFormatObj,
80            t: CFTimeInterval,
81            ts: *const CVTimeStamp,
82        ) -> bool;
83
84        #[cfg(all(
85            feature = "objc2-core-foundation",
86            feature = "objc2-core-video",
87            feature = "objc2-open-gl"
88        ))]
89        #[cfg(target_os = "macos")]
90        /// # Safety
91        ///
92        /// - `ctx` must be a valid pointer.
93        /// - `pf` must be a valid pointer.
94        /// - `ts` must be a valid pointer or null.
95        #[deprecated = "OpenGL is deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings)"]
96        #[unsafe(method(drawInCGLContext:pixelFormat:forLayerTime:displayTime:))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn drawInCGLContext_pixelFormat_forLayerTime_displayTime(
99            &self,
100            ctx: CGLContextObj,
101            pf: CGLPixelFormatObj,
102            t: CFTimeInterval,
103            ts: *const CVTimeStamp,
104        );
105
106        #[cfg(feature = "objc2-open-gl")]
107        #[cfg(target_os = "macos")]
108        #[deprecated = "OpenGL is deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings)"]
109        #[unsafe(method(copyCGLPixelFormatForDisplayMask:))]
110        #[unsafe(method_family = none)]
111        pub fn copyCGLPixelFormatForDisplayMask(&self, mask: u32) -> CGLPixelFormatObj;
112
113        #[cfg(feature = "objc2-open-gl")]
114        #[cfg(target_os = "macos")]
115        /// # Safety
116        ///
117        /// `pf` must be a valid pointer.
118        #[deprecated = "OpenGL is deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings)"]
119        #[unsafe(method(releaseCGLPixelFormat:))]
120        #[unsafe(method_family = none)]
121        pub unsafe fn releaseCGLPixelFormat(&self, pf: CGLPixelFormatObj);
122
123        #[cfg(feature = "objc2-open-gl")]
124        #[cfg(target_os = "macos")]
125        /// # Safety
126        ///
127        /// `pf` must be a valid pointer.
128        #[deprecated = "OpenGL is deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings)"]
129        #[unsafe(method(copyCGLContextForPixelFormat:))]
130        #[unsafe(method_family = none)]
131        pub unsafe fn copyCGLContextForPixelFormat(&self, pf: CGLPixelFormatObj) -> CGLContextObj;
132
133        #[cfg(feature = "objc2-open-gl")]
134        #[cfg(target_os = "macos")]
135        /// # Safety
136        ///
137        /// `ctx` must be a valid pointer.
138        #[deprecated = "OpenGL is deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings)"]
139        #[unsafe(method(releaseCGLContext:))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn releaseCGLContext(&self, ctx: CGLContextObj);
142
143        #[cfg(feature = "objc2-core-graphics")]
144        #[deprecated = "OpenGL is deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings)"]
145        #[unsafe(method(colorspace))]
146        #[unsafe(method_family = none)]
147        pub fn colorspace(&self) -> Option<Retained<CGColorSpace>>;
148
149        #[cfg(feature = "objc2-core-graphics")]
150        /// Setter for [`colorspace`][Self::colorspace].
151        #[deprecated = "OpenGL is deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings)"]
152        #[unsafe(method(setColorspace:))]
153        #[unsafe(method_family = none)]
154        pub fn setColorspace(&self, colorspace: Option<&CGColorSpace>);
155
156        #[unsafe(method(wantsExtendedDynamicRangeContent))]
157        #[unsafe(method_family = none)]
158        pub fn wantsExtendedDynamicRangeContent(&self) -> bool;
159
160        /// Setter for [`wantsExtendedDynamicRangeContent`][Self::wantsExtendedDynamicRangeContent].
161        #[unsafe(method(setWantsExtendedDynamicRangeContent:))]
162        #[unsafe(method_family = none)]
163        pub fn setWantsExtendedDynamicRangeContent(
164            &self,
165            wants_extended_dynamic_range_content: bool,
166        );
167    );
168}
169
170/// Methods declared on superclass `CALayer`.
171#[cfg(feature = "CALayer")]
172impl CAOpenGLLayer {
173    extern_methods!(
174        /// Layer creation and initialization. *
175        #[unsafe(method(layer))]
176        #[unsafe(method_family = none)]
177        pub fn layer() -> Retained<Self>;
178
179        #[unsafe(method(init))]
180        #[unsafe(method_family = init)]
181        pub fn init(this: Allocated<Self>) -> Retained<Self>;
182
183        /// # Safety
184        ///
185        /// `layer` should be of the correct type.
186        #[unsafe(method(initWithLayer:))]
187        #[unsafe(method_family = init)]
188        pub unsafe fn initWithLayer(this: Allocated<Self>, layer: &AnyObject) -> Retained<Self>;
189    );
190}
191
192/// Methods declared on superclass `NSObject`.
193#[cfg(feature = "CALayer")]
194impl CAOpenGLLayer {
195    extern_methods!(
196        #[unsafe(method(new))]
197        #[unsafe(method_family = new)]
198        pub fn new() -> Retained<Self>;
199    );
200}
201
202#[cfg(feature = "CALayer")]
203impl DefaultRetained for CAOpenGLLayer {
204    #[inline]
205    fn default_retained() -> Retained<Self> {
206        Self::new()
207    }
208}