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")]
22extern_conformance!(
23    unsafe impl NSCoding for NSEPSImageRep {}
24);
25
26#[cfg(feature = "NSImageRep")]
27extern_conformance!(
28    unsafe impl NSCopying for NSEPSImageRep {}
29);
30
31#[cfg(feature = "NSImageRep")]
32unsafe impl CopyingHelper for NSEPSImageRep {
33    type Result = Self;
34}
35
36#[cfg(feature = "NSImageRep")]
37extern_conformance!(
38    unsafe impl NSObjectProtocol for NSEPSImageRep {}
39);
40
41#[cfg(feature = "NSImageRep")]
42impl NSEPSImageRep {
43    extern_methods!(
44        /// Creates and returns a representation of an image initialized with the specified EPS data. Convenience of `-initWithData:`.
45        /// - Note: This method always returns `nil` on macOS 14.0 and later.
46        #[unsafe(method(imageRepWithData:))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn imageRepWithData(eps_data: &NSData) -> Option<Retained<Self>>;
49
50        /// Returns a representation of an image initialized with the specified EPS data.
51        /// - Note: This method always returns `nil` on macOS 14.0 and later.
52        #[unsafe(method(initWithData:))]
53        #[unsafe(method_family = init)]
54        pub unsafe fn initWithData(
55            this: Allocated<Self>,
56            eps_data: &NSData,
57        ) -> Option<Retained<Self>>;
58
59        /// The rectangle that bounds the image representation.
60        #[unsafe(method(boundingBox))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn boundingBox(&self) -> NSRect;
63
64        /// The EPS representation of the image representation.
65        #[unsafe(method(EPSRepresentation))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn EPSRepresentation(&self) -> Retained<NSData>;
68
69        /// 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.
70        #[deprecated]
71        #[unsafe(method(prepareGState))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn prepareGState(&self);
74    );
75}
76
77/// Methods declared on superclass `NSImageRep`.
78#[cfg(feature = "NSImageRep")]
79impl NSEPSImageRep {
80    extern_methods!(
81        #[unsafe(method(init))]
82        #[unsafe(method_family = init)]
83        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
84
85        #[unsafe(method(initWithCoder:))]
86        #[unsafe(method_family = init)]
87        pub unsafe fn initWithCoder(
88            this: Allocated<Self>,
89            coder: &NSCoder,
90        ) -> Option<Retained<Self>>;
91    );
92}
93
94/// Methods declared on superclass `NSObject`.
95#[cfg(feature = "NSImageRep")]
96impl NSEPSImageRep {
97    extern_methods!(
98        #[unsafe(method(new))]
99        #[unsafe(method_family = new)]
100        pub unsafe fn new() -> Retained<Self>;
101    );
102}