home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / apps / clib / progs / haswinlib / info / printer < prev    next >
Encoding:
Text File  |  1991-02-04  |  3.9 KB  |  73 lines

  1.  
  2.                       The HASWIN window library.
  3.                      ===========================
  4.                       Copyright H.A. Shaw 1990.
  5.                      ===========================
  6.  
  7. Printer handling under the HASWIN system.
  8. ------------------------------------------
  9.         RISCOS contains two interfaces to printers.  The top level access is
  10. via a printer application.  Acorn provides two such applications, namely
  11. !PrinterDM and !PrinterPS.  User programs cause these applications to print
  12. for them by message passing in a very similar way to the way a user program
  13. causes the Filer to load and save files for it.  These printer applications
  14. use the message passing system to cause file printing and HASWIN makes file
  15. printing look very similar to file saving to the user program.  A user
  16. program may supply a user print routine that HASWIN will call under two
  17. conditions.  If called with a filename and a buffer the routine should open
  18. the file whos name is given and send the data to be printed into it.  HASWIN
  19. will ensure that this data is picked up by the printer application.  If
  20. called with a filename, but no buffer then the sending of data to the file,
  21. and hence to the driver should be terminated if the user program has not
  22. already done so.  If the printer application is asked to print a file of a
  23. filetype it does not recognise it will send a message to every user program
  24. currently running.  HASWIN will receive this message and call the user print
  25. routine.  The user print routine should therefore expect to be called at any
  26. time the program is running.  If it is passed a filetype it does not
  27. recognise it should do nothing except to return HASWIN_FALSE.  The filetype
  28. is held in the field i[10] of the buffer it is passed.
  29.  
  30.         The low level access to printers is provided by the printer driver.
  31. Acorn provides two printer drivers, one for dot matrix printers and one for
  32. postcript printers.  HASWIN provides routines to provide direct access to
  33. these printer drivers for the user program.  It also uses these routines to
  34. provide higher level routines such as the ability to print a complete
  35. window, or to direct graphics and text output to printer drivers.
  36.  
  37.  
  38.         The user routine is defined as follows:
  39.  
  40. int userprint(char *name, buffer *buff)
  41.         - This routine is called by HASWIN to print a file.  "buff" is either
  42.           0 or points to a buffer containing:
  43.               buff->i[ 0] - length of buffer (rounded to next word).
  44.               buff->i[ 1] - <depends upon how the file print was initiated>
  45.               buff->i[ 2] - <depends upon how the file print was initiated>
  46.               buff->i[ 3] - <depends upon how the file print was initiated>
  47.               buff->i[ 4] - <depends upon how the file print was initiated>
  48.               buff->i[ 5] - <depends upon how the file print was initiated>
  49.               buff->i[ 6] - <depends upon how the file print was initiated>
  50.               buff->i[ 7] - <depends upon how the file print was initiated>
  51.               buff->i[ 8] - <depends upon how the file print was initiated>
  52.               buff->i[ 9] - estimated file size.
  53.               buff->i[10] - file type.
  54.               buff->c[44] - first character of 0 terminated file name.
  55.           "name" either points to the first character of the 0 terminated
  56.           filename or is zero.  This is usually equal to "buff->c[44]".
  57.           If "buff" is non-zero then a file is to be saved and the buffer
  58.           and "name" contain all the required information to save it.  If
  59.           "buff" is zero then the external task has sent an acknowledgement
  60.           to confirm the correct transfer of a previous file to itself.
  61.         - The routine should return HASWIN_TRUE if the file has been sent
  62.           successfully and HASWIN_FALSE on some error.
  63.  
  64.  
  65. int haswin_initialisepdriver(void);
  66.  
  67. int haswin_doespdriverexist(void);
  68.  
  69. pdriver *haswin_getpdriverinfo(pdriver *prt);
  70.  
  71. void haswin_setprintfileroutine(int (*user)(char *, buffer *));
  72.  
  73.