objc2_app_kit/generated/
NSEPSImageRep.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// An object that can render an image from encapsulated PostScript (EPS) code.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsepsimagerep?language=objc)
14    #[unsafe(super(NSImageRep, NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    #[cfg(feature = "NSImageRep")]
17    #[deprecated = "`NSEPSImageRep` instances cannot be created on macOS 14.0 and later"]
18    pub struct NSEPSImageRep;
19);
20
21#[cfg(feature = "NSImageRep")]
22unsafe impl NSCoding for NSEPSImageRep {}
23
24#[cfg(feature = "NSImageRep")]
25unsafe impl NSCopying for NSEPSImageRep {}
26
27#[cfg(feature = "NSImageRep")]
28unsafe impl CopyingHelper for NSEPSImageRep {
29    type Result = Self;
30}
31
32#[cfg(feature = "NSImageRep")]
33unsafe impl NSObjectProtocol for NSEPSImageRep {}
34
35#[cfg(feature = "NSImageRep")]
36impl NSEPSImageRep {
37    extern_methods!(
38        /// Creates and returns a representation of an image initialized with the specified EPS data. Convenience of `-initWithData:`.
39        /// - Note: This method always returns `nil` on macOS 14.0 and later.
40        #[unsafe(method(imageRepWithData:))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn imageRepWithData(eps_data: &NSData) -> Option<Retained<Self>>;
43
44        /// Returns a representation of an image initialized with the specified EPS data.
45        /// - Note: This method always returns `nil` on macOS 14.0 and later.
46        #[unsafe(method(initWithData:))]
47        #[unsafe(method_family = init)]
48        pub unsafe fn initWithData(
49            this: Allocated<Self>,
50            eps_data: &NSData,
51        ) -> Option<Retained<Self>>;
52
53        /// The rectangle that bounds the image representation.
54        #[unsafe(method(boundingBox))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn boundingBox(&self) -> NSRect;
57
58        /// The EPS representation of the image representation.
59        #[unsafe(method(EPSRepresentation))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn EPSRepresentation(&self) -> Retained<NSData>;
62
63        /// The `-[NSEPSImageRep draw]` method sends this message to itself just before rendering the EPS code. The default implementation of this method does nothing. It can be overridden in a subclass to prepare the graphics state as needed.
64        #[deprecated]
65        #[unsafe(method(prepareGState))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn prepareGState(&self);
68    );
69}
70
71/// Methods declared on superclass `NSImageRep`.
72#[cfg(feature = "NSImageRep")]
73impl NSEPSImageRep {
74    extern_methods!(
75        #[unsafe(method(init))]
76        #[unsafe(method_family = init)]
77        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
78
79        #[unsafe(method(initWithCoder:))]
80        #[unsafe(method_family = init)]
81        pub unsafe fn initWithCoder(
82            this: Allocated<Self>,
83            coder: &NSCoder,
84        ) -> Option<Retained<Self>>;
85    );
86}
87
88/// Methods declared on superclass `NSObject`.
89#[cfg(feature = "NSImageRep")]
90impl NSEPSImageRep {
91    extern_methods!(
92        #[unsafe(method(new))]
93        #[unsafe(method_family = new)]
94        pub unsafe fn new() -> Retained<Self>;
95    );
96}