| 1 |
/* |
| 2 |
* Copyright 2021 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.foundation.numerics.idl"; |
| 29 |
|
| 30 |
namespace Windows.Gaming.Input.ForceFeedback { |
| 31 |
typedef enum ForceFeedbackEffectAxes ForceFeedbackEffectAxes; |
| 32 |
typedef enum ForceFeedbackEffectState ForceFeedbackEffectState; |
| 33 |
typedef enum ForceFeedbackLoadEffectResult ForceFeedbackLoadEffectResult; |
| 34 |
typedef enum PeriodicForceEffectKind PeriodicForceEffectKind; |
| 35 |
typedef enum ConditionForceEffectKind ConditionForceEffectKind; |
| 36 |
interface IForceFeedbackEffect; |
| 37 |
interface IPeriodicForceEffect; |
| 38 |
interface IPeriodicForceEffectFactory; |
| 39 |
interface IConditionForceEffect; |
| 40 |
interface IConditionForceEffectFactory; |
| 41 |
interface IConstantForceEffect; |
| 42 |
interface IRampForceEffect; |
| 43 |
runtimeclass ForceFeedbackMotor; |
| 44 |
runtimeclass PeriodicForceEffect; |
| 45 |
runtimeclass ConditionForceEffect; |
| 46 |
runtimeclass ConstantForceEffect; |
| 47 |
runtimeclass RampForceEffect; |
| 48 |
|
| 49 |
declare { |
| 50 |
interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Gaming.Input.ForceFeedback.ForceFeedbackLoadEffectResult>; |
| 51 |
interface Windows.Foundation.IAsyncOperation<Windows.Gaming.Input.ForceFeedback.ForceFeedbackLoadEffectResult>; |
| 52 |
interface Windows.Foundation.Collections.IIterator<Windows.Gaming.Input.ForceFeedback.ForceFeedbackMotor *>; |
| 53 |
interface Windows.Foundation.Collections.IIterable<Windows.Gaming.Input.ForceFeedback.ForceFeedbackMotor *>; |
| 54 |
interface Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.ForceFeedback.ForceFeedbackMotor *>; |
| 55 |
interface Windows.Foundation.Collections.IVector<Windows.Gaming.Input.ForceFeedback.ForceFeedbackMotor *>; |
| 56 |
} |
| 57 |
|
| 58 |
[ |
| 59 |
contract(Windows.Foundation.UniversalApiContract, 3.0), |
| 60 |
flags |
| 61 |
] |
| 62 |
enum ForceFeedbackEffectAxes |
| 63 |
{ |
| 64 |
None = 0x0, |
| 65 |
X = 0x1, |
| 66 |
Y = 0x2, |
| 67 |
Z = 0x4 |
| 68 |
}; |
| 69 |
|
| 70 |
[contract(Windows.Foundation.UniversalApiContract, 3.0)] |
| 71 |
enum ForceFeedbackEffectState |
| 72 |
{ |
| 73 |
Stopped = 0, |
| 74 |
Running = 1, |
| 75 |
Paused = 2, |
| 76 |
Faulted = 3, |
| 77 |
}; |
| 78 |
|
| 79 |
[contract(Windows.Foundation.UniversalApiContract, 3.0)] |
| 80 |
enum ForceFeedbackLoadEffectResult |
| 81 |
{ |
| 82 |
Succeeded = 0, |
| 83 |
EffectStorageFull = 1, |
| 84 |
EffectNotSupported = 2 |
| 85 |
}; |
| 86 |
|
| 87 |
[contract(Windows.Foundation.UniversalApiContract, 3.0)] |
| 88 |
enum PeriodicForceEffectKind |
| 89 |
{ |
| 90 |
SquareWave = 0, |
| 91 |
SineWave = 1, |
| 92 |
TriangleWave = 2, |
| 93 |
SawtoothWaveUp = 3, |
| 94 |
SawtoothWaveDown = 4, |
| 95 |
}; |
| 96 |
|
| 97 |
[contract(Windows.Foundation.UniversalApiContract, 3.0)] |
| 98 |
enum ConditionForceEffectKind |
| 99 |
{ |
| 100 |
Spring = 0, |
| 101 |
Damper = 1, |
| 102 |
Inertia = 2, |
| 103 |
Friction = 3, |
| 104 |
}; |
| 105 |
|
| 106 |
[ |
| 107 |
contract(Windows.Foundation.UniversalApiContract, 3.0), |
| 108 |
uuid(a17fba0c-2ae4-48c2-8063-eabd0777cb89) |
| 109 |
] |
| 110 |
interface IForceFeedbackEffect : IInspectable |
| 111 |
{ |
| 112 |
[propget] HRESULT Gain([out, retval] DOUBLE *value); |
| 113 |
[propput] HRESULT Gain([in] DOUBLE value); |
| 114 |
[propget] HRESULT State([out, retval] Windows.Gaming.Input.ForceFeedback.ForceFeedbackEffectState *value); |
| 115 |
HRESULT Start(); |
| 116 |
HRESULT Stop(); |
| 117 |
} |
| 118 |
|
| 119 |
[ |
| 120 |
contract(Windows.Foundation.UniversalApiContract, 3.0), |
| 121 |
exclusiveto(Windows.Gaming.Input.ForceFeedback.ForceFeedbackMotor), |
| 122 |
uuid(8d3d417c-a5ea-4516-8026-2b00f74ef6e5) |
| 123 |
] |
| 124 |
interface IForceFeedbackMotor : IInspectable |
| 125 |
{ |
| 126 |
[propget] HRESULT AreEffectsPaused([out, retval] boolean *value); |
| 127 |
[propget] HRESULT MasterGain([out, retval] DOUBLE *value); |
| 128 |
[propput] HRESULT MasterGain([in] DOUBLE value); |
| 129 |
[propget] HRESULT IsEnabled([out, retval] boolean *value); |
| 130 |
[propget] HRESULT SupportedAxes([out, retval] Windows.Gaming.Input.ForceFeedback.ForceFeedbackEffectAxes *value); |
| 131 |
HRESULT LoadEffectAsync([in] Windows.Gaming.Input.ForceFeedback.IForceFeedbackEffect *effect, |
| 132 |
[out, retval] Windows.Foundation.IAsyncOperation<Windows.Gaming.Input.ForceFeedback.ForceFeedbackLoadEffectResult> **async_op); |
| 133 |
HRESULT PauseAllEffects(); |
| 134 |
HRESULT ResumeAllEffects(); |
| 135 |
HRESULT StopAllEffects(); |
| 136 |
HRESULT TryDisableAsync([out, retval] Windows.Foundation.IAsyncOperation<boolean> **async_op); |
| 137 |
HRESULT TryEnableAsync([out, retval] Windows.Foundation.IAsyncOperation<boolean> **async_op); |
| 138 |
HRESULT TryResetAsync([out, retval] Windows.Foundation.IAsyncOperation<boolean> **async_op); |
| 139 |
HRESULT TryUnloadEffectAsync([in] Windows.Gaming.Input.ForceFeedback.IForceFeedbackEffect *effect, |
| 140 |
[out, retval] Windows.Foundation.IAsyncOperation<boolean> **async_op); |
| 141 |
} |
| 142 |
|
| 143 |
[ |
| 144 |
contract(Windows.Foundation.UniversalApiContract, 3.0), |
| 145 |
exclusiveto(Windows.Gaming.Input.ForceFeedback.PeriodicForceEffect), |
| 146 |
uuid(5c5138d7-fc75-4d52-9a0a-efe4cab5fe64) |
| 147 |
] |
| 148 |
interface IPeriodicForceEffect : IInspectable |
| 149 |
requires Windows.Gaming.Input.ForceFeedback.IForceFeedbackEffect |
| 150 |
{ |
| 151 |
[propget] HRESULT Kind([out, retval] Windows.Gaming.Input.ForceFeedback.PeriodicForceEffectKind *value); |
| 152 |
HRESULT SetParameters([in] Windows.Foundation.Numerics.Vector3 vector, [in] FLOAT frequency, [in] FLOAT phase, |
| 153 |
[in] FLOAT bias, [in] Windows.Foundation.TimeSpan duration); |
| 154 |
HRESULT SetParametersWithEnvelope([in] Windows.Foundation.Numerics.Vector3 vector, [in] FLOAT frequency, [in] FLOAT phase, |
| 155 |
[in] FLOAT bias, [in] FLOAT attack_gain, [in] FLOAT sustain_gain, [in] FLOAT release_gain, |
| 156 |
[in] Windows.Foundation.TimeSpan start_delay, [in] Windows.Foundation.TimeSpan attack_duration, |
| 157 |
[in] Windows.Foundation.TimeSpan sustain_duration, [in] Windows.Foundation.TimeSpan release_duration, |
| 158 |
[in] UINT32 repeat_count); |
| 159 |
} |
| 160 |
|
| 161 |
[ |
| 162 |
contract(Windows.Foundation.UniversalApiContract, 3.0), |
| 163 |
exclusiveto(Windows.Gaming.Input.ForceFeedback.PeriodicForceEffect), |
| 164 |
uuid(6f62eb1a-9851-477b-b318-35ecaa15070f) |
| 165 |
] |
| 166 |
interface IPeriodicForceEffectFactory : IInspectable |
| 167 |
{ |
| 168 |
HRESULT CreateInstance([in] Windows.Gaming.Input.ForceFeedback.PeriodicForceEffectKind kind, |
| 169 |
[out, retval] Windows.Gaming.Input.ForceFeedback.PeriodicForceEffect **value); |
| 170 |
} |
| 171 |
|
| 172 |
[ |
| 173 |
contract(Windows.Foundation.UniversalApiContract, 3.0), |
| 174 |
exclusiveto(Windows.Gaming.Input.ForceFeedback.ConditionForceEffect), |
| 175 |
uuid(32d1ea68-3695-4e69-85c0-cd1944189140) |
| 176 |
] |
| 177 |
interface IConditionForceEffect : IInspectable |
| 178 |
requires Windows.Gaming.Input.ForceFeedback.IForceFeedbackEffect |
| 179 |
{ |
| 180 |
[propget] HRESULT Kind([out, retval] Windows.Gaming.Input.ForceFeedback.ConditionForceEffectKind *value); |
| 181 |
HRESULT SetParameters([in] Windows.Foundation.Numerics.Vector3 direction, [in] FLOAT positive_coeff, |
| 182 |
[in] FLOAT negative_coeff, [in] FLOAT max_positive_magnitude, [in] FLOAT max_negative_magnitude, |
| 183 |
[in] FLOAT deadzone, [in] FLOAT bias); |
| 184 |
} |
| 185 |
|
| 186 |
[ |
| 187 |
contract(Windows.Foundation.UniversalApiContract, 3.0), |
| 188 |
exclusiveto(Windows.Gaming.Input.ForceFeedback.ConditionForceEffect), |
| 189 |
uuid(91a99264-1810-4eb6-a773-bfd3b8cddbab) |
| 190 |
] |
| 191 |
interface IConditionForceEffectFactory : IInspectable |
| 192 |
{ |
| 193 |
HRESULT CreateInstance([in] Windows.Gaming.Input.ForceFeedback.ConditionForceEffectKind kind, |
| 194 |
[out, retval] Windows.Gaming.Input.ForceFeedback.ConditionForceEffect **value); |
| 195 |
} |
| 196 |
|
| 197 |
[ |
| 198 |
contract(Windows.Foundation.UniversalApiContract, 3.0), |
| 199 |
exclusiveto(Windows.Gaming.Input.ForceFeedback.ConstantForceEffect), |
| 200 |
uuid(9bfa0140-f3c7-415c-b068-0f068734bce0) |
| 201 |
] |
| 202 |
interface IConstantForceEffect : IInspectable |
| 203 |
requires Windows.Gaming.Input.ForceFeedback.IForceFeedbackEffect |
| 204 |
{ |
| 205 |
HRESULT SetParameters([in] Windows.Foundation.Numerics.Vector3 vector, [in] Windows.Foundation.TimeSpan duration); |
| 206 |
HRESULT SetParametersWithEnvelope([in] Windows.Foundation.Numerics.Vector3 vector, [in] FLOAT attack_gain, |
| 207 |
[in] FLOAT sustain_gain, [in] FLOAT release_gain, [in] Windows.Foundation.TimeSpan start_delay, |
| 208 |
[in] Windows.Foundation.TimeSpan attack_duration, [in] Windows.Foundation.TimeSpan sustain_duration, |
| 209 |
[in] Windows.Foundation.TimeSpan release_duration, [in] UINT32 repeat_count); |
| 210 |
} |
| 211 |
|
| 212 |
[ |
| 213 |
contract(Windows.Foundation.UniversalApiContract, 3.0), |
| 214 |
exclusiveto(Windows.Gaming.Input.ForceFeedback.RampForceEffect), |
| 215 |
uuid(f1f81259-1ca6-4080-b56d-b43f3354d052) |
| 216 |
] |
| 217 |
interface IRampForceEffect : IInspectable |
| 218 |
requires Windows.Gaming.Input.ForceFeedback.IForceFeedbackEffect |
| 219 |
{ |
| 220 |
HRESULT SetParameters([in] Windows.Foundation.Numerics.Vector3 start_vector, [in] Windows.Foundation.Numerics.Vector3 end_vector, |
| 221 |
[in] Windows.Foundation.TimeSpan duration); |
| 222 |
HRESULT SetParametersWithEnvelope([in] Windows.Foundation.Numerics.Vector3 start_vector, [in] Windows.Foundation.Numerics.Vector3 end_vector, |
| 223 |
[in] FLOAT attack_gain, [in] FLOAT sustain_gain, [in] FLOAT release_gain, [in] Windows.Foundation.TimeSpan start_delay, |
| 224 |
[in] Windows.Foundation.TimeSpan attack_duration, [in] Windows.Foundation.TimeSpan sustain_duration, |
| 225 |
[in] Windows.Foundation.TimeSpan release_duration, [in] UINT32 repeat_count); |
| 226 |
} |
| 227 |
|
| 228 |
[ |
| 229 |
contract(Windows.Foundation.UniversalApiContract, 3.0), |
| 230 |
marshaling_behavior(agile), |
| 231 |
threading(both) |
| 232 |
] |
| 233 |
runtimeclass ForceFeedbackMotor |
| 234 |
{ |
| 235 |
[default] interface Windows.Gaming.Input.ForceFeedback.IForceFeedbackMotor; |
| 236 |
} |
| 237 |
|
| 238 |
[ |
| 239 |
activatable(Windows.Gaming.Input.ForceFeedback.IPeriodicForceEffectFactory, Windows.Foundation.UniversalApiContract, 3.0), |
| 240 |
contract(Windows.Foundation.UniversalApiContract, 3.0), |
| 241 |
marshaling_behavior(agile), |
| 242 |
threading(both) |
| 243 |
] |
| 244 |
runtimeclass PeriodicForceEffect |
| 245 |
{ |
| 246 |
[default] interface Windows.Gaming.Input.ForceFeedback.IForceFeedbackEffect; |
| 247 |
interface Windows.Gaming.Input.ForceFeedback.IPeriodicForceEffect; |
| 248 |
} |
| 249 |
|
| 250 |
[ |
| 251 |
activatable(Windows.Gaming.Input.ForceFeedback.IConditionForceEffectFactory, Windows.Foundation.UniversalApiContract, 3.0), |
| 252 |
contract(Windows.Foundation.UniversalApiContract, 3.0), |
| 253 |
marshaling_behavior(agile), |
| 254 |
threading(both) |
| 255 |
] |
| 256 |
runtimeclass ConditionForceEffect |
| 257 |
{ |
| 258 |
[default] interface Windows.Gaming.Input.ForceFeedback.IForceFeedbackEffect; |
| 259 |
interface Windows.Gaming.Input.ForceFeedback.IConditionForceEffect; |
| 260 |
} |
| 261 |
|
| 262 |
[ |
| 263 |
activatable(Windows.Foundation.UniversalApiContract, 3.0), |
| 264 |
contract(Windows.Foundation.UniversalApiContract, 3.0), |
| 265 |
marshaling_behavior(agile), |
| 266 |
threading(both) |
| 267 |
] |
| 268 |
runtimeclass ConstantForceEffect |
| 269 |
{ |
| 270 |
[default] interface Windows.Gaming.Input.ForceFeedback.IForceFeedbackEffect; |
| 271 |
interface Windows.Gaming.Input.ForceFeedback.IConstantForceEffect; |
| 272 |
} |
| 273 |
|
| 274 |
[ |
| 275 |
activatable(Windows.Foundation.UniversalApiContract, 3.0), |
| 276 |
contract(Windows.Foundation.UniversalApiContract, 3.0), |
| 277 |
marshaling_behavior(agile), |
| 278 |
threading(both) |
| 279 |
] |
| 280 |
runtimeclass RampForceEffect |
| 281 |
{ |
| 282 |
[default] interface Windows.Gaming.Input.ForceFeedback.IForceFeedbackEffect; |
| 283 |
interface Windows.Gaming.Input.ForceFeedback.IRampForceEffect; |
| 284 |
} |
| 285 |
} |