From 1f694c7f7942b7974d88a8cbdab8381f59b6fbee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 2 Mar 2022 14:03:05 +0100 Subject: [PATCH] include: Add Windows.Gaming.Input.IGameControllerBatteryInfo interface definition. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémi Bernon Signed-off-by: Alexandre Julliard --- dlls/windows.gaming.input/classes.idl | 1 + include/Makefile.in | 1 + include/windows.devices.power.idl | 39 +++++++++++++++++++++++++++ include/windows.gaming.input.idl | 10 +++++++ 4 files changed, 51 insertions(+) create mode 100644 include/windows.devices.power.idl diff --git a/dlls/windows.gaming.input/classes.idl b/dlls/windows.gaming.input/classes.idl index fd52d8ebf66..ca3bd5d8dd7 100644 --- a/dlls/windows.gaming.input/classes.idl +++ b/dlls/windows.gaming.input/classes.idl @@ -32,6 +32,7 @@ import "windows.foundation.idl"; import "windows.devices.haptics.idl"; import "windows.gaming.input.forcefeedback.idl"; import "windows.system.idl"; +import "windows.devices.power.idl"; #define DO_NO_IMPORTS #include "windows.gaming.input.idl" diff --git a/include/Makefile.in b/include/Makefile.in index 2bb8cd672a7..b89225510e9 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -777,6 +777,7 @@ SOURCES = \ windot11.h \ windows.devices.enumeration.idl \ windows.devices.haptics.idl \ + windows.devices.power.idl \ windows.foundation.collections.idl \ windows.foundation.idl \ windows.gaming.input.custom.idl \ diff --git a/include/windows.devices.power.idl b/include/windows.devices.power.idl new file mode 100644 index 00000000000..4bf2599686c --- /dev/null +++ b/include/windows.devices.power.idl @@ -0,0 +1,39 @@ +/* + * 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 "windows.foundation.idl"; + +namespace Windows.Devices.Power { + interface IBatteryReport; + runtimeclass BatteryReport; + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile), + threading(both) + ] + runtimeclass BatteryReport + { + [default] interface Windows.Devices.Power.IBatteryReport; + } +} diff --git a/include/windows.gaming.input.idl b/include/windows.gaming.input.idl index 90253b3a8f6..6a5fc8af1ee 100644 --- a/include/windows.gaming.input.idl +++ b/include/windows.gaming.input.idl @@ -29,6 +29,7 @@ import "windows.foundation.idl"; import "windows.devices.haptics.idl"; import "windows.gaming.input.forcefeedback.idl"; import "windows.system.idl"; +import "windows.devices.power.idl"; #endif namespace Windows.Gaming.Input { @@ -319,6 +320,15 @@ namespace Windows.Gaming.Input { HRESULT FromGameController([in] Windows.Gaming.Input.IGameController *game_controller, [out, retval] Windows.Gaming.Input.RawGameController **value); } + [ + contract(Windows.Foundation.UniversalApiContract, 4.0), + uuid(dcecc681-3963-4da6-955d-553f3b6f6161) + ] + interface IGameControllerBatteryInfo : IInspectable + { + HRESULT TryGetBatteryReport([out, retval] Windows.Devices.Power.BatteryReport **value); + } + [ contract(Windows.Foundation.UniversalApiContract, 1.0), marshaling_behavior(agile),