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.

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