objc2_ui_kit/generated/
UIGraphicsRenderer.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-graphics")]
9use objc2_core_graphics::*;
10use objc2_foundation::*;
11
12use crate::*;
13
14extern_class!(
15 #[unsafe(super(NSObject))]
17 #[derive(Debug, PartialEq, Eq, Hash)]
18 pub struct UIGraphicsRendererFormat;
19);
20
21extern_conformance!(
22 unsafe impl NSCopying for UIGraphicsRendererFormat {}
23);
24
25unsafe impl CopyingHelper for UIGraphicsRendererFormat {
26 type Result = Self;
27}
28
29extern_conformance!(
30 unsafe impl NSObjectProtocol for UIGraphicsRendererFormat {}
31);
32
33impl UIGraphicsRendererFormat {
34 extern_methods!(
35 #[deprecated]
36 #[unsafe(method(defaultFormat))]
37 #[unsafe(method_family = none)]
38 pub unsafe fn defaultFormat() -> Retained<Self>;
39
40 #[unsafe(method(preferredFormat))]
41 #[unsafe(method_family = none)]
42 pub unsafe fn preferredFormat() -> Retained<Self>;
43
44 #[cfg(feature = "objc2-core-foundation")]
45 #[unsafe(method(bounds))]
46 #[unsafe(method_family = none)]
47 pub unsafe fn bounds(&self) -> CGRect;
48 );
49}
50
51impl UIGraphicsRendererFormat {
53 extern_methods!(
54 #[unsafe(method(init))]
55 #[unsafe(method_family = init)]
56 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
57
58 #[unsafe(method(new))]
59 #[unsafe(method_family = new)]
60 pub unsafe fn new() -> Retained<Self>;
61 );
62}
63
64extern_class!(
65 #[unsafe(super(NSObject))]
67 #[derive(Debug, PartialEq, Eq, Hash)]
68 pub struct UIGraphicsRendererContext;
69);
70
71extern_conformance!(
72 unsafe impl NSObjectProtocol for UIGraphicsRendererContext {}
73);
74
75impl UIGraphicsRendererContext {
76 extern_methods!(
77 #[cfg(feature = "objc2-core-graphics")]
78 #[unsafe(method(CGContext))]
79 #[unsafe(method_family = none)]
80 pub unsafe fn CGContext(&self) -> Retained<CGContext>;
81
82 #[unsafe(method(format))]
83 #[unsafe(method_family = none)]
84 pub unsafe fn format(&self) -> Retained<UIGraphicsRendererFormat>;
85
86 #[cfg(feature = "objc2-core-foundation")]
87 #[unsafe(method(fillRect:))]
88 #[unsafe(method_family = none)]
89 pub unsafe fn fillRect(&self, rect: CGRect);
90
91 #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-core-graphics"))]
92 #[unsafe(method(fillRect:blendMode:))]
93 #[unsafe(method_family = none)]
94 pub unsafe fn fillRect_blendMode(&self, rect: CGRect, blend_mode: CGBlendMode);
95
96 #[cfg(feature = "objc2-core-foundation")]
97 #[unsafe(method(strokeRect:))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn strokeRect(&self, rect: CGRect);
100
101 #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-core-graphics"))]
102 #[unsafe(method(strokeRect:blendMode:))]
103 #[unsafe(method_family = none)]
104 pub unsafe fn strokeRect_blendMode(&self, rect: CGRect, blend_mode: CGBlendMode);
105
106 #[cfg(feature = "objc2-core-foundation")]
107 #[unsafe(method(clipToRect:))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn clipToRect(&self, rect: CGRect);
110 );
111}
112
113impl UIGraphicsRendererContext {
115 extern_methods!(
116 #[unsafe(method(init))]
117 #[unsafe(method_family = init)]
118 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
119
120 #[unsafe(method(new))]
121 #[unsafe(method_family = new)]
122 pub unsafe fn new() -> Retained<Self>;
123 );
124}
125
126extern_class!(
127 #[unsafe(super(NSObject))]
129 #[derive(Debug, PartialEq, Eq, Hash)]
130 pub struct UIGraphicsRenderer;
131);
132
133extern_conformance!(
134 unsafe impl NSObjectProtocol for UIGraphicsRenderer {}
135);
136
137impl UIGraphicsRenderer {
138 extern_methods!(
139 #[cfg(feature = "objc2-core-foundation")]
140 #[unsafe(method(initWithBounds:))]
141 #[unsafe(method_family = init)]
142 pub unsafe fn initWithBounds(this: Allocated<Self>, bounds: CGRect) -> Retained<Self>;
143
144 #[cfg(feature = "objc2-core-foundation")]
145 #[unsafe(method(initWithBounds:format:))]
146 #[unsafe(method_family = init)]
147 pub unsafe fn initWithBounds_format(
148 this: Allocated<Self>,
149 bounds: CGRect,
150 format: &UIGraphicsRendererFormat,
151 ) -> Retained<Self>;
152
153 #[unsafe(method(format))]
154 #[unsafe(method_family = none)]
155 pub unsafe fn format(&self) -> Retained<UIGraphicsRendererFormat>;
156
157 #[unsafe(method(allowsImageOutput))]
158 #[unsafe(method_family = none)]
159 pub unsafe fn allowsImageOutput(&self) -> bool;
160 );
161}
162
163impl UIGraphicsRenderer {
165 extern_methods!(
166 #[unsafe(method(init))]
167 #[unsafe(method_family = init)]
168 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
169
170 #[unsafe(method(new))]
171 #[unsafe(method_family = new)]
172 pub unsafe fn new() -> Retained<Self>;
173 );
174}