| 1 |
/* |
| 2 |
* Copyright 2022 Rémi Bernon for CodeWeavers |
| 3 |
* |
| 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. |
| 8 |
* |
| 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. |
| 13 |
* |
| 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 |
| 17 |
*/ |
| 18 |
|
| 19 |
#ifdef __WIDL__ |
| 20 |
#pragma winrt ns_prefix |
| 21 |
#endif |
| 22 |
|
| 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.idl"; |
| 29 |
import "windows.storage.streams.idl"; |
| 30 |
|
| 31 |
namespace Windows.Gaming.Input.Custom { |
| 32 |
typedef enum XusbDeviceSubtype XusbDeviceSubtype; |
| 33 |
typedef enum XusbDeviceType XusbDeviceType; |
| 34 |
typedef struct GameControllerVersionInfo GameControllerVersionInfo; |
| 35 |
interface IGameControllerInputSink; |
| 36 |
interface IGameControllerProvider; |
| 37 |
interface IHidGameControllerInputSink; |
| 38 |
interface IHidGameControllerProvider; |
| 39 |
interface IXusbGameControllerInputSink; |
| 40 |
interface IXusbGameControllerProvider; |
| 41 |
interface ICustomGameControllerFactory; |
| 42 |
interface IGameControllerFactoryManagerStatics; |
| 43 |
interface IGameControllerFactoryManagerStatics2; |
| 44 |
runtimeclass GameControllerFactoryManager; |
| 45 |
runtimeclass HidGameControllerProvider; |
| 46 |
runtimeclass XusbGameControllerProvider; |
| 47 |
|
| 48 |
[contract(Windows.Foundation.UniversalApiContract, 3.0)] |
| 49 |
enum XusbDeviceSubtype |
| 50 |
{ |
| 51 |
Unknown = 0, |
| 52 |
Gamepad = 1, |
| 53 |
ArcadePad = 2, |
| 54 |
ArcadeStick = 3, |
| 55 |
FlightStick = 4, |
| 56 |
Wheel = 5, |
| 57 |
Guitar = 6, |
| 58 |
GuitarAlternate = 7, |
| 59 |
GuitarBass = 8, |
| 60 |
DrumKit = 9, |
| 61 |
DancePad = 10, |
| 62 |
}; |
| 63 |
|
| 64 |
[contract(Windows.Foundation.UniversalApiContract, 3.0)] |
| 65 |
enum XusbDeviceType |
| 66 |
{ |
| 67 |
Unknown = 0, |
| 68 |
Gamepad = 1, |
| 69 |
}; |
| 70 |
|
| 71 |
[contract(Windows.Foundation.UniversalApiContract, 3.0)] |
| 72 |
struct GameControllerVersionInfo |
| 73 |
{ |
| 74 |
UINT16 Major; |
| 75 |
UINT16 Minor; |
| 76 |
UINT16 Build; |
| 77 |
UINT16 Revision; |
| 78 |
}; |
| 79 |
|
| 80 |
[ |
| 81 |
contract(Windows.Foundation.UniversalApiContract, 3.0), |
| 82 |
uuid(1ff6f922-c640-4c78-a820-9a715c558bcb) |
| 83 |
] |
| 84 |
interface IGameControllerInputSink : IInspectable |
| 85 |
{ |
| 86 |
HRESULT OnInputResumed([in] UINT64 timestamp); |
| 87 |
HRESULT OnInputSuspended([in] UINT64 timestamp); |
| 88 |
} |
| 89 |
|
| 90 |
[ |
| 91 |
contract(Windows.Foundation.UniversalApiContract, 3.0), |
| 92 |
uuid(e6d73982-2996-4559-b16c-3e57d46e58d6) |
| 93 |
] |
| 94 |
interface IGameControllerProvider : IInspectable |
| 95 |
{ |
| 96 |
[propget] HRESULT FirmwareVersionInfo([out, retval] Windows.Gaming.Input.Custom.GameControllerVersionInfo *value); |
| 97 |
[propget] HRESULT HardwareProductId([out, retval] UINT16 *value); |
| 98 |
[propget] HRESULT HardwareVendorId([out, retval] UINT16 *value); |
| 99 |
[propget] HRESULT HardwareVersionInfo([out, retval] Windows.Gaming.Input.Custom.GameControllerVersionInfo *value); |
| 100 |
[propget] HRESULT IsConnected([out, retval] boolean *value); |
| 101 |
} |
| 102 |
|
| 103 |
[ |
| 104 |
contract(Windows.Foundation.UniversalApiContract, 4.0), |
| 105 |
uuid(f754c322-182d-40e4-a126-fcee4ffa1e31) |
| 106 |
] |
| 107 |
interface IHidGameControllerInputSink : IInspectable |
| 108 |
requires Windows.Gaming.Input.Custom.IGameControllerInputSink |
| 109 |
{ |
| 110 |
HRESULT OnInputReportReceived([in] UINT64 timestamp, [in] BYTE id, [in] UINT32 report_len, |
| 111 |
[in, size_is(report_len)] BYTE *report_buf); |
| 112 |
} |
| 113 |
|
| 114 |
[ |
| 115 |
contract(Windows.Foundation.UniversalApiContract, 4.0), |
| 116 |
exclusiveto(Windows.Gaming.Input.Custom.HidGameControllerProvider), |
| 117 |
uuid(95ce3af4-abf0-4b68-a081-3b7de73ff0e7) |
| 118 |
] |
| 119 |
interface IHidGameControllerProvider : IInspectable |
| 120 |
requires Windows.Gaming.Input.Custom.IGameControllerProvider |
| 121 |
{ |
| 122 |
[propget] HRESULT UsageId([out, retval] UINT16 *value); |
| 123 |
[propget] HRESULT UsagePage([out, retval] UINT16 *value); |
| 124 |
HRESULT GetFeatureReport([in] BYTE id, [in] UINT32 report_len, |
| 125 |
[out, size_is(report_len)] BYTE *report_buf); |
| 126 |
HRESULT SendFeatureReport([in] BYTE id, [in] UINT32 report_len, |
| 127 |
[in, size_is(report_len)] BYTE *report_buf); |
| 128 |
HRESULT SendOutputReport([in] BYTE id, [in] UINT32 report_len, |
| 129 |
[in, size_is(report_len)] BYTE *report_buf); |
| 130 |
} |
| 131 |
|
| 132 |
[ |
| 133 |
contract(Windows.Foundation.UniversalApiContract, 3.0), |
| 134 |
uuid(b2ac1d95-6ecb-42b3-8aab-025401ca4712) |
| 135 |
] |
| 136 |
interface IXusbGameControllerInputSink : IInspectable |
| 137 |
requires Windows.Gaming.Input.Custom.IGameControllerInputSink |
| 138 |
{ |
| 139 |
HRESULT OnInputReceived([in] UINT64 timestamp, [in] BYTE id, [in] UINT32 report_len, |
| 140 |
[in, size_is(report_len)] BYTE *report_buf); |
| 141 |
} |
| 142 |
|
| 143 |
[ |
| 144 |
contract(Windows.Foundation.UniversalApiContract, 3.0), |
| 145 |
exclusiveto(Windows.Gaming.Input.Custom.XusbGameControllerProvider), |
| 146 |
uuid(6e2971eb-0efb-48b4-808b-837643b2f216) |
| 147 |
] |
| 148 |
interface IXusbGameControllerProvider : IInspectable |
| 149 |
requires Windows.Gaming.Input.Custom.IGameControllerProvider |
| 150 |
{ |
| 151 |
HRESULT SetVibration([in] DOUBLE rumble_intensity, [in] DOUBLE buzz_intensity); |
| 152 |
} |
| 153 |
|
| 154 |
[ |
| 155 |
contract(Windows.Foundation.UniversalApiContract, 3.0), |
| 156 |
uuid(69a0ae5e-758e-4cbe-ace6-62155fe9126f) |
| 157 |
] |
| 158 |
interface ICustomGameControllerFactory : IInspectable |
| 159 |
{ |
| 160 |
HRESULT CreateGameController([in] Windows.Gaming.Input.Custom.IGameControllerProvider *provider, |
| 161 |
[out, retval] IInspectable **value); |
| 162 |
HRESULT OnGameControllerAdded([in] Windows.Gaming.Input.IGameController *value); |
| 163 |
HRESULT OnGameControllerRemoved([in] Windows.Gaming.Input.IGameController *value); |
| 164 |
} |
| 165 |
|
| 166 |
[ |
| 167 |
contract(Windows.Foundation.UniversalApiContract, 3.0), |
| 168 |
exclusiveto(Windows.Gaming.Input.Custom.GameControllerFactoryManager), |
| 169 |
uuid(36cb66e3-d0a1-4986-a24c-40b137deba9e) |
| 170 |
] |
| 171 |
interface IGameControllerFactoryManagerStatics : IInspectable |
| 172 |
{ |
| 173 |
HRESULT RegisterCustomFactoryForGipInterface([in] Windows.Gaming.Input.Custom.ICustomGameControllerFactory *factory, |
| 174 |
[in] GUID interfaceId); |
| 175 |
HRESULT RegisterCustomFactoryForHardwareId([in] Windows.Gaming.Input.Custom.ICustomGameControllerFactory *factory, |
| 176 |
[in] UINT16 vendor_id, [in] UINT16 product_id); |
| 177 |
HRESULT RegisterCustomFactoryForXusbType([in] Windows.Gaming.Input.Custom.ICustomGameControllerFactory *factory, |
| 178 |
[in] Windows.Gaming.Input.Custom.XusbDeviceType type, |
| 179 |
[in] Windows.Gaming.Input.Custom.XusbDeviceSubtype subtype); |
| 180 |
} |
| 181 |
|
| 182 |
[ |
| 183 |
contract(Windows.Foundation.UniversalApiContract, 4.0), |
| 184 |
exclusiveto(Windows.Gaming.Input.Custom.GameControllerFactoryManager), |
| 185 |
uuid(eace5644-19df-4115-b32a-2793e2aea3bb) |
| 186 |
] |
| 187 |
interface IGameControllerFactoryManagerStatics2 : IInspectable |
| 188 |
requires Windows.Gaming.Input.Custom.IGameControllerFactoryManagerStatics |
| 189 |
{ |
| 190 |
HRESULT TryGetFactoryControllerFromGameController([in] Windows.Gaming.Input.Custom.ICustomGameControllerFactory *factory, |
| 191 |
[in] Windows.Gaming.Input.IGameController *controller, |
| 192 |
[out, retval] Windows.Gaming.Input.IGameController **value); |
| 193 |
} |
| 194 |
|
| 195 |
[ |
| 196 |
contract(Windows.Foundation.UniversalApiContract, 3.0), |
| 197 |
marshaling_behavior(agile), |
| 198 |
static(Windows.Gaming.Input.Custom.IGameControllerFactoryManagerStatics, Windows.Foundation.UniversalApiContract, 3.0), |
| 199 |
static(Windows.Gaming.Input.Custom.IGameControllerFactoryManagerStatics2, Windows.Foundation.UniversalApiContract, 4.0), |
| 200 |
threading(both) |
| 201 |
] |
| 202 |
runtimeclass GameControllerFactoryManager |
| 203 |
{ |
| 204 |
} |
| 205 |
|
| 206 |
[ |
| 207 |
contract(Windows.Foundation.UniversalApiContract, 4.0), |
| 208 |
marshaling_behavior(agile), |
| 209 |
threading(both) |
| 210 |
] |
| 211 |
runtimeclass HidGameControllerProvider |
| 212 |
{ |
| 213 |
[default] interface Windows.Gaming.Input.Custom.IHidGameControllerProvider; |
| 214 |
interface Windows.Gaming.Input.Custom.IGameControllerProvider; |
| 215 |
} |
| 216 |
|
| 217 |
[ |
| 218 |
contract(Windows.Foundation.UniversalApiContract, 3.0), |
| 219 |
marshaling_behavior(agile), |
| 220 |
threading(both) |
| 221 |
] |
| 222 |
runtimeclass XusbGameControllerProvider |
| 223 |
{ |
| 224 |
[default] interface Windows.Gaming.Input.Custom.IXusbGameControllerProvider; |
| 225 |
interface Windows.Gaming.Input.Custom.IGameControllerProvider; |
| 226 |
} |
| 227 |
} |