objc2-core-motion 0.3.2

Bindings to the CoreMotion 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::*;

/// [Apple's documentation](https://developer.apple.com/documentation/coremotion/cmrotationrate?language=objc)
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct CMRotationRate {
    pub x: c_double,
    pub y: c_double,
    pub z: c_double,
}

unsafe impl Encode for CMRotationRate {
    const ENCODING: Encoding = Encoding::Struct(
        "?",
        &[
            <c_double>::ENCODING,
            <c_double>::ENCODING,
            <c_double>::ENCODING,
        ],
    );
}

unsafe impl RefEncode for CMRotationRate {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/coremotion/cmgyrodata?language=objc)
    #[unsafe(super(CMLogItem, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "CMLogItem")]
    pub struct CMGyroData;
);

#[cfg(feature = "CMLogItem")]
extern_conformance!(
    unsafe impl NSCoding for CMGyroData {}
);

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

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

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

#[cfg(feature = "CMLogItem")]
extern_conformance!(
    unsafe impl NSSecureCoding for CMGyroData {}
);

#[cfg(feature = "CMLogItem")]
impl CMGyroData {
    extern_methods!(
        #[unsafe(method(rotationRate))]
        #[unsafe(method_family = none)]
        pub unsafe fn rotationRate(&self) -> CMRotationRate;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "CMLogItem")]
impl CMGyroData {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}