Leaked source code of windows server 2003
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.

359 lines
13 KiB

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