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.

726 lines
26 KiB

  1. /*++
  2. Copyright (c) 1990-2003 Microsoft Corporation
  3. Module Name:
  4. plotform.c
  5. Abstract:
  6. This module contains functions to set the correct HPGL/2 plotter
  7. coordinate system
  8. Author:
  9. 30-Nov-1993 Tue 20:31:28 created
  10. [Environment:]
  11. GDI Device Driver - Plotter.
  12. [Notes:]
  13. Revision History:
  14. --*/
  15. #include "precomp.h"
  16. #pragma hdrstop
  17. #define DBG_PLOTFILENAME DbgPlotForm
  18. #define DBG_PLOTFORM 0x00000001
  19. #define DBG_FORMSIZE 0x00000002
  20. #define DBG_INTERNAL_ROT 0x00000004
  21. #define DBG_PF 0x00000008
  22. DEFINE_DBGVAR(0);
  23. #if DBG
  24. LPSTR pBmpRotMode[] = { "----- NONE -----",
  25. "BMP_ROT_RIGHT_90" };
  26. #endif
  27. BOOL
  28. SetPlotForm(
  29. PPLOTFORM pPlotForm,
  30. PPLOTGPC pPlotGPC,
  31. PPAPERINFO pCurPaper,
  32. PFORMSIZE pCurForm,
  33. PPLOTDEVMODE pPlotDM,
  34. PPPDATA pPPData
  35. )
  36. /*++
  37. Routine Description:
  38. This function computes the current FORM based on the printed margin. Auto
  39. rotation, landscape and other attributes are taken into account. The
  40. result is put into a PLOTFORM data structure located in our PDEV. This
  41. information is used to report data to GDI, as well as compute the HPGL2
  42. parameters for sizing the target surface.
  43. Arguments:
  44. pPlotForm - Pointer to the PLOTFROM data structure which will be updated
  45. pPlotGPC - Pointer to the PLOTGPC data structure
  46. pCurPaper - Pointer to the PAPERINFO for the paper loaded
  47. pCurForm - Pointer to the FORMSIZE for the requested form
  48. pPlotDM - Pointer to the validated PLOTDEVMODE data structure
  49. pPPData - Pointer to the PPDATA structure
  50. Return Value:
  51. TRUE if sucessful, FALSE if failed
  52. Author:
  53. 29-Nov-1993 Mon 13:58:09 created
  54. 17-Dec-1993 Fri 23:09:38 updated
  55. Re-write so that we will look at CurPaper rather than pCurForm when
  56. setting the PSSize, p1/p2 stuff, it also rotate the pCurPaper if
  57. GPC/user said that the paper should loaded side way
  58. 20-Dec-1993 Mon 12:59:38 updated
  59. correct PFF_xxxx flag setting so we always rotate the bitmap to the
  60. left 90 degree
  61. 23-Dec-1993 Thu 20:35:57 updated
  62. Fixed roll paper clipping problem, change behavior, if we have roll
  63. paper installed then the it will make hard clip limit as big as user
  64. specified form size.
  65. 24-Dec-1993 Fri 12:20:02 updated
  66. Re-plot again, this is become really paint just try to understand what
  67. HP plotter design problems
  68. 06-Jan-1994 Thu 00:22:45 updated
  69. Update SPLTOPLOTUNITS() macro
  70. 07-Feb-1996 Wed 15:46:06 updated
  71. Change it so that it always using the current devmode form and then
  72. clip it to the device size.
  73. Revision History:
  74. This assumes that the user inserted the paper with width of the form
  75. first,
  76. LEGEND:
  77. + = Original paper corners
  78. * = Original plotter origin and its X/Y coordinate
  79. @ = the rotated origin using 'RO' command, intended to rotate the X/Y
  80. axis to the correct orientation for the window system
  81. # = Final plotter origin and its X/Y coordinate
  82. p1,p2 = final P1/P2 which will be used by the plotter driver
  83. cx,cy = Original paper width/height
  84. The following explaines how HPGL/2 loads the paper/form and
  85. assigns the default coordinate system to it, it also shows which way the
  86. paper is moving, the illustration to the right is when we need to
  87. rotate the printing direction and coordinate system when user selects
  88. the non-conforming X/Y coordinate system as opposed to the HPGL/2 default.
  89. =======================================================================
  90. LENGTH >= WIDTH (CY >= CX) case
  91. =======================================================================
  92. Portrait Paper Rotate Change Origin
  93. Default Left 90 Negative Y
  94. p2 cx cx p1 cx
  95. +---------+ +---------+ +---------+
  96. | | | <------@| | |
  97. | | | X || | ^|
  98. | | ^| | | || | | ||
  99. c| M || RO90 c| M || IP c| M ||
  100. y| o || =====> y| o || ====> y| o ||
  101. | v || | v Y|| | v Y||
  102. | e X|| | e || | e ||
  103. | | || | | || | | ||
  104. | V || | V || | V ||
  105. | Y || | V| | X ||
  106. | <------*| | | | <------#|
  107. +---------+ +---------+ +---------+
  108. p1 p2
  109. |
  110. IP|
  111. |
  112. V
  113. Change Origin
  114. Negative X
  115. cx
  116. +---------+
  117. | <------#|
  118. | Y ||
  119. | | ||
  120. c| M ||
  121. y| o ||
  122. | v X||
  123. | e ||
  124. | | ||
  125. | V ||
  126. | V|
  127. | |
  128. +---------+
  129. =======================================================================
  130. LENGTH < WIDTH (CY < CX) case
  131. =======================================================================
  132. Landscape Rotate Left 90 Change Origin
  133. Paper Default Negative X
  134. cx p2 p2 cx cx
  135. +---------------+ +---------------+ +---------------+
  136. | | | | | <--------#|
  137. |^ | | | | ^| | | Y ||
  138. c|| M | c| M || c| M ||
  139. y|| o | y| o || y| o ||
  140. || v | RO90 | v X|| IP | v X||
  141. ||Y e | =====> | e || ====> | e ||
  142. || | | | | || | | ||
  143. || X V | | V Y || | V V|
  144. |*--------> | | <--------@| | |
  145. +---------------+ +---------------+ +---------------+
  146. p1 p1
  147. |
  148. IP|
  149. |
  150. V
  151. Change Origin
  152. Negative X
  153. cx
  154. +---------------+
  155. | |
  156. | | ^|
  157. c| M ||
  158. y| o ||
  159. | v Y||
  160. | e ||
  161. | | ||
  162. | V X ||
  163. | <--------#|
  164. +---------------+
  165. --*/
  166. {
  167. PLOTFORM PF;
  168. FORMSIZE DevForm;
  169. FORMSIZE ReqForm;
  170. RECTL rclDev;
  171. RECTL rclLog;
  172. SIZEL DeviceSize;
  173. LONG lTemp;
  174. BOOL DoRotate;
  175. PLOTDBG(DBG_PF, ("\n************* SetPlotForm *************\n"));
  176. //
  177. // We default using DeviceSize to check against the requested paper
  178. //
  179. DeviceSize = pPlotGPC->DeviceSize;
  180. rclDev = pPlotGPC->DeviceMargin;
  181. DoRotate = FALSE;
  182. //
  183. // Assume we using the current form from the devmode
  184. //
  185. DevForm =
  186. ReqForm = *pCurForm;
  187. PLOTDBG(DBG_PF, ("DeviceSize: %ld x %ld, L=%ld, T=%ld, R=%ld, B=%ld",
  188. DeviceSize.cx, DeviceSize.cy,
  189. rclDev.left, rclDev.top, rclDev.right, rclDev.bottom));
  190. PLOTDBG(DBG_PF, ("ReqForm: <%s>",
  191. pPlotDM->dm.dmFormName, ReqForm.Size.cx, ReqForm.Size.cy));
  192. PLOTDBG(DBG_PF, ("ReqForm: %ld x %ld, L=%ld, T=%ld, R=%ld, B=%ld [%ld x %ld]",
  193. ReqForm.Size.cx, ReqForm.Size.cy,
  194. ReqForm.ImageArea.left, ReqForm.ImageArea.top,
  195. ReqForm.ImageArea.right, ReqForm.ImageArea.bottom,
  196. ReqForm.ImageArea.right - ReqForm.ImageArea.left,
  197. ReqForm.ImageArea.bottom - ReqForm.ImageArea.top));
  198. if (pCurPaper->Size.cy == 0) {
  199. //
  200. // ROLL PAPER CASE
  201. //
  202. // If we have roll paper installed, we must determine the projection
  203. // of the current form on the roll paper in order to get the size
  204. // to come out correctly.
  205. //
  206. DevForm.Size.cx = pCurPaper->Size.cx;
  207. DevForm.Size.cy = DeviceSize.cy;
  208. PLOTDBG(DBG_PF,(">>ROLL FEED<< RollPaper = %ld x %ld, <RESET rclDev to ALL ZEROs>",
  209. DevForm.Size.cx, DevForm.Size.cy));
  210. } else if ((pPlotGPC->Flags & PLOTF_PAPERTRAY) &&
  211. ((DevForm.Size.cx == DeviceSize.cx) ||
  212. (DevForm.Size.cy == DeviceSize.cx))) {
  213. //
  214. // PAPER TRAY CASE: We need to make the DeviceSize equal to the DevForm
  215. // so that the margin will be correctly computed
  216. //
  217. DoRotate = (BOOL)(DevForm.Size.cx != DeviceSize.cx);
  218. PLOTDBG(DBG_PF,(">>PAPER TRAY<< Rotate Paper = %hs",
  219. (DoRotate) ? "YES" : "NO"));
  220. } else {
  221. PLOTASSERT(0, "SetPlotForm: Not supposed MANUAL feed the PAPER TRAY type PLOTTER",
  222. !(pPlotGPC->Flags & PLOTF_PAPERTRAY), pPlotGPC->Flags);
  223. PLOTDBG(DBG_PF,(">>MANUAL FEED<<"));
  224. //
  225. // MANUAL FEED CASE, this is the way paper is physically loaded, only
  226. // problem is if the paper is smaller than device can handle then we
  227. // really don't know where they inserted the paper.
  228. //
  229. DoRotate = (BOOL)(!(pPPData->Flags & PPF_MANUAL_FEED_CX));
  230. PLOTDBG(DBG_PF,("The MANUAL FEED paper Inserted %hs side first.",
  231. (DoRotate) ? "Length CY" : "Width CX"));
  232. }
  233. if (DoRotate) {
  234. SWAP(DevForm.Size.cx, DevForm.Size.cy, lTemp);
  235. PLOTDBG(DBG_PF, ("### Rotated DevForm to %ld x %ld ###",
  236. DevForm.Size.cx, DevForm.Size.cy));
  237. }
  238. //
  239. // Make sure largest requested form can be installed on the plotter
  240. //
  241. if (DevForm.Size.cx > DeviceSize.cx) {
  242. PLOTDBG(DBG_PF, ("WIDTH: DevForm (%ld) > DeviceSize (%ld). CORRECT IT",
  243. DevForm.Size.cx, DeviceSize.cx));
  244. DevForm.Size.cx = DeviceSize.cx;
  245. }
  246. if (DevForm.Size.cy > DeviceSize.cy) {
  247. PLOTDBG(DBG_PF, ("HEIGHT: DevForm (%ld) > DeviceSize (%ld). CORRECT IT",
  248. DevForm.Size.cy, DeviceSize.cy));
  249. DevForm.Size.cy = DeviceSize.cy;
  250. }
  251. //
  252. // Figure out how to fit this requested form onto loaded device form
  253. //
  254. DoRotate = FALSE;
  255. if ((DevForm.Size.cx >= ReqForm.Size.cx) &&
  256. (DevForm.Size.cy >= ReqForm.Size.cy)) {
  257. //
  258. // Can print without doing any rotation, but check for paper saver,
  259. // the paper saver is only possible if:
  260. //
  261. // 1) Is a Roll paper,
  262. // 2) User approves
  263. // 3) ReqForm length > width
  264. // 4) DevForm width >= ReqForm length
  265. //
  266. if ((pCurPaper->Size.cy == 0) &&
  267. (pPPData->Flags & PPF_AUTO_ROTATE) &&
  268. (ReqForm.Size.cy > ReqForm.Size.cx) &&
  269. (DevForm.Size.cx >= ReqForm.Size.cy)) {
  270. PLOTDBG(DBG_PF, ("ROLL PAPER SAVER: Doing AUTO_ROTATE"));
  271. DoRotate = !DoRotate;
  272. }
  273. } else if ((DevForm.Size.cx >= ReqForm.Size.cy) &&
  274. (DevForm.Size.cy >= ReqForm.Size.cx)) {
  275. //
  276. // Can print but we have to rotate the form ourselves
  277. //
  278. PLOTDBG(DBG_PF, ("INTERNAL ROTATE to fit Requseted FROM into device"));
  279. DoRotate = !DoRotate;
  280. } else {
  281. //
  282. // CANNOT print the requested form, so clip the form requested
  283. //
  284. PLOTDBG(DBG_PF, (">>>>> ReqForm is TOO BIG to FIT, Need to CLIP IT <<<<<"));
  285. ReqForm.Size = DevForm.Size;
  286. }
  287. if (DoRotate) {
  288. DoRotate = (BOOL)(pPlotDM->dm.dmOrientation != DMORIENT_LANDSCAPE);
  289. //
  290. // If we need to rotate one more time back to the same position for
  291. // the logical paper size then we must rotate to the left first, this
  292. // is because ALL our ORIGIN x,y are either at the front of the plotter
  293. // or at the front panel side of the plotter
  294. //
  295. RotatePaper(&(ReqForm.Size),
  296. &(ReqForm.ImageArea),
  297. (DoRotate) ? RM_L90 : RM_R90);
  298. PLOTDBG(DBG_PF, ("INTERNAL Rotated ReqForm: %ld x %ld, L=%ld, T=%ld, R=%ld, B=%ld [%ld x %ld]",
  299. ReqForm.Size.cx, ReqForm.Size.cy,
  300. ReqForm.ImageArea.left, ReqForm.ImageArea.top,
  301. ReqForm.ImageArea.right, ReqForm.ImageArea.bottom,
  302. ReqForm.ImageArea.right - ReqForm.ImageArea.left,
  303. ReqForm.ImageArea.bottom - ReqForm.ImageArea.top));
  304. } else {
  305. DoRotate = (BOOL)(pPlotDM->dm.dmOrientation == DMORIENT_LANDSCAPE);
  306. }
  307. //
  308. // Now the ReqForm is guaranteed to fit into the device paper. Find out how
  309. // it fits into the printable area and set the hardware margins appropriately.
  310. //
  311. DevForm.Size = ReqForm.Size;
  312. DevForm.ImageArea.left = rclDev.left;
  313. DevForm.ImageArea.top = rclDev.top;
  314. DevForm.ImageArea.right = DevForm.Size.cx - rclDev.right;
  315. DevForm.ImageArea.bottom = DevForm.Size.cy - rclDev.bottom;
  316. //
  317. // Intersect the requested form imageable area with the DevForm imageable area
  318. //
  319. IntersectRECTL(&(ReqForm.ImageArea), &(DevForm.ImageArea));
  320. //
  321. // Now figure out the offset from the logical margin to the physical margin
  322. //
  323. rclLog.left = ReqForm.ImageArea.left - DevForm.ImageArea.left;
  324. rclLog.top = ReqForm.ImageArea.top - DevForm.ImageArea.top;
  325. rclLog.right = DevForm.ImageArea.right - ReqForm.ImageArea.right;
  326. rclLog.bottom = DevForm.ImageArea.bottom - ReqForm.ImageArea.bottom;
  327. //
  328. // Rotate the requested form if necessary
  329. //
  330. if (DoRotate) {
  331. RotatePaper(&(ReqForm.Size), &(ReqForm.ImageArea), RM_R90);
  332. //
  333. // Now we can pick the right margin/corner for the rotation
  334. //
  335. // cx Rotate Left 90 Rotate Right 90
  336. // +-------+
  337. // | T | cy cy
  338. // | | +------------+ +------------+
  339. // c| | | R | | L |
  340. // y| | c| | c| |
  341. // |L R| x| | x| |
  342. // | | |T B| |B T|
  343. // | | | | | |
  344. // | | | L | | R |
  345. // | B | +------------+ +------------+
  346. // +-------+
  347. //
  348. PLOTDBG(DBG_PF, ("ROTATED RIGHT ReqForm: %ld x %ld, L=%ld, T=%ld, R=%ld, B=%ld [%ld x %ld]",
  349. ReqForm.Size.cx, ReqForm.Size.cy,
  350. ReqForm.ImageArea.left, ReqForm.ImageArea.top,
  351. ReqForm.ImageArea.right, ReqForm.ImageArea.bottom,
  352. ReqForm.ImageArea.right - ReqForm.ImageArea.left,
  353. ReqForm.ImageArea.bottom - ReqForm.ImageArea.top));
  354. }
  355. PLOTDBG(DBG_PF, ("FINAL DevForm: %ld x %ld, L=%ld, T=%ld, R=%ld, B=%ld [%ld x %ld]",
  356. DevForm.Size.cx, DevForm.Size.cy,
  357. DevForm.ImageArea.left, DevForm.ImageArea.top,
  358. DevForm.ImageArea.right, DevForm.ImageArea.bottom,
  359. DevForm.ImageArea.right - DevForm.ImageArea.left,
  360. DevForm.ImageArea.bottom - DevForm.ImageArea.top));
  361. PLOTDBG(DBG_PF, ("FINAL ReqForm: %ld x %ld, L=%ld, T=%ld, R=%ld, B=%ld [%ld x %ld]",
  362. ReqForm.Size.cx, ReqForm.Size.cy,
  363. ReqForm.ImageArea.left, ReqForm.ImageArea.top,
  364. ReqForm.ImageArea.right, ReqForm.ImageArea.bottom,
  365. ReqForm.ImageArea.right - ReqForm.ImageArea.left,
  366. ReqForm.ImageArea.bottom - ReqForm.ImageArea.top));
  367. PLOTDBG(DBG_PF, ("rclLog: L=%ld, T=%ld, R=%ld, B=%ld",
  368. rclLog.left, rclLog.top, rclLog.right, rclLog.bottom));
  369. //
  370. // Set fields in PLOTFORM
  371. //
  372. PF.Flags = 0;
  373. PF.BmpRotMode = BMP_ROT_NONE;
  374. PF.NotUsed = 0;
  375. PF.PlotSize.cx = DevForm.ImageArea.right - DevForm.ImageArea.left;
  376. PF.PlotSize.cy = DevForm.ImageArea.bottom - DevForm.ImageArea.top;
  377. PF.PhyOrg.x = ReqForm.ImageArea.left;
  378. PF.PhyOrg.y = ReqForm.ImageArea.top;
  379. PF.LogSize = ReqForm.Size;
  380. PF.LogExt.cx = ReqForm.ImageArea.right - ReqForm.ImageArea.left;
  381. PF.LogExt.cy = ReqForm.ImageArea.bottom - ReqForm.ImageArea.top;
  382. PF.BmpOffset.x = rclLog.left;
  383. PF.BmpOffset.y = rclLog.top;
  384. if (PF.PlotSize.cy >= PF.PlotSize.cx) {
  385. PLOTDBG(DBG_FORMSIZE,(">>>>> Plot SIze: CY >= CX (%ld: VERTICAL%hs) <<<<<",
  386. (DoRotate) ? 1 : 2,
  387. (DoRotate) ? " + ROTATE" : ""));
  388. //
  389. // The Standard HPGL/2 coordinate Y direction in in reverse, the scale
  390. // is from Max Y to 0.
  391. //
  392. if (DoRotate) {
  393. //
  394. // Portrait Paper Scale Coord X
  395. // Default Negative X
  396. //
  397. // p2 cx cx
  398. // +---------+ +---------+
  399. // | | | <------#|
  400. // | | | Y ||
  401. // | | ^| | | ||
  402. // c| M || c| M ||
  403. // y| o || ====> y| o ||
  404. // | v || | v X||
  405. // | e X|| | e ||
  406. // | | || | | ||
  407. // | V || | V ||
  408. // | Y || | V|
  409. // | <------*| | |
  410. // +---------+ +---------+
  411. // p1
  412. //
  413. PF.Flags |= PFF_FLIP_X_COORD;
  414. PF.BmpRotMode = BMP_ROT_RIGHT_90;
  415. PF.LogOrg.x = rclLog.top;
  416. PF.LogOrg.y = rclLog.left;
  417. } else {
  418. //
  419. // Portrait Paper Rotate Scale Coord Y
  420. // Default Left 90 Negative Y
  421. //
  422. // p2 cx cx p1 cx
  423. // +---------+ +---------+ +---------+
  424. // | | | <------@| | |
  425. // | | | X || | ^|
  426. // | | ^| | | || | | ||
  427. // c| M || RO90 c| M || c| M ||
  428. // y| o || =====> y| o || ====> y| o ||
  429. // | v || | v Y|| | v Y||
  430. // | e X|| | e || | e ||
  431. // | | || | | || | | ||
  432. // | V || | V || | V ||
  433. // | Y || | V| | X ||
  434. // | <------*| | | | <------#|
  435. // +---------+ +---------+ +---------+
  436. // p1 p2
  437. //
  438. PF.Flags |= (PFF_ROT_COORD_L90 | PFF_FLIP_Y_COORD);
  439. PF.LogOrg.x = rclLog.left;
  440. PF.LogOrg.y = rclLog.bottom;
  441. }
  442. } else {
  443. PLOTDBG(DBG_FORMSIZE,(">>>>> SetPlotForm: CY < CX (%ld: HORIZONTAL%hs) <<<<<",
  444. (DoRotate) ? 3 : 4,
  445. (DoRotate) ? " + ROTATE" : ""));
  446. //
  447. // The Standard HPGL/2 coordinate X direction in in reverse, the scale
  448. // is from Max X to 0
  449. //
  450. if (DoRotate) {
  451. //
  452. // DoRotate Rotate Left 90 Scale Coord X
  453. // Paper Default Negative X
  454. //
  455. // cx p2 p2 cx cx
  456. // +---------------+ +---------------+ +---------------+
  457. // | | | | | <--------#|
  458. // |^ | | | | ^| | | Y ||
  459. // c|| M | c| M || c| M ||
  460. // y|| o | y| o || y| o ||
  461. // || v | RO90 | v X|| | v X||
  462. // ||Y e |=====> | e || ==> | e ||
  463. // || | | | | || | | ||
  464. // || X V | | V Y || | V V|
  465. // |*--------> | | <--------@| | |
  466. // +---------------+ +---------------+ +---------------+
  467. // p1 p1
  468. //
  469. PF.Flags |= (PFF_ROT_COORD_L90 | PFF_FLIP_X_COORD);
  470. PF.BmpRotMode = BMP_ROT_RIGHT_90;
  471. PF.LogOrg.x = rclLog.top;
  472. PF.LogOrg.y = rclLog.left;
  473. } else {
  474. //
  475. // DoRotate Scale Coord X
  476. // Paper Default Negative X
  477. //
  478. // cx p2 cx
  479. // +----------------+ +-----------------+
  480. // | | | |
  481. // |^ | | | | ^|
  482. // c|| M | c| M ||
  483. // y|| o | y| o ||
  484. // || v | ====> | v Y||
  485. // ||Y e | | e ||
  486. // || | | | | ||
  487. // || X V | | V X ||
  488. // |*--------> | | <--------#|
  489. // +----------------+ +-----------------+
  490. // p1
  491. //
  492. PF.Flags |= PFF_FLIP_X_COORD;
  493. PF.LogOrg.x = rclLog.right;
  494. PF.LogOrg.y = rclLog.top;
  495. }
  496. }
  497. PLOTDBG(DBG_PF, ("FINAL LogOrg: (%ld, %ld), PhyOrg=(%ld, %ld)",
  498. PF.LogOrg.x, PF.LogOrg.y, PF.PhyOrg.x, PF.PhyOrg.y));
  499. //
  500. // Save result and output some information
  501. //
  502. *pPlotForm = PF;
  503. PLOTDBG(DBG_PLOTFORM,("******************************************************"));
  504. PLOTDBG(DBG_PLOTFORM,("******* SetPlotForm: ****** %hs --> %hs ******\n",
  505. (pPlotDM->dm.dmOrientation == DMORIENT_LANDSCAPE) ?
  506. "LANDSCAPE" : "PORTRAIT",
  507. (DoRotate) ? "LANDSCAPE" : "PORTRAIT"));
  508. PLOTDBG(DBG_PLOTFORM,(" Flags =%hs%hs%hs",
  509. (PF.Flags & PFF_ROT_COORD_L90) ? " <ROT_COORD_L90> " : "",
  510. (PF.Flags & PFF_FLIP_X_COORD) ? " <FLIP_X_COORD> " : "",
  511. (PF.Flags & PFF_FLIP_Y_COORD) ? " <FLIP_Y_COORD> " : ""));
  512. PLOTDBG(DBG_PLOTFORM,(" BmpRotMode = %hs", pBmpRotMode[PF.BmpRotMode]));
  513. PLOTDBG(DBG_PLOTFORM,(" PlotSize = (%7ld x%7ld) [%5ld x%6ld]",
  514. PF.PlotSize.cx, PF.PlotSize.cy,
  515. SPLTOPLOTUNITS(pPlotGPC, PF.PlotSize.cx),
  516. SPLTOPLOTUNITS(pPlotGPC, PF.PlotSize.cy)));
  517. PLOTDBG(DBG_PLOTFORM,("PhyOrg/Offset = (%7ld,%8ld) [%5ld,%7ld] ",
  518. PF.PhyOrg.x, PF.PhyOrg.y,
  519. SPLTOPLOTUNITS(pPlotGPC, PF.PhyOrg.x),
  520. SPLTOPLOTUNITS(pPlotGPC, PF.PhyOrg.y)));
  521. PLOTDBG(DBG_PLOTFORM,(" LogSize = (%7ld x%7ld) [%5ld x%6ld]",
  522. PF.LogSize.cx, PF.LogSize.cy,
  523. SPLTOPLOTUNITS(pPlotGPC, PF.LogSize.cx),
  524. SPLTOPLOTUNITS(pPlotGPC, PF.LogSize.cy)));
  525. PLOTDBG(DBG_PLOTFORM,(" LogOrg/p1 = (%7ld,%8ld) [%5ld,%7ld]",
  526. PF.LogOrg.x, PF.LogOrg.y,
  527. SPLTOPLOTUNITS(pPlotGPC, PF.LogOrg.x),
  528. SPLTOPLOTUNITS(pPlotGPC, PF.LogOrg.y)));
  529. PLOTDBG(DBG_PLOTFORM,(" LogExt = (%7ld,%8ld) [%5ld,%7ld]\n",
  530. PF.LogExt.cx, PF.LogExt.cy,
  531. SPLTOPLOTUNITS(pPlotGPC, PF.LogExt.cx),
  532. SPLTOPLOTUNITS(pPlotGPC, PF.LogExt.cy)));
  533. PLOTDBG(DBG_PLOTFORM,(" BmpOffset = (%7ld,%8ld) [%5ld,%7ld]",
  534. PF.BmpOffset.x, PF.BmpOffset.y,
  535. SPLTOPLOTUNITS(pPlotGPC, PF.BmpOffset.x),
  536. SPLTOPLOTUNITS(pPlotGPC, PF.BmpOffset.y)));
  537. PLOTDBG(DBG_PLOTFORM,
  538. ("Commands=PS%ld,%ld;%hsIP%ld,%ld,%ld,%ld;SC%ld,%ld,%ld,%ld\n",
  539. SPLTOPLOTUNITS(pPlotGPC, PF.PlotSize.cy),
  540. SPLTOPLOTUNITS(pPlotGPC, PF.PlotSize.cx),
  541. (PF.Flags & PFF_ROT_COORD_L90) ? "RO90;" : "",
  542. SPLTOPLOTUNITS(pPlotGPC, PF.LogOrg.x),
  543. SPLTOPLOTUNITS(pPlotGPC, PF.LogOrg.y),
  544. SPLTOPLOTUNITS(pPlotGPC, (PF.LogOrg.x + PF.LogExt.cx)) - 1,
  545. SPLTOPLOTUNITS(pPlotGPC, (PF.LogOrg.y + PF.LogExt.cy)) - 1,
  546. (PF.Flags & PFF_FLIP_X_COORD) ?
  547. SPLTOPLOTUNITS(pPlotGPC, PF.LogExt.cx) - 1 : 0,
  548. (PF.Flags & PFF_FLIP_X_COORD) ?
  549. 0 : SPLTOPLOTUNITS(pPlotGPC, PF.LogExt.cx) - 1,
  550. (PF.Flags & PFF_FLIP_Y_COORD) ?
  551. SPLTOPLOTUNITS(pPlotGPC, PF.LogExt.cy) - 1 : 0,
  552. (PF.Flags & PFF_FLIP_Y_COORD) ?
  553. 0 : SPLTOPLOTUNITS(pPlotGPC, PF.LogExt.cy) - 1));
  554. return(TRUE);
  555. }