objc2-virtualization 0.3.2

Bindings to the Virtualization framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// Configuration for a scanout attached to a Virtio graphics device.
    ///
    /// This scanout can be shown in a VZVirtualMachineView.
    ///
    /// See also: VZVirtioGraphicsDeviceConfiguration
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzvirtiographicsscanoutconfiguration?language=objc)
    #[unsafe(super(VZGraphicsDisplayConfiguration, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "VZGraphicsDisplayConfiguration")]
    pub struct VZVirtioGraphicsScanoutConfiguration;
);

#[cfg(feature = "VZGraphicsDisplayConfiguration")]
extern_conformance!(
    unsafe impl NSCopying for VZVirtioGraphicsScanoutConfiguration {}
);

#[cfg(feature = "VZGraphicsDisplayConfiguration")]
unsafe impl CopyingHelper for VZVirtioGraphicsScanoutConfiguration {
    type Result = Self;
}

#[cfg(feature = "VZGraphicsDisplayConfiguration")]
extern_conformance!(
    unsafe impl NSObjectProtocol for VZVirtioGraphicsScanoutConfiguration {}
);

#[cfg(feature = "VZGraphicsDisplayConfiguration")]
impl VZVirtioGraphicsScanoutConfiguration {
    extern_methods!(
        /// Create a scanout configuration with the specified pixel dimensions.
        ///
        /// Parameter `widthInPixels`: The width of the scanout, in pixels.
        ///
        /// Parameter `heightInPixels`: The height of the scanout, in pixels.
        #[unsafe(method(initWithWidthInPixels:heightInPixels:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithWidthInPixels_heightInPixels(
            this: Allocated<Self>,
            width_in_pixels: NSInteger,
            height_in_pixels: NSInteger,
        ) -> Retained<Self>;

        /// The width of the scanout, in pixels.
        #[unsafe(method(widthInPixels))]
        #[unsafe(method_family = none)]
        pub unsafe fn widthInPixels(&self) -> NSInteger;

        /// Setter for [`widthInPixels`][Self::widthInPixels].
        #[unsafe(method(setWidthInPixels:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setWidthInPixels(&self, width_in_pixels: NSInteger);

        /// The height of the scanout, in pixels.
        #[unsafe(method(heightInPixels))]
        #[unsafe(method_family = none)]
        pub unsafe fn heightInPixels(&self) -> NSInteger;

        /// Setter for [`heightInPixels`][Self::heightInPixels].
        #[unsafe(method(setHeightInPixels:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setHeightInPixels(&self, height_in_pixels: NSInteger);
    );
}

/// Methods declared on superclass `VZGraphicsDisplayConfiguration`.
#[cfg(feature = "VZGraphicsDisplayConfiguration")]
impl VZVirtioGraphicsScanoutConfiguration {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}