Rebase against 2828d0820a1661e46f606f28db090d710cef11f4.

This commit is contained in:
Zebediah Figura
2021-03-18 00:32:41 -05:00
parent c747e46d75
commit 44af049de7
8 changed files with 76 additions and 247 deletions

View File

@@ -1,4 +1,4 @@
From 029200956d78cda3fc27514adaf8d52541881367 Mon Sep 17 00:00:00 2001
From df4e50780191fa5ab30808b4b9dc34321650e070 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Fri, 9 Oct 2020 13:38:18 +0200
Subject: [PATCH] windows.gaming.input: Add stub dll.
@@ -8,13 +8,10 @@ Subject: [PATCH] windows.gaming.input: Add stub dll.
dlls/windows.gaming.input.dll/Makefile.in | 5 +
.../windows.gaming.input.spec | 3 +
.../windows.gaming.input_main.c | 140 ++++++++++++++++++
include/Makefile.in | 1 +
include/windows.gaming.input.idl | 24 +++
6 files changed, 174 insertions(+)
4 files changed, 149 insertions(+)
create mode 100644 dlls/windows.gaming.input.dll/Makefile.in
create mode 100644 dlls/windows.gaming.input.dll/windows.gaming.input.spec
create mode 100644 dlls/windows.gaming.input.dll/windows.gaming.input_main.c
create mode 100644 include/windows.gaming.input.idl
diff --git a/configure.ac b/configure.ac
index 8c092fb020c..558d2e906a2 100644
@@ -194,48 +191,6 @@ index 00000000000..2b6abc4dd84
+ IUnknown_AddRef(*factory);
+ return S_OK;
+}
diff --git a/include/Makefile.in b/include/Makefile.in
index d3494dde7a0..71afc8c0c99 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -749,6 +749,7 @@ SOURCES = \
windns.h \
windows.foundation.collections.idl \
windows.foundation.idl \
+ windows.gaming.input.idl \
windows.h \
windows.media.speechsynthesis.idl \
windowscontracts.idl \
diff --git a/include/windows.gaming.input.idl b/include/windows.gaming.input.idl
new file mode 100644
index 00000000000..575f34ccb58
--- /dev/null
+++ b/include/windows.gaming.input.idl
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2020 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";
--
2.20.1

View File

