Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

206 lines
7.5 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1999
  6. //
  7. // File: dinputdeviceobj.h
  8. //
  9. //--------------------------------------------------------------------------
  10. // ddPaletteObj.h : Declaration of the C_dxj_DirectDrawColorControlObject
  11. #include "direct.h"
  12. #include "resource.h" // main symbols
  13. #define typedef__dxj_DirectInputDevice8 LPDIRECTINPUTDEVICE8W
  14. /////////////////////////////////////////////////////////////////////////////
  15. // Direct
  16. class C_dxj_DirectInputDevice8Object :
  17. public I_dxj_DirectInputDevice8,
  18. public CComObjectRoot
  19. {
  20. public:
  21. C_dxj_DirectInputDevice8Object() ;
  22. ~C_dxj_DirectInputDevice8Object();
  23. BEGIN_COM_MAP(C_dxj_DirectInputDevice8Object)
  24. COM_INTERFACE_ENTRY(I_dxj_DirectInputDevice8)
  25. END_COM_MAP()
  26. DECLARE_AGGREGATABLE(C_dxj_DirectInputDevice8Object)
  27. public:
  28. /* [hidden] */ HRESULT STDMETHODCALLTYPE InternalSetObject(
  29. /* [in] */ IUnknown __RPC_FAR *lpdd);
  30. /* [hidden] */ HRESULT STDMETHODCALLTYPE InternalGetObject(
  31. /* [retval][out] */ IUnknown __RPC_FAR *__RPC_FAR *lpdd);
  32. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE acquire( void);
  33. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE getDeviceObjectsEnum(
  34. /* [in] */ long flags,
  35. /* [retval][out] */ I_dxj_DIEnumDeviceObjects __RPC_FAR *__RPC_FAR *ppret);
  36. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE getCapabilities(
  37. /* [out][in] */ DIDEVCAPS_CDESC __RPC_FAR *caps);
  38. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE getDeviceData(
  39. /* [out][in] */ SAFEARRAY __RPC_FAR * __RPC_FAR *deviceObjectDataArray,
  40. /* [in] */ long flags,
  41. /* [retval][out] */ long __RPC_FAR *c);
  42. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE getDeviceInfo(
  43. /* [retval][out] */ I_dxj_DirectInputDeviceInstance8 __RPC_FAR *__RPC_FAR *deviceInstance);
  44. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE getDeviceStateKeyboard(
  45. /* [out][in] */ DIKEYBOARDSTATE_CDESC __RPC_FAR *state);
  46. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE getDeviceStateMouse(
  47. /* [out][in] */ DIMOUSESTATE_CDESC __RPC_FAR *state);
  48. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE getDeviceStateMouse2(
  49. /* [out][in] */ DIMOUSESTATE2_CDESC __RPC_FAR *state);
  50. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE getDeviceStateJoystick(
  51. /* [out][in] */ DIJOYSTATE_CDESC __RPC_FAR *state);
  52. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE getDeviceStateJoystick2(
  53. /* [out][in] */ DIJOYSTATE2_CDESC __RPC_FAR *state);
  54. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE getDeviceState(
  55. /* [in] */ long cb,
  56. /* [in] */ void __RPC_FAR *state);
  57. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE getObjectInfo(
  58. /* [in] */ long obj,
  59. /* [in] */ long how,
  60. /* [retval][out] */ I_dxj_DirectInputDeviceObjectInstance __RPC_FAR *__RPC_FAR *ret);
  61. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE getProperty(
  62. /* [in] */ BSTR guid,
  63. /* [out] */ void __RPC_FAR *propertyInfo);
  64. #ifdef _WIN64
  65. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE runControlPanel(
  66. /* [in] */ HWND hwnd);
  67. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE setCooperativeLevel(
  68. /* [in] */ HWND hwnd,
  69. /* [in] */ long flags);
  70. #else
  71. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE runControlPanel(
  72. /* [in] */ long hwnd);
  73. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE setCooperativeLevel(
  74. /* [in] */ long hwnd,
  75. /* [in] */ long flags);
  76. #endif
  77. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE setCommonDataFormat(
  78. /* [in] */ long format);
  79. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE setDataFormat(
  80. /* [in] */ DIDATAFORMAT_CDESC __RPC_FAR *format,
  81. SAFEARRAY __RPC_FAR * __RPC_FAR *formatArray);
  82. #ifdef _WIN64
  83. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE setEventNotification(
  84. /* [in] */ HANDLE hEvent);
  85. #else
  86. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE setEventNotification(
  87. /* [in] */ long hEvent);
  88. #endif
  89. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE setProperty(
  90. /* [in] */ BSTR guid,
  91. /* [in] */ void __RPC_FAR *propertyInfo);
  92. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE unacquire( void);
  93. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE poll( void);
  94. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE createEffect(
  95. /* [in] */ BSTR effectGuid,
  96. /* [in] */ DIEFFECT_CDESC __RPC_FAR *effectinfo,
  97. /* [retval][out] */ I_dxj_DirectInputEffect __RPC_FAR *__RPC_FAR *ret);
  98. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE createCustomEffect(
  99. /* [in] */ DIEFFECT_CDESC __RPC_FAR *effectinfo,
  100. /* [in] */ long channels,
  101. /* [in] */ long samplePeriod,
  102. /* [in] */ long nSamples,
  103. /* [in] */ SAFEARRAY __RPC_FAR * __RPC_FAR *sampledata,
  104. /* [retval][out] */ I_dxj_DirectInputEffect __RPC_FAR *__RPC_FAR *ret);
  105. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE sendDeviceData(
  106. /* [in] */ long count,
  107. /* [in] */ SAFEARRAY __RPC_FAR * __RPC_FAR *data,
  108. /* [in] */ long flags,
  109. /* [retval][out] */ long __RPC_FAR *retcount);
  110. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE sendForceFeedbackCommand(
  111. /* [in] */ long flags);
  112. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE getForceFeedbackState(
  113. /* [retval][out] */ long __RPC_FAR *state);
  114. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE getEffectsEnum(
  115. /* [in] */ long effType,
  116. /* [retval][out] */ I_dxj_DirectInputEnumEffects __RPC_FAR *__RPC_FAR *ret);
  117. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE BuildActionMap(
  118. /* [out][in] */ DIACTIONFORMAT_CDESC __RPC_FAR *format,
  119. /* [in] */ BSTR username,
  120. /* [in] */ long flags);
  121. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE SetActionMap(
  122. /* [out][in] */ DIACTIONFORMAT_CDESC __RPC_FAR *format,
  123. /* [in] */ BSTR username,
  124. /* [in] */ long flags);
  125. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE GetImageInfo(
  126. /* [out] */ DIDEVICEIMAGEINFOHEADER_CDESC __RPC_FAR *info);
  127. /* [helpcontext] */ HRESULT STDMETHODCALLTYPE GetImageInfoCount(
  128. long *count);
  129. HRESULT STDMETHODCALLTYPE WriteEffectToFile(
  130. /*[in]*/ BSTR filename,
  131. /*[in]*/ long flags,
  132. /*[in]*/ BSTR guid,
  133. /*[in]*/ BSTR name,
  134. /*[in]*/ DIEFFECT_CDESC *CoverEffect);
  135. HRESULT STDMETHODCALLTYPE CreateEffectFromFile(
  136. /*[in]*/ BSTR filename,
  137. /*[in]*/ long flags,
  138. /*[in]*/ BSTR effectName,
  139. /*[out,retval]*/ I_dxj_DirectInputEffect **ret);
  140. private:
  141. DECL_VARIABLE(_dxj_DirectInputDevice8);
  142. //IDirectInputDevice8 *m__dxj_DirectInputDevice8;
  143. HRESULT cleanup();
  144. HRESULT init();
  145. public:
  146. DX3J_GLOBAL_LINKS(_dxj_DirectInputDevice8)
  147. DWORD nFormat;
  148. };
  149. typedef struct EFFECTSINFILE
  150. {
  151. char szEffect[MAX_PATH];
  152. IDirectInputDevice8W *pDev;
  153. IDirectInputEffect *pEff;
  154. HRESULT hr;
  155. } EFFECTSINFILE;