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")]
18unsafe impl NSCoding for NSCustomImageRep {}
19
20#[cfg(feature = "NSImageRep")]
21unsafe impl NSCopying for NSCustomImageRep {}
22
23#[cfg(feature = "NSImageRep")]
24unsafe impl CopyingHelper for NSCustomImageRep {
25    type Result = Self;
26}
27
28#[cfg(feature = "NSImageRep")]
29unsafe impl NSObjectProtocol for NSCustomImageRep {}
30
31#[cfg(feature = "NSImageRep")]
32impl NSCustomImageRep {
33    extern_methods!(
34        #[cfg(feature = "block2")]
35        #[unsafe(method(initWithSize:flipped:drawingHandler:))]
36        #[unsafe(method_family = init)]
37        pub unsafe fn initWithSize_flipped_drawingHandler(
38            this: Allocated<Self>,
39            size: NSSize,
40            drawing_handler_should_be_called_with_flipped_context: bool,
41            drawing_handler: &block2::Block<dyn Fn(NSRect) -> Bool>,
42        ) -> Retained<Self>;
43
44        #[cfg(feature = "block2")]
45        #[unsafe(method(drawingHandler))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn drawingHandler(&self) -> *mut block2::Block<dyn Fn(NSRect) -> Bool>;
48
49        #[unsafe(method(initWithDrawSelector:delegate:))]
50        #[unsafe(method_family = init)]
51        pub unsafe fn initWithDrawSelector_delegate(
52            this: Allocated<Self>,
53            selector: Sel,
54            delegate: &AnyObject,
55        ) -> Retained<Self>;
56
57        #[unsafe(method(drawSelector))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn drawSelector(&self) -> Option<Sel>;
60
61        #[unsafe(method(delegate))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn delegate(&self) -> Option<Retained<AnyObject>>;
64    );
65}
66
67/// Methods declared on superclass `NSImageRep`.
68#[cfg(feature = "NSImageRep")]
69impl NSCustomImageRep {
70    extern_methods!(
71        #[unsafe(method(init))]
72        #[unsafe(method_family = init)]
73        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
74
75        #[unsafe(method(initWithCoder:))]
76        #[unsafe(method_family = init)]
77        pub unsafe fn initWithCoder(
78            this: Allocated<Self>,
79            coder: &NSCoder,
80        ) -> Option<Retained<Self>>;
81    );
82}
83
84/// Methods declared on superclass `NSObject`.
85#[cfg(feature = "NSImageRep")]
86impl NSCustomImageRep {
87    extern_methods!(
88        #[unsafe(method(new))]
89        #[unsafe(method_family = new)]
90        pub unsafe fn new() -> Retained<Self>;
91    );
92}