@@ -1,15 +1,13 @@
From c198ba64a5ccf37f06e61b2baf523773e1cdb350 Mon Sep 17 00:00:00 2001
From f94d77d2f797f524793f74c455e56f33725b7728 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Sat, 20 Feb 2021 00:51:48 +0100
Subject: [PATCH] windows.gaming.input: Implement IGamepadStatics stubs.
---
.../windows.gaming.input_main.c | 125 +++++++++++++++++
.../windows.gaming.input_main.c | 125 ++++++++++++++++++
include/windows.foundation.collections.idl | 6 +
include/windows.foundation.idl | 5 +
include/windows.gaming.input.idl | 128 ++++++++++++++++++
loader/wine.inf.in | 1 +
5 files changed, 265 insertions(+)
3 files changed, 132 insertions(+)
diff --git a/dlls/windows.gaming.input.dll/windows.gaming.input_main.c b/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
index 2b6abc4dd84..a910f9bf40e 100644
@@ -193,158 +191,6 @@ index ed05016b96d..ba860a1e82e 100644
namespace Collections
{
[
diff --git a/include/windows.foundation.idl b/include/windows.foundation.idl
index 3c60278cf05..90bbc876339 100644
--- a/include/windows.foundation.idl
+++ b/include/windows.foundation.idl
@@ -27,6 +27,11 @@ import "windowscontracts.idl";
/* import "ivectorchangedeventargs.idl"; */
import "windows.foundation.collections.idl";
+typedef struct EventRegistrationToken
+{
+ __int64 value;
+} EventRegistrationToken;
+
namespace Windows {
namespace Foundation {
[contract(Windows.Foundation.FoundationContract, 1.0)]
diff --git a/include/windows.gaming.input.idl b/include/windows.gaming.input.idl
index 575f34ccb58..b5af4e24a66 100644
--- a/include/windows.gaming.input.idl
+++ b/include/windows.gaming.input.idl
@@ -22,3 +22,131 @@
import "inspectable.idl";
import "windows.foundation.idl";
+
+namespace Windows {
+ namespace Gaming {
+ namespace Input {
+ typedef enum GamepadButtons GamepadButtons;
+ typedef struct GamepadReading GamepadReading;
+ typedef struct GamepadVibration GamepadVibration;
+ interface IGameController;
+ interface IGameControllerBatteryInfo;
+ interface IGamepad;
+ interface IGamepad2;
+ interface IGamepadStatics;
+ interface IGamepadStatics2;
+ runtimeclass Gamepad;
+ }
+ }
+}
+
+namespace Windows {
+ namespace Gaming {
+ namespace Input {
+ declare {
+ interface Windows.Foundation.EventHandler<Windows.Gaming.Input.Gamepad*>;
+ interface Windows.Foundation.Collections.IVectorView<Gamepad*>;
+ }
+ }
+ }
+}
+
+namespace Windows {
+ namespace Gaming {
+ namespace Input {
+ [
+ contract(Windows.Foundation.UniversalApiContract, 1.0),
+ flags
+ ]
+ enum GamepadButtons
+ {
+ None = 0x0,
+ Menu = 0x1,
+ View = 0x2,
+ A = 0x4,
+ B = 0x8,
+ X = 0x10,
+ Y = 0x20,
+ DPadUp = 0x40,
+ DPadDown = 0x80,
+ DPadLeft = 0x100,
+ DPadRight = 0x200,
+ LeftShoulder = 0x400,
+ RightShoulder = 0x800,
+ LeftThumbstick = 0x1000,
+ RightThumbstick = 0x2000,
+ [contract(Windows.Foundation.UniversalApiContract, 3.0)]
+ Paddle1 = 0x4000,
+ [contract(Windows.Foundation.UniversalApiContract, 3.0)]
+ Paddle2 = 0x8000,
+ [contract(Windows.Foundation.UniversalApiContract, 3.0)]
+ Paddle3 = 0x10000,
+ [contract(Windows.Foundation.UniversalApiContract, 3.0)]
+ Paddle4 = 0x20000
+ };
+
+ [contract(Windows.Foundation.UniversalApiContract, 1.0)]
+ struct GamepadReading
+ {
+ UINT64 Timestamp;
+ Windows.Gaming.Input.GamepadButtons Buttons;
+ DOUBLE LeftTrigger;
+ DOUBLE RightTrigger;
+ DOUBLE LeftThumbstickX;
+ DOUBLE LeftThumbstickY;
+ DOUBLE RightThumbstickX;
+ DOUBLE RightThumbstickY;
+ };
+
+ [contract(Windows.Foundation.UniversalApiContract, 1.0)]
+ struct GamepadVibration
+ {
+ DOUBLE LeftMotor;
+ DOUBLE RightMotor;
+ DOUBLE LeftTrigger;
+ DOUBLE RightTrigger;
+ };
+
+ [
+ contract(Windows.Foundation.UniversalApiContract, 1.0),
+ exclusiveto(Windows.Gaming.Input.Gamepad),
+ uuid(bc7bb43c-0a69-3903-9e9d-a50f86a45de5)
+ ]
+ interface IGamepad : IInspectable
+ requires Windows.Gaming.Input.IGameController
+ {
+ [propget] HRESULT Vibration([out, retval] Windows.Gaming.Input.GamepadVibration* value);
+ [propput] HRESULT Vibration([in] Windows.Gaming.Input.GamepadVibration value);
+ HRESULT GetCurrentReading([out, retval] Windows.Gaming.Input.GamepadReading* value);
+ }
+
+ [
+ object,
+ uuid(8bbce529-d49c-39e9-9560-e47dde96b7c8)
+ ]
+ interface IGamepadStatics : IInspectable
+ {
+ [eventadd] HRESULT GamepadAdded([in] Windows.Foundation.EventHandler<Gamepad*> *value, [out, retval] EventRegistrationToken* token);
+ [eventremove] HRESULT GamepadAdded([in] EventRegistrationToken token);
+ [eventadd] HRESULT GamepadRemoved([in] Windows.Foundation.EventHandler<Gamepad*> *value, [out, retval] EventRegistrationToken* token);
+ [eventremove] HRESULT GamepadRemoved([in] EventRegistrationToken token);
+ [propget] HRESULT Gamepads([out, retval] Windows.Foundation.Collections.IVectorView<Gamepad*> **value);
+ }
+
+ [
+ contract(Windows.Foundation.UniversalApiContract, 1.0),
+ marshaling_behavior(agile),
+ static(Windows.Gaming.Input.IGamepadStatics, Windows.Foundation.UniversalApiContract, 1.0),
+ static(Windows.Gaming.Input.IGamepadStatics2, Windows.Foundation.UniversalApiContract, 4.0),
+ threading(both)
+ ]
+ runtimeclass Gamepad
+ {
+ [default] interface Windows.Gaming.Input.IGamepad;
+ interface Windows.Gaming.Input.IGameController;
+ [contract(Windows.Foundation.UniversalApiContract, 3.0)] interface Windows.Gaming.Input.IGamepad2;
+ [contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.Gaming.Input.IGameControllerBatteryInfo;
+ }
+ }
+ }
+}
diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index 4cef944fb88..a1cc73d6e57 100644
--- a/loader/wine.inf.in

View File

@@ -1,4 +1,4 @@
From 3398500d3ed2a90361d431d2fb630b60a6d7e8be Mon Sep 17 00:00:00 2001
From 1f15403b2743fa55e204fd42049df117acee6e78 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Mon, 12 Oct 2020 12:50:32 +0200
Subject: [PATCH] windows.gaming.input: Implement IRawGameControllerStatics
@@ -189,7 +189,7 @@ index dec9d39e7a3..1a40a8ddc35 100644
0
};
diff --git a/include/Makefile.in b/include/Makefile.in
index 71afc8c0c99..22ed5f3a2d5 100644
index 1c80421ef6f..ab49ee0e4b3 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -20,6 +20,7 @@ SOURCES = \
@@ -200,7 +200,7 @@ index 71afc8c0c99..22ed5f3a2d5 100644
asynot.idl \
asysta.idl \
atlbase.h \
@@ -750,8 +751,10 @@ SOURCES = \
@@ -751,8 +752,10 @@ SOURCES = \
windows.foundation.collections.idl \
windows.foundation.idl \
windows.gaming.input.idl \
@@ -302,7 +302,7 @@ index ba860a1e82e..2562d34791f 100644
{
[
diff --git a/include/windows.foundation.idl b/include/windows.foundation.idl
index 90bbc876339..2bed3d54cda 100644
index 3c60278cf05..b06b9eadaf4 100644
--- a/include/windows.foundation.idl
+++ b/include/windows.foundation.idl
@@ -21,7 +21,7 @@
@@ -314,7 +314,7 @@ index 90bbc876339..2bed3d54cda 100644
import "windowscontracts.idl";
/* import "eventtoken.idl"; */
/* import "ivectorchangedeventargs.idl"; */
@@ -119,3 +119,12 @@ namespace Windows {
@@ -114,3 +114,12 @@ namespace Windows {
}
}
}
@@ -445,11 +445,11 @@ index 00000000000..fa9da2f7656
+ }
+}
diff --git a/include/windows.gaming.input.idl b/include/windows.gaming.input.idl
index b5af4e24a66..36d4038ed1f 100644
index 1da22408eeb..90c1f02bd9d 100644
--- a/include/windows.gaming.input.idl
+++ b/include/windows.gaming.input.idl
@@ -22,11 +22,16 @@
@@ -23,11 +23,16 @@
import "eventtoken.idl";
import "inspectable.idl";
import "windows.foundation.idl";
+import "windows.system.idl";
@@ -465,7 +465,7 @@ index b5af4e24a66..36d4038ed1f 100644
typedef struct GamepadReading GamepadReading;
typedef struct GamepadVibration GamepadVibration;
interface IGameController;
@@ -35,7 +40,11 @@ namespace Windows {
@@ -36,7 +41,11 @@ namespace Windows {
interface IGamepad2;
interface IGamepadStatics;
interface IGamepadStatics2;
@@ -477,7 +477,7 @@ index b5af4e24a66..36d4038ed1f 100644
}
}
}
@@ -45,7 +54,11 @@ namespace Windows {
@@ -46,7 +55,11 @@ namespace Windows {
namespace Input {
declare {
interface Windows.Foundation.EventHandler<Windows.Gaming.Input.Gamepad*>;
@@ -489,7 +489,7 @@ index b5af4e24a66..36d4038ed1f 100644
}
}
}
@@ -85,6 +98,102 @@ namespace Windows {
@@ -86,6 +99,102 @@ namespace Windows {
Paddle4 = 0x20000
};
@@ -592,7 +592,7 @@ index b5af4e24a66..36d4038ed1f 100644
[contract(Windows.Foundation.UniversalApiContract, 1.0)]
struct GamepadReading
{
@@ -107,6 +216,23 @@ namespace Windows {
@@ -108,6 +217,23 @@ namespace Windows {
DOUBLE RightTrigger;
};
@@ -616,7 +616,7 @@ index b5af4e24a66..36d4038ed1f 100644
[
contract(Windows.Foundation.UniversalApiContract, 1.0),
exclusiveto(Windows.Gaming.Input.Gamepad),
@@ -120,6 +246,25 @@ namespace Windows {
@@ -121,6 +247,25 @@ namespace Windows {
HRESULT GetCurrentReading([out, retval] Windows.Gaming.Input.GamepadReading* value);
}
@@ -642,7 +642,7 @@ index b5af4e24a66..36d4038ed1f 100644
[
object,
uuid(8bbce529-d49c-39e9-9560-e47dde96b7c8)
@@ -133,6 +278,31 @@ namespace Windows {
@@ -134,6 +279,31 @@ namespace Windows {
[propget] HRESULT Gamepads([out, retval] Windows.Foundation.Collections.IVectorView<Gamepad*> **value);
}
@@ -674,7 +674,7 @@ index b5af4e24a66..36d4038ed1f 100644
[
contract(Windows.Foundation.UniversalApiContract, 1.0),
marshaling_behavior(agile),
@@ -147,6 +317,31 @@ namespace Windows {
@@ -148,6 +318,31 @@ namespace Windows {
[contract(Windows.Foundation.UniversalApiContract, 3.0)] interface Windows.Gaming.Input.IGamepad2;
[contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.Gaming.Input.IGameControllerBatteryInfo;
}