objc2_ui_kit/generated/
UIGraphicsRendererSubclass.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-graphics")]
7use objc2_core_graphics::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uigraphicsdrawingactions?language=objc)
13#[cfg(all(feature = "UIGraphicsRenderer", feature = "block2"))]
14pub type UIGraphicsDrawingActions =
15    *mut block2::DynBlock<dyn Fn(NonNull<UIGraphicsRendererContext>)>;
16
17/// UIGraphicsRendererProtected.
18#[cfg(feature = "UIGraphicsRenderer")]
19impl UIGraphicsRenderer {
20    extern_methods!(
21        #[unsafe(method(rendererContextClass))]
22        #[unsafe(method_family = none)]
23        pub unsafe fn rendererContextClass() -> &'static AnyClass;
24
25        #[cfg(feature = "objc2-core-graphics")]
26        #[unsafe(method(contextWithFormat:))]
27        // required for soundness, method has `returns_retained` attribute.
28        #[unsafe(method_family = copy)]
29        pub unsafe fn contextWithFormat(
30            format: &UIGraphicsRendererFormat,
31        ) -> Option<Retained<CGContext>>;
32
33        #[cfg(feature = "objc2-core-graphics")]
34        #[unsafe(method(prepareCGContext:withRendererContext:))]
35        #[unsafe(method_family = none)]
36        pub unsafe fn prepareCGContext_withRendererContext(
37            context: &CGContext,
38            renderer_context: &UIGraphicsRendererContext,
39        );
40
41        #[cfg(feature = "block2")]
42        #[unsafe(method(runDrawingActions:completionActions:error:_))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn runDrawingActions_completionActions_error(
45            &self,
46            drawing_actions: UIGraphicsDrawingActions,
47            completion_actions: UIGraphicsDrawingActions,
48        ) -> Result<(), Retained<NSError>>;
49    );
50}