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
#![allow(non_snake_case)]
use std::os::raw::c_float;

use objc2::encode::{Encode, Encoding, RefEncode};
use objc2::runtime::Bool;

#[repr(C)]
#[derive(Clone, Copy, Debug)]
#[deprecated = "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead"]
pub struct GCExtendedGamepadSnapshotData {
    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,
    pub leftThumbstickX: c_float,
    pub leftThumbstickY: c_float,
    pub rightThumbstickX: c_float,
    pub rightThumbstickY: c_float,
    pub leftTrigger: c_float,
    pub rightTrigger: c_float,
    pub supportsClickableThumbsticks: Bool,
    pub leftThumbstickButton: Bool,
    pub rightThumbstickButton: Bool,
}

#[allow(deprecated)]
unsafe impl Encode for GCExtendedGamepadSnapshotData {
    const ENCODING: Encoding = Encoding::Struct(
        "GCExtendedGamepadSnapshotData",
        &[
            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,
            c_float::ENCODING,
            c_float::ENCODING,
            c_float::ENCODING,
            c_float::ENCODING,
            c_float::ENCODING,
            c_float::ENCODING,
            Bool::ENCODING,
            Bool::ENCODING,
            Bool::ENCODING,
        ],
    );
}

#[allow(deprecated)]
unsafe impl RefEncode for GCExtendedGamepadSnapshotData {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}