kernelbase: Reimplement LOCALE_SNAME in GetLocaleInfoW/Ex using the locale.nls data.
[wine.git] / include / windows.gaming.input.idl
blob4e9bb6e2465da489c7fab12af4d188cfd9e7b427
1 /*
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
19 #ifdef __WIDL__
20 #pragma winrt ns_prefix
21 #endif
23 #ifndef DO_NO_IMPORTS
24 import "inspectable.idl";
25 import "asyncinfo.idl";
26 import "eventtoken.idl";
27 import "windowscontracts.idl";
28 import "windows.foundation.idl";
29 import "windows.devices.haptics.idl";
30 import "windows.gaming.input.forcefeedback.idl";
31 import "windows.system.idl";
32 import "windows.devices.power.idl";
33 #endif
35 namespace Windows.Gaming.Input {
36 typedef enum GamepadButtons GamepadButtons;
37 typedef enum GameControllerButtonLabel GameControllerButtonLabel;
38 typedef enum GameControllerSwitchKind GameControllerSwitchKind;
39 typedef enum GameControllerSwitchPosition GameControllerSwitchPosition;
40 typedef struct GamepadReading GamepadReading;
41 typedef struct GamepadVibration GamepadVibration;
42 interface IGameController;
43 interface IGameControllerBatteryInfo;
44 interface IGamepad;
45 interface IGamepad2;
46 interface IGamepadStatics;
47 interface IGamepadStatics2;
48 interface IRawGameController;
49 interface IRawGameController2;
50 runtimeclass Gamepad;
51 runtimeclass Headset;
52 runtimeclass RawGameController;
54 declare {
55 interface Windows.Foundation.EventHandler<Windows.Gaming.Input.Gamepad *>;
56 interface Windows.Foundation.EventHandler<Windows.Gaming.Input.RawGameController *>;
57 interface Windows.Foundation.TypedEventHandler<Windows.Gaming.Input.IGameController *, Windows.Gaming.Input.Headset *>;
58 interface Windows.Foundation.TypedEventHandler<Windows.Gaming.Input.IGameController *, Windows.System.UserChangedEventArgs *>;
59 interface Windows.Foundation.Collections.IIterator<Windows.Gaming.Input.Gamepad *>;
60 interface Windows.Foundation.Collections.IIterable<Windows.Gaming.Input.Gamepad *>;
61 interface Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.Gamepad *>;
62 interface Windows.Foundation.Collections.IVector<Windows.Gaming.Input.Gamepad *>;
63 interface Windows.Foundation.Collections.IIterator<Windows.Gaming.Input.RawGameController *>;
64 interface Windows.Foundation.Collections.IIterable<Windows.Gaming.Input.RawGameController *>;
65 interface Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.RawGameController *>;
66 interface Windows.Foundation.Collections.IVector<Windows.Gaming.Input.RawGameController *>;
70 contract(Windows.Foundation.UniversalApiContract, 1.0),
71 flags
73 enum GamepadButtons
75 None = 0x0,
76 Menu = 0x1,
77 View = 0x2,
78 A = 0x4,
79 B = 0x8,
80 X = 0x10,
81 Y = 0x20,
82 DPadUp = 0x40,
83 DPadDown = 0x80,
84 DPadLeft = 0x100,
85 DPadRight = 0x200,
86 LeftShoulder = 0x400,
87 RightShoulder = 0x800,
88 LeftThumbstick = 0x1000,
89 RightThumbstick = 0x2000,
90 [contract(Windows.Foundation.UniversalApiContract, 3.0)]
91 Paddle1 = 0x4000,
92 [contract(Windows.Foundation.UniversalApiContract, 3.0)]
93 Paddle2 = 0x8000,
94 [contract(Windows.Foundation.UniversalApiContract, 3.0)]
95 Paddle3 = 0x10000,
96 [contract(Windows.Foundation.UniversalApiContract, 3.0)]
97 Paddle4 = 0x20000
100 [contract(Windows.Foundation.UniversalApiContract, 3.0)]
101 enum GameControllerButtonLabel
103 None = 0,
104 XboxBack = 1,
105 XboxStart = 2,
106 XboxMenu = 3,
107 XboxView = 4,
108 XboxUp = 5,
109 XboxDown = 6,
110 XboxLeft = 7,
111 XboxRight = 8,
112 XboxA = 9,
113 XboxB = 10,
114 XboxX = 11,
115 XboxY = 12,
116 XboxLeftBumper = 13,
117 XboxLeftTrigger = 14,
118 XboxLeftStickButton = 15,
119 XboxRightBumper = 16,
120 XboxRightTrigger = 17,
121 XboxRightStickButton = 18,
122 XboxPaddle1 = 19,
123 XboxPaddle2 = 20,
124 XboxPaddle3 = 21,
125 XboxPaddle4 = 22,
126 Mode = 23,
127 Select = 24,
128 Menu = 25,
129 View = 26,
130 Back = 27,
131 Start = 28,
132 Options = 29,
133 Share = 30,
134 Up = 31,
135 Down = 32,
136 Left = 33,
137 Right = 34,
138 LetterA = 35,
139 LetterB = 36,
140 LetterC = 37,
141 LetterL = 38,
142 LetterR = 39,
143 LetterX = 40,
144 LetterY = 41,
145 LetterZ = 42,
146 Cross = 43,
147 Circle = 44,
148 Square = 45,
149 Triangle = 46,
150 LeftBumper = 47,
151 LeftTrigger = 48,
152 LeftStickButton = 49,
153 Left1 = 50,
154 Left2 = 51,
155 Left3 = 52,
156 RightBumper = 53,
157 RightTrigger = 54,
158 RightStickButton = 55,
159 Right1 = 56,
160 Right2 = 57,
161 Right3 = 58,
162 Paddle1 = 59,
163 Paddle2 = 60,
164 Paddle3 = 61,
165 Paddle4 = 62,
166 Plus = 63,
167 Minus = 64,
168 DownLeftArrow = 65,
169 DialLeft = 66,
170 DialRight = 67,
171 Suspension = 68
174 [contract(Windows.Foundation.UniversalApiContract, 4.0)]
175 enum GameControllerSwitchKind
177 TwoWay = 0,
178 FourWay = 1,
179 EightWay = 2
182 [contract(Windows.Foundation.UniversalApiContract, 4.0)]
183 enum GameControllerSwitchPosition
185 Center = 0,
186 Up = 1,
187 UpRight = 2,
188 Right = 3,
189 DownRight = 4,
190 Down = 5,
191 DownLeft = 6,
192 Left = 7,
193 UpLeft = 8
196 [contract(Windows.Foundation.UniversalApiContract, 1.0)]
197 struct GamepadReading
199 UINT64 Timestamp;
200 Windows.Gaming.Input.GamepadButtons Buttons;
201 DOUBLE LeftTrigger;
202 DOUBLE RightTrigger;
203 DOUBLE LeftThumbstickX;
204 DOUBLE LeftThumbstickY;
205 DOUBLE RightThumbstickX;
206 DOUBLE RightThumbstickY;
209 [contract(Windows.Foundation.UniversalApiContract, 1.0)]
210 struct GamepadVibration
212 DOUBLE LeftMotor;
213 DOUBLE RightMotor;
214 DOUBLE LeftTrigger;
215 DOUBLE RightTrigger;
219 contract(Windows.Foundation.UniversalApiContract, 1.0),
220 uuid(1baf6522-5f64-42c5-8267-b9fe2215bfbd)
222 interface IGameController : IInspectable
224 [eventadd] HRESULT HeadsetConnected([in] Windows.Foundation.TypedEventHandler<Windows.Gaming.Input.IGameController *, Windows.Gaming.Input.Headset *> *handler,
225 [out, retval] EventRegistrationToken *token);
226 [eventremove] HRESULT HeadsetConnected([in] EventRegistrationToken token);
227 [eventadd] HRESULT HeadsetDisconnected([in] Windows.Foundation.TypedEventHandler<Windows.Gaming.Input.IGameController *, Windows.Gaming.Input.Headset *> *handler,
228 [out, retval] EventRegistrationToken *token);
229 [eventremove] HRESULT HeadsetDisconnected([in] EventRegistrationToken token);
230 [eventadd] HRESULT UserChanged([in] Windows.Foundation.TypedEventHandler<Windows.Gaming.Input.IGameController *, Windows.System.UserChangedEventArgs *> *handler,
231 [out, retval] EventRegistrationToken *token);
232 [eventremove] HRESULT UserChanged([in] EventRegistrationToken token);
233 [propget] HRESULT Headset([out, retval] Windows.Gaming.Input.Headset **value);
234 [propget] HRESULT IsWireless([out, retval] boolean *value);
235 [propget] HRESULT User([out, retval] Windows.System.User **value);
239 contract(Windows.Foundation.UniversalApiContract, 1.0),
240 exclusiveto(Windows.Gaming.Input.Gamepad),
241 uuid(bc7bb43c-0a69-3903-9e9d-a50f86a45de5)
243 interface IGamepad : IInspectable
244 requires Windows.Gaming.Input.IGameController
246 [propget] HRESULT Vibration([out, retval] Windows.Gaming.Input.GamepadVibration *value);
247 [propput] HRESULT Vibration([in] Windows.Gaming.Input.GamepadVibration value);
248 HRESULT GetCurrentReading([out, retval] Windows.Gaming.Input.GamepadReading *value);
252 contract(Windows.Foundation.UniversalApiContract, 4.0),
253 exclusiveto(Windows.Gaming.Input.RawGameController),
254 uuid(7cad6d91-a7e1-4f71-9a78-33e9c5dfea62)
256 interface IRawGameController : IInspectable
257 requires Windows.Gaming.Input.IGameController
259 [propget] HRESULT AxisCount([out, retval] INT32 *value);
260 [propget] HRESULT ButtonCount([out, retval] INT32 *value);
261 [propget] HRESULT ForceFeedbackMotors([out, retval] Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.ForceFeedback.ForceFeedbackMotor *> **value);
262 [propget] HRESULT HardwareProductId([out, retval] UINT16 *value);
263 [propget] HRESULT HardwareVendorId([out, retval] UINT16 *value);
264 [propget] HRESULT SwitchCount([out, retval] INT32 *value);
265 HRESULT GetButtonLabel([in] INT32 index, [out, retval] Windows.Gaming.Input.GameControllerButtonLabel *value);
266 HRESULT GetCurrentReading([in] UINT32 buttons_size, [out, size_is(buttons_size)] boolean *buttons,
267 [in] UINT32 switches_size, [out, size_is(switches_size)] Windows.Gaming.Input.GameControllerSwitchPosition *switches,
268 [in] UINT32 axes_size, [out, size_is(axes_size)] DOUBLE *axes,
269 [out, retval] UINT64 *timestamp);
270 HRESULT GetSwitchKind([in] INT32 index, [out, retval] Windows.Gaming.Input.GameControllerSwitchKind *value);
274 contract(Windows.Foundation.UniversalApiContract, 5.0),
275 exclusiveto(Windows.Gaming.Input.RawGameController),
276 uuid(43c0c035-bb73-4756-a787-3ed6bea617bd)
278 interface IRawGameController2 : IInspectable
279 requires Windows.Gaming.Input.IRawGameController,
280 Windows.Gaming.Input.IGameController
282 [propget] HRESULT SimpleHapticsControllers([out, retval] Windows.Foundation.Collections.IVectorView<Windows.Devices.Haptics.SimpleHapticsController *> **value);
283 [propget] HRESULT NonRoamableId([out, retval] HSTRING *value);
284 [propget] HRESULT DisplayName([out, retval] HSTRING *value);
288 object,
289 uuid(8bbce529-d49c-39e9-9560-e47dde96b7c8)
291 interface IGamepadStatics : IInspectable
293 [eventadd] HRESULT GamepadAdded([in] Windows.Foundation.EventHandler<Gamepad *> *value, [out, retval] EventRegistrationToken *token);
294 [eventremove] HRESULT GamepadAdded([in] EventRegistrationToken token);
295 [eventadd] HRESULT GamepadRemoved([in] Windows.Foundation.EventHandler<Gamepad *> *value, [out, retval] EventRegistrationToken *token);
296 [eventremove] HRESULT GamepadRemoved([in] EventRegistrationToken token);
297 [propget] HRESULT Gamepads([out, retval] Windows.Foundation.Collections.IVectorView<Gamepad *> **value);
301 contract(Windows.Foundation.UniversalApiContract, 4.0),
302 exclusiveto(Windows.Gaming.Input.Gamepad),
303 uuid(42676dc5-0856-47c4-9213-b395504c3a3c)
305 interface IGamepadStatics2 : IInspectable
306 requires Windows.Gaming.Input.IGamepadStatics
308 HRESULT FromGameController([in] Windows.Gaming.Input.IGameController *controller,
309 [out, retval] Windows.Gaming.Input.Gamepad **value);
313 contract(Windows.Foundation.UniversalApiContract, 1.0),
314 exclusiveto(Windows.Gaming.Input.Headset),
315 uuid(3fd156ef-6925-3fa8-9181-029c5223ae3b)
317 interface IHeadset : IInspectable
319 [propget] HRESULT CaptureDeviceId([out, retval] HSTRING *value);
320 [propget] HRESULT RenderDeviceId([out, retval] HSTRING *value);
324 object,
325 uuid(eb8d0792-e95a-4b19-afc7-0a59f8bf759e)
327 interface IRawGameControllerStatics : IInspectable
329 [eventadd] HRESULT RawGameControllerAdded([in] Windows.Foundation.EventHandler<Windows.Gaming.Input.RawGameController *> *handler,
330 [out, retval] EventRegistrationToken *token);
331 [eventremove] HRESULT RawGameControllerAdded([in] EventRegistrationToken token);
332 [eventadd] HRESULT RawGameControllerRemoved([in] Windows.Foundation.EventHandler<Windows.Gaming.Input.RawGameController *> *handler,
333 [out, retval] EventRegistrationToken *token);
334 [eventremove] HRESULT RawGameControllerRemoved([in] EventRegistrationToken token);
335 [propget] HRESULT RawGameControllers([out, retval] Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.RawGameController *> **value);
336 HRESULT FromGameController([in] Windows.Gaming.Input.IGameController *game_controller, [out, retval] Windows.Gaming.Input.RawGameController **value);
340 contract(Windows.Foundation.UniversalApiContract, 4.0),
341 uuid(dcecc681-3963-4da6-955d-553f3b6f6161)
343 interface IGameControllerBatteryInfo : IInspectable
345 HRESULT TryGetBatteryReport([out, retval] Windows.Devices.Power.BatteryReport **value);
349 contract(Windows.Foundation.UniversalApiContract, 1.0),
350 marshaling_behavior(agile),
351 static(Windows.Gaming.Input.IGamepadStatics, Windows.Foundation.UniversalApiContract, 1.0),
352 static(Windows.Gaming.Input.IGamepadStatics2, Windows.Foundation.UniversalApiContract, 4.0),
353 threading(both)
355 runtimeclass Gamepad
357 [default] interface Windows.Gaming.Input.IGamepad;
358 interface Windows.Gaming.Input.IGameController;
359 [contract(Windows.Foundation.UniversalApiContract, 3.0)] interface Windows.Gaming.Input.IGamepad2;
360 [contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.Gaming.Input.IGameControllerBatteryInfo;
364 contract(Windows.Foundation.UniversalApiContract, 1.0),
365 marshaling_behavior(agile),
366 threading(both)
368 runtimeclass Headset
370 [default] interface Windows.Gaming.Input.IHeadset;
371 [contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.Gaming.Input.IGameControllerBatteryInfo;
375 contract(Windows.Foundation.UniversalApiContract, 4.0),
376 marshaling_behavior(agile),
377 static(Windows.Gaming.Input.IRawGameControllerStatics, Windows.Foundation.UniversalApiContract, 4.0),
378 threading(both)
380 runtimeclass RawGameController
382 [default] interface Windows.Gaming.Input.IRawGameController;
383 interface Windows.Gaming.Input.IGameController;
384 interface Windows.Gaming.Input.IGameControllerBatteryInfo;
385 [contract(Windows.Foundation.UniversalApiContract, 5.0)] interface Windows.Gaming.Input.IRawGameController2;