1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "GCGamepad", feature = "GCPhysicalInputProfile"))]
    #[deprecated = "GCGamepad has been deprecated, use GCExtendedGamepad instead"]
    pub struct GCGamepadSnapshot;

    #[cfg(all(feature = "GCGamepad", feature = "GCPhysicalInputProfile"))]
    unsafe impl ClassType for GCGamepadSnapshot {
        #[inherits(GCPhysicalInputProfile, NSObject)]
        type Super = GCGamepad;
        type Mutability = InteriorMutable;
    }
);

#[cfg(all(feature = "GCGamepad", feature = "GCPhysicalInputProfile"))]
unsafe impl NSObjectProtocol for GCGamepadSnapshot {}

extern_methods!(
    #[cfg(all(feature = "GCGamepad", feature = "GCPhysicalInputProfile"))]
    unsafe impl GCGamepadSnapshot {
        #[deprecated = "GCGamepad has been deprecated, use GCExtendedGamepad instead"]
        #[method_id(@__retain_semantics Other snapshotData)]
        pub unsafe fn snapshotData(&self) -> Id<NSData>;

        #[deprecated = "GCGamepad has been deprecated, use GCExtendedGamepad instead"]
        #[method(setSnapshotData:)]
        pub unsafe fn setSnapshotData(&self, snapshot_data: &NSData);

        #[deprecated = "GCGamepad has been deprecated, use GCExtendedGamepad instead"]
        #[method_id(@__retain_semantics Init initWithSnapshotData:)]
        pub unsafe fn initWithSnapshotData(this: Allocated<Self>, data: &NSData) -> Id<Self>;

        #[cfg(feature = "GCController")]
        #[deprecated = "GCGamepad has been deprecated, use GCExtendedGamepad instead"]
        #[method_id(@__retain_semantics Init initWithController:snapshotData:)]
        pub unsafe fn initWithController_snapshotData(
            this: Allocated<Self>,
            controller: &GCController,
            data: &NSData,
        ) -> Id<Self>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(all(feature = "GCGamepad", feature = "GCPhysicalInputProfile"))]
    unsafe impl GCGamepadSnapshot {
        #[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>;
    }
);

#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct GCGamepadSnapShotDataV100 {
    pub version: u16,
    pub size: u16,
    pub dpadX: c_float,
    pub dpadY: c_float,
    pub buttonA: c_float,
    pub buttonB: c_float,
    pub buttonX: c_float,
    pub buttonY: c_float,
    pub leftShoulder: c_float,
    pub rightShoulder: c_float,
}

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

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

extern "C" {
    #[deprecated = "GCGamepad has been deprecated, use GCExtendedGamepad instead"]
    pub fn GCGamepadSnapShotDataV100FromNSData(
        snapshot_data: *mut GCGamepadSnapShotDataV100,
        data: Option<&NSData>,
    ) -> Bool;
}

extern "C" {
    #[deprecated = "GCGamepad has been deprecated, use GCExtendedGamepad instead"]
    pub fn NSDataFromGCGamepadSnapShotDataV100(
        snapshot_data: *mut GCGamepadSnapShotDataV100,
    ) -> *mut NSData;
}