- Inside Macintosh: Imaging With QuickDraw /
- Chapter 9 - Printing Manager / Printing Manager Reference
- Printing Manager Routines / Low-Level Routines
PrCtlCall
You can use the PrCtlCall procedure to send various requests to the current printer driver.
PROCEDURE PrCtlCall (iWhichCtl: Integer; lParam1: LongInt;
lParam2: LongInt; lParam3: LongInt);
iWhichCtl
- A value that indicates the operation to perform. You can use these constants in this parameter:
CONST
iPrBitsCtl = 4; {print a bitmap object}
iPrIOCtl = 5; {perform text streaming}
iPrEvtCtl = 6; {print object specified in }
{ lParam1 parameter}
iPrDevCtl = 7; {device control command}
lParam1
- The use of this parameter varies according to the value in the
iWhichCtl parameter. See the following paragraphs for this information.
lParam2
- The use of this parameter varies according to the value in the
iWhichCtl parameter. See the following paragraphs for this information.
lParam3
- The use of this parameter varies according to the value in the
iWhichCtl parameter. See the following paragraphs for this information.
DESCRIPTION
The PrCtlCall procedure performs the operation indicated by the iWhichCtl parameter. Depending on the operation, PrCtlCall may also use information in the lParam1, lParam2, and lParam3 parameters. The PrCtlCall procedure calls the printer driver's control routine. Instead of sending the low-level calls to the printer driver, the PrCtlCall procedure converts the call into its high-level equivalent before execution.
You can use the PrCtlCall procedure with the iPrBitsCtl control constant when you want to print bitmaps. In this case, you should supply the parameters to PrCtlCall with the following information:
iWhichCtl
- The constant
iPrBitsCtl. This constant allows you to send all or part of a QuickDraw bitmap directly to the printer.
lParam1
- A pointer to the QuickDraw bitmap to print.
lParam2
- A pointer to the rectangle you want to print.
lParam3
- The type of resolution used to print the bitmap. The LaserWriter printer driver ignores this flag. This parameter can have one of the following values:
| | Constant | Value | Description |
| | lScreenBits | $00000000 | The resolution is 80 by 72 dpi |
| | lPaintBits | $00000001 | The resolution is 72 by 72 dpi |
| | lHiScreenBits | $00000002 | The resolution is 160 by 144 dpi |
| | lHiPaintBits | $00000003 | The resolution is 144 by 144 dpi |
You can use the PrCtlCall procedure with the iPrIOCtl control constant when you want text streaming in your application. (Text streaming is useful for fast printing of text when speed is more important than visual fidelity or formatting. It makes no use of QuickDraw.) In this case, you should supply the parameters to PrCtlCall with the following information:
iWhichCtl
- The constant
iPrIOCtl. This constant causes text streaming to occur.
lParam1
- A pointer to the beginning of the text.
lParam2
- The number of bytes to transfer. The high-order word must be 0.
lParam3
- This should be 0.
You can use the PrCtlCall procedure with the iPrEvtCtl control constant for printing the screen or the frontmost window on most ImageWriter printers. (The LaserWriter printer driver does not support this call.) In this case, you should supply the parameters to PrCtlCall with the following information:
iWhichCtl
- The constant
iPrEvtCtl. This constant prints the object you have selected using the lParam1 parameter.
lParam1
- This parameter selects the object to be printed. If this value is $00000000, you want to print the screen. If this value is $00010000, you want to print the frontmost window.
lParam2
- This should be
NIL.
lParam3
- This should be
NIL.
You can use the PrCtlCall procedure with the iPrDevCtl control constant for controlling the printer device. In this case, you should supply the parameters to PrCtlCall with the following information:
iWhichCtl
- The constant
iPrDevCtl.
lParam1
- The action you want to take. The values possible for this parameter are listed in Table 9-1.
lParam2
- This should be
NIL.
lParam3
- This should be
NIL.
Values for the lParam1 parameter when using the iPrDevCtl control constant
Constant | Value | Description |
| lPrDocOpen | $00010000 | Opens the document. This is similar to the high-level routine PrOpenDoc and should be followed with a call to PrCtlCall with the iPrDetl control call and an lParam1 value of lPrDocClose. |
| lPrReset | $00010000 | Reserved. |
| lPrPageClose | $00020000 | Closes the page. This is similar to the high-level routine PrClosePage and should follow a call to PrCtlCall with the iPrDevCtl control call and an lParam1 value of lPrPageOpen. |
| lPrPageEnd | $00020000 | Same as lPrPageClose. |
| lPrLineFeed | $00030000 | Paper advance. |
| lPrLFStd | $0003FFFF | Carriage return with line feed. The ImageWriter printer driver causes a carriage return plus a paper feed of one-sixth of an inch. The LaserWriter printer driver moves the pen location down the page. |
| lPrPageOpen | $00040000 | Opens the page for printing. This is similar to the high-level routine PrOpenPage and should be followed with a call to PrCtlCall with the iPrDevCtl control call and an lParam1 value of lPrPageClose. |
| lPrDocClose | $00050000 | Closes the document. This is similar to the high-level routine PrCloseDoc and should follow a call to PrCtlCall with the iPrDevCtl control call and an lParam1 value of lPrDocOpen. |
SPECIAL CONSIDERATIONS
Apple strongly discourages you from using this routine.
ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the PrCtlCall procedure are
| Trap macro | Selector |
| _PrGlue | $A0000E00 |
© Apple Computer, Inc. 7 JUL 1996
|