icrate 0.1.2

Bindings to Apple's frameworks
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::AppKit::*;
use crate::Foundation::*;
use crate::GameController::*;

extern_static!(GCInputMicroGamepadDpad: &'static NSString);

extern_static!(GCInputMicroGamepadButtonA: &'static NSString);

extern_static!(GCInputMicroGamepadButtonX: &'static NSString);

extern_static!(GCInputMicroGamepadButtonMenu: &'static NSString);

pub type GCMicroGamepadValueChangedHandler =
    *mut Block<(NonNull<GCMicroGamepad>, NonNull<GCControllerElement>), ()>;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "GameController_GCMicroGamepad")]
    pub struct GCMicroGamepad;

    #[cfg(feature = "GameController_GCMicroGamepad")]
    unsafe impl ClassType for GCMicroGamepad {
        #[inherits(NSObject)]
        type Super = GCPhysicalInputProfile;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "GameController_GCMicroGamepad")]
unsafe impl NSObjectProtocol for GCMicroGamepad {}

extern_methods!(
    #[cfg(feature = "GameController_GCMicroGamepad")]
    unsafe impl GCMicroGamepad {
        #[cfg(feature = "GameController_GCController")]
        #[method_id(@__retain_semantics Other controller)]
        pub unsafe fn controller(&self) -> Option<Id<GCController>>;

        #[method(valueChangedHandler)]
        pub unsafe fn valueChangedHandler(&self) -> GCMicroGamepadValueChangedHandler;

        #[method(setValueChangedHandler:)]
        pub unsafe fn setValueChangedHandler(
            &self,
            value_changed_handler: GCMicroGamepadValueChangedHandler,
        );

        #[cfg(feature = "GameController_GCMicroGamepadSnapshot")]
        #[deprecated = "GCMicroGamepadSnapshot has been deprecated, use [GCController capture] instead"]
        #[method_id(@__retain_semantics Other saveSnapshot)]
        pub unsafe fn saveSnapshot(&self) -> Id<GCMicroGamepadSnapshot>;

        #[cfg(feature = "GameController_GCControllerDirectionPad")]
        #[method_id(@__retain_semantics Other dpad)]
        pub unsafe fn dpad(&self) -> Id<GCControllerDirectionPad>;

        #[cfg(feature = "GameController_GCControllerButtonInput")]
        #[method_id(@__retain_semantics Other buttonA)]
        pub unsafe fn buttonA(&self) -> Id<GCControllerButtonInput>;

        #[cfg(feature = "GameController_GCControllerButtonInput")]
        #[method_id(@__retain_semantics Other buttonX)]
        pub unsafe fn buttonX(&self) -> Id<GCControllerButtonInput>;

        #[cfg(feature = "GameController_GCControllerButtonInput")]
        #[method_id(@__retain_semantics Other buttonMenu)]
        pub unsafe fn buttonMenu(&self) -> Id<GCControllerButtonInput>;

        #[method(reportsAbsoluteDpadValues)]
        pub unsafe fn reportsAbsoluteDpadValues(&self) -> bool;

        #[method(setReportsAbsoluteDpadValues:)]
        pub unsafe fn setReportsAbsoluteDpadValues(&self, reports_absolute_dpad_values: bool);

        #[method(allowsRotation)]
        pub unsafe fn allowsRotation(&self) -> bool;

        #[method(setAllowsRotation:)]
        pub unsafe fn setAllowsRotation(&self, allows_rotation: bool);

        #[method(setStateFromMicroGamepad:)]
        pub unsafe fn setStateFromMicroGamepad(&self, micro_gamepad: &GCMicroGamepad);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "GameController_GCMicroGamepad")]
    unsafe impl GCMicroGamepad {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);