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.

307 lines
9.9 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1999
  6. //
  7. // File: ddsurface4obj.h
  8. //
  9. //--------------------------------------------------------------------------
  10. // ddSurfaceObj.h : Declaration of the C_dxj_DirectDrawSurfaceObject
  11. #include "resource.h" // main symbols
  12. //#define typedef__dxj_DirectDrawSurface LPDIRECTDRAWSURFACE
  13. // 2nd #define helps with macros - same thing
  14. //#define typedef__dxj_DirectDrawSurface LPDIRECTDRAWSURFACE
  15. #define typedef__dxj_DirectDrawSurface4 LPDIRECTDRAWSURFACE4
  16. /////////////////////////////////////////////////////////////////////////////
  17. // Direct
  18. //REVIEW -- using pointers to ID's is necessary because some compilers don't like
  19. //references as template arguments.
  20. class C_dxj_DirectDrawSurface4Object :
  21. public I_dxj_DirectDrawSurface4,
  22. public CComObjectRoot
  23. {
  24. public:
  25. C_dxj_DirectDrawSurface4Object() ;
  26. virtual ~C_dxj_DirectDrawSurface4Object() ;
  27. DWORD InternalAddRef();
  28. DWORD InternalRelease();
  29. BEGIN_COM_MAP(C_dxj_DirectDrawSurface4Object)
  30. COM_INTERFACE_ENTRY(I_dxj_DirectDrawSurface4)
  31. #ifdef USING_IDISPATCH
  32. COM_INTERFACE_ENTRY(IDispatch)
  33. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  34. #endif
  35. END_COM_MAP()
  36. DECLARE_AGGREGATABLE(C_dxj_DirectDrawSurface4Object)
  37. // I_dxj_DirectDrawSurface4
  38. public:
  39. /* [hidden] */ HRESULT STDMETHODCALLTYPE InternalSetObject(
  40. /* [in] */ IUnknown __RPC_FAR *lpdds);
  41. /* [hidden] */ HRESULT STDMETHODCALLTYPE InternalGetObject(
  42. /* [retval][out] */ IUnknown __RPC_FAR *__RPC_FAR *lpdds);
  43. HRESULT STDMETHODCALLTYPE addAttachedSurface(
  44. /* [in] */ I_dxj_DirectDrawSurface4 __RPC_FAR *ddS) ;
  45. HRESULT STDMETHODCALLTYPE blt(
  46. /* [in] */ Rect __RPC_FAR *destRect,
  47. /* [in] */ I_dxj_DirectDrawSurface4 __RPC_FAR *ddS,
  48. /* [in] */ Rect __RPC_FAR *srcRect,
  49. /* [in] */ long flags,
  50. /* [retval][out] */ long __RPC_FAR *status);
  51. HRESULT STDMETHODCALLTYPE bltColorFill(
  52. /* [in] */ Rect __RPC_FAR *destRect,
  53. /* [in] */ long fillvalue,
  54. /* [retval][out] */ long __RPC_FAR *status);
  55. HRESULT STDMETHODCALLTYPE bltFast(
  56. /* [in] */ long dx,
  57. /* [in] */ long dy,
  58. /* [in] */ I_dxj_DirectDrawSurface4 __RPC_FAR *dds,
  59. /* [in] */ Rect __RPC_FAR *srcRect,
  60. /* [in] */ long trans,
  61. /* [retval][out] */ long __RPC_FAR *status);
  62. HRESULT STDMETHODCALLTYPE bltFx(
  63. /* [in] */ Rect __RPC_FAR *destRect,
  64. /* [in] */ I_dxj_DirectDrawSurface4 __RPC_FAR *ddS,
  65. /* [in] */ Rect __RPC_FAR *srcRect,
  66. /* [in] */ long flags,
  67. /* [in] */ DDBltFx __RPC_FAR *bltfx,
  68. /* [retval][out] */ long __RPC_FAR *status);
  69. HRESULT STDMETHODCALLTYPE bltToDC(
  70. /* [in] */ long hdc,
  71. /* [in] */ Rect __RPC_FAR *srcRect,
  72. /* [in] */ Rect __RPC_FAR *destRect);
  73. HRESULT STDMETHODCALLTYPE changeUniquenessValue( void);
  74. HRESULT STDMETHODCALLTYPE deleteAttachedSurface(
  75. /* [in] */ I_dxj_DirectDrawSurface4 __RPC_FAR *dds);
  76. HRESULT STDMETHODCALLTYPE drawBox(
  77. /* [in] */ long x1,
  78. /* [in] */ long y1,
  79. /* [in] */ long x2,
  80. /* [in] */ long y2);
  81. HRESULT STDMETHODCALLTYPE drawCircle(
  82. /* [in] */ long x1,
  83. /* [in] */ long y1,
  84. /* [in] */ long r);
  85. HRESULT STDMETHODCALLTYPE drawEllipse(
  86. /* [in] */ long x1,
  87. /* [in] */ long y1,
  88. /* [in] */ long x2,
  89. /* [in] */ long y2);
  90. HRESULT STDMETHODCALLTYPE drawLine(
  91. /* [in] */ long x1,
  92. /* [in] */ long y1,
  93. /* [in] */ long x2,
  94. /* [in] */ long y2);
  95. HRESULT STDMETHODCALLTYPE drawRoundedBox(
  96. /* [in] */ long x1,
  97. /* [in] */ long y1,
  98. /* [in] */ long x2,
  99. /* [in] */ long y2,
  100. /* [in] */ long rw,
  101. /* [in] */ long rh);
  102. HRESULT STDMETHODCALLTYPE drawText(
  103. /* [in] */ long x,
  104. /* [in] */ long y,
  105. /* [in] */ BSTR text,
  106. /* [in] */ VARIANT_BOOL b);
  107. HRESULT STDMETHODCALLTYPE flip(
  108. /* [in] */ I_dxj_DirectDrawSurface4 __RPC_FAR *dds,
  109. /* [in] */ long flags);
  110. HRESULT STDMETHODCALLTYPE getAttachedSurface(
  111. /* [in] */ DDSCaps2 __RPC_FAR *caps,
  112. /* [retval][out] */ I_dxj_DirectDrawSurface4 __RPC_FAR *__RPC_FAR *dds);
  113. HRESULT STDMETHODCALLTYPE getBltStatus(
  114. /* [in] */ long flags,
  115. /* [retval][out] */ long __RPC_FAR *status);
  116. HRESULT STDMETHODCALLTYPE getCaps(
  117. /* [out][in] */ DDSCaps2 __RPC_FAR *caps);
  118. HRESULT STDMETHODCALLTYPE getClipper(
  119. /* [retval][out] */ I_dxj_DirectDrawClipper __RPC_FAR *__RPC_FAR *val);
  120. HRESULT STDMETHODCALLTYPE getColorKey(
  121. /* [in] */ long flags,
  122. /* [out][in] */ DDColorKey __RPC_FAR *val);
  123. HRESULT STDMETHODCALLTYPE getDC(
  124. /* [retval][out] */ long __RPC_FAR *hdc);
  125. HRESULT STDMETHODCALLTYPE getDirectDraw(
  126. /* [retval][out] */ I_dxj_DirectDraw4 __RPC_FAR *__RPC_FAR *val);
  127. HRESULT STDMETHODCALLTYPE getDrawStyle(
  128. /* [retval][out] */ long __RPC_FAR *drawStyle);
  129. HRESULT STDMETHODCALLTYPE getDrawWidth(
  130. /* [retval][out] */ long __RPC_FAR *drawWidth);
  131. HRESULT STDMETHODCALLTYPE getFillColor(
  132. /* [retval][out] */ long __RPC_FAR *color);
  133. HRESULT STDMETHODCALLTYPE getFillStyle(
  134. /* [retval][out] */ long __RPC_FAR *fillStyle);
  135. HRESULT STDMETHODCALLTYPE getFlipStatus(
  136. /* [in] */ long flags,
  137. /* [retval][out] */ long __RPC_FAR *status);
  138. HRESULT STDMETHODCALLTYPE getFontTransparency(
  139. /* [retval][out] */ VARIANT_BOOL __RPC_FAR *b);
  140. HRESULT STDMETHODCALLTYPE getForeColor(
  141. /* [retval][out] */ long __RPC_FAR *color);
  142. HRESULT STDMETHODCALLTYPE getLockedPixel(
  143. /* [in] */ int x,
  144. /* [in] */ int y,
  145. /* [retval][out] */ long __RPC_FAR *col);
  146. HRESULT STDMETHODCALLTYPE getPalette(
  147. /* [retval][out] */ I_dxj_DirectDrawPalette __RPC_FAR *__RPC_FAR *val);
  148. HRESULT STDMETHODCALLTYPE getPixelFormat(
  149. /* [out][in] */ DDPixelFormat __RPC_FAR *pf);
  150. HRESULT STDMETHODCALLTYPE getSurfaceDesc(
  151. /* [out][in] */ DDSurfaceDesc2 __RPC_FAR *surface);
  152. HRESULT STDMETHODCALLTYPE getUniquenessValue(
  153. /* [retval][out] */ long __RPC_FAR *retVal);
  154. HRESULT STDMETHODCALLTYPE isLost(
  155. /* [retval][out] */ long __RPC_FAR *status);
  156. HRESULT STDMETHODCALLTYPE lock(
  157. /* [in] */ Rect __RPC_FAR *r,
  158. /* [in] */ DDSurfaceDesc2 __RPC_FAR *desc,
  159. /* [in] */ long flags,
  160. /* [in] */ Handle hnd);
  161. HRESULT STDMETHODCALLTYPE releaseDC(
  162. /* [in] */ long hdc);
  163. HRESULT STDMETHODCALLTYPE restore( void);
  164. HRESULT STDMETHODCALLTYPE setClipper(
  165. /* [in] */ I_dxj_DirectDrawClipper __RPC_FAR *val);
  166. HRESULT STDMETHODCALLTYPE setColorKey(
  167. /* [in] */ long flags,
  168. /* [in] */ DDColorKey __RPC_FAR *val);
  169. HRESULT STDMETHODCALLTYPE setDrawStyle(
  170. /* [in] */ long drawStyle);
  171. HRESULT STDMETHODCALLTYPE setDrawWidth(
  172. /* [in] */ long drawWidth);
  173. HRESULT STDMETHODCALLTYPE setFillColor(
  174. /* [in] */ long color);
  175. HRESULT STDMETHODCALLTYPE setFillStyle(
  176. /* [in] */ long fillStyle);
  177. HRESULT STDMETHODCALLTYPE setFont(
  178. /* [in] */ IFont __RPC_FAR *font);
  179. HRESULT STDMETHODCALLTYPE setFontTransparency(
  180. /* [in] */ VARIANT_BOOL b);
  181. HRESULT STDMETHODCALLTYPE setForeColor(
  182. /* [in] */ long color);
  183. HRESULT STDMETHODCALLTYPE setLockedPixel(
  184. /* [in] */ int x,
  185. /* [in] */ int y,
  186. /* [in] */ long col);
  187. HRESULT STDMETHODCALLTYPE setPalette(
  188. /* [in] */ I_dxj_DirectDrawPalette __RPC_FAR *ddp);
  189. HRESULT STDMETHODCALLTYPE unlock(
  190. /* [in] */ Rect __RPC_FAR *r);
  191. HRESULT STDMETHODCALLTYPE getLockedArray(SAFEARRAY **pArray);
  192. HRESULT STDMETHODCALLTYPE setFontBackColor(
  193. /* [in] */ long color);
  194. HRESULT STDMETHODCALLTYPE getFontBackColor(
  195. /* [out,retval] */ long *color);
  196. ////////////////////////////////////////////////////////////////////////
  197. //
  198. // note: this is public for the callbacks
  199. DECL_VARIABLE(_dxj_DirectDrawSurface4);
  200. //BOOL m_primaryflag;
  201. private:
  202. C_dxj_DirectDrawSurface4Object *_dxj_DirectDrawSurface4Lock;
  203. DDSURFACEDESC2 m_ddsd;
  204. BOOL m_bLocked;
  205. int m_nPixelBytes;
  206. BOOL m_fFontTransparent;
  207. BOOL m_fFillSolid;
  208. BOOL m_fFillTransparent;
  209. DWORD m_fillStyle;
  210. DWORD m_fillStyleHS;
  211. DWORD m_fillColor;
  212. DWORD m_foreColor;
  213. DWORD m_fontBackColor;
  214. DWORD m_drawStyle;
  215. DWORD m_drawWidth;
  216. HPEN m_hPen;
  217. HBRUSH m_hBrush;
  218. HFONT m_hFont;
  219. IFont *m_pIFont;
  220. SAFEARRAY **m_ppSA;
  221. BOOL m_bLockedArray;
  222. SAFEARRAY m_saLockedArray;
  223. DWORD m_pad[4];
  224. //pac
  225. public:
  226. DX3J_GLOBAL_LINKS(_dxj_DirectDrawSurface4)
  227. };
  228. //
  229. // Copies values from native unions into redundant Java members.
  230. void ExpandDDSurface4Desc(LPDDSURFACEDESC lpDesc);