home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / gcc / !GCC / patches / DeskLib / h / PDriver1 < prev    next >
Encoding:
Text File  |  1994-10-03  |  7.6 KB  |  241 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    PDriver.h
  12.     Author:  Copyright © 1993 Jason Howat (and a bit by Jason Williams)
  13.     Version: 1.10 (14 Jul 1993)
  14.     Purpose: SWI veneers for using printer drivers (the PDriver module)
  15. */
  16.  
  17.  
  18.  
  19. #ifndef __dl_pdriver_h
  20. #define __dl_pdriver_h
  21.  
  22. #ifndef __dl_core_h
  23. #include "Core.h"
  24. #endif
  25.  
  26. #ifndef __dl_wimp_h
  27. #include "Wimp.h"
  28. #endif
  29.  
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33.  
  34.  
  35. typedef int print_job;                  /* actually a RISC OS file handle */
  36.  
  37. typedef struct
  38. {
  39.   int xx;
  40.   int xy;
  41.   int yx;
  42.   int yy;
  43. } print_transformation;                 /* See pg 1554 of the RISC OS 2 PRMs */
  44.  
  45.                                         /* Values for the drivertype field
  46.                                            of printer_info                 */
  47. #define printdriver_POSTSCRIPT          0
  48. #define printdriver_FX80                1
  49. #define printdriver_LASERJET            2
  50. #define printdriver_INTEGREX            3
  51. #define printdriver_FAXMODEM            4
  52. #define printdriver_DIRECTDRIVELASER    5
  53. #define printdriver_CASPELGRAPHLANG     6
  54. #define printdriver_PDUMPER             7
  55. #define printdriver_EPSONJX             99
  56. #define printdriver_STARLC10            99
  57. #define printdriver_PAINTJET            99
  58.  
  59.  
  60.         /* These #defines represent the bits of the 'features' word */
  61. #define printfeat_COLOUR         0x00000001
  62. #define printfeat_LIMITED        0x00000002
  63. #define printfeat_DISCRETE       0x00000004
  64. #define printfeat_NOFILL         0x00000100
  65. #define printfeat_NOTHICKNESS    0x00000200
  66. #define printfeat_NOOVERWRITE    0x00000400
  67. #define printfeat_TRANSSPRITE    0x00000800
  68. #define printfeat_NEWFONTMANAGER 0x00001000
  69. #define printfeat_SCREENDUMP     0x01000000
  70. #define printfeat_TRANSFORMS     0x02000000
  71. #define printfeat_ILLUSTRATIONS  0x04000000
  72. #define printfeat_MISCOP         0x08000000
  73. #define printfeat_SETDRIVER      0x10000000
  74. #define printfeat_DECLAREFONT    0x20000000
  75.  
  76.  
  77.         /* The 'features' word represented as a structure. */
  78. typedef union
  79. {
  80.   int value;
  81.   struct
  82.   {
  83.     unsigned int colour         : 1;
  84.     unsigned int limited        : 1;
  85.     unsigned int discrete       : 1;
  86.     unsigned int filler1        : 5;   /* reserved */
  87.     unsigned int nofill         : 1;
  88.     unsigned int nothickness    : 1;
  89.     unsigned int nooverwrite    : 1;
  90.     unsigned int transsprite    : 1;
  91.     unsigned int newfontmanager : 1;
  92.     unsigned int filler2        : 3;   /* reserved */
  93.     unsigned int filler3        : 8;   /* reserved */
  94.     unsigned int screendump     : 1;
  95.     unsigned int transforms     : 1;
  96.     unsigned int illustrations  : 1;
  97.     unsigned int miscop         : 1;
  98.     unsigned int setdriver      : 1;
  99.     unsigned int declarefont    : 1;
  100.     unsigned int filler4        : 2;   /* reserved */
  101.   } data;
  102. } print_features;
  103.  
  104.  
  105. typedef struct
  106. {
  107.   unsigned int     version    : 16;
  108.   int              drivertype : 16;
  109.   wimp_point       resolution;
  110.   print_features   features;
  111.   char             *description;
  112.   wimp_point       halftone_res;
  113.   int              id_number;
  114. } printer_info;                  /* info returned by PDriver_Info (pg 1539) */
  115.  
  116.  
  117.  
  118. /* PDriver_Info ------------------------------------------------------------
  119.  * Reads information on the printer driver.
  120.  */
  121. os_error *PDriver_Info(printer_info *block);
  122.  
  123.  
  124. /* PDriver_PrinterName -----------------------------------------------------
  125.  * This function calls PDriver_Info, and returns the Printer name returned
  126.  * by that SWI. If no Printer Driver is installed, it returns NULL.
  127.  *
  128.  * NOTE that the returned string should be treated as READ ONLY, as it
  129.  * is a pointer into the PDriver's RMA workspace!
  130.  */
  131. extern char *PDriver_PrinterName(void);
  132.  
  133.  
  134. /* PDriver_CheckFeatures ---------------------------------------------------
  135.  * Checks the features of a printer and generates an error if appropriate.
  136.  */
  137. os_error *PDriver_CheckFeatures(print_features mask, print_features value);
  138.  
  139.  
  140. /* PDriver_PageSize --------------------------------------------------------
  141.  * Find how large the paper and print area are.
  142.  */
  143. os_error *PDriver_PageSize(wimp_point *size, wimp_rect *printable);
  144.  
  145.  
  146. /* PDriver_SelectJob -------------------------------------------------------
  147.  * Make a given print job the current one.
  148.  */
  149. os_error *PDriver_SelectJob(print_job new, char *title, print_job *old);
  150.  
  151.  
  152. /* PDriver_CurrentJob ------------------------------------------------------
  153.  * Get the handle of the current job.
  154.  */
  155. os_error *PDriver_CurrentJob(print_job *current);
  156.  
  157.  
  158. /* PDriver_EndJob ----------------------------------------------------------
  159.  * End a print job normally.
  160.  */
  161. os_error *PDriver_EndJob(print_job job);
  162.  
  163.  
  164. /* PDriver_AbortJob --------------------------------------------------------
  165.  * End a print job without any further output.
  166.  */
  167. os_error *PDriver_AbortJob(print_job job);
  168.  
  169.  
  170. /* PDriver_GiveRectangle ---------------------------------------------------
  171.  * Specify a rectangle to be printed.
  172.  */
  173. os_error *PDriver_GiveRectangle(int rectangle_id, wimp_rect *rectangle,
  174.                                 print_transformation *matrix,
  175.                                 wimp_point *position, int background_colour);
  176.  
  177.  
  178. /* PDriver_DrawPage --------------------------------------------------------
  179.  * Called to draw the page after all the rectangles have been specified.
  180.  */
  181. os_error *PDriver_DrawPage(int copies, wimp_rect *rectangle_to_print,
  182.                            int sequence_no, char *page,
  183.                            int *finished, int *rectangle_id);
  184.  
  185.  
  186. /* PDriver_GetRectangle ----------------------------------------------------
  187.  * Get the next print rectangle
  188.  */
  189. os_error *PDriver_GetRectangle(wimp_rect *rectangle_to_print,
  190.                                int *finished, int *rectangle_id);
  191.  
  192.  
  193. /* PDriver_CancelJob -------------------------------------------------------
  194.  * Stop the print job from printing.
  195.  */
  196. os_error *PDriver_CancelJob(print_job job);
  197.  
  198.  
  199. /* PDriver_ScreenDump ------------------------------------------------------
  200.  * Output a screen dump to the printer.
  201.  */
  202. os_error *PDriver_ScreenDump(print_job job);
  203.  
  204.  
  205. /* PDriver_EnumerateJobs ---------------------------------------------------
  206.  * List existing print jobs.
  207.  */
  208. os_error *PDriver_EnumerateJobs(print_job *handle);
  209.  
  210.  
  211. /* PDriver_CancelJobWithError ----------------------------------------------
  212.  * Cancels a print job - future attempts to output to it generate an error.
  213.  */
  214. os_error *PDriver_CancelJobWithError(print_job job, os_error *error);
  215.  
  216.  
  217. /* PDriver_SelectIllustration ----------------------------------------------
  218.  * Makes the given print job the current one, and treats it as an
  219.  * illustration.
  220.  */
  221. os_error *PDriver_SelectIllustration(print_job new, char *title,
  222.                                      print_job *old);
  223.  
  224.  
  225. /* PDriver_InsertIllustration ----------------------------------------------
  226.  * Inserts a file containing an illustration into the current job's output.
  227.  *
  228.  * NOTE - the drawpath will be changed from a void * when drawfile support is
  229.  * added to DeskLib.
  230.  */
  231. os_error *PDriver_InsertIllustration(int illustration_handle, void *drawpath,
  232.                                      wimp_point *bottom_left,
  233.                                      wimp_point *bottom_right,
  234.                                      wimp_point *top_left);
  235.  
  236. #ifdef __cplusplus
  237.            }
  238. #endif
  239.  
  240. #endif
  241.