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
"inspectable.idl";
24 import
"asyncinfo.idl";
25 import
"eventtoken.idl";
26 import
"windowscontracts.idl";
27 import
"windows.foundation.idl";
28 import
"windows.gaming.input.forcefeedback.idl";
29 import
"windows.system.idl";
34 typedef enum GamepadButtons GamepadButtons
;
35 typedef enum GameControllerButtonLabel GameControllerButtonLabel
;
36 typedef enum GameControllerSwitchKind GameControllerSwitchKind
;
37 typedef enum GameControllerSwitchPosition GameControllerSwitchPosition
;
38 typedef struct GamepadReading GamepadReading
;
39 typedef struct GamepadVibration GamepadVibration
;
40 interface IGameController
;
41 interface IGameControllerBatteryInfo
;
44 interface IGamepadStatics
;
45 interface IGamepadStatics2
;
46 interface IRawGameController
;
47 interface IRawGameController2
;
50 runtimeclass RawGameController
;
59 interface Windows.Foundation.EventHandler
<Windows.Gaming.Input.Gamepad
*>;
60 interface Windows.Foundation.EventHandler
<Windows.Gaming.Input.RawGameController
*>;
61 interface Windows.Foundation.TypedEventHandler
<Windows.Gaming.Input.IGameController
*, Windows.Gaming.Input.Headset
*>;
62 interface Windows.Foundation.TypedEventHandler
<Windows.Gaming.Input.IGameController
*, Windows.System.UserChangedEventArgs
*>;
63 interface Windows.Foundation.Collections.IVectorView
<Gamepad
*>;
64 interface Windows.Foundation.Collections.IVectorView
<Windows.Gaming.Input.RawGameController
*>;
74 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
91 RightShoulder
= 0x800,
92 LeftThumbstick
= 0x1000,
93 RightThumbstick
= 0x2000,
94 [contract
(Windows.Foundation.UniversalApiContract
, 3.0)]
96 [contract
(Windows.Foundation.UniversalApiContract
, 3.0)]
98 [contract
(Windows.Foundation.UniversalApiContract
, 3.0)]
100 [contract
(Windows.Foundation.UniversalApiContract
, 3.0)]
104 [contract
(Windows.Foundation.UniversalApiContract
, 3.0)]
105 enum GameControllerButtonLabel
121 XboxLeftTrigger
= 14,
122 XboxLeftStickButton
= 15,
123 XboxRightBumper
= 16,
124 XboxRightTrigger
= 17,
125 XboxRightStickButton
= 18,
156 LeftStickButton
= 49,
162 RightStickButton
= 55,
178 [contract
(Windows.Foundation.UniversalApiContract
, 4.0)]
179 enum GameControllerSwitchKind
186 [contract
(Windows.Foundation.UniversalApiContract
, 4.0)]
187 enum GameControllerSwitchPosition
200 [contract
(Windows.Foundation.UniversalApiContract
, 1.0)]
201 struct GamepadReading
204 Windows.Gaming.Input.GamepadButtons Buttons
;
207 DOUBLE LeftThumbstickX
;
208 DOUBLE LeftThumbstickY
;
209 DOUBLE RightThumbstickX
;
210 DOUBLE RightThumbstickY
;
213 [contract
(Windows.Foundation.UniversalApiContract
, 1.0)]
214 struct GamepadVibration
223 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
224 uuid(1baf6522
-5f64
-42c5
-8267-b9fe2215bfbd
)
226 interface IGameController
: IInspectable
228 [eventadd
] HRESULT HeadsetConnected
([in] Windows.Foundation.TypedEventHandler
<Windows.Gaming.Input.IGameController
*, Windows.Gaming.Input.Headset
*>* handler
,
229 [out, retval] EventRegistrationToken
* token
);
230 [eventremove
] HRESULT HeadsetConnected
([in] EventRegistrationToken token
);
231 [eventadd
] HRESULT HeadsetDisconnected
([in] Windows.Foundation.TypedEventHandler
<Windows.Gaming.Input.IGameController
*, Windows.Gaming.Input.Headset
*>* handler
,
232 [out, retval] EventRegistrationToken
* token
);
233 [eventremove
] HRESULT HeadsetDisconnected
([in] EventRegistrationToken token
);
234 [eventadd
] HRESULT UserChanged
([in] Windows.Foundation.TypedEventHandler
<Windows.Gaming.Input.IGameController
*, Windows.System.UserChangedEventArgs
*>* handler
,
235 [out, retval] EventRegistrationToken
* token
);
236 [eventremove
] HRESULT UserChanged
([in] EventRegistrationToken token
);
237 [propget] HRESULT Headset
([out, retval] Windows.Gaming.Input.Headset
** value
);
238 [propget] HRESULT IsWireless
([out, retval] boolean* value
);
239 [propget] HRESULT User
([out, retval] Windows.System.User
** value
);
243 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
244 exclusiveto
(Windows.Gaming.Input.Gamepad
),
245 uuid(bc7bb43c
-0a69
-3903-9e9d
-a50f86a45de5
)
247 interface IGamepad
: IInspectable
248 requires Windows.Gaming.Input.IGameController
250 [propget] HRESULT Vibration
([out, retval] Windows.Gaming.Input.GamepadVibration
* value
);
251 [propput] HRESULT Vibration
([in] Windows.Gaming.Input.GamepadVibration value
);
252 HRESULT GetCurrentReading
([out, retval] Windows.Gaming.Input.GamepadReading
* value
);
256 contract
(Windows.Foundation.UniversalApiContract
, 4.0),
257 exclusiveto
(Windows.Gaming.Input.RawGameController
),
258 uuid(7cad6d91
-a7e1
-4f71
-9a78
-33e9c5dfea62
)
260 interface IRawGameController
: IInspectable
261 requires Windows.Gaming.Input.IGameController
263 [propget] HRESULT AxisCount
([out, retval] INT32
* value
);
264 [propget] HRESULT ButtonCount
([out, retval] INT32
* value
);
265 [propget] HRESULT ForceFeedbackMotors
([out, retval] Windows.Foundation.Collections.IVectorView
<Windows.Gaming.Input.ForceFeedback.ForceFeedbackMotor
*>** value
);
266 [propget] HRESULT HardwareProductId
([out, retval] UINT16
* value
);
267 [propget] HRESULT HardwareVendorId
([out, retval] UINT16
* value
);
268 [propget] HRESULT SwitchCount
([out, retval] INT32
* value
);
269 HRESULT GetButtonLabel
([in] INT32 index
, [out, retval] Windows.Gaming.Input.GameControllerButtonLabel
* value
);
270 HRESULT GetCurrentReading
([in] UINT32 buttons_size
, [out, size_is(buttons_size
)] boolean* buttons
,
271 [in] UINT32 switches_size
, [out, size_is(switches_size
)] Windows.Gaming.Input.GameControllerSwitchPosition
* switches
,
272 [in] UINT32 axes_size
, [out, size_is(axes_size
)] DOUBLE* axes
,
273 [out, retval] UINT64
* timestamp
);
274 HRESULT GetSwitchKind
([in] INT32 index
, [out, retval] Windows.Gaming.Input.GameControllerSwitchKind
* value
);
279 uuid(8bbce529
-d49c
-39e9
-9560-e47dde96b7c8
)
281 interface IGamepadStatics
: IInspectable
283 [eventadd
] HRESULT GamepadAdded
([in] Windows.Foundation.EventHandler
<Gamepad
*> *value
, [out, retval] EventRegistrationToken
* token
);
284 [eventremove
] HRESULT GamepadAdded
([in] EventRegistrationToken token
);
285 [eventadd
] HRESULT GamepadRemoved
([in] Windows.Foundation.EventHandler
<Gamepad
*> *value
, [out, retval] EventRegistrationToken
* token
);
286 [eventremove
] HRESULT GamepadRemoved
([in] EventRegistrationToken token
);
287 [propget] HRESULT Gamepads
([out, retval] Windows.Foundation.Collections.IVectorView
<Gamepad
*> **value
);
291 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
292 exclusiveto
(Windows.Gaming.Input.Headset
),
293 uuid(3fd156ef
-6925-3fa8
-9181-029c5223ae3b
)
295 interface IHeadset
: IInspectable
297 [propget] HRESULT CaptureDeviceId
([out, retval] HSTRING
* value
);
298 [propget] HRESULT RenderDeviceId
([out, retval] HSTRING
* value
);
303 uuid(eb8d0792
-e95a
-4b19
-afc7
-0a59f8bf759e
)
305 interface IRawGameControllerStatics
: IInspectable
307 [eventadd
] HRESULT RawGameControllerAdded
([in] Windows.Foundation.EventHandler
<Windows.Gaming.Input.RawGameController
*> *handler
,
308 [out, retval] EventRegistrationToken
* token
);
309 [eventremove
] HRESULT RawGameControllerAdded
([in] EventRegistrationToken token
);
310 [eventadd
] HRESULT RawGameControllerRemoved
([in] Windows.Foundation.EventHandler
<Windows.Gaming.Input.RawGameController
*> *handler
,
311 [out, retval] EventRegistrationToken
* token
);
312 [eventremove
] HRESULT RawGameControllerRemoved
([in] EventRegistrationToken token
);
313 [propget] HRESULT RawGameControllers
([out, retval] Windows.Foundation.Collections.IVectorView
<Windows.Gaming.Input.RawGameController
*> **value
);
314 HRESULT FromGameController
([in] Windows.Gaming.Input.IGameController
*game_controller
, [out, retval] Windows.Gaming.Input.RawGameController
**value
);
318 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
319 marshaling_behavior
(agile
),
320 static
(Windows.Gaming.Input.IGamepadStatics
, Windows.Foundation.UniversalApiContract
, 1.0),
321 static
(Windows.Gaming.Input.IGamepadStatics2
, Windows.Foundation.UniversalApiContract
, 4.0),
326 [default] interface Windows.Gaming.Input.IGamepad
;
327 interface Windows.Gaming.Input.IGameController
;
328 [contract
(Windows.Foundation.UniversalApiContract
, 3.0)] interface Windows.Gaming.Input.IGamepad2
;
329 [contract
(Windows.Foundation.UniversalApiContract
, 4.0)] interface Windows.Gaming.Input.IGameControllerBatteryInfo
;
333 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
334 marshaling_behavior
(agile
),
339 [default] interface Windows.Gaming.Input.IHeadset
;
340 [contract
(Windows.Foundation.UniversalApiContract
, 4.0)] interface Windows.Gaming.Input.IGameControllerBatteryInfo
;
344 contract
(Windows.Foundation.UniversalApiContract
, 4.0),
345 marshaling_behavior
(agile
),
346 static
(Windows.Gaming.Input.IRawGameControllerStatics
, Windows.Foundation.UniversalApiContract
, 4.0),
349 runtimeclass RawGameController
351 [default] interface Windows.Gaming.Input.IRawGameController
;
352 interface Windows.Gaming.Input.IGameController
;
353 interface Windows.Gaming.Input.IGameControllerBatteryInfo
;
354 [contract
(Windows.Foundation.UniversalApiContract
, 5.0)] interface Windows.Gaming.Input.IRawGameController2
;