|
GEOS SDK TechDocs
|
|
3.1 Printing System Components
|
4 Print Control Instance Data
Now that you're somewhat familiar with these components, you're ready for the detailed account of how they work together to print a job. Note that the application is only involved at one point. The printing system takes care of the rest automatically.
-
User Activates Trigger
Printing normally begins when the user activates the User Print Trigger provided by the Print Control. This trigger sends a message to the Print Control telling it to put up the Print Dialog box.
-
User Interacts with the Print Dialog Box
The Print Control responds to the Print Trigger's message by presenting a dialog box in which the user selects such things as page range and print quality (see. The user then either initiates printing or cancels. If the user wants to print, he'll confirm this by clicking on the appropriate trigger. The application will then get a chance to veto the user's choices. The Print Control asks the dialog box to remove itself, and it then gets ready for the upcoming print job.
-
Print Control Prepares for New Job
Soon the Print Control is going to ask for the page descriptions, but first it needs a place to store the data. It creates a spool file in which to store the upcoming graphics commands. It also allocates a GString handle by which the Print Output can transmit the commands. It then sends a message to the application's Print Output, signalling that the Print Output should supply the job.
-
Application Supplies Job
Having received the Print Control's message, the Print Output supplies graphics routines to the provided GString handle, using the same commands as when printing to any other GState. This string of graphics commands ends with a message saying the job is completed. The Print Control supplies some extra information to the spooler, and the print job is ready to enter the queue.
-
Job Traverses Queue
At this point, the spool library places the print job on a printer queue where the job waits to be printed. (Actually, the Spooler uses a trick to save on overhead. If there are no jobs for a printer, the Spooler doesn't maintain a queue for that printer. When a new job comes in for a printer that has no queue so far, a new queue is prepared for that printer and the job placed on the new queue. When the last job of a queue is printed and there are no more jobs forthcoming, the queue is removed.) The Spooler's various scheduling powers, if exercised, affect jobs in the queue.
-
Printing
Eventually, the job reaches the head of the queue. It is now ready to print. The Spooler works with the Printer Driver to transform the print job into a form that the printer can work with. This may involve building a bitmap depicting the job, or it might involve translating the GString's commands into the commands of some other page description language, such as PostScript.
-
Hard Copy
The printer driver sends the appropriate printer commands to the printer. If the printer doesn't have sufficient memory to hold the whole job, the driver sends only part of the job at a time.
|
GEOS SDK TechDocs
|
|
3.1 Printing System Components
|
4 Print Control Instance Data