widl: Always check the runtimeclass interfaces presence.
[wine/zf.git] / include / windows.gaming.input.idl
blob1da22408eeb07db92d808ad772160d28aa0715e6
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 "eventtoken.idl";
24 import "inspectable.idl";
25 import "windows.foundation.idl";
27 namespace Windows {
28 namespace Gaming {
29 namespace Input {
30 typedef enum GamepadButtons GamepadButtons;
31 typedef struct GamepadReading GamepadReading;
32 typedef struct GamepadVibration GamepadVibration;
33 interface IGameController;
34 interface IGameControllerBatteryInfo;
35 interface IGamepad;
36 interface IGamepad2;
37 interface IGamepadStatics;
38 interface IGamepadStatics2;
39 runtimeclass Gamepad;
44 namespace Windows {
45 namespace Gaming {
46 namespace Input {
47 declare {
48 interface Windows.Foundation.EventHandler<Windows.Gaming.Input.Gamepad*>;
49 interface Windows.Foundation.Collections.IVectorView<Gamepad*>;
55 namespace Windows {
56 namespace Gaming {
57 namespace Input {
59 contract(Windows.Foundation.UniversalApiContract, 1.0),
60 flags
62 enum GamepadButtons
64 None = 0x0,
65 Menu = 0x1,
66 View = 0x2,
67 A = 0x4,
68 B = 0x8,
69 X = 0x10,
70 Y = 0x20,
71 DPadUp = 0x40,
72 DPadDown = 0x80,
73 DPadLeft = 0x100,
74 DPadRight = 0x200,
75 LeftShoulder = 0x400,
76 RightShoulder = 0x800,
77 LeftThumbstick = 0x1000,
78 RightThumbstick = 0x2000,
79 [contract(Windows.Foundation.UniversalApiContract, 3.0)]
80 Paddle1 = 0x4000,
81 [contract(Windows.Foundation.UniversalApiContract, 3.0)]
82 Paddle2 = 0x8000,
83 [contract(Windows.Foundation.UniversalApiContract, 3.0)]
84 Paddle3 = 0x10000,
85 [contract(Windows.Foundation.UniversalApiContract, 3.0)]
86 Paddle4 = 0x20000
89 [contract(Windows.Foundation.UniversalApiContract, 1.0)]
90 struct GamepadReading
92 UINT64 Timestamp;
93 Windows.Gaming.Input.GamepadButtons Buttons;
94 DOUBLE LeftTrigger;
95 DOUBLE RightTrigger;
96 DOUBLE LeftThumbstickX;
97 DOUBLE LeftThumbstickY;
98 DOUBLE RightThumbstickX;
99 DOUBLE RightThumbstickY;
102 [contract(Windows.Foundation.UniversalApiContract, 1.0)]
103 struct GamepadVibration
105 DOUBLE LeftMotor;
106 DOUBLE RightMotor;
107 DOUBLE LeftTrigger;
108 DOUBLE RightTrigger;
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);
125 object,
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),
142 threading(both)
144 runtimeclass Gamepad
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;