The Spool Library: 5.3 Print Control Messages: Working with Instance Data

Up: GEOS SDK TechDocs | Up | Prev: 5.2 Flow of Control Messages | Next: 6 Page Size Control
MSG_PRINT_CONTROL_SET_OUTPUT, MSG_PRINT_CONTROL_GET_OUTPUT, MSG_PRINT_CONTROL_SET_DOC_NAME_OUTPUT, MSG_PRINT_CONTROL_GET_DOC_NAME_OUTPUT, MSG_PRINT_CONTROL_SET_DEFAULT_PRINTER, MSG_PRINT_CONTROL_GET_DEFAULT_PRINTER, MSG_PRINT_CONTROL_GET_PRINT_MODE, MSG_PRINT_CONTROL_GET_PAPER_SIZE, MSG_PRINT_CONTROL_GET_PRINTER_MARGINS, MSG_PRINT_CONTROL_CALC_DOC_DIMENSIONS, MSG_PRINT_CONTROL_VERIFY_DOC_MARGINS, MSG_PRINT_CONTROL_VERIFY_DOC_SIZE

The Print Control handles many messages which allow the geode to retrieve and alter the values of the instance data.

MSG_PRINT_CONTROL_SET_OUTPUT

void 	MSG_PRINT_CONTROL_SET_OUTPUT(
        optr 	objectPtr);

This message, used very rarely, specifies that a different object should become the Print Output. Pass the optr of the object to use.

Source: Unrestricted.

Destination: Any PrintControl object.

Parameters: objectPtr The optr of the new PCI_output .

Return: Nothing.

Interception: Unlikely.

MSG_PRINT_CONTROL_GET_OUTPUT

optr 	MSG_PRINT_CONTROL_GET_OUTPUT();

This message returns the optr of the Print Output.

Source: Unrestricted.

Destination: Any PrintControl object.

Parameters: None.

Return: The optr of the current PCI_output object.

Interception: Unlikely.

MSG_PRINT_CONTROL_SET_DOC_NAME_OUTPUT

void 	MSG_PRINT_CONTROL_SET_DOC_NAME_OUTPUT(
        optr 	document);

This message, used very rarely, specifies that a different object should become the Document Name Output object. Pass the optr of the object to use.

Source: Unrestricted.

Destination: Any PrintControl object.

Parameters: objectPtr The optr of the new PCI_docNameOutput .

Return: Nothing.

Interception: Unlikely.

MSG_PRINT_CONTROL_GET_DOC_NAME_OUTPUT

optr 	MSG_PRINT_CONTROL_GET_DOC_NAME_OUTPUT();

This message returns the optr of the Document Name Output object.

Source: Unrestricted.

Destination: Any PrintControl object.

Parameters: None.

Return: The optr of the Document Name output object.

Interception: Unlikely.

MSG_PRINT_CONTROL_SET_DEFAULT_PRINTER

void 	MSG_PRINT_CONTROL_SET_DEFAULT_PRINTER(
        int 	printerNum);		/* -1 for system's default printer */

This message sets the application default printer, to be used the next time the print dialog box appears. Pass the printer number of the printer to use. Passing a value of -1 means that the system default printer should be used.

Source: Unrestricted.

Destination: Any PrintControl object.

Parameters: printerNum Number of the new default printer.

Return: Nothing.

Interception: Unlikely.

MSG_PRINT_CONTROL_GET_DEFAULT_PRINTER

int 	MSG_PRINT_CONTROL_GET_DEFAULT_PRINTER();

Use this message to retrieve the number of the present application default printer. You may not assume that this printer is the one the user is printing on, since the user may have changed to another printer. A return value of -1 means that the application will use the system default printer.

Source: Unrestricted.

Destination: Any PrintControl object.

Parameters: None.

Return: The number of the default printer.

Interception: Unlikely.

MSG_PRINT_CONTROL_GET_PRINT_MODE

byte 	MSG_PRINT_CONTROL_GET_PRINT_MODE(); 

This message retrieves the current user-selected print mode, if any. Its possible return values include zero, meaning no mode has been selected; PM_GRAPHICS_LOW_RES; PM_GRAPHICS_MED_RES; PM_GRAPHICS_HI_RES; PM_TEXT_DRAFT; and PM_TEXT_NLQ.

