objc2_ui_kit/generated/
UIGraphicsRenderer.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::*;
10use objc2_foundation::*;
11
12use crate::*;
13
14extern_class!(
15    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uigraphicsrendererformat?language=objc)
16    #[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 fn defaultFormat() -> Retained<Self>;
39
40        #[unsafe(method(preferredFormat))]
41        #[unsafe(method_family = none)]
42        pub fn preferredFormat() -> Retained<Self>;
43
44        #[cfg(feature = "objc2-core-foundation")]
45        #[unsafe(method(bounds))]
46        #[unsafe(method_family = none)]
47        pub fn bounds(&self) -> CGRect;
48    );
49}
50
51/// Methods declared on superclass `NSObject`.
52impl UIGraphicsRendererFormat {
53    extern_methods!(
54        #[unsafe(method(init))]
55        #[unsafe(method_family = init)]
56        pub fn init(this: Allocated<Self>) -> Retained<Self>;
57
58        #[unsafe(method(new))]
59        #[unsafe(method_family = new)]
60        pub fn new() -> Retained<Self>;
61    );
62}
63
64impl DefaultRetained for UIGraphicsRendererFormat {
65    #[inline]
66    fn default_retained() -> Retained<Self> {
67        Self::new()
68    }
69}
70
71extern_class!(
72    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uigraphicsrenderercontext?language=objc)
73    #[unsafe(super(NSObject))]
74    #[derive(Debug, PartialEq, Eq, Hash)]
75    pub struct UIGraphicsRendererContext;
76);
77
78extern_conformance!(
79    unsafe impl NSObjectProtocol for UIGraphicsRendererContext {}
80);
81
82impl UIGraphicsRendererContext {
83    extern_methods!(
84        #[cfg(feature = "objc2-core-graphics")]
85        #[unsafe(method(CGContext))]
86        #[unsafe(method_family = none)]
87        pub fn CGContext(&self) -> Retained<CGContext>;
88
89        #[unsafe(method(format))]
90        #[unsafe(method_family = none)]
91        pub fn format(&self) -> Retained<UIGraphicsRendererFormat>;
92
93        #[cfg(feature = "objc2-core-foundation")]
94        #[unsafe(method(fillRect:))]
95        #[unsafe(method_family = none)]
96        pub fn fillRect(&self, rect: CGRect);
97
98        #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-core-graphics"))]
99        #[unsafe(method(fillRect:blendMode:))]
100        #[unsafe(method_family = none)]
101        pub fn fillRect_blendMode(&self, rect: CGRect, blend_mode: CGBlendMode);
102
103        #[cfg(feature = "objc2-core-foundation")]
104        #[unsafe(method(strokeRect:))]
105        #[unsafe(method_family = none)]
106        pub fn strokeRect(&self, rect: CGRect);
107
108        #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-core-graphics"))]
109        #[unsafe(method(strokeRect:blendMode:))]
110        #[unsafe(method_family = none)]
111        pub fn strokeRect_blendMode(&self, rect: CGRect, blend_mode: CGBlendMode);
112
113        #[cfg(feature = "objc2-core-foundation")]
114        #[unsafe(method(clipToRect:))]
115        #[unsafe(method_family = none)]
116        pub fn clipToRect(&self, rect: CGRect);
117    );
118}
119
120/// Methods declared on superclass `NSObject`.
121impl UIGraphicsRendererContext {
122    extern_methods!(
123        #[unsafe(method(init))]
124        #[unsafe(method_family = init)]
125        pub fn init(this: Allocated<Self>) -> Retained<Self>;
126
127        #[unsafe(method(new))]
128        #[unsafe(method_family = new)]
129        pub fn new() -> Retained<Self>;
130    );
131}
132
133impl DefaultRetained for UIGraphicsRendererContext {
134    #[inline]
135    fn default_retained() -> Retained<Self> {
136        Self::new()
137    }
138}
139
140extern_class!(
141    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uigraphicsrenderer?language=objc)
142    #[unsafe(super(NSObject))]
143    #[derive(Debug, PartialEq, Eq, Hash)]
144    pub struct UIGraphicsRenderer;
145);
146
147extern_conformance!(
148    unsafe impl NSObjectProtocol for UIGraphicsRenderer {}
149);
150
151impl UIGraphicsRenderer {
152    extern_methods!(
153        #[cfg(feature = "objc2-core-foundation")]
154        #[unsafe(method(initWithBounds:))]
155        #[unsafe(method_family = init)]
156        pub fn initWithBounds(this: Allocated<Self>, bounds: CGRect) -> Retained<Self>;
157
158        #[cfg(feature = "objc2-core-foundation")]
159        #[unsafe(method(initWithBounds:format:))]
160        #[unsafe(method_family = init)]
161        pub fn initWithBounds_format(
162            this: Allocated<Self>,
163            bounds: CGRect,
164            format: &UIGraphicsRendererFormat,
165        ) -> Retained<Self>;
166
167        #[unsafe(method(format))]
168        #[unsafe(method_family = none)]
169        pub fn format(&self) -> Retained<UIGraphicsRendererFormat>;
170
171        #[unsafe(method(allowsImageOutput))]
172        #[unsafe(method_family = none)]
173        pub fn allowsImageOutput(&self) -> bool;
174    );
175}
176
177/// Methods declared on superclass `NSObject`.
178impl UIGraphicsRenderer {
179    extern_methods!(
180        #[unsafe(method(init))]
181        #[unsafe(method_family = init)]
182        pub fn init(this: Allocated<Self>) -> Retained<Self>;
183
184        #[unsafe(method(new))]
185        #[unsafe(method_family = new)]
186        pub fn new() -> Retained<Self>;
187    );
188}
189
190impl DefaultRetained for UIGraphicsRenderer {
191    #[inline]
192    fn default_retained() -> Retained<Self> {
193        Self::new()
194    }
195}