objc2-game-controller 0.3.2

Bindings to the GameController 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!(
    /// Represents a color used by a GCDeviceLight.
    ///
    ///
    /// See: GCDeviceLight
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamecontroller/gccolor?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct GCColor;
);

extern_conformance!(
    unsafe impl NSCoding for GCColor {}
);

extern_conformance!(
    unsafe impl NSCopying for GCColor {}
);

unsafe impl CopyingHelper for GCColor {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for GCColor {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for GCColor {}
);

impl GCColor {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(initWithRed:green:blue:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithRed_green_blue(
            this: Allocated<Self>,
            red: c_float,
            green: c_float,
            blue: c_float,
        ) -> Retained<Self>;

        #[unsafe(method(red))]
        #[unsafe(method_family = none)]
        pub unsafe fn red(&self) -> c_float;

        #[unsafe(method(green))]
        #[unsafe(method_family = none)]
        pub unsafe fn green(&self) -> c_float;

        #[unsafe(method(blue))]
        #[unsafe(method_family = none)]
        pub unsafe fn blue(&self) -> c_float;
    );
}

/// Methods declared on superclass `NSObject`.
impl GCColor {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}