home *** CD-ROM | disk | FTP | other *** search
-
- The HASWIN window library.
- ===========================
- Copyright H.A. Shaw 1990.
- ===========================
-
- Printer handling under the HASWIN system.
- ------------------------------------------
- RISCOS contains two interfaces to printers. The top level access is
- via a printer application. Acorn provides two such applications, namely
- !PrinterDM and !PrinterPS. User programs cause these applications to print
- for them by message passing in a very similar way to the way a user program
- causes the Filer to load and save files for it. These printer applications
- use the message passing system to cause file printing and HASWIN makes file
- printing look very similar to file saving to the user program. A user
- program may supply a user print routine that HASWIN will call under two
- conditions. If called with a filename and a buffer the routine should open
- the file whos name is given and send the data to be printed into it. HASWIN
- will ensure that this data is picked up by the printer application. If
- called with a filename, but no buffer then the sending of data to the file,
- and hence to the driver should be terminated if the user program has not
- already done so. If the printer application is asked to print a file of a
- filetype it does not recognise it will send a message to every user program
- currently running. HASWIN will receive this message and call the user print
- routine. The user print routine should therefore expect to be called at any
- time the program is running. If it is passed a filetype it does not
- recognise it should do nothing except to return HASWIN_FALSE. The filetype
- is held in the field i[10] of the buffer it is passed.
-
- The low level access to printers is provided by the printer driver.
- Acorn provides two printer drivers, one for dot matrix printers and one for
- postcript printers. HASWIN provides routines to provide direct access to
- these printer drivers for the user program. It also uses these routines to
- provide higher level routines such as the ability to print a complete
- window, or to direct graphics and text output to printer drivers.
-
-
- The user routine is defined as follows:
-
- int userprint(char *name, buffer *buff)
- - This routine is called by HASWIN to print a file. "buff" is either
- 0 or points to a buffer containing:
- buff->i[ 0] - length of buffer (rounded to next word).
- buff->i[ 1] - <depends upon how the file print was initiated>
- buff->i[ 2] - <depends upon how the file print was initiated>
- buff->i[ 3] - <depends upon how the file print was initiated>
- buff->i[ 4] - <depends upon how the file print was initiated>
- buff->i[ 5] - <depends upon how the file print was initiated>
- buff->i[ 6] - <depends upon how the file print was initiated>
- buff->i[ 7] - <depends upon how the file print was initiated>
- buff->i[ 8] - <depends upon how the file print was initiated>
- buff->i[ 9] - estimated file size.
- buff->i[10] - file type.
- buff->c[44] - first character of 0 terminated file name.
- "name" either points to the first character of the 0 terminated
- filename or is zero. This is usually equal to "buff->c[44]".
- If "buff" is non-zero then a file is to be saved and the buffer
- and "name" contain all the required information to save it. If
- "buff" is zero then the external task has sent an acknowledgement
- to confirm the correct transfer of a previous file to itself.
- - The routine should return HASWIN_TRUE if the file has been sent
- successfully and HASWIN_FALSE on some error.
-
-
- int haswin_initialisepdriver(void);
-
- int haswin_doespdriverexist(void);
-
- pdriver *haswin_getpdriverinfo(pdriver *prt);
-
- void haswin_setprintfileroutine(int (*user)(char *, buffer *));
-
-