objc2_quartz_core/generated/
CARenderer.rs1use 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-video")]
9use objc2_core_video::*;
10use objc2_foundation::*;
11#[cfg(feature = "objc2-metal")]
12use objc2_metal::*;
13
14use crate::*;
15
16extern_class!(
17 #[unsafe(super(NSObject))]
19 #[derive(Debug, PartialEq, Eq, Hash)]
20 pub struct CARenderer;
21);
22
23extern_conformance!(
24 unsafe impl NSObjectProtocol for CARenderer {}
25);
26
27impl CARenderer {
28 extern_methods!(
29 #[deprecated = "+rendererWithMTLTexture"]
30 #[unsafe(method(rendererWithCGLContext:options:))]
31 #[unsafe(method_family = none)]
32 pub unsafe fn rendererWithCGLContext_options(
33 ctx: NonNull<c_void>,
34 dict: Option<&NSDictionary>,
35 ) -> Retained<CARenderer>;
36
37 #[cfg(feature = "objc2-metal")]
38 #[unsafe(method(rendererWithMTLTexture:options:))]
39 #[unsafe(method_family = none)]
40 pub unsafe fn rendererWithMTLTexture_options(
41 tex: &ProtocolObject<dyn MTLTexture>,
42 dict: Option<&NSDictionary>,
43 ) -> Retained<CARenderer>;
44
45 #[cfg(feature = "CALayer")]
46 #[unsafe(method(layer))]
47 #[unsafe(method_family = none)]
48 pub fn layer(&self) -> Option<Retained<CALayer>>;
49
50 #[cfg(feature = "CALayer")]
51 #[unsafe(method(setLayer:))]
53 #[unsafe(method_family = none)]
54 pub fn setLayer(&self, layer: Option<&CALayer>);
55
56 #[cfg(feature = "objc2-core-foundation")]
57 #[unsafe(method(bounds))]
58 #[unsafe(method_family = none)]
59 pub fn bounds(&self) -> CGRect;
60
61 #[cfg(feature = "objc2-core-foundation")]
62 #[unsafe(method(setBounds:))]
64 #[unsafe(method_family = none)]
65 pub fn setBounds(&self, bounds: CGRect);
66
67 #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-core-video"))]
68 #[unsafe(method(beginFrameAtTime:timeStamp:))]
69 #[unsafe(method_family = none)]
70 pub unsafe fn beginFrameAtTime_timeStamp(&self, t: CFTimeInterval, ts: *mut CVTimeStamp);
71
72 #[cfg(feature = "objc2-core-foundation")]
73 #[unsafe(method(updateBounds))]
74 #[unsafe(method_family = none)]
75 pub fn updateBounds(&self) -> CGRect;
76
77 #[cfg(feature = "objc2-core-foundation")]
78 #[unsafe(method(addUpdateRect:))]
79 #[unsafe(method_family = none)]
80 pub fn addUpdateRect(&self, r: CGRect);
81
82 #[unsafe(method(render))]
83 #[unsafe(method_family = none)]
84 pub fn render(&self);
85
86 #[cfg(feature = "objc2-core-foundation")]
87 #[unsafe(method(nextFrameTime))]
88 #[unsafe(method_family = none)]
89 pub fn nextFrameTime(&self) -> CFTimeInterval;
90
91 #[unsafe(method(endFrame))]
92 #[unsafe(method_family = none)]
93 pub fn endFrame(&self);
94
95 #[cfg(feature = "objc2-metal")]
96 #[unsafe(method(setDestination:))]
97 #[unsafe(method_family = none)]
98 pub unsafe fn setDestination(&self, tex: &ProtocolObject<dyn MTLTexture>);
99 );
100}
101
102impl CARenderer {
104 extern_methods!(
105 #[unsafe(method(init))]
106 #[unsafe(method_family = init)]
107 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
108
109 #[unsafe(method(new))]
110 #[unsafe(method_family = new)]
111 pub unsafe fn new() -> Retained<Self>;
112 );
113}
114
115extern "C" {
116 pub static kCARendererColorSpace: &'static NSString;
120}
121
122extern "C" {
123 pub static kCARendererMetalCommandQueue: &'static NSString;
125}