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")]
25extern_conformance!(
26    unsafe impl NSCopying for VZMacGraphicsDisplayConfiguration {}
27);
28
29#[cfg(feature = "VZGraphicsDisplayConfiguration")]
30unsafe impl CopyingHelper for VZMacGraphicsDisplayConfiguration {
31    type Result = Self;
32}
33
34#[cfg(feature = "VZGraphicsDisplayConfiguration")]
35extern_conformance!(
36    unsafe impl NSObjectProtocol for VZMacGraphicsDisplayConfiguration {}
37);
38
39#[cfg(feature = "VZGraphicsDisplayConfiguration")]
40impl VZMacGraphicsDisplayConfiguration {
41    extern_methods!(
42        /// Create a display configuration with the specified pixel dimensions and pixel density.
43        ///
44        /// Parameter `widthInPixels`: The width of the display, in pixels.
45        ///
46        /// Parameter `heightInPixels`: The height of the display, in pixels.
47        ///
48        /// Parameter `pixelsPerInch`: The pixel density as a number of pixels per inch.
49        #[unsafe(method(initWithWidthInPixels:heightInPixels:pixelsPerInch:))]
50        #[unsafe(method_family = init)]
51        pub unsafe fn initWithWidthInPixels_heightInPixels_pixelsPerInch(
52            this: Allocated<Self>,
53            width_in_pixels: NSInteger,
54            height_in_pixels: NSInteger,
55            pixels_per_inch: NSInteger,
56        ) -> Retained<Self>;
57
58        #[cfg(feature = "objc2-app-kit")]
59        /// Create a display configuration suitable for showing on the specified screen.
60        ///
61        /// Parameter `screen`: The screen on which you intend to present the VZVirtualMachineView for the display.
62        ///
63        /// Parameter `sizeInPoints`: The intended logical size of the display.
64        ///
65        /// The pixel dimensions and pixel density will be initialized based on the specified screen and
66        /// size. Note: an instance of macOS running in the virtual machine may not necessarily provide
67        /// a display mode with a backing scale factor matching the specified screen.
68        #[unsafe(method(initForScreen:sizeInPoints:))]
69        #[unsafe(method_family = init)]
70        pub unsafe fn initForScreen_sizeInPoints(
71            this: Allocated<Self>,
72            screen: &NSScreen,
73            size_in_points: NSSize,
74        ) -> Retained<Self>;
75
76        /// The width of the display, in pixels.
77        #[unsafe(method(widthInPixels))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn widthInPixels(&self) -> NSInteger;
80
81        /// Setter for [`widthInPixels`][Self::widthInPixels].
82        #[unsafe(method(setWidthInPixels:))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn setWidthInPixels(&self, width_in_pixels: NSInteger);
85
86        /// The height of the display, in pixels.
87        #[unsafe(method(heightInPixels))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn heightInPixels(&self) -> NSInteger;
90
91        /// Setter for [`heightInPixels`][Self::heightInPixels].
92        #[unsafe(method(setHeightInPixels:))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn setHeightInPixels(&self, height_in_pixels: NSInteger);
95
96        /// The pixel density as a number of pixels per inch.
97        #[unsafe(method(pixelsPerInch))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn pixelsPerInch(&self) -> NSInteger;
100
101        /// Setter for [`pixelsPerInch`][Self::pixelsPerInch].
102        #[unsafe(method(setPixelsPerInch:))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn setPixelsPerInch(&self, pixels_per_inch: NSInteger);
105    );
106}
107
108/// Methods declared on superclass `VZGraphicsDisplayConfiguration`.
109#[cfg(feature = "VZGraphicsDisplayConfiguration")]
110impl VZMacGraphicsDisplayConfiguration {
111    extern_methods!(
112        #[unsafe(method(new))]
113        #[unsafe(method_family = new)]
114        pub unsafe fn new() -> Retained<Self>;
115
116        #[unsafe(method(init))]
117        #[unsafe(method_family = init)]
118        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
119    );
120}