objc2_app_kit/generated/
NSCIImageRep.rs1use 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-image")]
9#[cfg(target_vendor = "apple")]
10use objc2_core_image::*;
11use objc2_foundation::*;
12
13use crate::*;
14
15extern_class!(
16 #[unsafe(super(NSImageRep, NSObject))]
18 #[derive(Debug, PartialEq, Eq, Hash)]
19 #[cfg(feature = "NSImageRep")]
20 pub struct NSCIImageRep;
21);
22
23#[cfg(feature = "NSImageRep")]
24extern_conformance!(
25 unsafe impl NSCoding for NSCIImageRep {}
26);
27
28#[cfg(feature = "NSImageRep")]
29extern_conformance!(
30 unsafe impl NSCopying for NSCIImageRep {}
31);
32
33#[cfg(feature = "NSImageRep")]
34unsafe impl CopyingHelper for NSCIImageRep {
35 type Result = Self;
36}
37
38#[cfg(feature = "NSImageRep")]
39extern_conformance!(
40 unsafe impl NSObjectProtocol for NSCIImageRep {}
41);
42
43#[cfg(feature = "NSImageRep")]
44impl NSCIImageRep {
45 extern_methods!(
46 #[cfg(feature = "objc2-core-image")]
47 #[cfg(target_vendor = "apple")]
48 #[unsafe(method(imageRepWithCIImage:))]
49 #[unsafe(method_family = none)]
50 pub unsafe fn imageRepWithCIImage(image: &CIImage) -> Retained<Self>;
51
52 #[cfg(feature = "objc2-core-image")]
53 #[cfg(target_vendor = "apple")]
54 #[unsafe(method(initWithCIImage:))]
55 #[unsafe(method_family = init)]
56 pub unsafe fn initWithCIImage(this: Allocated<Self>, image: &CIImage) -> Retained<Self>;
57
58 #[cfg(feature = "objc2-core-image")]
59 #[cfg(target_vendor = "apple")]
60 #[unsafe(method(CIImage))]
61 #[unsafe(method_family = none)]
62 pub unsafe fn CIImage(&self) -> Retained<CIImage>;
63 );
64}
65
66#[cfg(feature = "NSImageRep")]
68impl NSCIImageRep {
69 extern_methods!(
70 #[unsafe(method(init))]
71 #[unsafe(method_family = init)]
72 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
73
74 #[unsafe(method(initWithCoder:))]
75 #[unsafe(method_family = init)]
76 pub unsafe fn initWithCoder(
77 this: Allocated<Self>,
78 coder: &NSCoder,
79 ) -> Option<Retained<Self>>;
80 );
81}
82
83#[cfg(feature = "NSImageRep")]
85impl NSCIImageRep {
86 extern_methods!(
87 #[unsafe(method(new))]
88 #[unsafe(method_family = new)]
89 pub unsafe fn new() -> Retained<Self>;
90 );
91}
92
93mod private_CIImageNSAppKitAdditions {
94 pub trait Sealed {}
95}
96
97#[doc(alias = "NSAppKitAdditions")]
99pub unsafe trait CIImageNSAppKitAdditions:
100 ClassType + Sized + private_CIImageNSAppKitAdditions::Sealed
101{
102 extern_methods!(
103 #[cfg(all(feature = "NSBitmapImageRep", feature = "NSImageRep"))]
104 #[unsafe(method(initWithBitmapImageRep:))]
105 #[unsafe(method_family = init)]
106 unsafe fn initWithBitmapImageRep(
107 this: Allocated<Self>,
108 bitmap_image_rep: &NSBitmapImageRep,
109 ) -> Option<Retained<Self>>;
110
111 #[cfg(all(feature = "NSGraphics", feature = "objc2-core-foundation"))]
112 #[unsafe(method(drawInRect:fromRect:operation:fraction:))]
113 #[unsafe(method_family = none)]
114 unsafe fn drawInRect_fromRect_operation_fraction(
115 &self,
116 rect: NSRect,
117 from_rect: NSRect,
118 op: NSCompositingOperation,
119 delta: CGFloat,
120 );
121
122 #[cfg(all(feature = "NSGraphics", feature = "objc2-core-foundation"))]
123 #[unsafe(method(drawAtPoint:fromRect:operation:fraction:))]
124 #[unsafe(method_family = none)]
125 unsafe fn drawAtPoint_fromRect_operation_fraction(
126 &self,
127 point: NSPoint,
128 from_rect: NSRect,
129 op: NSCompositingOperation,
130 delta: CGFloat,
131 );
132 );
133}
134
135#[cfg(feature = "objc2-core-image")]
136#[cfg(target_vendor = "apple")]
137impl private_CIImageNSAppKitAdditions::Sealed for CIImage {}
138#[cfg(feature = "objc2-core-image")]
139#[cfg(target_vendor = "apple")]
140unsafe impl CIImageNSAppKitAdditions for CIImage {}