windows.gaming.input.forcefeedback.idl 13 KB

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