objc2_virtualization/generated/
VZMacGraphicsDisplayConfiguration.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::*;
6#[cfg(feature = "objc2-app-kit")]
7use objc2_app_kit::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// Configuration for a display attached to a Mac graphics device.
14    ///
15    /// This display can be shown in a VZVirtualMachineView.
16    ///
17    /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzmacgraphicsdisplayconfiguration?language=objc)
18    #[unsafe(super(VZGraphicsDisplayConfiguration, NSObject))]
19    #[derive(Debug, PartialEq, Eq, Hash)]
20    #[cfg(feature = "VZGraphicsDisplayConfiguration")]
21    pub struct VZMacGraphicsDisplayConfiguration;
22);
23
24#[cfg(feature = "VZGraphicsDisplayConfiguration")]
25unsafe impl NSCopying for VZMacGraphicsDisplayConfiguration {}
26
27#[cfg(feature = "VZGraphicsDisplayConfiguration")]
28unsafe impl CopyingHelper for VZMacGraphicsDisplayConfiguration {
29    type Result = Self;
30}
31
32#[cfg(feature = "VZGraphicsDisplayConfiguration")]
33unsafe impl NSObjectProtocol for VZMacGraphicsDisplayConfiguration {}
34
35#[cfg(feature = "VZGraphicsDisplayConfiguration")]
36impl VZMacGraphicsDisplayConfiguration {
37    extern_methods!(
38        /// Create a display configuration with the specified pixel dimensions and pixel density.
39        ///
40        /// Parameter `widthInPixels`: The width of the display, in pixels.
41        ///
42        /// Parameter `heightInPixels`: The height of the display, in pixels.
43        ///
44        /// Parameter `pixelsPerInch`: The pixel density as a number of pixels per inch.
45        #[unsafe(method(initWithWidthInPixels:heightInPixels:pixelsPerInch:))]
46        #[unsafe(method_family = init)]
47        pub unsafe fn initWithWidthInPixels_heightInPixels_pixelsPerInch(
48            this: Allocated<Self>,
49            width_in_pixels: NSInteger,
50            height_in_pixels: NSInteger,
51            pixels_per_inch: NSInteger,
52        ) -> Retained<Self>;
53
54        #[cfg(feature = "objc2-app-kit")]
55        /// Create a display configuration suitable for showing on the specified screen.
56        ///
57        /// Parameter `screen`: The screen on which you intend to present the VZVirtualMachineView for the display.
58        ///
59        /// Parameter `sizeInPoints`: The intended logical size of the display.
60        ///
61        /// The pixel dimensions and pixel density will be initialized based on the specified screen and
62        /// size. Note: an instance of macOS running in the virtual machine may not necessarily provide
63        /// a display mode with a backing scale factor matching the specified screen.
64        #[unsafe(method(initForScreen:sizeInPoints:))]
65        #[unsafe(method_family = init)]
66        pub unsafe fn initForScreen_sizeInPoints(
67            this: Allocated<Self>,
68            screen: &NSScreen,
69            size_in_points: NSSize,
70        ) -> Retained<Self>;
71
72        /// The width of the display, in pixels.
73        #[unsafe(method(widthInPixels))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn widthInPixels(&self) -> NSInteger;
76
77        /// Setter for [`widthInPixels`][Self::widthInPixels].
78        #[unsafe(method(setWidthInPixels:))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn setWidthInPixels(&self, width_in_pixels: NSInteger);
81
82        /// The height of the display, in pixels.
83        #[unsafe(method(heightInPixels))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn heightInPixels(&self) -> NSInteger;
86
87        /// Setter for [`heightInPixels`][Self::heightInPixels].
88        #[unsafe(method(setHeightInPixels:))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn setHeightInPixels(&self, height_in_pixels: NSInteger);
91
92        /// The pixel density as a number of pixels per inch.
93        #[unsafe(method(pixelsPerInch))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn pixelsPerInch(&self) -> NSInteger;
96
97        /// Setter for [`pixelsPerInch`][Self::pixelsPerInch].
98        #[unsafe(method(setPixelsPerInch:))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn setPixelsPerInch(&self, pixels_per_inch: NSInteger);
101    );
102}
103
104/// Methods declared on superclass `VZGraphicsDisplayConfiguration`.
105#[cfg(feature = "VZGraphicsDisplayConfiguration")]
106impl VZMacGraphicsDisplayConfiguration {
107    extern_methods!(
108        #[unsafe(method(new))]
109        #[unsafe(method_family = new)]
110        pub unsafe fn new() -> Retained<Self>;
111
112        #[unsafe(method(init))]
113        #[unsafe(method_family = init)]
114        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
115    );
116}