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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
//! 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 = "GCMicroGamepad", feature = "GCPhysicalInputProfile"))]
    #[deprecated = "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead"]
    pub struct GCMicroGamepadSnapshot;

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

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

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

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

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

        #[cfg(feature = "GCController")]
        #[deprecated = "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] 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 = "GCMicroGamepad", feature = "GCPhysicalInputProfile"))]
    unsafe impl GCMicroGamepadSnapshot {
        #[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>;
    }
);

// NS_ENUM
#[deprecated = "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead"]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct GCMicroGamepadSnapshotDataVersion(pub NSInteger);
impl GCMicroGamepadSnapshotDataVersion {
    #[deprecated = "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead"]
    pub const GCMicroGamepadSnapshotDataVersion1: Self = Self(0x0100);
}

unsafe impl Encode for GCMicroGamepadSnapshotDataVersion {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

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

extern "C" {
    pub static GCCurrentMicroGamepadSnapshotDataVersion: GCMicroGamepadSnapshotDataVersion;
}

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

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

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

extern "C" {
    #[deprecated = "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead"]
    pub fn GCMicroGamepadSnapshotDataFromNSData(
        snapshot_data: *mut GCMicroGamepadSnapshotData,
        data: Option<&NSData>,
    ) -> Bool;
}

extern "C" {
    #[deprecated = "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead"]
    pub fn NSDataFromGCMicroGamepadSnapshotData(
        snapshot_data: *mut GCMicroGamepadSnapshotData,
    ) -> *mut NSData;
}

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

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

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

extern "C" {
    #[deprecated = "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead"]
    pub fn GCMicroGamepadSnapShotDataV100FromNSData(
        snapshot_data: *mut GCMicroGamepadSnapShotDataV100,
        data: Option<&NSData>,
    ) -> Bool;
}

extern "C" {
    #[deprecated = "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead"]
    pub fn NSDataFromGCMicroGamepadSnapShotDataV100(
        snapshot_data: *mut GCMicroGamepadSnapShotDataV100,
    ) -> *mut NSData;
}