objc2_virtualization/generated/
VZMacGraphicsDisplay.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5
6use crate::*;
7
8extern_class!(
9    /// Class representing a virtual Mac graphics display.
10    ///
11    /// The VZMacGraphicsDisplay is the runtime counterpart of VZMacGraphicsDisplayConfiguration.
12    ///
13    /// When a graphics device is configured with class VZMacGraphicsDisplayConfiguration,
14    /// the VZGraphicsDevice's displays are in the same order as their configuration objects and they have the type VZMacGraphicsDisplay.
15    ///
16    /// For example, if when setting up a virtual Mac, `VZMacGraphicsDeviceConfiguration.displays[0]` is a `VZMacGraphicsDisplayConfiguration`,
17    /// then after creating a virtual machine from the configuration, the `VZVirtualMachine.graphicsDevices` is a `VZMacGraphicsDevice`.
18    /// The `VZMacGraphicsDevice.displays[0]` is a `VZMacGraphicsDisplay` corresponding to the `VZMacGraphicsDeviceConfiguration` in the configuration.
19    ///
20    ///
21    /// See: VZMacGraphicsDisplayConfiguration
22    ///
23    /// See: VZGraphicsDevice
24    ///
25    /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzmacgraphicsdisplay?language=objc)
26    #[unsafe(super(VZGraphicsDisplay, NSObject))]
27    #[derive(Debug, PartialEq, Eq, Hash)]
28    #[cfg(feature = "VZGraphicsDisplay")]
29    pub struct VZMacGraphicsDisplay;
30);
31
32#[cfg(feature = "VZGraphicsDisplay")]
33extern_conformance!(
34    unsafe impl NSObjectProtocol for VZMacGraphicsDisplay {}
35);
36
37#[cfg(feature = "VZGraphicsDisplay")]
38impl VZMacGraphicsDisplay {
39    extern_methods!(
40        /// The pixel density as a number of pixels per inch.
41        #[unsafe(method(pixelsPerInch))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn pixelsPerInch(&self) -> NSInteger;
44    );
45}
46
47/// Methods declared on superclass `VZGraphicsDisplay`.
48#[cfg(feature = "VZGraphicsDisplay")]
49impl VZMacGraphicsDisplay {
50    extern_methods!(
51        #[unsafe(method(new))]
52        #[unsafe(method_family = new)]
53        pub unsafe fn new() -> Retained<Self>;
54
55        #[unsafe(method(init))]
56        #[unsafe(method_family = init)]
57        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
58    );
59}