2 * Copyright 2021 RĂ©mi Bernon for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #pragma winrt ns_prefix
23 import
"eventtoken.idl";
24 import
"inspectable.idl";
25 import
"windows.foundation.idl";
30 typedef enum GamepadButtons GamepadButtons
;
31 typedef struct GamepadReading GamepadReading
;
32 typedef struct GamepadVibration GamepadVibration
;
33 interface IGameController
;
34 interface IGameControllerBatteryInfo
;
37 interface IGamepadStatics
;
38 interface IGamepadStatics2
;
48 interface Windows.Foundation.EventHandler
<Windows.Gaming.Input.Gamepad
*>;
49 interface Windows.Foundation.Collections.IVectorView
<Gamepad
*>;
59 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
76 RightShoulder
= 0x800,
77 LeftThumbstick
= 0x1000,
78 RightThumbstick
= 0x2000,
79 [contract
(Windows.Foundation.UniversalApiContract
, 3.0)]
81 [contract
(Windows.Foundation.UniversalApiContract
, 3.0)]
83 [contract
(Windows.Foundation.UniversalApiContract
, 3.0)]
85 [contract
(Windows.Foundation.UniversalApiContract
, 3.0)]
89 [contract
(Windows.Foundation.UniversalApiContract
, 1.0)]
93 Windows.Gaming.Input.GamepadButtons Buttons
;
96 DOUBLE LeftThumbstickX
;
97 DOUBLE LeftThumbstickY
;
98 DOUBLE RightThumbstickX
;
99 DOUBLE RightThumbstickY
;
102 [contract
(Windows.Foundation.UniversalApiContract
, 1.0)]
103 struct GamepadVibration
112 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
113 exclusiveto
(Windows.Gaming.Input.Gamepad
),
114 uuid(bc7bb43c
-0a69
-3903-9e9d
-a50f86a45de5
)
116 interface IGamepad
: IInspectable
117 requires Windows.Gaming.Input.IGameController
119 [propget] HRESULT Vibration
([out, retval] Windows.Gaming.Input.GamepadVibration
* value
);
120 [propput] HRESULT Vibration
([in] Windows.Gaming.Input.GamepadVibration value
);
121 HRESULT GetCurrentReading
([out, retval] Windows.Gaming.Input.GamepadReading
* value
);
126 uuid(8bbce529
-d49c
-39e9
-9560-e47dde96b7c8
)
128 interface IGamepadStatics
: IInspectable
130 [eventadd
] HRESULT GamepadAdded
([in] Windows.Foundation.EventHandler
<Gamepad
*> *value
, [out, retval] EventRegistrationToken
* token
);
131 [eventremove
] HRESULT GamepadAdded
([in] EventRegistrationToken token
);
132 [eventadd
] HRESULT GamepadRemoved
([in] Windows.Foundation.EventHandler
<Gamepad
*> *value
, [out, retval] EventRegistrationToken
* token
);
133 [eventremove
] HRESULT GamepadRemoved
([in] EventRegistrationToken token
);
134 [propget] HRESULT Gamepads
([out, retval] Windows.Foundation.Collections.IVectorView
<Gamepad
*> **value
);
138 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
139 marshaling_behavior
(agile
),
140 static
(Windows.Gaming.Input.IGamepadStatics
, Windows.Foundation.UniversalApiContract
, 1.0),
141 static
(Windows.Gaming.Input.IGamepadStatics2
, Windows.Foundation.UniversalApiContract
, 4.0),
146 [default] interface Windows.Gaming.Input.IGamepad
;
147 interface Windows.Gaming.Input.IGameController
;
148 [contract
(Windows.Foundation.UniversalApiContract
, 3.0)] interface Windows.Gaming.Input.IGamepad2
;
149 [contract
(Windows.Foundation.UniversalApiContract
, 4.0)] interface Windows.Gaming.Input.IGameControllerBatteryInfo
;