Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- include/Makefile.in | 1 + include/windows.foundation.numerics.idl | 39 +++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 include/windows.foundation.numerics.idl
diff --git a/include/Makefile.in b/include/Makefile.in index b0a1d0e4880..24ed4acca84 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -787,6 +787,7 @@ SOURCES = \ windows.foundation.collections.idl \ windows.foundation.idl \ windows.foundation.metadata.idl \ + windows.foundation.numerics.idl \ windows.gaming.input.custom.idl \ windows.gaming.input.forcefeedback.idl \ windows.gaming.input.idl \ diff --git a/include/windows.foundation.numerics.idl b/include/windows.foundation.numerics.idl new file mode 100644 index 00000000000..eca99ca29bc --- /dev/null +++ b/include/windows.foundation.numerics.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 "asyncinfo.idl"; +import "eventtoken.idl"; +import "windowscontracts.idl"; +import "windows.foundation.idl"; + +namespace Windows.Foundation.Numerics { + typedef struct Vector3 Vector3; + + [contract(Windows.Foundation.UniversalApiContract, 1.0)] + struct Vector3 + { + FLOAT X; + FLOAT Y; + FLOAT Z; + }; +}
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- .../windows.gaming.input.forcefeedback.idl | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+)
diff --git a/include/windows.gaming.input.forcefeedback.idl b/include/windows.gaming.input.forcefeedback.idl index 639e0c5cd57..e02c136e562 100644 --- a/include/windows.gaming.input.forcefeedback.idl +++ b/include/windows.gaming.input.forcefeedback.idl @@ -25,13 +25,18 @@ import "asyncinfo.idl"; import "eventtoken.idl"; import "windowscontracts.idl"; import "windows.foundation.idl"; +import "windows.foundation.numerics.idl";
namespace Windows.Gaming.Input.ForceFeedback { typedef enum ForceFeedbackEffectAxes ForceFeedbackEffectAxes; typedef enum ForceFeedbackEffectState ForceFeedbackEffectState; typedef enum ForceFeedbackLoadEffectResult ForceFeedbackLoadEffectResult; + typedef enum PeriodicForceEffectKind PeriodicForceEffectKind; interface IForceFeedbackEffect; + interface IPeriodicForceEffect; + interface IPeriodicForceEffectFactory; runtimeclass ForceFeedbackMotor; + runtimeclass PeriodicForceEffect;
declare { interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Gaming.Input.ForceFeedback.ForceFeedbackLoadEffectResult>; @@ -71,6 +76,16 @@ namespace Windows.Gaming.Input.ForceFeedback { EffectNotSupported = 2 };
+ [contract(Windows.Foundation.UniversalApiContract, 3.0)] + enum PeriodicForceEffectKind + { + SquareWave = 0, + SineWave = 1, + TriangleWave = 2, + SawtoothWaveUp = 3, + SawtoothWaveDown = 4, + }; + [ contract(Windows.Foundation.UniversalApiContract, 3.0), uuid(a17fba0c-2ae4-48c2-8063-eabd0777cb89) @@ -108,6 +123,35 @@ namespace Windows.Gaming.Input.ForceFeedback { [out, retval] Windows.Foundation.IAsyncOperation<boolean> **async_op); }
+ [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + exclusiveto(Windows.Gaming.Input.ForceFeedback.PeriodicForceEffect), + uuid(5c5138d7-fc75-4d52-9a0a-efe4cab5fe64) + ] + interface IPeriodicForceEffect : IInspectable + requires Windows.Gaming.Input.ForceFeedback.IForceFeedbackEffect + { + [propget] HRESULT Kind([out, retval] Windows.Gaming.Input.ForceFeedback.PeriodicForceEffectKind *value); + HRESULT SetParameters([in] Windows.Foundation.Numerics.Vector3 vector, [in] FLOAT frequency, [in] FLOAT phase, + [in] FLOAT bias, [in] Windows.Foundation.TimeSpan duration); + HRESULT SetParametersWithEnvelope([in] Windows.Foundation.Numerics.Vector3 vector, [in] FLOAT frequency, [in] FLOAT phase, + [in] FLOAT bias, [in] FLOAT attack_gain, [in] FLOAT sustain_gain, [in] FLOAT release_gain, + [in] Windows.Foundation.TimeSpan start_delay, [in] Windows.Foundation.TimeSpan attack_duration, + [in] Windows.Foundation.TimeSpan sustain_duration, [in] Windows.Foundation.TimeSpan release_duration, + [in] UINT32 repeat_count); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + exclusiveto(Windows.Gaming.Input.ForceFeedback.PeriodicForceEffect), + uuid(6f62eb1a-9851-477b-b318-35ecaa15070f) + ] + interface IPeriodicForceEffectFactory : IInspectable + { + HRESULT CreateInstance([in] Windows.Gaming.Input.ForceFeedback.PeriodicForceEffectKind kind, + [out, retval] Windows.Gaming.Input.ForceFeedback.PeriodicForceEffect **value); + } + [ contract(Windows.Foundation.UniversalApiContract, 3.0), marshaling_behavior(agile), @@ -117,4 +161,16 @@ namespace Windows.Gaming.Input.ForceFeedback { { [default] interface Windows.Gaming.Input.ForceFeedback.IForceFeedbackMotor; } + + [ + activatable(Windows.Gaming.Input.ForceFeedback.IPeriodicForceEffectFactory, Windows.Foundation.UniversalApiContract, 3.0), + contract(Windows.Foundation.UniversalApiContract, 3.0), + marshaling_behavior(agile), + threading(both) + ] + runtimeclass PeriodicForceEffect + { + [default] interface Windows.Gaming.Input.ForceFeedback.IForceFeedbackEffect; + interface Windows.Gaming.Input.ForceFeedback.IPeriodicForceEffect; + } }
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- .../windows.gaming.input.forcefeedback.idl | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+)
diff --git a/include/windows.gaming.input.forcefeedback.idl b/include/windows.gaming.input.forcefeedback.idl index e02c136e562..ad3290f1a5c 100644 --- a/include/windows.gaming.input.forcefeedback.idl +++ b/include/windows.gaming.input.forcefeedback.idl @@ -32,11 +32,15 @@ namespace Windows.Gaming.Input.ForceFeedback { typedef enum ForceFeedbackEffectState ForceFeedbackEffectState; typedef enum ForceFeedbackLoadEffectResult ForceFeedbackLoadEffectResult; typedef enum PeriodicForceEffectKind PeriodicForceEffectKind; + typedef enum ConditionForceEffectKind ConditionForceEffectKind; interface IForceFeedbackEffect; interface IPeriodicForceEffect; interface IPeriodicForceEffectFactory; + interface IConditionForceEffect; + interface IConditionForceEffectFactory; runtimeclass ForceFeedbackMotor; runtimeclass PeriodicForceEffect; + runtimeclass ConditionForceEffect;
declare { interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Gaming.Input.ForceFeedback.ForceFeedbackLoadEffectResult>; @@ -86,6 +90,15 @@ namespace Windows.Gaming.Input.ForceFeedback { SawtoothWaveDown = 4, };
+ [contract(Windows.Foundation.UniversalApiContract, 3.0)] + enum ConditionForceEffectKind + { + Spring = 0, + Damper = 1, + Inertia = 2, + Friction = 3, + }; + [ contract(Windows.Foundation.UniversalApiContract, 3.0), uuid(a17fba0c-2ae4-48c2-8063-eabd0777cb89) @@ -152,6 +165,31 @@ namespace Windows.Gaming.Input.ForceFeedback { [out, retval] Windows.Gaming.Input.ForceFeedback.PeriodicForceEffect **value); }
+ [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + exclusiveto(Windows.Gaming.Input.ForceFeedback.ConditionForceEffect), + uuid(32d1ea68-3695-4e69-85c0-cd1944189140) + ] + interface IConditionForceEffect : IInspectable + requires Windows.Gaming.Input.ForceFeedback.IForceFeedbackEffect + { + [propget] HRESULT Kind([out, retval] Windows.Gaming.Input.ForceFeedback.ConditionForceEffectKind *value); + HRESULT SetParameters([in] Windows.Foundation.Numerics.Vector3 direction, [in] FLOAT positive_coeff, + [in] FLOAT negative_coeff, [in] FLOAT max_positive_magnitude, [in] FLOAT max_negative_magnitude, + [in] FLOAT deadzone, [in] FLOAT bias); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + exclusiveto(Windows.Gaming.Input.ForceFeedback.ConditionForceEffect), + uuid(91a99264-1810-4eb6-a773-bfd3b8cddbab) + ] + interface IConditionForceEffectFactory : IInspectable + { + HRESULT CreateInstance([in] Windows.Gaming.Input.ForceFeedback.ConditionForceEffectKind kind, + [out, retval] Windows.Gaming.Input.ForceFeedback.ConditionForceEffect **value); + } + [ contract(Windows.Foundation.UniversalApiContract, 3.0), marshaling_behavior(agile), @@ -173,4 +211,16 @@ namespace Windows.Gaming.Input.ForceFeedback { [default] interface Windows.Gaming.Input.ForceFeedback.IForceFeedbackEffect; interface Windows.Gaming.Input.ForceFeedback.IPeriodicForceEffect; } + + [ + activatable(Windows.Gaming.Input.ForceFeedback.IConditionForceEffectFactory, Windows.Foundation.UniversalApiContract, 3.0), + contract(Windows.Foundation.UniversalApiContract, 3.0), + marshaling_behavior(agile), + threading(both) + ] + runtimeclass ConditionForceEffect + { + [default] interface Windows.Gaming.Input.ForceFeedback.IForceFeedbackEffect; + interface Windows.Gaming.Input.ForceFeedback.IConditionForceEffect; + } }
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- .../windows.gaming.input.forcefeedback.idl | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+)
diff --git a/include/windows.gaming.input.forcefeedback.idl b/include/windows.gaming.input.forcefeedback.idl index ad3290f1a5c..033cf09cc1f 100644 --- a/include/windows.gaming.input.forcefeedback.idl +++ b/include/windows.gaming.input.forcefeedback.idl @@ -38,9 +38,11 @@ namespace Windows.Gaming.Input.ForceFeedback { interface IPeriodicForceEffectFactory; interface IConditionForceEffect; interface IConditionForceEffectFactory; + interface IConstantForceEffect; runtimeclass ForceFeedbackMotor; runtimeclass PeriodicForceEffect; runtimeclass ConditionForceEffect; + runtimeclass ConstantForceEffect;
declare { interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Gaming.Input.ForceFeedback.ForceFeedbackLoadEffectResult>; @@ -190,6 +192,21 @@ namespace Windows.Gaming.Input.ForceFeedback { [out, retval] Windows.Gaming.Input.ForceFeedback.ConditionForceEffect **value); }
+ [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + exclusiveto(Windows.Gaming.Input.ForceFeedback.ConstantForceEffect), + uuid(9bfa0140-f3c7-415c-b068-0f068734bce0) + ] + interface IConstantForceEffect : IInspectable + requires Windows.Gaming.Input.ForceFeedback.IForceFeedbackEffect + { + HRESULT SetParameters([in] Windows.Foundation.Numerics.Vector3 vector, [in] Windows.Foundation.TimeSpan duration); + HRESULT SetParametersWithEnvelope([in] Windows.Foundation.Numerics.Vector3 vector, [in] FLOAT attack_gain, + [in] FLOAT sustain_gain, [in] FLOAT release_gain, [in] Windows.Foundation.TimeSpan start_delay, + [in] Windows.Foundation.TimeSpan attack_duration, [in] Windows.Foundation.TimeSpan sustain_duration, + [in] Windows.Foundation.TimeSpan release_duration, [in] UINT32 repeat_count); + } + [ contract(Windows.Foundation.UniversalApiContract, 3.0), marshaling_behavior(agile), @@ -223,4 +240,16 @@ namespace Windows.Gaming.Input.ForceFeedback { [default] interface Windows.Gaming.Input.ForceFeedback.IForceFeedbackEffect; interface Windows.Gaming.Input.ForceFeedback.IConditionForceEffect; } + + [ + activatable(Windows.Foundation.UniversalApiContract, 3.0), + contract(Windows.Foundation.UniversalApiContract, 3.0), + marshaling_behavior(agile), + threading(both) + ] + runtimeclass ConstantForceEffect + { + [default] interface Windows.Gaming.Input.ForceFeedback.IForceFeedbackEffect; + interface Windows.Gaming.Input.ForceFeedback.IConstantForceEffect; + } }
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- .../windows.gaming.input.forcefeedback.idl | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+)
diff --git a/include/windows.gaming.input.forcefeedback.idl b/include/windows.gaming.input.forcefeedback.idl index 033cf09cc1f..290d1f62971 100644 --- a/include/windows.gaming.input.forcefeedback.idl +++ b/include/windows.gaming.input.forcefeedback.idl @@ -39,10 +39,12 @@ namespace Windows.Gaming.Input.ForceFeedback { interface IConditionForceEffect; interface IConditionForceEffectFactory; interface IConstantForceEffect; + interface IRampForceEffect; runtimeclass ForceFeedbackMotor; runtimeclass PeriodicForceEffect; runtimeclass ConditionForceEffect; runtimeclass ConstantForceEffect; + runtimeclass RampForceEffect;
declare { interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Gaming.Input.ForceFeedback.ForceFeedbackLoadEffectResult>; @@ -207,6 +209,22 @@ namespace Windows.Gaming.Input.ForceFeedback { [in] Windows.Foundation.TimeSpan release_duration, [in] UINT32 repeat_count); }
+ [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + exclusiveto(Windows.Gaming.Input.ForceFeedback.RampForceEffect), + uuid(f1f81259-1ca6-4080-b56d-b43f3354d052) + ] + interface IRampForceEffect : IInspectable + requires Windows.Gaming.Input.ForceFeedback.IForceFeedbackEffect + { + HRESULT SetParameters([in] Windows.Foundation.Numerics.Vector3 start_vector, [in] Windows.Foundation.Numerics.Vector3 end_vector, + [in] Windows.Foundation.TimeSpan duration); + HRESULT SetParametersWithEnvelope([in] Windows.Foundation.Numerics.Vector3 start_vector, [in] Windows.Foundation.Numerics.Vector3 end_vector, + [in] FLOAT attack_gain, [in] FLOAT sustain_gain, [in] FLOAT release_gain, [in] Windows.Foundation.TimeSpan start_delay, + [in] Windows.Foundation.TimeSpan attack_duration, [in] Windows.Foundation.TimeSpan sustain_duration, + [in] Windows.Foundation.TimeSpan release_duration, [in] UINT32 repeat_count); + } + [ contract(Windows.Foundation.UniversalApiContract, 3.0), marshaling_behavior(agile), @@ -252,4 +270,16 @@ namespace Windows.Gaming.Input.ForceFeedback { [default] interface Windows.Gaming.Input.ForceFeedback.IForceFeedbackEffect; interface Windows.Gaming.Input.ForceFeedback.IConstantForceEffect; } + + [ + activatable(Windows.Foundation.UniversalApiContract, 3.0), + contract(Windows.Foundation.UniversalApiContract, 3.0), + marshaling_behavior(agile), + threading(both) + ] + runtimeclass RampForceEffect + { + [default] interface Windows.Gaming.Input.ForceFeedback.IForceFeedbackEffect; + interface Windows.Gaming.Input.ForceFeedback.IRampForceEffect; + } }