Source: Unrestricted.

Destination: Any PrintControl object.

Parameters: None.

Return: A PrinterOutputModes signalling the printer's quality.

Interception: Unlikely.

Structures: The PrinterOutputModes structure has the following definition:

typedef ByteFlags PrinterOutputModes;
#define  POM_GRAPHICS_LOW 0x10 
#define POM_GRAPHICS_MEDIUM 0x08 
#define POM_GRAPHICS_HIGH 0x04
#define POM_TEXT_DRAFT 0x02 
#define POM_TEXT_NLQ 0x01

Each flag indicates the specified quality is available. Two useful masks which have been set up are PRINT_GRAPHICS and PRINT_TEXT.

MSG_PRINT_CONTROL_GET_PAPER_SIZE

void 	MSG_PRINT_CONTROL_GET_PAPER_SIZE(
        PCMargineParams 		*retVal); 

Use this message to retrieve the Print Control's present paper size.

Source: Unrestricted.

Destination: Any PrintControl object.

Parameters: retVal An empty PCMarginParams structure which the message handler will fill.

Return: Nothing returned explicitly; the retVal structure will be filled.

Interception: Unlikely.

MSG_PRINT_CONTROL_GET_PAPER_SIZE_INFO

void	MSG_PRINT_CONTROL_GET_PAPER_SIZE_INFO(
        PageSizeReport 	*ptr);

Use this message to retrieve all of the information about the document size and orientation.

Source: Unrestricted.

Destination: Any PrintControl object.

Parameters: ptr Pointer to an empty PageSizeReport structure which the message handler will fill in.

Return: Nothing.

Interception: Unlikely.

Structures: The PageSizeReport structure has the following definition:

typedef struct {
	dword			PSR_width;
	dword			PSR_height;
	PageLayout			PSR_layout;
	PCMarginParams 			PSR_margins;
} PageSizeReport;

MSG_PRINT_CONTROL_GET_PRINTER_MARGINS

void 	MSG_PRINT_CONTROL_GET_PRINTER_MARGINS(
        MarginDimensions 		*retVal,
        Boolean 		setMargins); 

This message returns the margins enforced by the requested printer. If the boolean argument is true , the document margins will be set to be the same as the printer margins.

Source: Unrestricted.

Destination: Any PrintControl object.

Parameters: setMargins Pass TRUE to set the document's margins equal to the printer's margins, FALSE to leave the margins as they are.

retVal
A pointer to an empty MarginDimensions structure to be filled in by the handler.

Return: The printer's enforced margins.

Structures: The following structure keeps track of all four of a document's margins.

 typedef struct {
	int 	leftMargin;		/* measured in points */
	int 	topMargin;
	int 	rightMargin;
	int 	bottomMargin;
} MarginDimensions;

Interception: Unlikely.

MSG_PRINT_CONTROL_CALC_DOC_DIMENSIONS

void 	MSG_PRINT_CONTROL_CALC_DOC_DIMENSIONS(
        PageSizeReport 	*ptr); 

This message calculates the maximum printable area allowed by the user-selected paper size and printer-mandated margins. This message automatically resets the document size and margins to hold these values.

Note that this message correctly handles rotated pages.

Source: Unrestricted.

Destination: Any PrintControl object.

Parameters: ptr A pointer to a PageSizeReport structure to hold return value.

Return: Nothing returned explicitly.

ptr
The pointer to the filled PageSizeReport structure.

Interception: Unlikely.

MSG_PRINT_CONTROL_CHECK_IF_DOC_WILL_FIT

Boolean 	MSG_PRINT_CONTROL_CHECK_IF_DOC_WILL_FIT(
        Boolean 	warning); 

This message returns true if the passed document margins will fit on the selected printer.

Source: Unrestricted.

Destination: Any PrintControl object.

Parameters: warning If set, the PrintControl will deliver a warning to the user.

Return: Indication of whether the printer can work with the current margins ( true if so, false if not).

Interception: Unlikely.


Up: GEOS SDK TechDocs | Up | Prev: 5.2 Flow of Control Messages | Next: 6 Page Size Control