msvcrt: Import log1pf implementation from musl.
[wine.git] / include / windows.gaming.input.idl
blob0f9dd37acd83267ec5e8ef7c06874615c975847c
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 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";
31 namespace Windows {
32 namespace Gaming {
33 namespace Input {
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;
42 interface IGamepad;
43 interface IGamepad2;
44 interface IGamepadStatics;
45 interface IGamepadStatics2;
46 interface IRawGameController;
47 interface IRawGameController2;
48 runtimeclass Gamepad;
49 runtimeclass Headset;
50 runtimeclass RawGameController;
55 namespace Windows {
56 namespace Gaming {
57 namespace Input {
58 declare {
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*>;
70 namespace Windows {
71 namespace Gaming {
72 namespace Input {
74 contract(Windows.Foundation.UniversalApiContract, 1.0),
75 flags
77 enum GamepadButtons
79 None = 0x0,
80 Menu = 0x1,
81 View = 0x2,
82 A = 0x4,
83 B = 0x8,
84 X = 0x10,
85 Y = 0x20,
86 DPadUp = 0x40,
87 DPadDown = 0x80,
88 DPadLeft = 0x100,
89 DPadRight = 0x200,
90 LeftShoulder = 0x400,
91 RightShoulder = 0x800,
92 LeftThumbstick = 0x1000,
93 RightThumbstick = 0x2000,
94 [contract(Windows.Foundation.UniversalApiContract, 3.0)]
95 Paddle1 = 0x4000,
96 [contract(Windows.Foundation.UniversalApiContract, 3.0)]
97 Paddle2 = 0x8000,
98 [contract(Windows.Foundation.UniversalApiContract, 3.0)]
99 Paddle3 = 0x10000,
100 [contract(Windows.Foundation.UniversalApiContract, 3.0)]
101 Paddle4 = 0x20000
104 [contract(Windows.Foundation.UniversalApiContract, 3.0)]
105 enum GameControllerButtonLabel
107 None = 0,
108 XboxBack = 1,
109 XboxStart = 2,
110 XboxMenu = 3,
111 XboxView = 4,
112 XboxUp = 5,
113 XboxDown = 6,
114 XboxLeft = 7,
115 XboxRight = 8,
116 XboxA = 9,
117 XboxB = 10,
118 XboxX = 11,
119 XboxY = 12,
120 XboxLeftBumper = 13,
121 XboxLeftTrigger = 14,
122 XboxLeftStickButton = 15,
123 XboxRightBumper = 16,
124 XboxRightTrigger = 17,
125 XboxRightStickButton = 18,
126 XboxPaddle1 = 19,
127 XboxPaddle2 = 20,
128 XboxPaddle3 = 21,
129 XboxPaddle4 = 22,
130 Mode = 23,
131 Select = 24,
132 Menu = 25,
133 View = 26,
134 Back = 27,
135 Start = 28,
136 Options = 29,
137 Share = 30,
138 Up = 31,
139 Down = 32,
140 Left = 33,
141 Right = 34,
142 LetterA = 35,
143 LetterB = 36,
144 LetterC = 37,
145 LetterL = 38,
146 LetterR = 39,
147 LetterX = 40,
148 LetterY = 41,
149 LetterZ = 42,
150 Cross = 43,
151 Circle = 44,
152 Square = 45,
153 Triangle = 46,
154 LeftBumper = 47,
155 LeftTrigger = 48,
156 LeftStickButton = 49,
157 Left1 = 50,
158 Left2 = 51,
159 Left3 = 52,
160 RightBumper = 53,
161 RightTrigger = 54,
162 RightStickButton = 55,
163 Right1 = 56,
164 Right2 = 57,
165 Right3 = 58,
166 Paddle1 = 59,
167 Paddle2 = 60,
168 Paddle3 = 61,
169 Paddle4 = 62,
170 Plus = 63,
171 Minus = 64,
172 DownLeftArrow = 65,
173 DialLeft = 66,
174 DialRight = 67,
175 Suspension = 68
178 [contract(Windows.Foundation.UniversalApiContract, 4.0)]
179 enum GameControllerSwitchKind
181 TwoWay = 0,
182 FourWay = 1,
183 EightWay = 2
186 [contract(Windows.Foundation.UniversalApiContract, 4.0)]
187 enum GameControllerSwitchPosition
189 Center = 0,
190 Up = 1,
191 UpRight = 2,
192 Right = 3,
193 DownRight = 4,
194 Down = 5,
195 DownLeft = 6,
196 Left = 7,
197 UpLeft = 8
200 [contract(Windows.Foundation.UniversalApiContract, 1.0)]
201 struct GamepadReading
203 UINT64 Timestamp;
204 Windows.Gaming.Input.GamepadButtons Buttons;
205 DOUBLE LeftTrigger;
206 DOUBLE RightTrigger;
207 DOUBLE LeftThumbstickX;
208 DOUBLE LeftThumbstickY;
209 DOUBLE RightThumbstickX;
210 DOUBLE RightThumbstickY;
213 [contract(Windows.Foundation.UniversalApiContract, 1.0)]
214 struct GamepadVibration
216 DOUBLE LeftMotor;
217 DOUBLE RightMotor;
218 DOUBLE LeftTrigger;
219 DOUBLE RightTrigger;
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);
278 object,
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);
302 object,
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),
322 threading(both)
324 runtimeclass Gamepad
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),
335 threading(both)
337 runtimeclass Headset
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),
347 threading(both)
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;