objc2_metric_kit/generated/
MXDisplayMetric.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::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// An MXMetric subclass that encapsulates display metrics.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/metrickit/mxdisplaymetric?language=objc)
13    #[unsafe(super(MXMetric, NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(feature = "MXMetric")]
16    pub struct MXDisplayMetric;
17);
18
19#[cfg(feature = "MXMetric")]
20unsafe impl NSCoding for MXDisplayMetric {}
21
22#[cfg(feature = "MXMetric")]
23unsafe impl NSObjectProtocol for MXDisplayMetric {}
24
25#[cfg(feature = "MXMetric")]
26unsafe impl NSSecureCoding for MXDisplayMetric {}
27
28#[cfg(feature = "MXMetric")]
29impl MXDisplayMetric {
30    extern_methods!(
31        #[cfg(all(feature = "MXAverage", feature = "MXUnit"))]
32        /// Average Pixel Luminance for the application.
33        ///
34        /// APL data ranges from 0-100, in increments of 1.
35        ///
36        /// This value is null when the device does not support APL.
37        ///
38        /// Dimensioned as MXUnitAveragePixelLuminance.
39        #[unsafe(method(averagePixelLuminance))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn averagePixelLuminance(
42            &self,
43        ) -> Option<Retained<MXAverage<MXUnitAveragePixelLuminance>>>;
44    );
45}
46
47/// Methods declared on superclass `NSObject`.
48#[cfg(feature = "MXMetric")]
49impl MXDisplayMetric {
50    extern_methods!(
51        #[unsafe(method(init))]
52        #[unsafe(method_family = init)]
53        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
54
55        #[unsafe(method(new))]
56        #[unsafe(method_family = new)]
57        pub unsafe fn new() -> Retained<Self>;
58    );
59}