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.

478 lines
13 KiB

  1. /****************************************************************************
  2. *
  3. * Win16 Emitter Routines header file
  4. *
  5. * Date: 7/18/91
  6. * Author: Jeffrey Newman (c-jeffn)
  7. *
  8. ***************************************************************************/
  9. #ifndef _WIN16_MF3216_
  10. #define _WIN16_MF3216_
  11. #pragma pack(1)
  12. #define msosignature 0x50504E54 // Office/Escher signature
  13. #define msocommentBeginSrcCopy 0x0106
  14. #define msocommentEndSrcCopy 0x0107
  15. typedef struct tagRECTS {
  16. SHORT left;
  17. SHORT top;
  18. SHORT right;
  19. SHORT bottom;
  20. } RECTS, *PRECTS;
  21. typedef struct tagWIN16LOGPEN {
  22. WORD lopnStyle;
  23. POINTS lopnWidth;
  24. COLORREF lopnColor;
  25. } WIN16LOGPEN, *LPWIN16LOGPEN;
  26. typedef struct tagWIN16LOGBRUSH
  27. {
  28. WORD lbStyle;
  29. DWORD lbColor;
  30. SHORT lbHatch;
  31. } WIN16LOGBRUSH, *LPWIN16LOGBRUSH;
  32. typedef struct tagWIN16LOGFONT
  33. {
  34. SHORT lfHeight;
  35. SHORT lfWidth;
  36. SHORT lfEscapement;
  37. SHORT lfOrientation;
  38. SHORT lfWeight;
  39. BYTE lfItalic;
  40. BYTE lfUnderline;
  41. BYTE lfStrikeOut;
  42. BYTE lfCharSet;
  43. BYTE lfOutPrecision;
  44. BYTE lfClipPrecision;
  45. BYTE lfQuality;
  46. BYTE lfPitchAndFamily;
  47. BYTE lfFaceName[LF_FACESIZE];
  48. } WIN16LOGFONT, *LPWIN16LOGFONT;
  49. typedef struct tagMETARECORD0 {
  50. DWORD rdSize;
  51. WORD rdFunction;
  52. } METARECORD0;
  53. // Define METARECORD1 through METARECORD9.
  54. #define METARECORD_(n) \
  55. typedef struct tagMETARECORD##n { \
  56. DWORD rdSize; \
  57. WORD rdFunction; \
  58. WORD rdParm[n]; \
  59. } METARECORD##n
  60. METARECORD_(1);
  61. METARECORD_(2);
  62. METARECORD_(3);
  63. METARECORD_(4);
  64. METARECORD_(5);
  65. METARECORD_(6);
  66. METARECORD_(7);
  67. METARECORD_(8);
  68. METARECORD_(9);
  69. typedef struct tagMETARECORD_CREATEFONTINDIRECT {
  70. DWORD rdSize;
  71. WORD rdFunction;
  72. WIN16LOGFONT lf16;
  73. } METARECORD_CREATEFONTINDIRECT;
  74. typedef struct tagMETARECORD_CREATEPENINDIRECT {
  75. DWORD rdSize;
  76. WORD rdFunction;
  77. WIN16LOGPEN lopn16;
  78. } METARECORD_CREATEPENINDIRECT;
  79. typedef struct tagMETARECORD_CREATEBRUSHINDIRECT {
  80. DWORD rdSize;
  81. WORD rdFunction;
  82. WIN16LOGBRUSH lb16;
  83. } METARECORD_CREATEBRUSHINDIRECT;
  84. typedef struct tagMETARECORD_DIBCREATEPATTERNBRUSH {
  85. DWORD rdSize;
  86. WORD rdFunction;
  87. WORD iType;
  88. WORD iUsage;
  89. } METARECORD_DIBCREATEPATTERNBRUSH;
  90. typedef struct tagMETARECORD_POLY {
  91. DWORD rdSize;
  92. WORD rdFunction;
  93. WORD cpt;
  94. } METARECORD_POLY;
  95. typedef struct tagMETARECORD_POLYPOLYGON {
  96. DWORD rdSize;
  97. WORD rdFunction;
  98. WORD ccpt;
  99. } METARECORD_POLYPOLYGON;
  100. typedef struct tagMETARECORD_DIBSTRETCHBLT {
  101. DWORD rdSize;
  102. WORD rdFunction;
  103. DWORD rop;
  104. SHORT cySrc;
  105. SHORT cxSrc;
  106. SHORT ySrc;
  107. SHORT xSrc;
  108. SHORT cy;
  109. SHORT cx;
  110. SHORT y;
  111. SHORT x;
  112. } METARECORD_DIBSTRETCHBLT;
  113. typedef struct tagMETARECORD_SETPALENTRIES {
  114. DWORD rdSize;
  115. WORD rdFunction;
  116. WORD iStart;
  117. WORD cEntries;
  118. } METARECORD_SETPALENTRIES;
  119. typedef struct tagMETARECORD_ESCAPE {
  120. DWORD rdSize;
  121. WORD rdFunction;
  122. WORD wEscape;
  123. WORD wCount;
  124. } METARECORD_ESCAPE, *PMETARECORD_ESCAPE;
  125. #pragma pack()
  126. #define bEmitWin16EOF(pLocalDC) \
  127. bW16Emit0(pLocalDC, 0)
  128. #define bEmitWin16RealizePalette(pLocalDC) \
  129. bW16Emit0(pLocalDC, META_REALIZEPALETTE)
  130. #define bEmitWin16SaveDC(pLocalDC) \
  131. bW16Emit0(pLocalDC, META_SAVEDC)
  132. #define bEmitWin16SetTextAlign(pLocalDC, wFlags) \
  133. bW16Emit1(pLocalDC, META_SETTEXTALIGN, wFlags)
  134. #define bEmitWin16SetStretchBltMode(pLocalDC, iStretchMode) \
  135. bW16Emit1(pLocalDC, META_SETSTRETCHBLTMODE, iStretchMode)
  136. #define bEmitWin16SetROP2(pLocalDC, nDrawMode) \
  137. bW16Emit1(pLocalDC, META_SETROP2, nDrawMode)
  138. #define bEmitWin16SetPolyFillMode(pLocalDC, iPolyFillMode) \
  139. bW16Emit1(pLocalDC, META_SETPOLYFILLMODE, iPolyFillMode)
  140. #define bEmitWin16SetBkMode(pLocalDC, iBkMode) \
  141. bW16Emit1(pLocalDC, META_SETBKMODE, iBkMode)
  142. #define bEmitWin16SelectPalette(pLocalDC, ihObject) \
  143. bW16Emit1(pLocalDC, META_SELECTPALETTE, ihObject)
  144. #define bEmitWin16SelectObject(pLocalDC, ihObject) \
  145. bW16Emit1(pLocalDC, META_SELECTOBJECT, ihObject)
  146. #define bEmitWin16DeleteObject(pLocalDC, ihObject) \
  147. bW16Emit1(pLocalDC, META_DELETEOBJECT, ihObject)
  148. #define bEmitWin16SetMapMode(pLocalDC, iMapMode) \
  149. bW16Emit1(pLocalDC, META_SETMAPMODE, iMapMode)
  150. #define bEmitWin16PaintRgn(pLocalDC, ihRgn) \
  151. bW16Emit1(pLocalDC, META_PAINTREGION, ihRgn)
  152. #define bEmitWin16InvertRgn(pLocalDC, ihRgn) \
  153. bW16Emit1(pLocalDC, META_INVERTREGION, ihRgn)
  154. #define bEmitWin16RestoreDC(pLocalDC, nSavedDC) \
  155. bW16Emit1(pLocalDC, META_RESTOREDC, nSavedDC)
  156. #define bEmitWin16ResizePalette(pLocalDC, cEntries) \
  157. bW16Emit1(pLocalDC, META_RESIZEPALETTE, cEntries)
  158. #define bEmitWin16SetTextColor(pLocalDC, crColor) \
  159. bW16Emit2(pLocalDC, META_SETTEXTCOLOR, \
  160. HIWORD(crColor), LOWORD(crColor))
  161. #define bEmitWin16SetMapperFlags(pLocalDC, dwFlags) \
  162. bW16Emit2(pLocalDC, META_SETMAPPERFLAGS, \
  163. HIWORD(dwFlags), LOWORD(dwFlags))
  164. #define bEmitWin16SetBkColor(pLocalDC, crColor) \
  165. bW16Emit2(pLocalDC, META_SETBKCOLOR, \
  166. HIWORD(crColor), LOWORD(crColor))
  167. #define bEmitWin16SetWindowOrg(pLocalDC, x, y) \
  168. bW16Emit2(pLocalDC, META_SETWINDOWORG, x, y)
  169. #define bEmitWin16SetWindowExt(pLocalDC, x, y) \
  170. bW16Emit2(pLocalDC, META_SETWINDOWEXT, x, y)
  171. #define bEmitWin16SetViewportOrg(pLocalDC, x, y) \
  172. bW16Emit2(pLocalDC, META_SETVIEWPORTORG, x, y)
  173. #define bEmitWin16SetViewportExt(pLocalDC, x, y) \
  174. bW16Emit2(pLocalDC, META_SETVIEWPORTEXT, x, y)
  175. #define bEmitWin16OffsetClipRgn(pLocalDC, x, y) \
  176. bW16Emit2(pLocalDC, META_OFFSETCLIPRGN, x, y)
  177. #define bEmitWin16FillRgn(pLocalDC, ihRgn, ihBrush) \
  178. bW16Emit2(pLocalDC, META_FILLREGION, ihBrush, ihRgn)
  179. #define bEmitWin16MoveTo(pLocalDC, x, y) \
  180. bW16Emit2(pLocalDC, META_MOVETO, x, y)
  181. #define bEmitWin16LineTo(pLocalDC, x, y) \
  182. bW16Emit2(pLocalDC, META_LINETO, x, y)
  183. #define bEmitWin16FrameRgn(pLocalDC, ihRgn, ihBrush, nWidth, nHeight) \
  184. bW16Emit4(pLocalDC, META_FRAMEREGION, \
  185. nWidth, nHeight, ihBrush, ihRgn)
  186. #define bEmitWin16ExcludeClipRect(pLocalDC, xLeft, yTop, xRight, yBottom) \
  187. bW16Emit4(pLocalDC, META_EXCLUDECLIPRECT, \
  188. xLeft, yTop, xRight, yBottom)
  189. #define bEmitWin16IntersectClipRect(pLocalDC, xLeft, yTop, xRight, yBottom)\
  190. bW16Emit4(pLocalDC, META_INTERSECTCLIPRECT, \
  191. xLeft, yTop, xRight, yBottom)
  192. #define bEmitWin16SetPixel(pLocalDC, x, y, crColor) \
  193. bW16Emit4(pLocalDC, META_SETPIXEL, x, y, \
  194. HIWORD(crColor), LOWORD(crColor))
  195. #define bEmitWin16ExtFloodFill(pLocalDC, x, y, crColor, iMode) \
  196. bW16Emit5(pLocalDC, META_EXTFLOODFILL, x, y, \
  197. HIWORD(crColor), LOWORD(crColor), iMode)
  198. #define bEmitWin16Rectangle(pLocalDC, x1, y1, x2, y2) \
  199. bW16Emit4(pLocalDC, META_RECTANGLE, x1, y1, x2, y2)
  200. #define bEmitWin16Ellipse(pLocalDC, x1, y1, x2, y2) \
  201. bW16Emit4(pLocalDC, META_ELLIPSE, x1, y1, x2, y2)
  202. #define bEmitWin16RoundRect(pLocalDC, x1, y1, x2, y2, x3, y3) \
  203. bW16Emit6(pLocalDC, META_ROUNDRECT, x1, y1, x2, y2, x3, y3)
  204. #define bEmitWin16Arc(pLocalDC, x1, y1, x2, y2, x3, y3, x4, y4) \
  205. bW16Emit8(pLocalDC, META_ARC, \
  206. x1, y1, x2, y2, x3, y3, x4, y4)
  207. #define bEmitWin16Chord(pLocalDC, x1, y1, x2, y2, x3, y3, x4, y4) \
  208. bW16Emit8(pLocalDC, META_CHORD, \
  209. x1, y1, x2, y2, x3, y3, x4, y4)
  210. #define bEmitWin16Pie(pLocalDC, x1, y1, x2, y2, x3, y3, x4, y4) \
  211. bW16Emit8(pLocalDC, META_PIE, \
  212. x1, y1, x2, y2, x3, y3, x4, y4)
  213. #define bEmitWin16BitBltNoSrc(pLocalDC, x, y, cx, cy, rop) \
  214. bW16Emit9(pLocalDC, META_DIBBITBLT, \
  215. x, y, cx, cy, 0, 0, 0, HIWORD(rop), LOWORD(rop))
  216. #define bEmitWin16EmitSrcCopyComment(pLocalDC, code) \
  217. bW16Emit5(pLocalDC, META_ESCAPE, code, HIWORD(msosignature),\
  218. LOWORD(msosignature), 0x0006, MFCOMMENT)
  219. BOOL bW16Emit0
  220. (
  221. PLOCALDC pLocalDC,
  222. WORD RecordID
  223. ) ;
  224. BOOL bW16Emit1
  225. (
  226. PLOCALDC pLocalDC,
  227. WORD RecordID,
  228. WORD x1
  229. ) ;
  230. BOOL bW16Emit2
  231. (
  232. PLOCALDC pLocalDC,
  233. WORD RecordID,
  234. WORD x1,
  235. WORD x2
  236. ) ;
  237. BOOL bW16Emit4
  238. (
  239. PLOCALDC pLocalDC,
  240. WORD RecordID,
  241. WORD x1,
  242. WORD x2,
  243. WORD x3,
  244. WORD x4
  245. ) ;
  246. BOOL bW16Emit5
  247. (
  248. PLOCALDC pLocalDC,
  249. WORD RecordID,
  250. WORD x1,
  251. WORD x2,
  252. WORD x3,
  253. WORD x4,
  254. WORD x5
  255. ) ;
  256. BOOL bW16Emit6
  257. (
  258. PLOCALDC pLocalDC,
  259. WORD RecordID,
  260. WORD x1,
  261. WORD x2,
  262. WORD x3,
  263. WORD x4,
  264. WORD x5,
  265. WORD x6
  266. ) ;
  267. BOOL bW16Emit8
  268. (
  269. PLOCALDC pLocalDC,
  270. WORD RecordID,
  271. WORD x1,
  272. WORD x2,
  273. WORD x3,
  274. WORD x4,
  275. WORD x5,
  276. WORD x6,
  277. WORD x7,
  278. WORD x8
  279. ) ;
  280. BOOL bW16Emit9
  281. (
  282. PLOCALDC pLocalDC,
  283. WORD RecordID,
  284. WORD x1,
  285. WORD x2,
  286. WORD x3,
  287. WORD x4,
  288. WORD x5,
  289. WORD x6,
  290. WORD x7,
  291. WORD x8,
  292. WORD x9
  293. ) ;
  294. BOOL bEmitWin16CreateFontIndirect
  295. (
  296. PLOCALDC pLocalDC,
  297. LPWIN16LOGFONT lpWin16LogFont
  298. ) ;
  299. BOOL bEmitWin16Poly
  300. (
  301. PLOCALDC pLocalDC,
  302. LPPOINTS ppt,
  303. SHORT cpt,
  304. WORD metaType
  305. ) ;
  306. BOOL bEmitWin16PolyPolygon
  307. (
  308. PLOCALDC pLocalDC,
  309. PPOINTS ppt,
  310. PWORD pcpt,
  311. WORD cpt,
  312. WORD ccpt
  313. ) ;
  314. BOOL bEmitWin16StretchBlt
  315. (
  316. PLOCALDC pLocalDC,
  317. SHORT x,
  318. SHORT y,
  319. SHORT cx,
  320. SHORT cy,
  321. SHORT xSrc,
  322. SHORT ySrc,
  323. SHORT cxSrc,
  324. SHORT cySrc,
  325. DWORD rop,
  326. PBITMAPINFO lpbmi,
  327. DWORD cbbmi,
  328. PBYTE lpBits,
  329. DWORD cbBits
  330. ) ;
  331. BOOL bEmitWin16ExtTextOut
  332. (
  333. PLOCALDC pLocalDC,
  334. SHORT x,
  335. SHORT y,
  336. WORD fwOpts,
  337. PRECTS prcts,
  338. PSTR ach,
  339. SHORT nCount,
  340. PWORD lpDx
  341. ) ;
  342. BOOL bEmitWin16CreateRegion
  343. (
  344. PLOCALDC pLocalDC,
  345. DWORD cbRgn,
  346. PVOID pRgn
  347. ) ;
  348. BOOL bEmitWin16SetPaletteEntries
  349. (
  350. PLOCALDC pLocalDC,
  351. DWORD iStart,
  352. DWORD cEntries,
  353. LPPALETTEENTRY pPalEntries
  354. ) ;
  355. BOOL bEmitWin16CreatePalette
  356. (
  357. PLOCALDC pLocalDC,
  358. LPLOGPALETTE lpLogPal
  359. ) ;
  360. BOOL bEmitWin16CreateBrushIndirect
  361. (
  362. PLOCALDC pLocalDC,
  363. LPWIN16LOGBRUSH lpLogBrush16
  364. ) ;
  365. BOOL bEmitWin16CreateDIBPatternBrush
  366. (
  367. PLOCALDC pLocalDC,
  368. PBITMAPINFO pBitmapInfo,
  369. DWORD cbBitmapInfo,
  370. PBYTE pBits,
  371. DWORD cbBits,
  372. WORD iUsage,
  373. WORD iType
  374. ) ;
  375. BOOL bEmitWin16CreatePen
  376. (
  377. PLOCALDC pLocalDC,
  378. WORD iPenStyle,
  379. PPOINTS pptsWidth,
  380. COLORREF crColor
  381. ) ;
  382. BOOL bEmitWin16Escape
  383. (
  384. PLOCALDC pLocalDC,
  385. SHORT wEscape,
  386. SHORT wCount,
  387. LPSTR lpInData,
  388. LPSTR lpOutData
  389. ) ;
  390. BOOL bEmitWin16EscapeEnhMetaFile
  391. (
  392. PLOCALDC pLocalDC,
  393. PMETARECORD_ESCAPE pmfeEnhMF,
  394. LPBYTE lpEmfData
  395. ) ;
  396. #endif // _WIN16_MF3216_