1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-image")]
#[cfg(target_vendor = "apple")]
use objc2_core_image::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "NSImageRep")]
    pub struct NSCIImageRep;

    #[cfg(feature = "NSImageRep")]
    unsafe impl ClassType for NSCIImageRep {
        #[inherits(NSObject)]
        type Super = NSImageRep;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "NSImageRep")]
unsafe impl NSCoding for NSCIImageRep {}

#[cfg(feature = "NSImageRep")]
unsafe impl NSCopying for NSCIImageRep {}

#[cfg(feature = "NSImageRep")]
unsafe impl NSObjectProtocol for NSCIImageRep {}

extern_methods!(
    #[cfg(feature = "NSImageRep")]
    unsafe impl NSCIImageRep {
        #[cfg(feature = "objc2-core-image")]
        #[cfg(target_vendor = "apple")]
        #[method_id(@__retain_semantics Other imageRepWithCIImage:)]
        pub unsafe fn imageRepWithCIImage(image: &CIImage) -> Retained<Self>;

        #[cfg(feature = "objc2-core-image")]
        #[cfg(target_vendor = "apple")]
        #[method_id(@__retain_semantics Init initWithCIImage:)]
        pub unsafe fn initWithCIImage(this: Allocated<Self>, image: &CIImage) -> Retained<Self>;

        #[cfg(feature = "objc2-core-image")]
        #[cfg(target_vendor = "apple")]
        #[method_id(@__retain_semantics Other CIImage)]
        pub unsafe fn CIImage(&self) -> Retained<CIImage>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSImageRep`
    #[cfg(feature = "NSImageRep")]
    unsafe impl NSCIImageRep {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "NSImageRep")]
    unsafe impl NSCIImageRep {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

extern_category!(
    /// Category "NSAppKitAdditions" on [`CIImage`].
    #[doc(alias = "NSAppKitAdditions")]
    pub unsafe trait CIImageNSAppKitAdditions {
        #[cfg(all(feature = "NSBitmapImageRep", feature = "NSImageRep"))]
        #[method_id(@__retain_semantics Init initWithBitmapImageRep:)]
        unsafe fn initWithBitmapImageRep(
            this: Allocated<Self>,
            bitmap_image_rep: &NSBitmapImageRep,
        ) -> Option<Retained<Self>>;

        #[cfg(feature = "NSGraphics")]
        #[method(drawInRect:fromRect:operation:fraction:)]
        unsafe fn drawInRect_fromRect_operation_fraction(
            &self,
            rect: NSRect,
            from_rect: NSRect,
            op: NSCompositingOperation,
            delta: CGFloat,
        );

        #[cfg(feature = "NSGraphics")]
        #[method(drawAtPoint:fromRect:operation:fraction:)]
        unsafe fn drawAtPoint_fromRect_operation_fraction(
            &self,
            point: NSPoint,
            from_rect: NSRect,
            op: NSCompositingOperation,
            delta: CGFloat,
        );
    }

    #[cfg(feature = "objc2-core-image")]
    #[cfg(target_vendor = "apple")]
    unsafe impl CIImageNSAppKitAdditions for CIImage {}
);