home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 2 / DATAFILE_PDCD2.iso / utilities2 / desklib / !DeskLib / h / PDriver < prev    next >
Encoding:
Text File  |  1993-07-14  |  5.2 KB  |  211 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.  
  31.  
  32. typedef int print_job;                     /* actually a RISC OS file handle */
  33.  
  34. typedef struct
  35. {
  36.   int xx;
  37.   int xy;
  38.   int yx;
  39.   int yy;
  40. } print_transformation;               /* See Page 1554 of the RISC OS 2 PRMs */
  41.  
  42. #define printdriver_POSTSCRIPT  0   /* Values for the drivertype field */
  43. #define printdriver_FX80        1   /* of printer_info                 */
  44. #define printdriver_LASERJET    2
  45. #define printdriver_INTEGREX    3   
  46.  
  47.         /* These #defines represent the bits of the 'features' word */
  48.  
  49. #define printfeat_COLOUR         0x00000001
  50. #define printfeat_LIMITED        0x00000002
  51. #define printfeat_DISCRETE       0x00000004
  52. #define printfeat_NOFILL         0x00000100
  53. #define printfeat_NOTHICKNESS    0x00000200
  54. #define printfeat_NOOVERWRITE    0x00000400
  55. #define printfeat_SCREENDUMP     0x01000000
  56. #define printfeat_TRANSFORMS     0x02000000
  57. #define printfeat_ILLUSTRATIONS  0x04000000
  58.  
  59.         /* The 'features' word represented as a structure. */
  60.  
  61. typedef union
  62. {
  63.   int value;
  64.   struct
  65.   {
  66.     unsigned int colour        : 1;
  67.     unsigned int limited       : 1;
  68.     unsigned int discrete      : 1;
  69.     unsigned int filler1       : 5;   /* reserved */
  70.     unsigned int nofill        : 1;
  71.     unsigned int nothickness   : 1;
  72.     unsigned int nooverwrite   : 1;
  73.     unsigned int filler2       : 5;   /* reserved */
  74.     unsigned int filler3       : 8;   /* reserved */
  75.     unsigned int screendump    : 1;
  76.     unsigned int transforms    : 1;
  77.     unsigned int illustrations : 1;
  78.     unsigned int filler4       : 5;   /* reserved */
  79.   } data;
  80. } print_features;
  81.  
  82.  
  83. typedef struct
  84. {
  85.   unsigned int     version    : 16;
  86.   int              drivertype : 16;
  87.   wimp_point       resolution;
  88.   print_features   features;
  89.   char             *description;
  90.   wimp_point       halftone_res;
  91.   int              id_number;
  92. } printer_info;                  /* info returned by PDriver_Info (pg 1539) */
  93.  
  94.  
  95.  
  96.   /*  PDriver_Info
  97.    *  Reads information on the printer driver.
  98.    */
  99. os_error *PDriver_Info(printer_info *block);
  100.  
  101.  
  102.   /*  PDriver_PrinterName (pseudo-SWI veneer)
  103.    *  This function calls PDriver_Info, and returns the Printer name returned
  104.    *  by that SWI. If no Printer Driver is installed, it returns NULL.
  105.    *
  106.    *  NOTE that the returned string should be treated as READ ONLY, as it
  107.    *  is a pointer into the PDriver's RMA workspace!
  108.    */
  109. extern char *PDriver_PrinterName(void);
  110.  
  111.  
  112. /*  PDriver_CheckFeatures
  113.  *
  114.  */
  115. os_error *PDriver_CheckFeatures(print_features mask, print_features value);
  116.  
  117.  
  118. /*  PDriver_PageSize
  119.  *
  120.  */
  121. os_error *PDriver_PageSize(wimp_point *size, wimp_rect *printable);
  122.  
  123.  
  124. /*  PDriver_SelectJob
  125.  *
  126.  */
  127. os_error *PDriver_SelectJob(print_job new, char *title, print_job *old);
  128.  
  129.  
  130. /*  PDriver_CurrentJob
  131.  *
  132.  */
  133. os_error *PDriver_CurrentJob(print_job *current);
  134.  
  135.  
  136. /*  PDriver_EndJob
  137.  *
  138.  */
  139. os_error *PDriver_EndJob(print_job job);
  140.  
  141.  
  142. /*  PDriver_AbortJob
  143.  *
  144.  */
  145. os_error *PDriver_AbortJob(print_job job);
  146.  
  147.  
  148. /*  PDriver_GiveRectangle
  149.  *
  150.  */
  151. os_error *PDriver_GiveRectangle(int rectangle_id, wimp_rect *rectangle,
  152.                                 print_transformation *matrix,
  153.                                 wimp_point *position, int background_colour);
  154.  
  155.  
  156. /*  PDriver_DrawPage
  157.  *
  158.  */
  159. os_error *PDriver_DrawPage(int copies, wimp_rect *rectangle_to_print,
  160.                            int sequence_no, char *page,
  161.                            int *finished, int *rectangle_id);
  162.  
  163.  
  164. /*  PDriver_GetRectangle
  165.  *
  166.  */
  167. os_error *PDriver_GetRectangle(wimp_rect *rectangle_to_print,
  168.                                int *finished, int *rectangle_id);
  169.  
  170.  
  171. /*  PDriver_CancelJob
  172.  *
  173.  */
  174. os_error *PDriver_CancelJob(print_job job);
  175.  
  176.  
  177. /*  PDriver_ScreenDump
  178.  *
  179.  */
  180. os_error *PDriver_ScreenDump(print_job job);
  181.  
  182.  
  183. /*  PDriver_EnumerateJobs
  184.  *
  185.  */
  186. os_error *PDriver_EnumerateJobs
  187.  
  188.  
  189. /*  PDriver_CancelJobWithError
  190.  *
  191.  */
  192. os_error *PDriver_CancelJobWithError(print_job job, os_error *error);
  193.  
  194.  
  195. /*  PDriver_SelectIllustration
  196.  *
  197.  */
  198. os_error *PDriver_SelectIllustration(print_job new, char *title, print_job *old);
  199.  
  200.  
  201. /*  PDriver_InsertIllustration
  202.  *  NOTE - the drawpath will be changed from a void * when drawfile support
  203.  *  is added to DeskLib.
  204.  */
  205. os_error *PDriver_InsertIllustration(int illustration_handle, void *drawpath,
  206.                                      wimp_point *bottom_left,
  207.                                      wimp_point *bottom_right,
  208.                                      wimp_point *top_left);
  209.  
  210. #endif
  211.