objc2_app_kit/generated/
NSCustomImageRep.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscustomimagerep?language=objc)
11    #[unsafe(super(NSImageRep, NSObject))]
12    #[derive(Debug, PartialEq, Eq, Hash)]
13    #[cfg(feature = "NSImageRep")]
14    pub struct NSCustomImageRep;
15);
16
17#[cfg(feature = "NSImageRep")]
18extern_conformance!(
19    unsafe impl NSCoding for NSCustomImageRep {}
20);
21
22#[cfg(feature = "NSImageRep")]
23extern_conformance!(
24    unsafe impl NSCopying for NSCustomImageRep {}
25);
26
27#[cfg(feature = "NSImageRep")]
28unsafe impl CopyingHelper for NSCustomImageRep {
29    type Result = Self;
30}
31
32#[cfg(feature = "NSImageRep")]
33extern_conformance!(
34    unsafe impl NSObjectProtocol for NSCustomImageRep {}
35);
36
37#[cfg(feature = "NSImageRep")]
38impl NSCustomImageRep {
39    extern_methods!(
40        #[cfg(feature = "block2")]
41        #[unsafe(method(initWithSize:flipped:drawingHandler:))]
42        #[unsafe(method_family = init)]
43        pub unsafe fn initWithSize_flipped_drawingHandler(
44            this: Allocated<Self>,
45            size: NSSize,
46            drawing_handler_should_be_called_with_flipped_context: bool,
47            drawing_handler: &block2::DynBlock<dyn Fn(NSRect) -> Bool>,
48        ) -> Retained<Self>;
49
50        #[cfg(feature = "block2")]
51        #[unsafe(method(drawingHandler))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn drawingHandler(&self) -> *mut block2::DynBlock<dyn Fn(NSRect) -> Bool>;
54
55        #[unsafe(method(initWithDrawSelector:delegate:))]
56        #[unsafe(method_family = init)]
57        pub unsafe fn initWithDrawSelector_delegate(
58            this: Allocated<Self>,
59            selector: Sel,
60            delegate: &AnyObject,
61        ) -> Retained<Self>;
62
63        #[unsafe(method(drawSelector))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn drawSelector(&self) -> Option<Sel>;
66
67        #[unsafe(method(delegate))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn delegate(&self) -> Option<Retained<AnyObject>>;
70    );
71}
72
73/// Methods declared on superclass `NSImageRep`.
74#[cfg(feature = "NSImageRep")]
75impl NSCustomImageRep {
76    extern_methods!(
77        #[unsafe(method(init))]
78        #[unsafe(method_family = init)]
79        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
80
81        #[unsafe(method(initWithCoder:))]
82        #[unsafe(method_family = init)]
83        pub unsafe fn initWithCoder(
84            this: Allocated<Self>,
85            coder: &NSCoder,
86        ) -> Option<Retained<Self>>;
87    );
88}
89
90/// Methods declared on superclass `NSObject`.
91#[cfg(feature = "NSImageRep")]
92impl NSCustomImageRep {
93    extern_methods!(
94        #[unsafe(method(new))]
95        #[unsafe(method_family = new)]
96        pub unsafe fn new() -> Retained<Self>;
97    );
98}