use objc2::__framework_prelude::*;
use crate::*;
#[cfg(all(
feature = "GCControllerElement",
feature = "GCPhysicalInputProfile",
feature = "block2"
))]
pub type GCGamepadValueChangedHandler =
*mut block2::Block<dyn Fn(NonNull<GCGamepad>, NonNull<GCControllerElement>)>;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "GCPhysicalInputProfile")]
#[deprecated]
pub struct GCGamepad;
#[cfg(feature = "GCPhysicalInputProfile")]
unsafe impl ClassType for GCGamepad {
#[inherits(NSObject)]
type Super = GCPhysicalInputProfile;
type Mutability = InteriorMutable;
}
);
#[cfg(feature = "GCPhysicalInputProfile")]
unsafe impl NSObjectProtocol for GCGamepad {}
extern_methods!(
#[cfg(feature = "GCPhysicalInputProfile")]
unsafe impl GCGamepad {
#[cfg(feature = "GCController")]
#[deprecated]
#[method_id(@__retain_semantics Other controller)]
pub unsafe fn controller(&self) -> Option<Retained<GCController>>;
#[cfg(all(feature = "GCControllerElement", feature = "block2"))]
#[deprecated]
#[method(valueChangedHandler)]
pub unsafe fn valueChangedHandler(&self) -> GCGamepadValueChangedHandler;
#[cfg(all(feature = "GCControllerElement", feature = "block2"))]
#[deprecated]
#[method(setValueChangedHandler:)]
pub unsafe fn setValueChangedHandler(
&self,
value_changed_handler: GCGamepadValueChangedHandler,
);
#[cfg(feature = "GCGamepadSnapshot")]
#[deprecated]
#[method_id(@__retain_semantics Other saveSnapshot)]
pub unsafe fn saveSnapshot(&self) -> Retained<GCGamepadSnapshot>;
#[cfg(all(feature = "GCControllerDirectionPad", feature = "GCControllerElement"))]
#[deprecated]
#[method_id(@__retain_semantics Other dpad)]
pub unsafe fn dpad(&self) -> Retained<GCControllerDirectionPad>;
#[cfg(all(feature = "GCControllerButtonInput", feature = "GCControllerElement"))]
#[deprecated]
#[method_id(@__retain_semantics Other buttonA)]
pub unsafe fn buttonA(&self) -> Retained<GCControllerButtonInput>;
#[cfg(all(feature = "GCControllerButtonInput", feature = "GCControllerElement"))]
#[deprecated]
#[method_id(@__retain_semantics Other buttonB)]
pub unsafe fn buttonB(&self) -> Retained<GCControllerButtonInput>;
#[cfg(all(feature = "GCControllerButtonInput", feature = "GCControllerElement"))]
#[deprecated]
#[method_id(@__retain_semantics Other buttonX)]
pub unsafe fn buttonX(&self) -> Retained<GCControllerButtonInput>;
#[cfg(all(feature = "GCControllerButtonInput", feature = "GCControllerElement"))]
#[deprecated]
#[method_id(@__retain_semantics Other buttonY)]
pub unsafe fn buttonY(&self) -> Retained<GCControllerButtonInput>;
#[cfg(all(feature = "GCControllerButtonInput", feature = "GCControllerElement"))]
#[deprecated]
#[method_id(@__retain_semantics Other leftShoulder)]
pub unsafe fn leftShoulder(&self) -> Retained<GCControllerButtonInput>;
#[cfg(all(feature = "GCControllerButtonInput", feature = "GCControllerElement"))]
#[deprecated]
#[method_id(@__retain_semantics Other rightShoulder)]
pub unsafe fn rightShoulder(&self) -> Retained<GCControllerButtonInput>;
}
);
extern_methods!(
#[cfg(feature = "GCPhysicalInputProfile")]
unsafe impl GCGamepad {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);