## Presentation Device Driver Reference for OS/2

[prev][next][parent][TOC]

### Normal Sequence of Events:

1.Application calls DevOpenDC to open an OD_QUEUED device for printing PM_ Q_RAW data.

2.Application calls DevEscape with DEVESC_STARTDOC.

a.Hardcopy driver calls SplQmOpen to open a spool file if one is not yet opened.
b.Hardcopy driver calls GreCreateJournalFile to create a journal file.
c.Hardcopy driver calls SplQmStartDoc to start the spool file.
d.Hardcopy driver calls GreStartJournalFile to start recording Grexxx calls.

Note: Recording does not block the flow of Grexxx calls to handling routines in the graphics engine and presentation driver.
e.Hardcopy driver processes the incoming Grexxx calls to create the first band of data for the spool file.

3.Application calls DevEscape with DEVESC_NEWFRAME to start a new page.

a.Hardcopy driver calls GreStopJournalFile to stop the journal file.

b.Hardcopy driver calls SplQmWrite to write the first band in the spool file.

c.Hardcopy driver moves clip rectangle to next band in presentation space.

d.Hardcopy driver calls GrePlayJournalFile to play the journal file.

e.Hardcopy driver processes each Grexxx call to create the second band of data for the spool file.

f.Hardcopy driver calls SplQmWrite to write the second band in the spool file.

g.Hardcopy driver plays the journal file repeatedly until all the bands have been processed and passed to the spooler.

h.Hardcopy driver issues a page eject, if necessary.

i.Hardcopy driver calls GreDeleteJournalFile.

j.Hardcopy driver calls SplQmEndDoc to stop the spool file, and returns the Job ID to the application's DevEscape with DEVESC_ENDDOC.

Note: If no Grexxx calls have been made (that is, no output is required), only Steps 1 and 8 are executed.

4.Application calls DevEscape with DEVESC_ENDDOC to end the document.

a.Hardcopy driver calls GreStopJournalFile to stop the journal file.

b.Hardcopy driver calls SplQmWrite to write the first band in the spool file.

c.Hardcopy driver calls GrePlayJournalFile to play the journal file.

d.Hardcopy driver processes each Grexxx call to create the second band of data for the spool file.

e.Hardcopy driver calls SplQmWrite to write the second band in the spool file.

f.Hardcopy driver plays the journal file repeatedly until all the bands have been processed and passed to the spooler.

g.Hardcopy driver calls GreDeleteJournalFile.

h.Hardcopy driver calls SplQmEndDoc to stop the spool file, and returns the Job ID to the application's DevEscape with DEVESC_ENDDOC.

Note: If no Grexxx calls have been made (that is, no output is required), only Steps 3.a, 3.i, and 3.j are executed. No page is ejected.

5.Application calls DevEscape with DEVESC_STARTDOC (repeat Step 2).

6.Application calls DevEscape with DEVESC_NEWFRAME to start new page ( repeat Step 3 under Normal Sequence of Events).

7.Application calls DevEscape with DEVESC_ENDDOC to spool the second job ( repeat Step 4).

8.Application calls DevCloseDC.

a.Hardcopy driver calls SplQmClose.