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