objc2_phase/generated/
PHASEMaterial.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
8/// Material preset
9///
10/// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasematerialpreset?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct PHASEMaterialPreset(pub NSInteger);
15impl PHASEMaterialPreset {
16    #[doc(alias = "PHASEMaterialPresetCardboard")]
17    pub const Cardboard: Self = Self(0x6d437264);
18    #[doc(alias = "PHASEMaterialPresetGlass")]
19    pub const Glass: Self = Self(0x6d476c73);
20    #[doc(alias = "PHASEMaterialPresetBrick")]
21    pub const Brick: Self = Self(0x6d42726b);
22    #[doc(alias = "PHASEMaterialPresetConcrete")]
23    pub const Concrete: Self = Self(0x6d436372);
24    #[doc(alias = "PHASEMaterialPresetDrywall")]
25    pub const Drywall: Self = Self(0x6d447277);
26    #[doc(alias = "PHASEMaterialPresetWood")]
27    pub const Wood: Self = Self(0x6d577564);
28}
29
30unsafe impl Encode for PHASEMaterialPreset {
31    const ENCODING: Encoding = NSInteger::ENCODING;
32}
33
34unsafe impl RefEncode for PHASEMaterialPreset {
35    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
36}
37
38extern_class!(
39    /// *************************************************************************************************
40    ///
41    ///
42    ///
43    /// A PHASEMaterial describes the acoustic properties of a material.
44    ///
45    /// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasematerial?language=objc)
46    #[unsafe(super(NSObject))]
47    #[derive(Debug, PartialEq, Eq, Hash)]
48    pub struct PHASEMaterial;
49);
50
51extern_conformance!(
52    unsafe impl NSObjectProtocol for PHASEMaterial {}
53);
54
55impl PHASEMaterial {
56    extern_methods!(
57        #[unsafe(method(init))]
58        #[unsafe(method_family = init)]
59        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
60
61        #[unsafe(method(new))]
62        #[unsafe(method_family = new)]
63        pub unsafe fn new() -> Retained<Self>;
64
65        #[cfg(feature = "PHASEEngine")]
66        /// Initialize a new material from a preset.
67        #[unsafe(method(initWithEngine:preset:))]
68        #[unsafe(method_family = init)]
69        pub unsafe fn initWithEngine_preset(
70            this: Allocated<Self>,
71            engine: &PHASEEngine,
72            preset: PHASEMaterialPreset,
73        ) -> Retained<Self>;
74    );
75}