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.

968 lines
37 KiB

  1. /*++
  2. Copyright (c) 1996-1998 Microsoft Corporation
  3. Module Name:
  4. prentry.c
  5. Abstract:
  6. This file implements functions that generate printing related GPD entries.
  7. Environment:
  8. User-mode, stand-alone utility tool
  9. Revision History:
  10. 10/16/96 -zhanw-
  11. Created it.
  12. --*/
  13. #include "gpc2gpd.h"
  14. DWORD
  15. DwCalcMoveUnit(
  16. IN PCONVINFO pci,
  17. IN PCURSORMOVE pcm,
  18. IN WORD wMasterUnit,
  19. IN WORD wStartOCD,
  20. IN WORD wEndOCD)
  21. /*++
  22. Routine Description:
  23. This function calculates the unit used by movement commands in the
  24. given range.
  25. Arguments:
  26. pci: conversion related info
  27. pcm: the current CURSORMOVE structure
  28. wMasterUnit: X or Y master unit depending on the OCD range
  29. wStartOCD: the starting OCD to scan
  30. wEndOCD: the ending OCD to scan
  31. Return Value:
  32. the movement command unit. If there is no movement command, return 0.
  33. --*/
  34. {
  35. WORD i;
  36. OCD ocd;
  37. PCD pcd;
  38. PEXTCD pextcd = NULL; // points the parameter's EXTCD.
  39. for (ocd = (WORD)NOOCD, i = wStartOCD; i <= wEndOCD; i++)
  40. if (pcm->rgocd[i] != NOOCD)
  41. {
  42. ocd = pcm->rgocd[i];
  43. break;
  44. }
  45. if (ocd != NOOCD)
  46. {
  47. pcd = (PCD)((PBYTE)(pci->pdh) + (pci->pdh)->loHeap + ocd);
  48. if (pcd->wCount != 0)
  49. pextcd = GETEXTCD(pci->pdh, pcd);
  50. if (pextcd)
  51. {
  52. short sMult, sDiv;
  53. if ((sMult = pextcd->sUnitMult) == 0)
  54. sMult = 1;
  55. if ((sDiv = pextcd->sUnitDiv) == 0)
  56. sDiv = 1;
  57. if (pextcd->fGeneral & XCD_GEN_MODULO)
  58. return (DWORD)((((wMasterUnit + pextcd->sPreAdd) * sMult) %
  59. sDiv) + pextcd->sUnitAdd);
  60. else
  61. return (DWORD)((((wMasterUnit + pextcd->sPreAdd) * sMult) /
  62. sDiv) + pextcd->sUnitAdd);
  63. }
  64. else // no modification needed
  65. return (DWORD)wMasterUnit;
  66. }
  67. else
  68. return 0;
  69. }
  70. void
  71. VOutTextCaps(
  72. IN OUT PCONVINFO pci,
  73. WORD fText,
  74. BOOL bIndent)
  75. {
  76. //
  77. // at most 15 text capability flags can be used. In reality,
  78. // only less than 5 are used. So we don't break into multiple lines
  79. // for simplicity.
  80. //
  81. pci->dwMode |= FM_VOUT_LIST; // special handling for erasing last comma
  82. VOut(pci, "%s*TextCaps: LIST(%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s)\r\n",
  83. bIndent ? " " : "",
  84. (fText & TC_OP_CHARACTER) ? "TC_OP_CHARACTER," : "",
  85. (fText & TC_OP_STROKE) ? "TC_OP_STROKE," : "",
  86. (fText & TC_CP_STROKE) ? "TC_CP_STROKE," : "",
  87. (fText & TC_CR_90) ? "TC_CR_90," : "",
  88. (fText & TC_CR_ANY) ? "TC_CR_ANY," : "",
  89. (fText & TC_SF_X_YINDEP) ? "TC_SF_X_YINDEP," : "",
  90. (fText & TC_SA_DOUBLE) ? "TC_SA_DOUBLE," : "",
  91. (fText & TC_SA_INTEGER) ? "TC_SA_INTEGER," : "",
  92. (fText & TC_SA_CONTIN) ? "TC_SA_CONTIN," : "",
  93. (fText & TC_EA_DOUBLE) ? "TC_EA_DOUBLE," : "",
  94. (fText & TC_IA_ABLE) ? "TC_IA_ABLE," : "",
  95. (fText & TC_UA_ABLE) ? "TC_UA_ABLE," : "",
  96. (fText & TC_SO_ABLE) ? "TC_SO_ABLE," : "",
  97. (fText & TC_RA_ABLE) ? "TC_RA_ABLE," : "",
  98. (fText & TC_VA_ABLE) ? "TC_VA_ABLE" : "");
  99. pci->dwMode &= ~FM_VOUT_LIST;
  100. }
  101. //
  102. // values for dwType param below.
  103. //
  104. #define FF_INPUTBIN 1
  105. #define FF_PAPERSIZE 2
  106. #define FF_BOTH 3
  107. void
  108. VCreateEjectFFDependency(
  109. PCONVINFO pci,
  110. DWORD dwType, // type of dependency
  111. BOOL bIndentation) // whether to add extra 2 levels of indentation
  112. //
  113. // Generate dependency on either InputBin or PaperSize options.
  114. // Always use the 1st option to establish the base value.
  115. //
  116. {
  117. PPAPERINFO ppi;
  118. DWORD dwCount;
  119. DWORD i;
  120. if (dwType == FF_INPUTBIN)
  121. {
  122. ppi = pci->ppiSrc;
  123. dwCount = pci->dwNumOfSrc;
  124. }
  125. else // either FF_PAPERSIZE or FF_BOTH
  126. {
  127. ppi = pci->ppiSize;
  128. dwCount = pci->dwNumOfSize;
  129. }
  130. VOut(pci, "%s*EjectPageWithFF?: %s\r\n",
  131. bIndentation? " " : "",
  132. (ppi[0].bEjectFF) ? "TRUE" : "FALSE");
  133. VOut(pci, "%s*switch: %s\r\n%s{\r\n",
  134. bIndentation? " " : "",
  135. dwType == FF_INPUTBIN? "InputBin" : "PaperSize",
  136. bIndentation? " " : "");
  137. //
  138. // loop through the rest of options. If it's different
  139. // than the first one, create a *case construct for it.
  140. //
  141. for (i = 1; i < dwCount; i++)
  142. if (ppi[i].bEjectFF != ppi[0].bEjectFF)
  143. {
  144. VOut(pci, "%s *case: %s\r\n%s {\r\n",
  145. bIndentation? " " : "",
  146. ppi[i].aubOptName,
  147. bIndentation? " " : "");
  148. if (dwType == FF_BOTH)
  149. VCreateEjectFFDependency(pci, FF_INPUTBIN, TRUE);
  150. else
  151. VOut(pci, "%s *EjectPageWithFF?: %s\r\n",
  152. bIndentation? " " : "",
  153. ppi[0].bEjectFF ? "FALSE" : "TRUE");
  154. VOut(pci, "%s }\r\n", bIndentation? " " : "");
  155. }
  156. VOut(pci, "%s}\r\n", bIndentation? " " : ""); // close *switch construct
  157. }
  158. DWORD
  159. DwMergeFonts(
  160. PWORD pwBuf,
  161. DWORD dwStartIndex,
  162. PWORD pwList)
  163. {
  164. DWORD i, count;
  165. WORD id;
  166. WORD low, high;
  167. if (!*pwList)
  168. return 0;
  169. low = *pwList;
  170. high = *(pwList + 1);
  171. for (count = 0, id = low; id <= high; id++)
  172. {
  173. for (i = 0; i < dwStartIndex; i++)
  174. {
  175. if (pwBuf[i] == id)
  176. break;
  177. }
  178. if (i == dwStartIndex) // this is not a repeat
  179. {
  180. pwBuf[dwStartIndex + count] = id;
  181. count++;
  182. }
  183. }
  184. pwList += 2; // skip the range numbers
  185. while (id = *pwList)
  186. {
  187. for (i = 0; i < dwStartIndex; i++)
  188. {
  189. if (pwBuf[i] == id)
  190. break;
  191. }
  192. if (i == dwStartIndex) // this is not a repeat
  193. {
  194. pwBuf[dwStartIndex + count] = id;
  195. count++;
  196. }
  197. pwList++;
  198. }
  199. return count;
  200. }
  201. void
  202. VOutputFontList(
  203. IN OUT PCONVINFO pci,
  204. IN PWORD pwPFonts,
  205. IN PWORD pwLFonts)
  206. /*++
  207. Routine Description:
  208. This function outputs the font id list: LIST( , , ...) which ends with a
  209. a newline character. If two font lists are given, merge them first and
  210. remove the repeated id's.
  211. Arguments:
  212. pci: point to CONVINFO
  213. pwPFonts: point to list of font id's available in Portrait orientation.
  214. Note that as in GPC, the first two numbers represent the
  215. inclusive range of the font id's. Can be NULL.
  216. pwLFonts: Landscape font list. Can be NULL.
  217. Return Value:
  218. NONE.
  219. --*/
  220. {
  221. DWORD i, count;
  222. WORD awFonts[1000] = {0}; // assume at most 1000 resident fonts per printer
  223. //
  224. // first, collect the list of fonts (unique id's)
  225. //
  226. count = 0;
  227. if (pwPFonts)
  228. count += DwMergeFonts(awFonts, count, pwPFonts);
  229. if (pwLFonts)
  230. count += DwMergeFonts(awFonts, count, pwLFonts);
  231. if (count == 0)
  232. {
  233. VOut(pci, "LIST()\r\n");
  234. return;
  235. }
  236. #if defined(DEVSTUDIO) // Must map these lists to account for multi PFM-> UFM
  237. vMapFontList(awFonts, count, pci);
  238. #endif
  239. VOut(pci, "LIST(");
  240. for (i = 0; i < count - 1; i++)
  241. {
  242. //
  243. // check if need to move to a new line. Estimate 16 fonts id's
  244. // per line.
  245. //
  246. if (i && i % 16 == 0)
  247. VOut(pci, "\r\n+ ");
  248. VOut(pci, "%d,", awFonts[i]);
  249. }
  250. VOut(pci, "%d)\r\n", awFonts[i]); // last one
  251. }
  252. void
  253. VOutputPrintingEntries(
  254. IN OUT PCONVINFO pci)
  255. {
  256. PDH pdh = pci->pdh;
  257. PMODELDATA pmd = pci->pmd;
  258. PCURSORMOVE pcm;
  259. PGPCRESOLUTION pres;
  260. PPAPERSIZE pps;
  261. PSHORT psIndex;
  262. WORD wCount;
  263. pcm = (PCURSORMOVE)GetTableInfo(pdh, HE_CURSORMOVE,
  264. pmd->rgi[MD_I_CURSORMOVE]);
  265. if (*(psIndex = DHOFFSET(pdh, pmd->rgoi[MD_OI_RESOLUTION])) == 0)
  266. pres = NULL;
  267. else
  268. pres = (PGPCRESOLUTION)GetTableInfo(pdh, HE_RESOLUTION,
  269. *(psIndex + WGetDefaultIndex(pci, MD_OI_RESOLUTION) - 1) - 1);
  270. if (*(psIndex = DHOFFSET(pdh, pmd->rgoi[MD_OI_PAPERSIZE])) == 0)
  271. pps = NULL;
  272. else
  273. pps = (PPAPERSIZE)GetTableInfo(pdh, HE_PAPERSIZE,
  274. *(psIndex + WGetDefaultIndex(pci, MD_OI_PAPERSIZE) - 1) - 1);
  275. //
  276. // ASSUMPTIONS:
  277. // 1. all GPCRESOLUTION structs have same fCursor field value
  278. // 2. all PAPERSIZE structs have the same setting for PS_CENTER flag
  279. // 3. RES_DM_GDI and RES_DM_LEFT_BOUND bits are set consistently for
  280. // all GPCRESOLUTION options.
  281. //
  282. //
  283. // Printer Configuration Commands
  284. //
  285. {
  286. BOOL bDocSetup;
  287. WORD wOrder;
  288. POCD pocd = (POCD)(pci->ppc->rgocd);
  289. //
  290. // Note that both in RASDD and Win95 Unidrv, the configuration
  291. // commands and selection commands are classified as follows:
  292. // 1. All commands before PC_OCD_BEGIN_PAGE (exclusive) are sent per
  293. // job and per ResetDC. So they should be in DOC_SETUP section.
  294. // 2. All commands after PC_OCD_BEGIN_PAGE (inclusive) is sent at the
  295. // beginning of each page. So they should be in PAGE_SETUP section.
  296. // 3. PC_OCD_ENDDOC is sent only once per job. So it should be in
  297. // JOB_FINISH section.
  298. // 4. PC_OCD_ENDPAGE is sent only once at the end of each page. So
  299. // it should be in PAGE_FINISH section.
  300. // 5. There is nothing in JOB_SETUP section when converting from GPC.
  301. // 6. There is nothing in DOC_FINISH section when converting from
  302. // GPC.
  303. //
  304. bDocSetup = BInDocSetup(pci, PC_ORD_BEGINDOC, &wOrder);
  305. if (wOrder > 0 &&
  306. BBuildCmdStr(pci, CMD_PC_BEGIN_DOC, pocd[PC_OCD_BEGIN_DOC]))
  307. VOutputConfigCmd(pci, "CmdStartDoc",
  308. bDocSetup? SS_DOCSETUP : SS_PAGESETUP, wOrder);
  309. if (BBuildCmdStr(pci, CMD_PC_BEGIN_PAGE, pocd[PC_OCD_BEGIN_PAGE]))
  310. VOutputConfigCmd(pci, "CmdStartPage", SS_PAGESETUP, 1);
  311. if (BBuildCmdStr(pci, CMD_PC_ENDDOC, pocd[PC_OCD_ENDDOC]))
  312. VOutputConfigCmd(pci, "CmdEndJob", SS_JOBFINISH, 1);
  313. if (BBuildCmdStr(pci, CMD_PC_ENDPAGE, pocd[PC_OCD_ENDPAGE]))
  314. VOutputConfigCmd(pci, "CmdEndPage", SS_PAGEFINISH, 1);
  315. bDocSetup = BInDocSetup(pci, PC_ORD_MULT_COPIES, &wOrder);
  316. if (wOrder > 0 && pci->ppc->sMaxCopyCount > 1 &&
  317. BBuildCmdStr(pci, CMD_PC_MULT_COPIES, pocd[PC_OCD_MULT_COPIES]))
  318. VOutputConfigCmd(pci, "CmdCopies",
  319. bDocSetup? SS_DOCSETUP : SS_PAGESETUP, wOrder);
  320. }
  321. //
  322. // Printer Capabilities
  323. //
  324. VOut(pci, "*RotateCoordinate?: %s\r\n",
  325. (pmd->fGeneral & MD_LANDSCAPE_RT90) ? "TRUE" : "FALSE");
  326. VOut(pci, "*RotateRaster?: %s\r\n",
  327. (pmd->fGeneral & MD_LANDSCAPE_GRX_ABLE) ? "TRUE" : "FALSE");
  328. VOut(pci, "*RotateFont?: %s\r\n",
  329. (pmd->fGeneral & MD_ROTATE_FONT_ABLE) ? "TRUE" : "FALSE");
  330. if (pmd->fText || pmd->fLText)
  331. {
  332. if (pmd->fText == pmd->fLText)
  333. VOutTextCaps(pci, pmd->fText, FALSE);
  334. else
  335. {
  336. VOut(pci, "*switch: Orientation\r\n{\r\n");
  337. VOut(pci, " *case: PORTRAIT\r\n {\r\n");
  338. VOutTextCaps(pci, pmd->fText, TRUE);
  339. VOut(pci, " }\r\n");
  340. if (pmd->fGeneral & MD_LANDSCAPE_RT90)
  341. VOut(pci, " *case: LANDSCAPE_CC90\r\n {\r\n");
  342. else
  343. VOut(pci, " *case: LANDSCAPE_CC270\r\n {\r\n");
  344. VOutTextCaps(pci, pmd->fLText, TRUE);
  345. VOut(pci, " }\r\n}\r\n");
  346. }
  347. }
  348. if (pci->dwMode & FM_MEMORY_FEATURE_EXIST)
  349. VOut(pci, "*MemoryUsage: LIST(%s)\r\n",
  350. (pmd->fGeneral & MD_FONT_MEMCFG) ? "FONT" : "FONT, RASTER, VECTOR");
  351. //
  352. // Cursor Control
  353. //
  354. if (pres)
  355. VOut(pci, "*CursorXAfterCR: %s\r\n", (pres->fCursor & RES_CUR_CR_GRX_ORG)?
  356. "AT_PRINTABLE_X_ORIGIN" : "AT_CURSOR_X_ORIGIN");
  357. if (pcm)
  358. {
  359. enum {Y_MOVE_NONE = 0, Y_MOVE_UP = 1, Y_MOVE_DOWN = 2, Y_MOVE_ABS = 4 }
  360. eCmdsPresent = Y_MOVE_NONE,
  361. eRelativeYCmds = /* Y_MOVE_UP | */ Y_MOVE_DOWN; // use as bit field
  362. // for now just Y_MOVE_DOWN is sufficient for Relative Y move support.
  363. pci->pcm = pcm;
  364. //
  365. // check for flags that are ignored by NT4.0 RASDD but used by
  366. // Win95 Unidrv. When these flags are found, we expect minidriver
  367. // developers to double-check the generated GPD file to ensure
  368. // identical output under the new driver.
  369. //
  370. if (pcm->fGeneral & CM_GEN_FAV_XY)
  371. pci->dwErrorCode |= ERR_CM_GEN_FAV_XY;
  372. if (pcm->fXMove & CM_XM_RESET_FONT)
  373. pci->dwErrorCode |= ERR_CM_XM_RESET_FONT;
  374. if(pci->dwErrorCode & ERR_RES_BO_RESET_FONT)
  375. VOut(pci, " *ReselectFont: LIST(%sAFTER_GRXDATA)\r\n",
  376. (pci->dwErrorCode & ERR_CM_XM_RESET_FONT)? "AFTER_XMOVE, ":"");
  377. else if(pci->dwErrorCode & ERR_CM_XM_RESET_FONT)
  378. VOut(pci, " *ReselectFont: LIST(AFTER_XMOVE)\r\n");
  379. if (pcm->fXMove & CM_XM_ABS_NO_LEFT)
  380. pci->dwErrorCode |= ERR_CM_XM_ABS_NO_LEFT;
  381. if (pcm->fYMove & CM_YM_TRUNCATE)
  382. pci->dwErrorCode |= ERR_CM_YM_TRUNCATE;
  383. if ((pcm->fXMove & (CM_XM_NO_POR_GRX | CM_XM_NO_LAN_GRX)) ||
  384. (pcm->fYMove & (CM_YM_NO_POR_GRX | CM_YM_NO_LAN_GRX)))
  385. {
  386. pci->dwMode |= FM_VOUT_LIST;
  387. VOut(pci, "*BadCursorMoveInGrxMode: LIST(%s%s%s%s)\r\n",
  388. (pcm->fXMove & CM_XM_NO_POR_GRX) ? "X_PORTRAIT," : "",
  389. (pcm->fXMove & CM_XM_NO_LAN_GRX) ? "X_LANDSCAPE," : "",
  390. (pcm->fYMove & CM_YM_NO_POR_GRX) ? "Y_PORTRAIT," : "",
  391. (pcm->fYMove & CM_YM_NO_LAN_GRX) ? "Y_LANDSCAPE" : "");
  392. pci->dwMode &= ~FM_VOUT_LIST;
  393. }
  394. if ((pcm->fYMove & CM_YM_CR) ||
  395. ((pcm->fYMove & CM_YM_LINESPACING) &&
  396. pcm->rgocd[CM_OCD_YM_LINESPACING] != NOOCD) )
  397. {
  398. pci->dwMode |= FM_VOUT_LIST;
  399. VOut(pci, "*YMoveAttributes: LIST(%s%s)\r\n",
  400. (pcm->fYMove & CM_YM_CR) ? "SEND_CR_FIRST," : "",
  401. (pcm->fYMove & CM_YM_LINESPACING) ? "FAVOR_LF" : "");
  402. pci->dwMode &= ~FM_VOUT_LIST;
  403. }
  404. if (pcm->rgocd[CM_OCD_YM_LINESPACING] != NOOCD) // it takes 1 param.
  405. {
  406. PCD pcd;
  407. PEXTCD pextcd; // points the parameter's EXTCD.
  408. pcd = (PCD)((PBYTE)(pdh) + pdh->loHeap +
  409. pcm->rgocd[CM_OCD_YM_LINESPACING]);
  410. pextcd = GETEXTCD(pdh, pcd);
  411. if (!(pextcd->fGeneral & XCD_GEN_NO_MAX))
  412. VOut(pci, "*MaxLineSpacing: %d\r\n",pextcd->sMax);
  413. }
  414. //
  415. // Three cases:
  416. // 1) if only absolute X-move command is specified,*XMoveThreshold
  417. // should be 0, i.e. always use absolute cmd.
  418. // 2) if only relative X-move command is specified, *XMoveThreshold
  419. // should be *, i.e always use relative cmds.
  420. // 3) if both are specified, both RASDD and Win95 Unidrv prefers
  421. // absolute X-move cmd regardless of CM_XM_FAVOR_ABS bit. In that
  422. // case, *XMoveThreshold should be 0, which is the default value.
  423. //
  424. if (pcm->rgocd[CM_OCD_XM_ABS] == NOOCD)
  425. {
  426. if (pcm->rgocd[CM_OCD_XM_REL] != NOOCD ||
  427. pcm->rgocd[CM_OCD_XM_RELLEFT] != NOOCD)
  428. VOut(pci, "*XMoveThreshold: *\r\n");
  429. }
  430. else
  431. VOut(pci, "*XMoveThreshold: 0\r\n");
  432. //
  433. // But CM_YM_FAV_ABS bit is honored by both drivers, except Win95 Unidrv
  434. // adds a hack: if the y-move is relative upward (i.e. genative diff)
  435. // with less than 10 pixels (in master Y unit), then always use
  436. // the relative Y movement. I don't see a strong reason to preserve
  437. // this hack.
  438. //
  439. if ((pcm->fYMove & CM_YM_FAV_ABS) && pcm->rgocd[CM_OCD_YM_ABS] != NOOCD)
  440. VOut(pci, "*YMoveThreshold: 0\r\n");
  441. else if (pcm->rgocd[CM_OCD_YM_REL] != NOOCD ||
  442. pcm->rgocd[CM_OCD_YM_RELUP] != NOOCD)
  443. VOut(pci, "*YMoveThreshold: *\r\n");
  444. //
  445. // Figure out the X & Y movement units.
  446. // Assume that all X-move cmds have the same units. Same for Y-move cmds.
  447. //
  448. {
  449. DWORD dwMoveUnit;
  450. if (dwMoveUnit = DwCalcMoveUnit(pci, pcm, pdh->ptMaster.x,
  451. CM_OCD_XM_ABS, CM_OCD_XM_RELLEFT))
  452. VOut(pci, "*XMoveUnit: %d\r\n", dwMoveUnit);
  453. if (dwMoveUnit = DwCalcMoveUnit(pci, pcm, pdh->ptMaster.y,
  454. CM_OCD_YM_ABS, CM_OCD_YM_RELUP))
  455. VOut(pci, "*YMoveUnit: %d\r\n", dwMoveUnit);
  456. }
  457. //
  458. // dump commands in CURSORMOVE structure
  459. //
  460. if (BBuildCmdStr(pci, CMD_CM_XM_ABS, pcm->rgocd[CM_OCD_XM_ABS]))
  461. VOutputCmd(pci, "CmdXMoveAbsolute");
  462. if (BBuildCmdStr(pci, CMD_CM_XM_REL, pcm->rgocd[CM_OCD_XM_REL]))
  463. VOutputCmd(pci, "CmdXMoveRelRight");
  464. if (BBuildCmdStr(pci, CMD_CM_XM_RELLEFT, pcm->rgocd[CM_OCD_XM_RELLEFT]))
  465. VOutputCmd(pci, "CmdXMoveRelLeft");
  466. if ((pcm->fYMove & CM_YM_RES_DEPENDENT) &&
  467. (pcm->rgocd[CM_OCD_YM_ABS] != NOOCD ||
  468. pcm->rgocd[CM_OCD_YM_REL] != NOOCD ||
  469. pcm->rgocd[CM_OCD_YM_RELUP] != NOOCD ||
  470. pcm->rgocd[CM_OCD_YM_LINESPACING] != NOOCD))
  471. {
  472. pci->dwErrorCode |= ERR_CM_YM_RES_DEPENDENT;
  473. VOut(pci, "*%% Error: the above *YMoveUnit value is wrong. It should be dependent on the resolution. Correct it manually.\r\n");
  474. //
  475. // Create dependency on Resolution options by
  476. // looping through each option and feed the multiplication
  477. // factor (ptTextScale.y) for building the command string.
  478. //
  479. VOut(pci, "*switch: Resolution\r\n{\r\n");
  480. psIndex = DHOFFSET(pdh, pmd->rgoi[MD_OI_RESOLUTION]);
  481. wCount = 1;
  482. while (*psIndex)
  483. {
  484. pci->pres = (PGPCRESOLUTION)GetTableInfo(pdh, HE_RESOLUTION,
  485. *psIndex - 1);
  486. VOut(pci, " *case: Option%d\r\n {\r\n", wCount);
  487. if (BBuildCmdStr(pci, CMD_CM_YM_ABS, pcm->rgocd[CM_OCD_YM_ABS]))
  488. VOutputCmd2(pci, "CmdYMoveAbsolute"),
  489. eCmdsPresent |= Y_MOVE_ABS;
  490. if (BBuildCmdStr(pci, CMD_CM_YM_REL, pcm->rgocd[CM_OCD_YM_REL]))
  491. VOutputCmd2(pci, "CmdYMoveRelDown"),
  492. eCmdsPresent |= Y_MOVE_DOWN;
  493. if (BBuildCmdStr(pci, CMD_CM_YM_RELUP, pcm->rgocd[CM_OCD_YM_RELUP]))
  494. VOutputCmd2(pci, "CmdYMoveRelUp"),
  495. eCmdsPresent |= Y_MOVE_UP;
  496. if (BBuildCmdStr(pci, CMD_CM_YM_LINESPACING, pcm->rgocd[CM_OCD_YM_LINESPACING]))
  497. VOutputCmd2(pci, "CmdSetLineSpacing");
  498. VOut(pci, " }\r\n"); // close *case construct
  499. psIndex++;
  500. wCount++;
  501. }
  502. VOut(pci, "}\r\n"); // close *switch construct
  503. }
  504. else
  505. {
  506. if (BBuildCmdStr(pci, CMD_CM_YM_ABS, pcm->rgocd[CM_OCD_YM_ABS]))
  507. VOutputCmd(pci, "CmdYMoveAbsolute"),
  508. eCmdsPresent |= Y_MOVE_ABS;
  509. if (BBuildCmdStr(pci, CMD_CM_YM_REL, pcm->rgocd[CM_OCD_YM_REL]))
  510. VOutputCmd(pci, "CmdYMoveRelDown"),
  511. eCmdsPresent |= Y_MOVE_DOWN;
  512. if (BBuildCmdStr(pci, CMD_CM_YM_RELUP, pcm->rgocd[CM_OCD_YM_RELUP]))
  513. VOutputCmd(pci, "CmdYMoveRelUp"),
  514. eCmdsPresent |= Y_MOVE_UP;
  515. if (BBuildCmdStr(pci, CMD_CM_YM_LINESPACING, pcm->rgocd[CM_OCD_YM_LINESPACING]))
  516. VOutputCmd(pci, "CmdSetLineSpacing");
  517. }
  518. if (BBuildCmdStr(pci, CMD_CM_CR, pcm->rgocd[CM_OCD_CR]))
  519. VOutputCmd(pci, "CmdCR");
  520. if (BBuildCmdStr(pci, CMD_CM_LF, pcm->rgocd[CM_OCD_LF]))
  521. VOutputCmd(pci, "CmdLF");
  522. if (BBuildCmdStr(pci, CMD_CM_FF, pcm->rgocd[CM_OCD_FF]))
  523. VOutputCmd(pci, "CmdFF");
  524. if (BBuildCmdStr(pci, CMD_CM_BS, pcm->rgocd[CM_OCD_BS]))
  525. VOutputCmd(pci, "CmdBackSpace");
  526. if (BBuildCmdStr(pci, CMD_CM_UNI_DIR, pcm->rgocd[CM_OCD_UNI_DIR]))
  527. VOutputCmd(pci, "CmdUniDirectionOn");
  528. if (BBuildCmdStr(pci, CMD_CM_UNI_DIR_OFF, pcm->rgocd[CM_OCD_UNI_DIR_OFF]))
  529. VOutputCmd(pci, "CmdUniDirectionOff");
  530. if (BBuildCmdStr(pci, CMD_CM_PUSH_POS, pcm->rgocd[CM_OCD_PUSH_POS]))
  531. VOutputCmd(pci, "CmdPushCursor");
  532. if (BBuildCmdStr(pci, CMD_CM_POP_POS, pcm->rgocd[CM_OCD_POP_POS]))
  533. VOutputCmd(pci, "CmdPopCursor");
  534. if(!(eCmdsPresent & Y_MOVE_ABS) &&
  535. ((eCmdsPresent & eRelativeYCmds) != eRelativeYCmds))
  536. VOut(pci, "*%% Error: no Abs or Rel YMoveCommands found. Correct it manually.\r\n");
  537. }
  538. if ((pci->pmd->fText & TC_CR_90) &&
  539. BBuildCmdStr(pci, CMD_PC_PRINT_DIR, pci->ppc->rgocd[PC_OCD_PRN_DIRECTION]))
  540. VOutputCmd(pci, "CmdSetSimpleRotation");
  541. //
  542. // In GPC, information regarding *EjectPageWithFF is spread out
  543. // among PAPERSIZE and PAPERSOURCE structures. For almost all
  544. // printers, the real dependency is not so pervasive. For example,
  545. // on dot-matrix printers, only PAPERSOURCE really uses this bit.
  546. // On most page printers, FF is always used to eject page.
  547. // We check for the reality and generate *switch/*case constructs
  548. // only when really needed.
  549. //
  550. {
  551. DWORD i;
  552. BOOL bSizeSame, bSrcSame; // whether all options same
  553. bSizeSame = TRUE;
  554. for (i = 1; bSizeSame && i < pci->dwNumOfSize; i++)
  555. bSizeSame = bSizeSame &&
  556. (pci->ppiSize[i].bEjectFF == pci->ppiSize[0].bEjectFF);
  557. bSrcSame = TRUE;
  558. for (i = 1; bSrcSame && i < pci->dwNumOfSrc; i++)
  559. bSrcSame = bSrcSame &&
  560. (pci->ppiSrc[i].bEjectFF == pci->ppiSrc[0].bEjectFF);
  561. if ((bSizeSame && pci->ppiSize[0].bEjectFF) ||
  562. (bSrcSame && pci->ppiSrc[0].bEjectFF) )
  563. VOut(pci, "*EjectPageWithFF?: TRUE\r\n");
  564. else if ((bSizeSame && !pci->ppiSize[0].bEjectFF) &&
  565. (bSrcSame && !pci->ppiSrc[0].bEjectFF))
  566. VOut(pci, "*EjectPageWithFF?: FALSE\r\n");
  567. else if (bSizeSame && !pci->ppiSize[0].bEjectFF)
  568. VCreateEjectFFDependency(pci, FF_INPUTBIN, FALSE);
  569. else if (bSrcSame && !pci->ppiSize[0].bEjectFF)
  570. VCreateEjectFFDependency(pci, FF_PAPERSIZE, FALSE);
  571. else
  572. //
  573. // Have dependency on both PaperSize and InputBin.
  574. // Is this any sensible reason for this case? Assume not
  575. // for now until we find a minidriver that does.
  576. //
  577. VCreateEjectFFDependency(pci, FF_BOTH, FALSE);
  578. }
  579. //
  580. // Color attributes and commands are output in ColorMode options.
  581. //
  582. //
  583. // Raster Printing
  584. // Source: MD_OI_COMPRESSION, GPCRESOLUTION (RES_DM_GDI, RES_DM_LEFT_BOUND)
  585. // GPCRESOLUTION.fBlockOut, GPCRESOLUTION.fCursor (all flags),
  586. //
  587. // Rater Printing --- Raster Data Compression
  588. //
  589. {
  590. PCOMPRESSMODE pcmode;
  591. BOOL bDisableCmdDone = FALSE;
  592. psIndex = DHOFFSET(pdh, pmd->rgoi[MD_OI_COMPRESSION]);
  593. while (*psIndex != 0)
  594. {
  595. pcmode = (PCOMPRESSMODE)GetTableInfo(pdh, HE_COMPRESSION, *psIndex - 1);
  596. if (pcmode->iMode == CMP_ID_TIFF40 &&
  597. BBuildCmdStr(pci, CMD_CMP_TIFF, pcmode->rgocd[CMP_OCD_BEGIN]))
  598. VOutputCmd(pci, "CmdEnableTIFF4");
  599. else if (pcmode->iMode == CMP_ID_DELTAROW &&
  600. BBuildCmdStr(pci, CMD_CMP_DELTAROW, pcmode->rgocd[CMP_OCD_BEGIN]))
  601. VOutputCmd(pci, "CmdEnableDRC");
  602. else if (pcmode->iMode == CMP_ID_FE_RLE &&
  603. BBuildCmdStr(pci, CMD_CMP_FE_RLE, pcmode->rgocd[CMP_OCD_BEGIN]))
  604. VOutputCmd(pci, "CmdEnableFE_RLE");
  605. if (!bDisableCmdDone &&
  606. BBuildCmdStr(pci, CMD_CMP_NONE, pcmode->rgocd[CMP_OCD_END]))
  607. {
  608. VOutputCmd(pci, "CmdDisableCompression");
  609. bDisableCmdDone = TRUE;
  610. }
  611. psIndex++;
  612. }
  613. }
  614. //
  615. // Raster Printing --- Raster Data Emission
  616. //
  617. if (pres)
  618. {
  619. VOut(pci, "*OutputDataFormat: %s\r\n",
  620. (pres->fDump & RES_DM_GDI) ? "H_BYTE" : "V_BYTE");
  621. VOut(pci, "*OptimizeLeftBound?: %s\r\n",
  622. (pres->fDump & RES_DM_LEFT_BOUND) ? "TRUE" : "FALSE");
  623. VOut(pci, "*CursorXAfterSendBlockData: %s\r\n",
  624. (pres->fCursor & RES_CUR_X_POS_ORG)? "AT_GRXDATA_ORIGIN" :
  625. ((pres->fCursor & RES_CUR_X_POS_AT_0)? "AT_CURSOR_X_ORIGIN" :
  626. "AT_GRXDATA_END"));
  627. VOut(pci, "*CursorYAfterSendBlockData: %s\r\n",
  628. (pres->fCursor & RES_CUR_Y_POS_AUTO)? "AUTO_INCREMENT" : "NO_MOVE");
  629. }
  630. if (pmd->fGeneral & MD_NO_ADJACENT)
  631. pci->dwErrorCode |= ERR_MD_NO_ADJACENT;
  632. //
  633. // Device Fonts.
  634. // Source: MODELDATA, MD_OI_PORT_FONTS and MD_OI_LAND_FONTS.
  635. //
  636. if (pmd->sLookAhead > 0)
  637. VOut(pci, "*LookAheadRegion: %d\r\n", pmd->sLookAhead);
  638. #if defined(DEVSTUDIO) // Must map this ID to account for multi PFM-> UFM
  639. vMapFontList(&pmd->sDefaultFontID, 1, pci);
  640. #endif
  641. if (pmd->sDefaultFontID > 0)
  642. VOut(pci, "*DefaultFont: %d\r\n", pmd->sDefaultFontID);
  643. if (pmd->sDefaultCTT >= 0)
  644. VOut(pci, "*DefaultCTT: %d\r\n", pmd->sDefaultCTT);
  645. else
  646. VOut(pci, "*DefaultCTT: -%d\r\n", -pmd->sDefaultCTT);
  647. if (pmd->sMaxFontsPage > 0)
  648. VOut(pci, "*MaxFontUsePerPage: %d\r\n", pmd->sMaxFontsPage);
  649. if (pmd->fGeneral & MD_ALIGN_BASELINE)
  650. VOut(pci, "*CharPosition: BASELINE\r\n");
  651. {
  652. PWORD pwPFonts, pwLFonts;
  653. pwPFonts = (PWORD)((PBYTE)pdh + pdh->loHeap + pmd->rgoi[MD_OI_PORT_FONTS]);
  654. pwLFonts = (PWORD)((PBYTE)pdh + pdh->loHeap + pmd->rgoi[MD_OI_LAND_FONTS]);
  655. if (*pwPFonts || *pwLFonts)
  656. {
  657. if (pmd->fGeneral & MD_ROTATE_FONT_ABLE)
  658. {
  659. VOut(pci, "*DeviceFonts: ");
  660. VOutputFontList(pci, pwPFonts, pwLFonts);
  661. }
  662. else
  663. {
  664. VOut(pci, "*switch: Orientation\r\n{\r\n");
  665. VOut(pci, " *case: PORTRAIT\r\n {\r\n");
  666. VOut(pci, " *DeviceFonts: ");
  667. VOutputFontList(pci, pwPFonts, NULL);
  668. VOut(pci, " }\r\n");
  669. if (pmd->fGeneral & MD_LANDSCAPE_RT90)
  670. VOut(pci, " *case: LANDSCAPE_CC90\r\n {\r\n");
  671. else
  672. VOut(pci, " *case: LANDSCAPE_CC270\r\n {\r\n");
  673. VOut(pci, " *DeviceFonts: ");
  674. VOutputFontList(pci, NULL, pwLFonts);
  675. VOut(pci, " }\r\n}\r\n");
  676. }
  677. }
  678. }
  679. //
  680. // Built-in Font Cartridges.
  681. // Source: MD_OI_FONTCART
  682. //
  683. {
  684. PGPCFONTCART pfc;
  685. psIndex = DHOFFSET(pdh, pmd->rgoi[MD_OI_FONTCART]);
  686. wCount = 1;
  687. while (*psIndex != 0)
  688. {
  689. pfc = (PGPCFONTCART)GetTableInfo(pdh, HE_FONTCART, *psIndex - 1);
  690. VOut(pci, "*FontCartridge: FC%d\r\n{\r\n", wCount);
  691. VOut(pci, " *rcCartridgeNameID: %d\r\n", pfc->sCartNameID);
  692. if (pmd->fGeneral & MD_ROTATE_FONT_ABLE)
  693. {
  694. VOut(pci, " *Fonts: ");
  695. VOutputFontList(pci,
  696. (PWORD)((PBYTE)pdh + pdh->loHeap + pfc->orgwPFM[FC_ORGW_PORT]),
  697. (PWORD)((PBYTE)pdh + pdh->loHeap + pfc->orgwPFM[FC_ORGW_LAND]));
  698. }
  699. else
  700. {
  701. VOut(pci, " *PortraitFonts: ");
  702. VOutputFontList(pci,
  703. (PWORD)((PBYTE)pdh + pdh->loHeap + pfc->orgwPFM[FC_ORGW_PORT]),
  704. NULL);
  705. VOut(pci, " *LandscapeFonts: ");
  706. VOutputFontList(pci,
  707. NULL,
  708. (PWORD)((PBYTE)pdh + pdh->loHeap + pfc->orgwPFM[FC_ORGW_LAND]));
  709. }
  710. VOut(pci, "}\r\n"); // close *FontCartridge
  711. psIndex++;
  712. wCount++;
  713. }
  714. }
  715. //
  716. // Font Downloading
  717. // Source: MODELDATA, DOWNLOADINFO.
  718. //
  719. if (pmd->rgi[MD_I_DOWNLOADINFO] != NOT_USED)
  720. {
  721. PDOWNLOADINFO pdi;
  722. pdi = (PDOWNLOADINFO)GetTableInfo(pdh, HE_DOWNLOADINFO,
  723. pmd->rgi[MD_I_DOWNLOADINFO]);
  724. VOut(pci, "*MinFontID: %d\r\n*MaxFontID: %d\r\n", pdi->wIDMin, pdi->wIDMax);
  725. if (pdi->sMaxFontCount != -1)
  726. VOut(pci, "*MaxNumDownFonts: %d\r\n", pdi->sMaxFontCount);
  727. if (pdi->rgocd[DLI_OCD_SET_SECOND_FONT_ID] != NOOCD ||
  728. pdi->rgocd[DLI_OCD_SELECT_SECOND_FONT_ID] != NOOCD)
  729. pci->dwErrorCode |= ERR_HAS_SECOND_FONT_ID_CMDS;
  730. if (pdi->fFormat & DLI_FMT_CAPSL)
  731. pci->dwErrorCode |= ERR_DLI_FMT_CAPSL;
  732. if (pdi->fFormat & DLI_FMT_PPDS)
  733. pci->dwErrorCode |= ERR_DLI_FMT_PPDS;
  734. if (pdi->fGeneral & DLI_GEN_DLPAGE)
  735. pci->dwErrorCode |= ERR_DLI_GEN_DLPAGE;
  736. if (pdi->fGeneral & DLI_GEN_7BIT_CHARSET)
  737. pci->dwErrorCode |= ERR_DLI_GEN_7BIT_CHARSET;
  738. #if 0
  739. // delete this entry --- assume always TRUE since the driver
  740. // doesn't even have code to handle non-incremental case.
  741. VOut(pci, "*IncrementalDownload?: %s\r\n",
  742. (pdi->fFormat & DLI_FMT_INCREMENT)? "TRUE" : "FALSE");
  743. #endif
  744. if (pdi->fFormat & DLI_FMT_CALLBACK)
  745. VOut(pci, "*FontFormat: OEM_CALLBACK\r\n");
  746. else
  747. {
  748. if (pdi->fFormat & DLI_FMT_OUTLINE)
  749. {
  750. //
  751. // check for potential Resolution dependency
  752. //
  753. if ((pci->dwMode & FM_RES_DM_DOWNLOAD_OUTLINE) &&
  754. (pci->dwMode & FM_NO_RES_DM_DOWNLOAD_OUTLINE))
  755. {
  756. VOut(pci, "*switch: Resolution\r\n{\r\n");
  757. psIndex = DHOFFSET(pdh, pmd->rgoi[MD_OI_RESOLUTION]);
  758. wCount = 1;
  759. while (*psIndex)
  760. {
  761. pres = (PGPCRESOLUTION)GetTableInfo(pdh, HE_RESOLUTION,
  762. *psIndex - 1);
  763. VOut(pci, " *case: Option%d\r\n {\r\n", wCount);
  764. VOut(pci, " *FontFormat: %s\r\n",
  765. (pres->fDump & RES_DM_DOWNLOAD_OUTLINE) ?
  766. "HPPCL_OUTLINE" : "HPPCL_RES");
  767. VOut(pci, " }\r\n"); // close *case construct
  768. psIndex++;
  769. wCount++;
  770. }
  771. VOut(pci, "}\r\n");
  772. }
  773. else if (pci->dwMode & FM_RES_DM_DOWNLOAD_OUTLINE)
  774. VOut(pci, "*FontFormat: HPPCL_OUTLINE\r\n");
  775. else
  776. //
  777. // assume all HPPCL_OUTLINE capable printers support
  778. // resolution specific bitmap download format.
  779. //
  780. VOut(pci, "*FontFormat: HPPCL_RES\r\n");
  781. }
  782. else if (pdi->fFormat & DLI_FMT_RES_SPECIFIED)
  783. VOut(pci, "*FontFormat: HPPCL_RES\r\n");
  784. else if (pdi->fFormat & DLI_FMT_PCL)
  785. VOut(pci, "*FontFormat: HPPCL\r\n");
  786. }
  787. if (BBuildCmdStr(pci, CMD_SET_FONT_ID, pdi->rgocd[DLI_OCD_SET_FONT_ID]))
  788. VOutputCmd(pci, "CmdSetFontID");
  789. if (BBuildCmdStr(pci, CMD_SELECT_FONT_ID, pdi->rgocd[DLI_OCD_SELECT_FONT_ID]))
  790. VOutputCmd(pci, "CmdSelectFontID");
  791. if (BBuildCmdStr(pci, CMD_SET_CHAR_CODE, pdi->rgocd[DLI_OCD_SET_CHAR_CODE]))
  792. VOutputCmd(pci, "CmdSetCharCode");
  793. }
  794. //
  795. // Font Simulation
  796. // Source: FONTSIMULATION.
  797. //
  798. if (pmd->rgi[MD_I_FONTSIM] != NOT_USED)
  799. {
  800. PFONTSIMULATION pfs;
  801. pfs = (PFONTSIMULATION)GetTableInfo(pdh, HE_FONTSIM, pmd->rgi[MD_I_FONTSIM]);
  802. if (pmd->fText & TC_EA_DOUBLE)
  803. {
  804. if (BBuildCmdStr(pci, CMD_FS_BOLD_ON, pfs->rgocd[FS_OCD_BOLD_ON]))
  805. VOutputCmd(pci, "CmdBoldOn");
  806. if (BBuildCmdStr(pci, CMD_FS_BOLD_OFF, pfs->rgocd[FS_OCD_BOLD_OFF]))
  807. VOutputCmd(pci, "CmdBoldOff");
  808. }
  809. if (pmd->fText & TC_IA_ABLE)
  810. {
  811. if (BBuildCmdStr(pci, CMD_FS_ITALIC_ON, pfs->rgocd[FS_OCD_ITALIC_ON]))
  812. VOutputCmd(pci, "CmdItalicOn");
  813. if (BBuildCmdStr(pci, CMD_FS_ITALIC_OFF, pfs->rgocd[FS_OCD_ITALIC_OFF]))
  814. VOutputCmd(pci, "CmdItalicOff");
  815. }
  816. if (pmd->fText & TC_UA_ABLE)
  817. {
  818. if (BBuildCmdStr(pci, CMD_FS_UNDERLINE_ON, pfs->rgocd[FS_OCD_UNDERLINE_ON]))
  819. VOutputCmd(pci, "CmdUnderlineOn");
  820. if (BBuildCmdStr(pci, CMD_FS_UNDERLINE_OFF, pfs->rgocd[FS_OCD_UNDERLINE_OFF]))
  821. VOutputCmd(pci, "CmdUnderlineOff");
  822. }
  823. if (pmd->fText & TC_SO_ABLE)
  824. {
  825. if (BBuildCmdStr(pci, CMD_FS_STRIKETHRU_ON, pfs->rgocd[FS_OCD_STRIKETHRU_ON]))
  826. VOutputCmd(pci, "CmdStrikeThruOn");
  827. if (BBuildCmdStr(pci, CMD_FS_STRIKETHRU_OFF, pfs->rgocd[FS_OCD_STRIKETHRU_OFF]))
  828. VOutputCmd(pci, "CmdStrikeThruOff");
  829. }
  830. if (pmd->fGeneral & MD_WHITE_TEXT)
  831. {
  832. if (BBuildCmdStr(pci, CMD_FS_WHITE_TEXT_ON, pfs->rgocd[FS_OCD_WHITE_TEXT_ON]))
  833. VOutputCmd(pci, "CmdWhiteTextOn");
  834. if (BBuildCmdStr(pci, CMD_FS_WHITE_TEXT_OFF, pfs->rgocd[FS_OCD_WHITE_TEXT_OFF]))
  835. VOutputCmd(pci, "CmdWhiteTextOff");
  836. }
  837. if (pfs->rgocd[FS_OCD_SINGLE_BYTE] != NOOCD &&
  838. pfs->rgocd[FS_OCD_DOUBLE_BYTE] != NOOCD)
  839. {
  840. if (BBuildCmdStr(pci, CMD_FS_SINGLE_BYTE, pfs->rgocd[FS_OCD_SINGLE_BYTE]))
  841. VOutputCmd(pci, "CmdSelectSingleByteMode");
  842. if (BBuildCmdStr(pci, CMD_FS_DOUBLE_BYTE, pfs->rgocd[FS_OCD_DOUBLE_BYTE]))
  843. VOutputCmd(pci, "CmdSelectDoubleByteMode");
  844. }
  845. if (pfs->rgocd[FS_OCD_VERT_ON] != NOOCD &&
  846. pfs->rgocd[FS_OCD_VERT_OFF] != NOOCD)
  847. {
  848. if (BBuildCmdStr(pci, CMD_FS_VERT_ON, pfs->rgocd[FS_OCD_VERT_ON]))
  849. VOutputCmd(pci, "CmdVerticalPrintingOn");
  850. if (BBuildCmdStr(pci, CMD_FS_VERT_OFF, pfs->rgocd[FS_OCD_VERT_OFF]))
  851. VOutputCmd(pci, "CmdVerticalPrintingOff");
  852. }
  853. }
  854. //
  855. // Rectangle Area Fill entries
  856. //
  857. if (pmd->rgi[MD_I_RECTFILL] != NOT_USED)
  858. {
  859. PRECTFILL prf;
  860. prf = (PRECTFILL)GetTableInfo(pdh, HE_RECTFILL, pmd->rgi[MD_I_RECTFILL]);
  861. if (prf->fGeneral & RF_MIN_IS_WHITE)
  862. pci->dwErrorCode |= ERR_RF_MIN_IS_WHITE;
  863. if (prf->fGeneral & RF_CUR_X_END)
  864. VOut(pci, "*CursorXAfterRectFill: AT_RECT_X_END\r\n");
  865. if (prf->fGeneral & RF_CUR_Y_END)
  866. VOut(pci, "*CursorYAfterRectFill: AT_RECT_Y_END\r\n");
  867. VOut(pci, "*MinGrayFill: %d\r\n", prf->wMinGray);
  868. VOut(pci, "*MaxGrayFill: %d\r\n", prf->wMaxGray);
  869. if (BBuildCmdStr(pci, CMD_RF_X_SIZE, prf->rgocd[RF_OCD_X_SIZE]))
  870. VOutputCmd(pci, "CmdSetRectWidth");
  871. if (BBuildCmdStr(pci, CMD_RF_Y_SIZE, prf->rgocd[RF_OCD_Y_SIZE]))
  872. VOutputCmd(pci, "CmdSetRectHeight");
  873. if (BBuildCmdStr(pci, CMD_RF_GRAY_FILL, prf->rgocd[RF_OCD_GRAY_FILL]))
  874. VOutputCmd(pci, "CmdRectGrayFill");
  875. if (BBuildCmdStr(pci, CMD_RF_WHITE_FILL, prf->rgocd[RF_OCD_WHITE_FILL]))
  876. VOutputCmd(pci, "CmdRectWhiteFill");
  877. }
  878. }