2022-02-28 09:44:04 +01:00
|
|
|
/*
|
|
|
|
* Copyright 2022 Rémi Bernon for CodeWeavers
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef __WIDL__
|
|
|
|
#pragma winrt ns_prefix
|
|
|
|
#endif
|
|
|
|
|
|
|
|
import "inspectable.idl";
|
|
|
|
import "asyncinfo.idl";
|
|
|
|
import "eventtoken.idl";
|
|
|
|
import "windowscontracts.idl";
|
|
|
|
import "windows.foundation.idl";
|
|
|
|
import "windows.gaming.input.idl";
|
|
|
|
import "windows.storage.streams.idl";
|
|
|
|
|
|
|
|
namespace Windows.Gaming.Input.Custom {
|
2022-02-28 09:44:06 +01:00
|
|
|
typedef enum XusbDeviceSubtype XusbDeviceSubtype;
|
|
|
|
typedef enum XusbDeviceType XusbDeviceType;
|
2022-02-28 09:44:04 +01:00
|
|
|
typedef struct GameControllerVersionInfo GameControllerVersionInfo;
|
2022-03-01 09:32:32 +01:00
|
|
|
interface IGameControllerInputSink;
|
2022-02-28 09:44:04 +01:00
|
|
|
interface IGameControllerProvider;
|
2022-03-01 09:32:33 +01:00
|
|
|
interface IHidGameControllerInputSink;
|
2022-02-28 09:44:05 +01:00
|
|
|
interface ICustomGameControllerFactory;
|
2022-02-28 09:44:06 +01:00
|
|
|
interface IGameControllerFactoryManagerStatics;
|
|
|
|
interface IGameControllerFactoryManagerStatics2;
|
|
|
|
runtimeclass GameControllerFactoryManager;
|
|
|
|
|
|
|
|
[contract(Windows.Foundation.UniversalApiContract, 3.0)]
|
|
|
|
enum XusbDeviceSubtype
|
|
|
|
{
|
|
|
|
Unknown = 0,
|
|
|
|
Gamepad = 1,
|
|
|
|
ArcadePad = 2,
|
|
|
|
ArcadeStick = 3,
|
|
|
|
FlightStick = 4,
|
|
|
|
Wheel = 5,
|
|
|
|
Guitar = 6,
|
|
|
|
GuitarAlternate = 7,
|
|
|
|
GuitarBass = 8,
|
|
|
|
DrumKit = 9,
|
|
|
|
DancePad = 10,
|
|
|
|
};
|
|
|
|
|
|
|
|
[contract(Windows.Foundation.UniversalApiContract, 3.0)]
|
|
|
|
enum XusbDeviceType
|
|
|
|
{
|
|
|
|
Unknown = 0,
|
|
|
|
Gamepad = 1,
|
|
|
|
};
|
2022-02-28 09:44:04 +01:00
|
|
|
|
|
|
|
[contract(Windows.Foundation.UniversalApiContract, 3.0)]
|
|
|
|
struct GameControllerVersionInfo
|
|
|
|
{
|
|
|
|
UINT16 Major;
|
|
|
|
UINT16 Minor;
|
|
|
|
UINT16 Build;
|
|
|
|
UINT16 Revision;
|
|
|
|
};
|
|
|
|
|
2022-03-01 09:32:32 +01:00
|
|
|
[
|
|
|
|
contract(Windows.Foundation.UniversalApiContract, 3.0),
|
|
|
|
uuid(1ff6f922-c640-4c78-a820-9a715c558bcb)
|
|
|
|
]
|
|
|
|
interface IGameControllerInputSink : IInspectable
|
|
|
|
{
|
|
|
|
HRESULT OnInputResumed([in] UINT64 timestamp);
|
|
|
|
HRESULT OnInputSuspended([in] UINT64 timestamp);
|
|
|
|
}
|
|
|
|
|
2022-02-28 09:44:04 +01:00
|
|
|
[
|
|
|
|
contract(Windows.Foundation.UniversalApiContract, 3.0),
|
|
|
|
uuid(e6d73982-2996-4559-b16c-3e57d46e58d6)
|
|
|
|
]
|
|
|
|
interface IGameControllerProvider : IInspectable
|
|
|
|
{
|
|
|
|
[propget] HRESULT FirmwareVersionInfo([out, retval] Windows.Gaming.Input.Custom.GameControllerVersionInfo *value);
|
|
|
|
[propget] HRESULT HardwareProductId([out, retval] UINT16 *value);
|
|
|
|
[propget] HRESULT HardwareVendorId([out, retval] UINT16 *value);
|
|
|
|
[propget] HRESULT HardwareVersionInfo([out, retval] Windows.Gaming.Input.Custom.GameControllerVersionInfo *value);
|
|
|
|
[propget] HRESULT IsConnected([out, retval] boolean *value);
|
|
|
|
}
|
2022-02-28 09:44:05 +01:00
|
|
|
|
2022-03-01 09:32:33 +01:00
|
|
|
[
|
|
|
|
contract(Windows.Foundation.UniversalApiContract, 4.0),
|
|
|
|
uuid(f754c322-182d-40e4-a126-fcee4ffa1e31)
|
|
|
|
]
|
|
|
|
interface IHidGameControllerInputSink : IInspectable
|
|
|
|
requires Windows.Gaming.Input.Custom.IGameControllerInputSink
|
|
|
|
{
|
|
|
|
HRESULT OnInputReportReceived([in] UINT64 timestamp, [in] BYTE id, [in] UINT32 report_len,
|
|
|
|
[in, size_is(report_len)] BYTE *report_buf);
|
|
|
|
}
|
|
|
|
|
2022-02-28 09:44:05 +01:00
|
|
|
[
|
|
|
|
contract(Windows.Foundation.UniversalApiContract, 3.0),
|
|
|
|
uuid(69a0ae5e-758e-4cbe-ace6-62155fe9126f)
|
|
|
|
]
|
|
|
|
interface ICustomGameControllerFactory : IInspectable
|
|
|
|
{
|
|
|
|
HRESULT CreateGameController([in] Windows.Gaming.Input.Custom.IGameControllerProvider *provider,
|
|
|
|
[out, retval] IInspectable **value);
|
|
|
|
HRESULT OnGameControllerAdded([in] Windows.Gaming.Input.IGameController *value);
|
|
|
|
HRESULT OnGameControllerRemoved([in] Windows.Gaming.Input.IGameController *value);
|
|
|
|
}
|
2022-02-28 09:44:06 +01:00
|
|
|
|
|
|
|
[
|
|
|
|
contract(Windows.Foundation.UniversalApiContract, 3.0),
|
|
|
|
exclusiveto(Windows.Gaming.Input.Custom.GameControllerFactoryManager),
|
|
|
|
uuid(36cb66e3-d0a1-4986-a24c-40b137deba9e)
|
|
|
|
]
|
|
|
|
interface IGameControllerFactoryManagerStatics : IInspectable
|
|
|
|
{
|
|
|
|
HRESULT RegisterCustomFactoryForGipInterface([in] Windows.Gaming.Input.Custom.ICustomGameControllerFactory *factory,
|
|
|
|
[in] GUID interfaceId);
|
|
|
|
HRESULT RegisterCustomFactoryForHardwareId([in] Windows.Gaming.Input.Custom.ICustomGameControllerFactory *factory,
|
|
|
|
[in] UINT16 vendor_id, [in] UINT16 product_id);
|
|
|
|
HRESULT RegisterCustomFactoryForXusbType([in] Windows.Gaming.Input.Custom.ICustomGameControllerFactory *factory,
|
|
|
|
[in] Windows.Gaming.Input.Custom.XusbDeviceType type,
|
|
|
|
[in] Windows.Gaming.Input.Custom.XusbDeviceSubtype subtype);
|
|
|
|
}
|
|
|
|
|
|
|
|
[
|
|
|
|
contract(Windows.Foundation.UniversalApiContract, 4.0),
|
|
|
|
exclusiveto(Windows.Gaming.Input.Custom.GameControllerFactoryManager),
|
|
|
|
uuid(eace5644-19df-4115-b32a-2793e2aea3bb)
|
|
|
|
]
|
|
|
|
interface IGameControllerFactoryManagerStatics2 : IInspectable
|
|
|
|
requires Windows.Gaming.Input.Custom.IGameControllerFactoryManagerStatics
|
|
|
|
{
|
|
|
|
HRESULT TryGetFactoryControllerFromGameController([in] Windows.Gaming.Input.Custom.ICustomGameControllerFactory *factory,
|
|
|
|
[in] Windows.Gaming.Input.IGameController *controller,
|
|
|
|
[out, retval] Windows.Gaming.Input.IGameController **value);
|
|
|
|
}
|
|
|
|
|
|
|
|
[
|
|
|
|
contract(Windows.Foundation.UniversalApiContract, 3.0),
|
|
|
|
marshaling_behavior(agile),
|
|
|
|
static(Windows.Gaming.Input.Custom.IGameControllerFactoryManagerStatics, Windows.Foundation.UniversalApiContract, 3.0),
|
|
|
|
static(Windows.Gaming.Input.Custom.IGameControllerFactoryManagerStatics2, Windows.Foundation.UniversalApiContract, 4.0),
|
|
|
|
threading(both)
|
|
|
|
]
|
|
|
|
runtimeclass GameControllerFactoryManager
|
|
|
|
{
|
|
|
|
}
|
2022-02-28 09:44:04 +01:00
|
|
|
}
|