home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / oslib / h / pdriver < prev    next >
Encoding:
Text File  |  1994-09-22  |  37.2 KB  |  1,151 lines

  1. #ifndef pdriver_H
  2. #define pdriver_H
  3.  
  4. /* C header file for PDriver
  5.  * written by DefMod (Sep 16 1994) on Thu Sep 22 16:37:52 1994
  6.  * Copyright © Acorn Computers Ltd, 1994
  7.  */
  8.  
  9. /*************************************************************************
  10.  * This source file was written by Acorn Computers Limited. It is part   *
  11.  * of the OSLib library for writing applications for RISC OS. It may be  *
  12.  * used freely in the creation of programs for RISC OS.                  *
  13.  *************************************************************************/
  14.  
  15. #ifndef types_H
  16.    #include "types.h"
  17. #endif
  18.  
  19. #ifndef os_H
  20.    #include "os.h"
  21. #endif
  22.  
  23. #ifndef draw_H
  24.    #include "draw.h"
  25. #endif
  26.  
  27. #ifndef font_H
  28.    #include "font.h"
  29. #endif
  30.  
  31. #ifndef messagetrans_H
  32.    #include "messagetrans.h"
  33. #endif
  34.  
  35. /**********************************
  36.  * SWI names and SWI reason codes *
  37.  **********************************/
  38. #undef  PDriver_Info
  39. #define PDriver_Info                            0x80140
  40. #undef  XPDriver_Info
  41. #define XPDriver_Info                           0xA0140
  42. #undef  PDriver_SetInfo
  43. #define PDriver_SetInfo                         0x80141
  44. #undef  XPDriver_SetInfo
  45. #define XPDriver_SetInfo                        0xA0141
  46. #undef  PDriver_CheckFeatures
  47. #define PDriver_CheckFeatures                   0x80142
  48. #undef  XPDriver_CheckFeatures
  49. #define XPDriver_CheckFeatures                  0xA0142
  50. #undef  PDriver_PageSize
  51. #define PDriver_PageSize                        0x80143
  52. #undef  XPDriver_PageSize
  53. #define XPDriver_PageSize                       0xA0143
  54. #undef  PDriver_SetPageSize
  55. #define PDriver_SetPageSize                     0x80144
  56. #undef  XPDriver_SetPageSize
  57. #define XPDriver_SetPageSize                    0xA0144
  58. #undef  PDriver_SelectJob
  59. #define PDriver_SelectJob                       0x80145
  60. #undef  XPDriver_SelectJob
  61. #define XPDriver_SelectJob                      0xA0145
  62. #undef  PDriver_CurrentJob
  63. #define PDriver_CurrentJob                      0x80146
  64. #undef  XPDriver_CurrentJob
  65. #define XPDriver_CurrentJob                     0xA0146
  66. #undef  PDriver_FontSWI
  67. #define PDriver_FontSWI                         0x80147
  68. #undef  XPDriver_FontSWI
  69. #define XPDriver_FontSWI                        0xA0147
  70. #undef  PDriver_EndJob
  71. #define PDriver_EndJob                          0x80148
  72. #undef  XPDriver_EndJob
  73. #define XPDriver_EndJob                         0xA0148
  74. #undef  PDriver_AbortJob
  75. #define PDriver_AbortJob                        0x80149
  76. #undef  XPDriver_AbortJob
  77. #define XPDriver_AbortJob                       0xA0149
  78. #undef  PDriver_Reset
  79. #define PDriver_Reset                           0x8014A
  80. #undef  XPDriver_Reset
  81. #define XPDriver_Reset                          0xA014A
  82. #undef  PDriver_GiveRectangle
  83. #define PDriver_GiveRectangle                   0x8014B
  84. #undef  XPDriver_GiveRectangle
  85. #define XPDriver_GiveRectangle                  0xA014B
  86. #undef  PDriver_DrawPage
  87. #define PDriver_DrawPage                        0x8014C
  88. #undef  XPDriver_DrawPage
  89. #define XPDriver_DrawPage                       0xA014C
  90. #undef  PDriver_GetRectangle
  91. #define PDriver_GetRectangle                    0x8014D
  92. #undef  XPDriver_GetRectangle
  93. #define XPDriver_GetRectangle                   0xA014D
  94. #undef  PDriver_CancelJob
  95. #define PDriver_CancelJob                       0x8014E
  96. #undef  XPDriver_CancelJob
  97. #define XPDriver_CancelJob                      0xA014E
  98. #undef  PDriver_ScreenDump
  99. #define PDriver_ScreenDump                      0x8014F
  100. #undef  XPDriver_ScreenDump
  101. #define XPDriver_ScreenDump                     0xA014F
  102. #undef  PDriver_EnumerateJobs
  103. #define PDriver_EnumerateJobs                   0x80150
  104. #undef  XPDriver_EnumerateJobs
  105. #define XPDriver_EnumerateJobs                  0xA0150
  106. #undef  PDriver_SetPrinter
  107. #define PDriver_SetPrinter                      0x80151
  108. #undef  XPDriver_SetPrinter
  109. #define XPDriver_SetPrinter                     0xA0151
  110. #undef  PDriver_CancelJobWithError
  111. #define PDriver_CancelJobWithError              0x80152
  112. #undef  XPDriver_CancelJobWithError
  113. #define XPDriver_CancelJobWithError             0xA0152
  114. #undef  PDriver_SelectIllustration
  115. #define PDriver_SelectIllustration              0x80153
  116. #undef  XPDriver_SelectIllustration
  117. #define XPDriver_SelectIllustration             0xA0153
  118. #undef  PDriver_InsertIllustration
  119. #define PDriver_InsertIllustration              0x80154
  120. #undef  XPDriver_InsertIllustration
  121. #define XPDriver_InsertIllustration             0xA0154
  122. #undef  PDriver_DeclareFont
  123. #define PDriver_DeclareFont                     0x80155
  124. #undef  XPDriver_DeclareFont
  125. #define XPDriver_DeclareFont                    0xA0155
  126. #undef  PDriver_DeclareDriver
  127. #define PDriver_DeclareDriver                   0x80156
  128. #undef  XPDriver_DeclareDriver
  129. #define XPDriver_DeclareDriver                  0xA0156
  130. #undef  PDriver_RemoveDriver
  131. #define PDriver_RemoveDriver                    0x80157
  132. #undef  XPDriver_RemoveDriver
  133. #define XPDriver_RemoveDriver                   0xA0157
  134. #undef  PDriver_SelectDriver
  135. #define PDriver_SelectDriver                    0x80158
  136. #undef  XPDriver_SelectDriver
  137. #define XPDriver_SelectDriver                   0xA0158
  138. #undef  PDriver_EnumerateDrivers
  139. #define PDriver_EnumerateDrivers                0x80159
  140. #undef  XPDriver_EnumerateDrivers
  141. #define XPDriver_EnumerateDrivers               0xA0159
  142. #undef  PDriver_MiscOp
  143. #define PDriver_MiscOp                          0x8015A
  144. #undef  XPDriver_MiscOp
  145. #define XPDriver_MiscOp                         0xA015A
  146. #undef  PDriverMiscOp_AddFont
  147. #define PDriverMiscOp_AddFont                   0x0
  148. #undef  PDriverMiscOp_RemoveFont
  149. #define PDriverMiscOp_RemoveFont                0x1
  150. #undef  PDriverMiscOp_EnumerateFonts
  151. #define PDriverMiscOp_EnumerateFonts            0x2
  152. #undef  PDriverMiscOp_RegisterDumper
  153. #define PDriverMiscOp_RegisterDumper            0x80000000
  154. #undef  PDriverMiscOp_DeregisterDumper
  155. #define PDriverMiscOp_DeregisterDumper          0x80000001
  156. #undef  PDriverMiscOp_StripTypes
  157. #define PDriverMiscOp_StripTypes                0x80000002
  158. #undef  PDriver_MiscOpForDriver
  159. #define PDriver_MiscOpForDriver                 0x8015B
  160. #undef  XPDriver_MiscOpForDriver
  161. #define XPDriver_MiscOpForDriver                0xA015B
  162. #undef  PDriverMiscOpForDriver_AddFont
  163. #define PDriverMiscOpForDriver_AddFont          0x0
  164. #undef  PDriverMiscOpForDriver_RemoveFont
  165. #define PDriverMiscOpForDriver_RemoveFont       0x1
  166. #undef  PDriverMiscOpForDriver_EnumerateFonts
  167. #define PDriverMiscOpForDriver_EnumerateFonts   0x2
  168. #undef  PDriverMiscOpForDriver_RegisterDumper
  169. #define PDriverMiscOpForDriver_RegisterDumper   0x80000000
  170. #undef  PDriverMiscOpForDriver_DeregisterDumper
  171. #define PDriverMiscOpForDriver_DeregisterDumper 0x80000001
  172. #undef  PDriverMiscOpForDriver_StripTypes
  173. #define PDriverMiscOpForDriver_StripTypes       0x80000002
  174. #undef  PDriver_SetDriver
  175. #define PDriver_SetDriver                       0x8015C
  176. #undef  XPDriver_SetDriver
  177. #define XPDriver_SetDriver                      0xA015C
  178. #undef  Service_Print
  179. #define Service_Print                           0x41
  180. #undef  Service_PDriverStarting
  181. #define Service_PDriverStarting                 0x65
  182. #undef  Service_PDriverGetMessages
  183. #define Service_PDriverGetMessages              0x78
  184. #undef  Service_PDriverChanged
  185. #define Service_PDriverChanged                  0x7F
  186.  
  187. /************************************
  188.  * Structure and union declarations *
  189.  ************************************/
  190. typedef struct pdriver_message_print_error      pdriver_message_print_error;
  191. typedef struct pdriver_message_print_type_odd   pdriver_message_print_type_odd;
  192. typedef struct pdriver_message_ps_printer_query pdriver_message_ps_printer_query;
  193.  
  194. /********************
  195.  * Type definitions *
  196.  ********************/
  197. struct pdriver_message_print_error
  198.    {  int errnum;
  199.       char errmess [232];
  200.    };
  201.  
  202. struct pdriver_message_print_type_odd
  203.    {  bits file_type;
  204.       char file_name [232];
  205.    };
  206.  
  207. struct pdriver_message_ps_printer_query
  208.    {  byte *buffer;
  209.       int size;
  210.    };
  211.  
  212. /************************
  213.  * Constant definitions *
  214.  ************************/
  215. #define pdriver_OS_UNIT                         400
  216. #define pdriver_INCH                            72000
  217. #define pdriver_POINT                           1000
  218. #define pdriver_TYPE_PS                         0
  219. #define pdriver_TYPE_DM                         1
  220. #define pdriver_TYPE_LJ                         2
  221. #define pdriver_TYPE_IX                         3
  222. #define pdriver_TYPE_FX                         4
  223. #define pdriver_TYPE_LZ                         5
  224. #define pdriver_TYPE_LB                         6
  225. #define pdriver_TYPE_UF                         7
  226. #define pdriver_TYPE_JX                         99
  227. #define pdriver_TYPE_PJ                         99
  228. #define pdriver_FEATURE_COLOUR                  0x1u
  229. #define pdriver_FEATURE_LIMITED_COLOURS         0x2u
  230. #define pdriver_FEATURE_DISCRETE_COLOURS        0x4u
  231. #define pdriver_FEATURE_OUTLINES_ONLY           0x100u
  232. #define pdriver_FEATURE_THIN_LINES_ONLY         0x200u
  233. #define pdriver_FEATURE_NO_OVERWRITE            0x400u
  234. #define pdriver_FEATURE_TRFM_SPRITE             0x800u
  235. #define pdriver_FEATURE_TRFM_FONT               0x1000u
  236. #define pdriver_FEATURE_SCREEN_DUMP             0x1000000u
  237. #define pdriver_FEATURE_GENERAL_TRFM            0x2000000u
  238. #define pdriver_FEATURE_INSERT_ILLUSTRATION     0x4000000u
  239. #define pdriver_FEATURE_MISC_OP                 0x8000000u
  240. #define pdriver_FEATURE_SET_DRIVER              0x10000000u
  241. #define pdriver_FEATURE_DECLARE_FONT            0x20000000u
  242. #define pdriver_NO_DOWNLOAD                     0x1u
  243. #define pdriver_KERNED                          0x2u
  244. #define error_PDRIVER_BAD_FEATURES              0x5C0u
  245. #define error_PDRIVER_NO_CURRENT_SPRITE         0x5C1u
  246. #define error_PDRIVER_NO_JOB_SELECTED           0x5C2u
  247. #define error_PDRIVER_NO_SUCH_JOB               0x5C3u
  248. #define error_PDRIVER_NO_CURRENT_PAGE           0x5C4u
  249. #define error_PDRIVER_PRINTING_PAGE             0x5C5u
  250. #define error_PDRIVER_INVALID_COPIES            0x5C6u
  251. #define error_PDRIVER_CANNOT_HANDLE             0x5C7u
  252. #define error_PDRIVER_BAD_HALFTONE              0x5C8u
  253. #define error_PDRIVER_CANCELLED                 0x5C9u
  254. #define error_PDRIVER_SINGULAR_MATRIX           0x5CAu
  255. #define error_PDRIVER_BAD_RECTANGLE             0x5CBu
  256. #define error_PDRIVER_RECTANGLES_MISS           0x5CCu
  257. #define error_PDRIVER_NO_FREE_MEMORY            0x5CDu
  258. #define error_PDRIVER_NOT_ONE_PAGE              0x5CEu
  259. #define error_PDRIVER_IN_USE                    0x5CFu
  260. #define error_PDRIVER_OVERFLOW                  0x5D0u
  261. #define error_PDRIVER_BAD_MISC_OP               0x5D1u
  262. #define error_PDRIVER_NO_DUPLICATES             0x5D2u
  263. #define error_PDRIVER_NO_CURRENT_DRIVER         0x5D3u
  264. #define error_PDRIVER_UNKNOWN_NUMBER            0x5D4u
  265. #define error_PDRIVER_DUPLICATE_NUMBER          0x5D5u
  266. #define error_PDRIVER_BAD_SET_PRINTER           0x5D6u
  267. #define message_PRINT_FILE                      0x80140u
  268. #define message_WILL_PRINT                      0x80141u
  269. #define message_PRINT_SAVE                      0x80142u
  270. #define message_PRINT_INIT                      0x80143u
  271. #define message_PRINT_ERROR                     0x80144u
  272. #define message_PRINT_TYPE_ODD                  0x80145u
  273. #define message_PRINT_TYPE_KNOWN                0x80146u
  274. #define message_SET_PRINTER                     0x80147u
  275. #define message_PRINT_INIT2                     0x80148u
  276. #define message_PS_PRINTER_QUERY                0x8014Cu
  277. #define message_PS_PRINTER_ACK                  0x8014Du
  278. #define message_PS_PRINTER_MODIFIED             0x8014Eu
  279. #define message_PS_PRINTER_DEFAULTS             0x8014Fu
  280. #define message_PS_PRINTER_DEFAULTED            0x80150u
  281. #define message_PS_PRINTER_NOT_PS               0x80151u
  282. #define message_RESET_PRINTER                   0x80152u
  283. #define message_PS_IS_FONTPRINT_RUNNING         0x80153u
  284.  
  285. /*************************
  286.  * Function declarations *
  287.  *************************/
  288.  
  289. #ifdef __cplusplus
  290.    extern "C" {
  291. #endif
  292.  
  293. /*************************************************************
  294.  * NOTE: The following functions provide direct access to    *
  295.  *       the SWI's noted in the function description.        *
  296.  *       Please read the relevant PRM section for more       *
  297.  *       information on their input/output parameters.       *
  298.  *************************************************************/
  299.  
  300. /* ------------------------------------------------------------------------
  301.  * Function:      pdriver_info()
  302.  *
  303.  * Description:   Gets information on the printer manager
  304.  *
  305.  * Output:        type - value of R0 on exit
  306.  *                xres - value of R1 on exit
  307.  *                yres - value of R2 on exit
  308.  *                features - value of R3 on exit
  309.  *                desc - value of R4 on exit
  310.  *                halftone_xres - value of R5 on exit
  311.  *                halftone_yres - value of R6 on exit
  312.  *                printer - value of R7 on exit
  313.  *
  314.  * Other notes:   Calls SWI 0x80140.
  315.  */
  316.  
  317. extern os_error *xpdriver_info (int *type,
  318.       int *xres,
  319.       int *yres,
  320.       bits *features,
  321.       char **desc,
  322.       int *halftone_xres,
  323.       int *halftone_yres,
  324.       int *printer);
  325. extern void pdriver_info (int *type,
  326.       int *xres,
  327.       int *yres,
  328.       bits *features,
  329.       char **desc,
  330.       int *halftone_xres,
  331.       int *halftone_yres,
  332.       int *printer);
  333.  
  334. /* ------------------------------------------------------------------------
  335.  * Function:      pdriver_set_info()
  336.  *
  337.  * Description:   Configures the printer driver
  338.  *
  339.  * Input:         xres - value of R1 on entry
  340.  *                yres - value of R2 on entry
  341.  *                features - value of R3 on entry
  342.  *                pdumper_name - value of R5 on entry
  343.  *                pdumper_no - value of R6 on entry
  344.  *                printer - value of R7 on entry
  345.  *
  346.  * Other notes:   Calls SWI 0x80141.
  347.  */
  348.  
  349. extern os_error *xpdriver_set_info (int xres,
  350.       int yres,
  351.       bits features,
  352.       char *pdumper_name,
  353.       int pdumper_no,
  354.       int printer);
  355. extern void pdriver_set_info (int xres,
  356.       int yres,
  357.       bits features,
  358.       char *pdumper_name,
  359.       int pdumper_no,
  360.       int printer);
  361.  
  362. /* ------------------------------------------------------------------------
  363.  * Function:      pdriver_check_features()
  364.  *
  365.  * Description:   Checks the features of a printer
  366.  *
  367.  * Input:         features - value of R0 on entry
  368.  *                value - value of R1 on entry
  369.  *
  370.  * Other notes:   Calls SWI 0x80142.
  371.  */
  372.  
  373. extern os_error *xpdriver_check_features (bits features,
  374.       bits value);
  375. extern void pdriver_check_features (bits features,
  376.       bits value);
  377.  
  378. /* ------------------------------------------------------------------------
  379.  * Function:      pdriver_page_size()
  380.  *
  381.  * Description:   Finds how large the paper and printable area are
  382.  *
  383.  * Output:        xsize - value of R1 on exit
  384.  *                ysize - value of R2 on exit
  385.  *                left - value of R3 on exit
  386.  *                bottom - value of R4 on exit
  387.  *                right - value of R5 on exit
  388.  *                top - value of R6 on exit
  389.  *
  390.  * Other notes:   Calls SWI 0x80143.
  391.  */
  392.  
  393. extern os_error *xpdriver_page_size (int *xsize,
  394.       int *ysize,
  395.       int *left,
  396.       int *bottom,
  397.       int *right,
  398.       int *top);
  399. extern void pdriver_page_size (int *xsize,
  400.       int *ysize,
  401.       int *left,
  402.       int *bottom,
  403.       int *right,
  404.       int *top);
  405.  
  406. /* ------------------------------------------------------------------------
  407.  * Function:      pdriver_set_page_size()
  408.  *
  409.  * Description:   Sets how large the paper and printable area are
  410.  *
  411.  * Input:         xsize - value of R1 on entry
  412.  *                ysize - value of R2 on entry
  413.  *                left - value of R3 on entry
  414.  *                bottom - value of R4 on entry
  415.  *                right - value of R5 on entry
  416.  *                top - value of R6 on entry
  417.  *
  418.  * Other notes:   Calls SWI 0x80144.
  419.  */
  420.  
  421. extern os_error *xpdriver_set_page_size (int xsize,
  422.       int ysize,
  423.       int left,
  424.       int bottom,
  425.       int right,
  426.       int top);
  427. extern void pdriver_set_page_size (int xsize,
  428.       int ysize,
  429.       int left,
  430.       int bottom,
  431.       int right,
  432.       int top);
  433.  
  434. /* ------------------------------------------------------------------------
  435.  * Function:      pdriver_select_job()
  436.  *
  437.  * Description:   Makes a given print job the current one
  438.  *
  439.  * Input:         job - value of R0 on entry
  440.  *                title - value of R1 on entry
  441.  *
  442.  * Output:        old_job - value of R0 on exit (X version only)
  443.  *
  444.  * Returns:       R0 (non-X version only)
  445.  *
  446.  * Other notes:   Calls SWI 0x80145.
  447.  */
  448.  
  449. extern os_error *xpdriver_select_job (os_f job,
  450.       char *title,
  451.       os_f *old_job);
  452. extern os_f pdriver_select_job (os_f job,
  453.       char *title);
  454.  
  455. /* ------------------------------------------------------------------------
  456.  * Function:      pdriver_current_job()
  457.  *
  458.  * Description:   Gets the file handle of the current job
  459.  *
  460.  * Output:        job - value of R0 on exit (X version only)
  461.  *
  462.  * Returns:       R0 (non-X version only)
  463.  *
  464.  * Other notes:   Calls SWI 0x80146.
  465.  */
  466.  
  467. extern os_error *xpdriver_current_job (os_f *job);
  468. extern os_f pdriver_current_job (void);
  469.  
  470. /* ------------------------------------------------------------------------
  471.  * Function:      pdriver_end_job()
  472.  *
  473.  * Description:   Ends a print job normally
  474.  *
  475.  * Input:         job - value of R0 on entry
  476.  *
  477.  * Other notes:   Calls SWI 0x80148.
  478.  */
  479.  
  480. extern os_error *xpdriver_end_job (os_f job);
  481. extern void pdriver_end_job (os_f job);
  482.  
  483. /* ------------------------------------------------------------------------
  484.  * Function:      pdriver_abort_job()
  485.  *
  486.  * Description:   Ends a print job without any further output
  487.  *
  488.  * Input:         job - value of R0 on entry
  489.  *
  490.  * Other notes:   Calls SWI 0x80149.
  491.  */
  492.  
  493. extern os_error *xpdriver_abort_job (os_f job);
  494. extern void pdriver_abort_job (os_f job);
  495.  
  496. /* ------------------------------------------------------------------------
  497.  * Function:      pdriver_reset()
  498.  *
  499.  * Description:   Aborts all print jobs
  500.  *
  501.  * Other notes:   Calls SWI 0x8014A.
  502.  */
  503.  
  504. extern os_error *xpdriver_reset (void);
  505. extern void pdriver_reset (void);
  506.  
  507. /* ------------------------------------------------------------------------
  508.  * Function:      pdriver_give_rectangle()
  509.  *
  510.  * Description:   Specifies a rectangle to be printed
  511.  *
  512.  * Input:         id - value of R0 on entry
  513.  *                rect - value of R1 on entry
  514.  *                trfm - value of R2 on entry
  515.  *                pos - value of R3 on entry
  516.  *                bg - value of R4 on entry
  517.  *
  518.  * Other notes:   Calls SWI 0x8014B.
  519.  */
  520.  
  521. extern os_error *xpdriver_give_rectangle (int id,
  522.       os_box *rect,
  523.       os_hom_trfm *trfm,
  524.       os_coord *pos,
  525.       os_colour bg);
  526. extern void pdriver_give_rectangle (int id,
  527.       os_box *rect,
  528.       os_hom_trfm *trfm,
  529.       os_coord *pos,
  530.       os_colour bg);
  531.  
  532. /* ------------------------------------------------------------------------
  533.  * Function:      pdriver_draw_page()
  534.  *
  535.  * Description:   Called to draw the page after all rectangles have been
  536.  *                specified
  537.  *
  538.  * Input:         copies - value of R0 on entry
  539.  *                rect - value of R1 on entry
  540.  *                page - value of R2 on entry
  541.  *                page_no - value of R3 on entry
  542.  *
  543.  * Output:        more - value of R0 on exit (X version only)
  544.  *                id - value of R2 on exit
  545.  *
  546.  * Returns:       R0 (non-X version only)
  547.  *
  548.  * Other notes:   Calls SWI 0x8014C.
  549.  */
  550.  
  551. extern os_error *xpdriver_draw_page (int copies,
  552.       os_box *rect,
  553.       int page,
  554.       char *page_no,
  555.       bool *more,
  556.       int *id);
  557. extern bool pdriver_draw_page (int copies,
  558.       os_box *rect,
  559.       int page,
  560.       char *page_no,
  561.       int *id);
  562.  
  563. /* ------------------------------------------------------------------------
  564.  * Function:      pdriver_get_rectangle()
  565.  *
  566.  * Description:   Gets the next print rectangle
  567.  *
  568.  * Input:         rect - value of R1 on entry
  569.  *
  570.  * Output:        more - value of R0 on exit (X version only)
  571.  *                id - value of R2 on exit
  572.  *
  573.  * Returns:       R0 (non-X version only)
  574.  *
  575.  * Other notes:   Calls SWI 0x8014D.
  576.  */
  577.  
  578. extern os_error *xpdriver_get_rectangle (os_box *rect,
  579.       bool *more,
  580.       int *id);
  581. extern bool pdriver_get_rectangle (os_box *rect,
  582.       int *id);
  583.  
  584. /* ------------------------------------------------------------------------
  585.  * Function:      pdriver_cancel_job()
  586.  *
  587.  * Description:   Stops a print job from printing
  588.  *
  589.  * Input:         job - value of R0 on entry
  590.  *
  591.  * Other notes:   Calls SWI 0x8014E.
  592.  */
  593.  
  594. extern os_error *xpdriver_cancel_job (os_f job);
  595. extern void pdriver_cancel_job (os_f job);
  596.  
  597. /* ------------------------------------------------------------------------
  598.  * Function:      pdriver_screen_dump()
  599.  *
  600.  * Description:   Outputs a screen dump to the printer
  601.  *
  602.  * Input:         job - value of R0 on entry
  603.  *
  604.  * Other notes:   Calls SWI 0x8014F.
  605.  */
  606.  
  607. extern os_error *xpdriver_screen_dump (os_f job);
  608. extern void pdriver_screen_dump (os_f job);
  609.  
  610. /* ------------------------------------------------------------------------
  611.  * Function:      pdriver_enumerate_jobs()
  612.  *
  613.  * Description:   Lists existing print jobs
  614.  *
  615.  * Input:         context - value of R0 on entry
  616.  *
  617.  * Output:        context_out - value of R0 on exit (X version only)
  618.  *
  619.  * Returns:       R0 (non-X version only)
  620.  *
  621.  * Other notes:   Calls SWI 0x80150.
  622.  */
  623.  
  624. extern os_error *xpdriver_enumerate_jobs (int context,
  625.       int *context_out);
  626. extern int pdriver_enumerate_jobs (int context);
  627.  
  628. /* ------------------------------------------------------------------------
  629.  * Function:      pdriver_cancel_job_with_error()
  630.  *
  631.  * Description:   Cancels a print job - future attempts to output to it are
  632.  *                errors
  633.  *
  634.  * Input:         job - value of R0 on entry
  635.  *                error - value of R1 on entry
  636.  *
  637.  * Other notes:   Calls SWI 0x80152.
  638.  */
  639.  
  640. extern os_error *xpdriver_cancel_job_with_error (os_f job,
  641.       os_error *error);
  642. extern void pdriver_cancel_job_with_error (os_f job,
  643.       os_error *error);
  644.  
  645. /* ------------------------------------------------------------------------
  646.  * Function:      pdriver_select_illustration()
  647.  *
  648.  * Description:   Makes the given print job the current one, and treats it
  649.  *                as an illustration
  650.  *
  651.  * Input:         job - value of R0 on entry
  652.  *                title - value of R1 on entry
  653.  *
  654.  * Output:        old_job - value of R0 on exit (X version only)
  655.  *
  656.  * Returns:       R0 (non-X version only)
  657.  *
  658.  * Other notes:   Calls SWI 0x80153.
  659.  */
  660.  
  661. extern os_error *xpdriver_select_illustration (os_f job,
  662.       char *title,
  663.       os_f *old_job);
  664. extern os_f pdriver_select_illustration (os_f job,
  665.       char *title);
  666.  
  667. /* ------------------------------------------------------------------------
  668.  * Function:      pdriver_insert_illustration()
  669.  *
  670.  * Description:   Inserts a file containing an illustration into the
  671.  *                current job's output
  672.  *
  673.  * Input:         job - value of R0 on entry
  674.  *                clip_path - value of R1 on entry
  675.  *                x0 - value of R2 on entry
  676.  *                y0 - value of R3 on entry
  677.  *                x1 - value of R4 on entry
  678.  *                y1 - value of R5 on entry
  679.  *                x2 - value of R6 on entry
  680.  *                y2 - value of R7 on entry
  681.  *
  682.  * Other notes:   Calls SWI 0x80154.
  683.  */
  684.  
  685. extern os_error *xpdriver_insert_illustration (os_f job,
  686.       draw_path *clip_path,
  687.       int x0,
  688.       int y0,
  689.       int x1,
  690.       int y1,
  691.       int x2,
  692.       int y2);
  693. extern void pdriver_insert_illustration (os_f job,
  694.       draw_path *clip_path,
  695.       int x0,
  696.       int y0,
  697.       int x1,
  698.       int y1,
  699.       int x2,
  700.       int y2);
  701.  
  702. /* ------------------------------------------------------------------------
  703.  * Function:      pdriver_declare_font()
  704.  *
  705.  * Description:   Declares the fonts that will be used in a document
  706.  *
  707.  * Input:         font - value of R0 on entry
  708.  *                font_name - value of R1 on entry
  709.  *                flags - value of R2 on entry
  710.  *
  711.  * Other notes:   Calls SWI 0x80155.
  712.  */
  713.  
  714. extern os_error *xpdriver_declare_font (font_f font,
  715.       char *font_name,
  716.       bits flags);
  717. extern void pdriver_declare_font (font_f font,
  718.       char *font_name,
  719.       bits flags);
  720.  
  721. /* ------------------------------------------------------------------------
  722.  * Function:      pdriver_declare_driver()
  723.  *
  724.  * Description:   Registers a printer driver with the PDriver sharer module
  725.  *
  726.  * Input:         reason - value of R0 on entry
  727.  *                workspace - value of R1 on entry
  728.  *                type - value of R2 on entry
  729.  *
  730.  * Other notes:   Calls SWI 0x80156.
  731.  */
  732.  
  733. extern os_error *xpdriver_declare_driver (int reason,
  734.       void *workspace,
  735.       int type);
  736. extern void pdriver_declare_driver (int reason,
  737.       void *workspace,
  738.       int type);
  739.  
  740. /* ------------------------------------------------------------------------
  741.  * Function:      pdriver_remove_driver()
  742.  *
  743.  * Description:   Deregisters a printer driver with the PDriver sharer
  744.  *                module
  745.  *
  746.  * Input:         type - value of R0 on entry
  747.  *
  748.  * Other notes:   Calls SWI 0x80157.
  749.  */
  750.  
  751. extern os_error *xpdriver_remove_driver (int type);
  752. extern void pdriver_remove_driver (int type);
  753.  
  754. /* ------------------------------------------------------------------------
  755.  * Function:      pdriver_select_driver()
  756.  *
  757.  * Description:   Selects the specified printer driver
  758.  *
  759.  * Input:         type - value of R0 on entry
  760.  *
  761.  * Output:        old_type - value of R0 on exit (X version only)
  762.  *
  763.  * Returns:       R0 (non-X version only)
  764.  *
  765.  * Other notes:   Calls SWI 0x80158.
  766.  */
  767.  
  768. extern os_error *xpdriver_select_driver (int type,
  769.       int *old_type);
  770. extern int pdriver_select_driver (int type);
  771.  
  772. /* ------------------------------------------------------------------------
  773.  * Function:      pdriver_enumerate_drivers()
  774.  *
  775.  * Description:   Enumerates all printer drivers within the system
  776.  *
  777.  * Input:         context - value of R0 on entry
  778.  *
  779.  * Output:        context_out - value of R0 on exit (X version only)
  780.  *                type - value of R1 on exit
  781.  *
  782.  * Returns:       R0 (non-X version only)
  783.  *
  784.  * Other notes:   Calls SWI 0x80159.
  785.  */
  786.  
  787. extern os_error *xpdriver_enumerate_drivers (int context,
  788.       int *context_out,
  789.       int *type);
  790. extern int pdriver_enumerate_drivers (int context,
  791.       int *type);
  792.  
  793. /* ------------------------------------------------------------------------
  794.  * Function:      pdrivermiscop_add_font()
  795.  *
  796.  * Description:   Adds a font name to a list of those known to the current
  797.  *                printer driver
  798.  *
  799.  * Input:         font_name - value of R1 on entry
  800.  *                alien_name - value of R2 on entry
  801.  *                flags - value of R3 on entry
  802.  *                add_flags - value of R4 on entry
  803.  *
  804.  * Other notes:   Calls SWI 0x8015A with R0 = 0x0.
  805.  */
  806.  
  807. extern os_error *xpdrivermiscop_add_font (char *font_name,
  808.       char *alien_name,
  809.       bits flags,
  810.       bits add_flags);
  811. extern void pdrivermiscop_add_font (char *font_name,
  812.       char *alien_name,
  813.       bits flags,
  814.       bits add_flags);
  815.  
  816. /* ------------------------------------------------------------------------
  817.  * Function:      pdrivermiscop_remove_font()
  818.  *
  819.  * Description:   Removes font name(s) from a list of those known to the
  820.  *                current printer driver
  821.  *
  822.  * Input:         font_name - value of R1 on entry
  823.  *
  824.  * Other notes:   Calls SWI 0x8015A with R0 = 0x1.
  825.  */
  826.  
  827. extern os_error *xpdrivermiscop_remove_font (char *font_name);
  828. extern void pdrivermiscop_remove_font (char *font_name);
  829.  
  830. /* ------------------------------------------------------------------------
  831.  * Function:      pdrivermiscop_enumerate_fonts()
  832.  *
  833.  * Description:   Enumerates the font names known to the current printer
  834.  *                driver
  835.  *
  836.  * Input:         buffer - value of R1 on entry
  837.  *                size - value of R2 on entry
  838.  *                context - value of R3 on entry
  839.  *                flags - value of R4 on entry
  840.  *
  841.  * Output:        end - value of R1 on exit
  842.  *                context_out - value of R3 on exit (X version only)
  843.  *
  844.  * Returns:       R3 (non-X version only)
  845.  *
  846.  * Other notes:   Calls SWI 0x8015A with R0 = 0x2.
  847.  */
  848.  
  849. extern os_error *xpdrivermiscop_enumerate_fonts (char *buffer,
  850.       int size,
  851.       int context,
  852.       bits flags,
  853.       char **end,
  854.       int *context_out);
  855. extern int pdrivermiscop_enumerate_fonts (char *buffer,
  856.       int size,
  857.       int context,
  858.       bits flags,
  859.       char **end);
  860.  
  861. /* ------------------------------------------------------------------------
  862.  * Function:      pdrivermiscop_register_dumper()
  863.  *
  864.  * Description:   Registers a printer dumper with the current printer
  865.  *                driver, PDriverDP
  866.  *
  867.  * Input:         pdumper_no - value of R1 on entry
  868.  *                dp_version_required - value of R2 on entry
  869.  *                dumper_workspace - value of R3 on entry
  870.  *                dumper_code - value of R4 on entry
  871.  *                supported_calls - value of R5 on entry
  872.  *                supported_strips - value of R6 on entry
  873.  *
  874.  * Other notes:   Calls SWI 0x8015A with R0 = 0x80000000.
  875.  */
  876.  
  877. extern os_error *xpdrivermiscop_register_dumper (int pdumper_no,
  878.       int dp_version_required,
  879.       void *dumper_workspace,
  880.       void *dumper_code,
  881.       bits supported_calls,
  882.       bits supported_strips);
  883. extern void pdrivermiscop_register_dumper (int pdumper_no,
  884.       int dp_version_required,
  885.       void *dumper_workspace,
  886.       void *dumper_code,
  887.       bits supported_calls,
  888.       bits supported_strips);
  889.  
  890. /* ------------------------------------------------------------------------
  891.  * Function:      pdrivermiscop_deregister_dumper()
  892.  *
  893.  * Description:   Deregisters a printer dumper with the current printer
  894.  *                driver, PDriverDP
  895.  *
  896.  * Input:         pdumper_no - value of R1 on entry
  897.  *
  898.  * Other notes:   Calls SWI 0x8015A with R0 = 0x80000001.
  899.  */
  900.  
  901. extern os_error *xpdrivermiscop_deregister_dumper (int pdumper_no);
  902. extern void pdrivermiscop_deregister_dumper (int pdumper_no);
  903.  
  904. /* ------------------------------------------------------------------------
  905.  * Function:      pdrivermiscop_strip_types()
  906.  *
  907.  * Description:   Returns a bit mask showing which strip types a printer
  908.  *                dumper supports with the current printer driver
  909.  *
  910.  * Input:         pdumper_no - value of R1 on entry
  911.  *
  912.  * Output:        type_mask - value of R0 on exit (X version only)
  913.  *
  914.  * Returns:       R0 (non-X version only)
  915.  *
  916.  * Other notes:   Calls SWI 0x8015A with R0 = 0x80000002.
  917.  */
  918.  
  919. extern os_error *xpdrivermiscop_strip_types (int pdumper_no,
  920.       bits *type_mask);
  921. extern bits pdrivermiscop_strip_types (int pdumper_no);
  922.  
  923. /* ------------------------------------------------------------------------
  924.  * Function:      pdrivermiscopfordriver_add_font()
  925.  *
  926.  * Description:   Adds a font name to a list of those known to a specified
  927.  *                printer driver
  928.  *
  929.  * Input:         font_name - value of R1 on entry
  930.  *                alien_name - value of R2 on entry
  931.  *                flags - value of R3 on entry
  932.  *                add_flags - value of R4 on entry
  933.  *                type - value of R8 on entry
  934.  *
  935.  * Other notes:   Calls SWI 0x8015B with R0 = 0x0.
  936.  */
  937.  
  938. extern os_error *xpdrivermiscopfordriver_add_font (char *font_name,
  939.       char *alien_name,
  940.       bits flags,
  941.       bits add_flags,
  942.       int type);
  943. extern void pdrivermiscopfordriver_add_font (char *font_name,
  944.       char *alien_name,
  945.       bits flags,
  946.       bits add_flags,
  947.       int type);
  948.  
  949. /* ------------------------------------------------------------------------
  950.  * Function:      pdrivermiscopfordriver_remove_font()
  951.  *
  952.  * Description:   Removes font name(s) from a list of those known to a
  953.  *                specified printer driver
  954.  *
  955.  * Input:         font_name - value of R1 on entry
  956.  *                type - value of R8 on entry
  957.  *
  958.  * Other notes:   Calls SWI 0x8015B with R0 = 0x1.
  959.  */
  960.  
  961. extern os_error *xpdrivermiscopfordriver_remove_font (char *font_name,
  962.       int type);
  963. extern void pdrivermiscopfordriver_remove_font (char *font_name,
  964.       int type);
  965.  
  966. /* ------------------------------------------------------------------------
  967.  * Function:      pdrivermiscopfordriver_enumerate_fonts()
  968.  *
  969.  * Description:   Enumerates the font names known to a specified printer
  970.  *                driver
  971.  *
  972.  * Input:         buffer - value of R1 on entry
  973.  *                size - value of R2 on entry
  974.  *                context - value of R3 on entry
  975.  *                flags - value of R4 on entry
  976.  *                type - value of R8 on entry
  977.  *
  978.  * Output:        end - value of R1 on exit
  979.  *                context_out - value of R3 on exit (X version only)
  980.  *
  981.  * Returns:       R3 (non-X version only)
  982.  *
  983.  * Other notes:   Calls SWI 0x8015B with R0 = 0x2.
  984.  */
  985.  
  986. extern os_error *xpdrivermiscopfordriver_enumerate_fonts (char *buffer,
  987.       int size,
  988.       int context,
  989.       bits flags,
  990.       int type,
  991.       char **end,
  992.       int *context_out);
  993. extern int pdrivermiscopfordriver_enumerate_fonts (char *buffer,
  994.       int size,
  995.       int context,
  996.       bits flags,
  997.       int type,
  998.       char **end);
  999.  
  1000. /* ------------------------------------------------------------------------
  1001.  * Function:      pdrivermiscopfordriver_register_dumper()
  1002.  *
  1003.  * Description:   Registers a printer dumper a specified printer driver,
  1004.  *                PDriverDP
  1005.  *
  1006.  * Input:         pdumper_no - value of R1 on entry
  1007.  *                dp_version_required - value of R2 on entry
  1008.  *                dumper_workspace - value of R3 on entry
  1009.  *                dumper_code - value of R4 on entry
  1010.  *                supported_calls - value of R5 on entry
  1011.  *                supported_strips - value of R6 on entry
  1012.  *                type - value of R8 on entry
  1013.  *
  1014.  * Other notes:   Calls SWI 0x8015A with R0 = 0x80000000.
  1015.  */
  1016.  
  1017. extern os_error *xpdrivermiscopfordriver_register_dumper (int pdumper_no,
  1018.       int dp_version_required,
  1019.       void *dumper_workspace,
  1020.       void *dumper_code,
  1021.       bits supported_calls,
  1022.       bits supported_strips,
  1023.       int type);
  1024. extern void pdrivermiscopfordriver_register_dumper (int pdumper_no,
  1025.       int dp_version_required,
  1026.       void *dumper_workspace,
  1027.       void *dumper_code,
  1028.       bits supported_calls,
  1029.       bits supported_strips,
  1030.       int type);
  1031.  
  1032. /* ------------------------------------------------------------------------
  1033.  * Function:      pdrivermiscopfordriver_deregister_dumper()
  1034.  *
  1035.  * Description:   Deregisters a printer dumper with a specified printer
  1036.  *                driver, PDriverDP
  1037.  *
  1038.  * Input:         pdumper_no - value of R1 on entry
  1039.  *                type - value of R8 on entry
  1040.  *
  1041.  * Other notes:   Calls SWI 0x8015A with R0 = 0x80000001.
  1042.  */
  1043.  
  1044. extern os_error *xpdrivermiscopfordriver_deregister_dumper (int pdumper_no,
  1045.       int type);
  1046. extern void pdrivermiscopfordriver_deregister_dumper (int pdumper_no,
  1047.       int type);
  1048.  
  1049. /* ------------------------------------------------------------------------
  1050.  * Function:      pdrivermiscopfordriver_strip_types()
  1051.  *
  1052.  * Description:   Returns a bit mask showing which strip types a printer
  1053.  *                dumper supports with a specified printer driver
  1054.  *
  1055.  * Input:         pdumper_no - value of R1 on entry
  1056.  *                type - value of R8 on entry
  1057.  *
  1058.  * Output:        type_mask - value of R0 on exit (X version only)
  1059.  *
  1060.  * Returns:       R0 (non-X version only)
  1061.  *
  1062.  * Other notes:   Calls SWI 0x8015A with R0 = 0x80000002.
  1063.  */
  1064.  
  1065. extern os_error *xpdrivermiscopfordriver_strip_types (int pdumper_no,
  1066.       int type,
  1067.       bits *type_mask);
  1068. extern bits pdrivermiscopfordriver_strip_types (int pdumper_no,
  1069.       int type);
  1070.  
  1071. /* ------------------------------------------------------------------------
  1072.  * Function:      pdriver_set_driver()
  1073.  *
  1074.  * Description:   Configures the current printer driver
  1075.  *
  1076.  * Input:         pdumper_no - value of R1 on entry
  1077.  *                ensure_command - value of R2 on entry
  1078.  *                configuration_data1 - value of R3 on entry
  1079.  *                configuration_data2 - value of R4 on entry
  1080.  *                configuration_word - value of R5 on entry
  1081.  *
  1082.  * Other notes:   Calls SWI 0x8015C.
  1083.  */
  1084.  
  1085. extern os_error *xpdriver_set_driver (int pdumper_no,
  1086.       char *ensure_command,
  1087.       byte *configuration_data1,
  1088.       byte *configuration_data2,
  1089.       int configuration_word);
  1090. extern void pdriver_set_driver (int pdumper_no,
  1091.       char *ensure_command,
  1092.       byte *configuration_data1,
  1093.       byte *configuration_data2,
  1094.       int configuration_word);
  1095.  
  1096. /* ------------------------------------------------------------------------
  1097.  * Function:      service_print()
  1098.  *
  1099.  * Description:   For internal use only
  1100.  *
  1101.  * Other notes:   Calls SWI 0x30 with R1 = 0x41.
  1102.  */
  1103.  
  1104. extern os_error *xservice_print (void);
  1105. extern void service_print (void);
  1106.  
  1107. /* ------------------------------------------------------------------------
  1108.  * Function:      service_pdriver_starting()
  1109.  *
  1110.  * Description:   PDriver sharer module started
  1111.  *
  1112.  * Other notes:   Calls SWI 0x30 with R1 = 0x65.
  1113.  */
  1114.  
  1115. extern os_error *xservice_pdriver_starting (void);
  1116. extern void service_pdriver_starting (void);
  1117.  
  1118. /* ------------------------------------------------------------------------
  1119.  * Function:      service_pdriver_get_messages()
  1120.  *
  1121.  * Description:   Get common messages file
  1122.  *
  1123.  * Output:        unclaimed - value of R1 on exit (X version only)
  1124.  *                common_cb - value of R3 on exit
  1125.  *
  1126.  * Returns:       R1 (non-X version only)
  1127.  *
  1128.  * Other notes:   Calls SWI 0x30 with R1 = 0x78.
  1129.  */
  1130.  
  1131. extern os_error *xservice_pdriver_get_messages (bool *unclaimed,
  1132.       messagetrans_control_block **common_cb);
  1133. extern bool service_pdriver_get_messages (messagetrans_control_block **common_cb);
  1134.  
  1135. /* ------------------------------------------------------------------------
  1136.  * Function:      service_pdriver_changed()
  1137.  *
  1138.  * Description:   The currently selected printer driver has changed
  1139.  *
  1140.  * Other notes:   Calls SWI 0x30 with R1 = 0x7F.
  1141.  */
  1142.  
  1143. extern os_error *xservice_pdriver_changed (void);
  1144. extern void service_pdriver_changed (void);
  1145.  
  1146. #ifdef __cplusplus
  1147.    }
  1148. #endif
  1149.  
  1150. #endif
  1151.