home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / oslib / h / pdumper < prev    next >
Encoding:
Text File  |  1994-09-07  |  11.5 KB  |  363 lines

  1. #ifndef pdumper_H
  2. #define pdumper_H
  3.  
  4. /* C header file for PDumper
  5.  * written by DefMod (Sep  7 1994) on Wed Sep  7 21:19:47 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. /**********************************
  24.  * SWI names and SWI reason codes *
  25.  **********************************/
  26. #undef  PDumper_Info
  27. #define PDumper_Info                            0x41B00
  28. #undef  XPDumper_Info
  29. #define XPDumper_Info                           0x61B00
  30. #undef  PDumper_Claim
  31. #define PDumper_Claim                           0x41B01
  32. #undef  XPDumper_Claim
  33. #define XPDumper_Claim                          0x61B01
  34. #undef  PDumper_Free
  35. #define PDumper_Free                            0x41B02
  36. #undef  XPDumper_Free
  37. #define XPDumper_Free                           0x61B02
  38. #undef  PDumper_Find
  39. #define PDumper_Find                            0x41B03
  40. #undef  XPDumper_Find
  41. #define XPDumper_Find                           0x61B03
  42. #undef  PDumper_StartJob
  43. #define PDumper_StartJob                        0x41B04
  44. #undef  XPDumper_StartJob
  45. #define XPDumper_StartJob                       0x61B04
  46. #undef  PDumper_TidyJob
  47. #define PDumper_TidyJob                         0x41B05
  48. #undef  XPDumper_TidyJob
  49. #define XPDumper_TidyJob                        0x61B05
  50. #undef  PDumper_SetColour
  51. #define PDumper_SetColour                       0x41B06
  52. #undef  XPDumper_SetColour
  53. #define XPDumper_SetColour                      0x61B06
  54. #undef  PDumper_PrepareStrip
  55. #define PDumper_PrepareStrip                    0x41B07
  56. #undef  XPDumper_PrepareStrip
  57. #define XPDumper_PrepareStrip                   0x61B07
  58. #undef  PDumper_LookupError
  59. #define PDumper_LookupError                     0x41B08
  60. #undef  XPDumper_LookupError
  61. #define XPDumper_LookupError                    0x61B08
  62. #undef  PDumper_CopyFilename
  63. #define PDumper_CopyFilename                    0x41B09
  64. #undef  XPDumper_CopyFilename
  65. #define XPDumper_CopyFilename                   0x61B09
  66. #undef  Service_PDumperStarting
  67. #define Service_PDumperStarting                 0x66
  68. #undef  Service_PDumperDying
  69. #define Service_PDumperDying                    0x67
  70.  
  71. /************************
  72.  * Constant definitions *
  73.  ************************/
  74. #define error_PDUMPER_UNDECLARED                0x5D7u
  75. #define error_PDUMPER_TOO_OLD                   0x5D8u
  76. #define error_PDUMPER_DUPLICATE_MODULE          0x5D9u
  77. #define error_PDUMPER_BAD_CALL                  0x5DAu
  78. #define error_PDUMPER_BAD_STRIP                 0x5DBu
  79. #define error_PDUMPER_BAD_PALETTE               0x5DCu
  80. #define error_PDUMPER_NOT_LINKED                0x5DDu
  81. #define error_PDUMPER_RESERVED                  0x5DEu
  82. #define error_PDUMPER_BAD_OUTPUT_TYPE           0x5DFu
  83. #define error_PDUMPER_BLOCK_NOT_FOUND           0x5E0u
  84. #define error_PDUMPER_IN_USE                    0x5E1u
  85. #define pdumper_DEVICE_SPRITE_DEVICE            0
  86. #define pdumper_DEVICE_GENERIC_DOT_MATRIX       1
  87. #define pdumper_DEVICE_LASERJET                 2
  88. #define pdumper_DEVICE_IMAGEWRITER              3
  89. #define pdumper_DEVICE24_PIN                    4
  90. #define pdumper_DEVICE_DESKJET                  5
  91. #define pdumper_STRIP_MONOCHROME                0
  92. #define pdumper_STRIP_GREY_SCALE                1
  93. #define pdumper_STRIP8_BIT                      2
  94. #define pdumper_STRIP24_BIT_MULTIPLE            3
  95. #define pdumper_STRIP16_BIT                     4
  96. #define pdumper_STRIP24_BIT                     5
  97. #define pdumper_FEATURE_HALFTONE_GREY           0x1u
  98. #define pdumper_FEATURE_DIFFUSED_GREY           0x2u
  99. #define pdumper_FEATURE_HALFTONE_COLOUR         0x4u
  100. #define pdumper_FEATURE_DIFFUSED_COLOUR         0x8u
  101. #define pdumper_FORMAT_HALFTONE_GREY            0x1u
  102. #define pdumper_FORMAT_DIFFUSED_GREY            0x2u
  103. #define pdumper_FORMAT_HALFTONE_COLOUR          0x4u
  104. #define pdumper_FORMAT_DIFFUSED_COLOUR          0x8u
  105. #define pdumper_HALFTONE_XRESOLUTION            0xFFu
  106. #define pdumper_HALFTONE_XRESOLUTION_SHIFT      0
  107. #define pdumper_HALFTONE_YRESOLUTION            0xFF00u
  108. #define pdumper_HALFTONE_YRESOLUTION_SHIFT      8
  109.  
  110. /*************************
  111.  * Function declarations *
  112.  *************************/
  113.  
  114. #ifdef __cplusplus
  115.    extern "C" {
  116. #endif
  117.  
  118. /*************************************************************
  119.  * NOTE: The following functions provide direct access to    *
  120.  *       the SWI's noted in the function description.        *
  121.  *       Please read the relevant PRM section for more       *
  122.  *       information on their input/output parameters.       *
  123.  *************************************************************/
  124.  
  125. /* ------------------------------------------------------------------------
  126.  * Function:      pdumper_info()
  127.  *
  128.  * Description:   Returns information about the PDumper support module
  129.  *
  130.  * Output:        version - value of R0 on exit
  131.  *                features - value of R1 on exit
  132.  *
  133.  * Other notes:   Calls SWI 0x41B00.
  134.  */
  135.  
  136. extern os_error *xpdumper_info (int *version,
  137.       bits *features);
  138. extern void pdumper_info (int *version,
  139.       bits *features);
  140.  
  141. /* ------------------------------------------------------------------------
  142.  * Function:      pdumper_claim()
  143.  *
  144.  * Description:   Allocates a block of memory and links it into the chain
  145.  *
  146.  * Input:         anchor - value of R0 on entry
  147.  *                size - value of R3 on entry
  148.  *                tag - value of R4 on entry
  149.  *
  150.  * Output:        blk - value of R2 on exit (X version only)
  151.  *
  152.  * Returns:       R2 (non-X version only)
  153.  *
  154.  * Other notes:   Calls SWI 0x41B01.
  155.  */
  156.  
  157. extern os_error *xpdumper_claim (int *anchor,
  158.       int size,
  159.       bits tag,
  160.       void **blk);
  161. extern void *pdumper_claim (int *anchor,
  162.       int size,
  163.       bits tag);
  164.  
  165. /* ------------------------------------------------------------------------
  166.  * Function:      pdumper_free()
  167.  *
  168.  * Description:   Unlinks a block of memory from the chain and releases it
  169.  *
  170.  * Input:         anchor - value of R0 on entry
  171.  *                blk - value of R2 on entry
  172.  *
  173.  * Other notes:   Calls SWI 0x41B02.
  174.  */
  175.  
  176. extern os_error *xpdumper_free (int *anchor,
  177.       void *blk);
  178. extern void pdumper_free (int *anchor,
  179.       void *blk);
  180.  
  181. /* ------------------------------------------------------------------------
  182.  * Function:      pdumper_find()
  183.  *
  184.  * Description:   Scans the printer dumper's chain for a block of memory
  185.  *                with the given tag
  186.  *
  187.  * Input:         anchor - value of R0 on entry
  188.  *                tag - value of R2 on entry
  189.  *
  190.  * Output:        blk - value of R2 on exit (X version only)
  191.  *
  192.  * Returns:       R2 (non-X version only)
  193.  *
  194.  * Other notes:   Calls SWI 0x41B03.
  195.  */
  196.  
  197. extern os_error *xpdumper_find (int *anchor,
  198.       bits tag,
  199.       void **blk);
  200. extern void *pdumper_find (int *anchor,
  201.       bits tag);
  202.  
  203. /* ------------------------------------------------------------------------
  204.  * Function:      pdumper_start_job()
  205.  *
  206.  * Description:   Sets up any workspace that is required for a job
  207.  *
  208.  * Input:         anchor - value of R0 on entry
  209.  *                flags - value of R1 on entry
  210.  *                palette_file_name - value of R2 on entry
  211.  *
  212.  * Other notes:   Calls SWI 0x41B04.
  213.  */
  214.  
  215. extern os_error *xpdumper_start_job (int *anchor,
  216.       bits flags,
  217.       char *palette_file_name);
  218. extern void pdumper_start_job (int *anchor,
  219.       bits flags,
  220.       char *palette_file_name);
  221.  
  222. /* ------------------------------------------------------------------------
  223.  * Function:      pdumper_tidy_job()
  224.  *
  225.  * Description:   Releases workspace used for a job
  226.  *
  227.  * Input:         anchor - value of R0 on entry
  228.  *                end_of_document - value of R2 on entry
  229.  *                tags - value of R3 on entry
  230.  *
  231.  * Other notes:   Calls SWI 0x41B05.
  232.  */
  233.  
  234. extern os_error *xpdumper_tidy_job (int *anchor,
  235.       bool end_of_document,
  236.       int *tags);
  237. extern void pdumper_tidy_job (int *anchor,
  238.       bool end_of_document,
  239.       int *tags);
  240.  
  241. /* ------------------------------------------------------------------------
  242.  * Function:      pdumper_set_colour()
  243.  *
  244.  * Description:   Processes the colour setting required by the printer
  245.  *                dumper
  246.  *
  247.  * Input:         anchor - value of R0 on entry
  248.  *                colour - value of R1 on entry
  249.  *                strip_and_pass_no - value of R2 on entry
  250.  *                halftone_info - value of R4 on entry
  251.  *
  252.  * Output:        col - value of R3 on exit (X version only)
  253.  *
  254.  * Returns:       R3 (non-X version only)
  255.  *
  256.  * Other notes:   Calls SWI 0x41B06.
  257.  */
  258.  
  259. extern os_error *xpdumper_set_colour (int *anchor,
  260.       os_colour colour,
  261.       bits strip_and_pass_no,
  262.       int halftone_info,
  263.       int *col);
  264. extern int pdumper_set_colour (int *anchor,
  265.       os_colour colour,
  266.       bits strip_and_pass_no,
  267.       int halftone_info);
  268.  
  269. /* ------------------------------------------------------------------------
  270.  * Function:      pdumper_prepare_strip()
  271.  *
  272.  * Description:   Processes a bitmap into a format suitable for printing
  273.  *
  274.  * Input:         anchor - value of R0 on entry
  275.  *                image - value of R1 on entry
  276.  *                format - value of R2 on entry
  277.  *                width - value of R3 on entry
  278.  *                height - value of R4 on entry
  279.  *                stride - value of R5 on entry
  280.  *                halftone_info - value of R6 on entry
  281.  *
  282.  * Other notes:   Calls SWI 0x41B07.
  283.  */
  284.  
  285. extern os_error *xpdumper_prepare_strip (int *anchor,
  286.       byte *image,
  287.       int format,
  288.       int width,
  289.       int height,
  290.       int stride,
  291.       bits halftone_info);
  292. extern void pdumper_prepare_strip (int *anchor,
  293.       byte *image,
  294.       int format,
  295.       int width,
  296.       int height,
  297.       int stride,
  298.       bits halftone_info);
  299.  
  300. /* ------------------------------------------------------------------------
  301.  * Function:      pdumper_lookup_error()
  302.  *
  303.  * Description:   Accesses the internal error handling routines within the
  304.  *                support module
  305.  *
  306.  * Input:         error - value of R0 on entry
  307.  *                arg0 - value of R1 on entry
  308.  *
  309.  * Other notes:   Calls SWI 0x41B08.
  310.  */
  311.  
  312. extern os_error *xpdumper_lookup_error (os_error *error,
  313.       char *arg0);
  314. extern void pdumper_lookup_error (os_error *error,
  315.       char *arg0);
  316.  
  317. /* ------------------------------------------------------------------------
  318.  * Function:      pdumper_copy_filename()
  319.  *
  320.  * Description:   Copies a specified file name into a buffer
  321.  *
  322.  * Input:         buffer - value of R0 on entry
  323.  *                size - value of R1 on entry
  324.  *                file_name - value of R2 on entry
  325.  *
  326.  * Other notes:   Calls SWI 0x41B09.
  327.  */
  328.  
  329. extern os_error *xpdumper_copy_filename (char *buffer,
  330.       int size,
  331.       char *file_name);
  332. extern void pdumper_copy_filename (char *buffer,
  333.       int size,
  334.       char *file_name);
  335.  
  336. /* ------------------------------------------------------------------------
  337.  * Function:      service_pdumper_starting()
  338.  *
  339.  * Description:   PDriverDP module starting up
  340.  *
  341.  * Other notes:   Calls SWI 0x30 with R1 = 0x66.
  342.  */
  343.  
  344. extern os_error *xservice_pdumper_starting (void);
  345. extern void service_pdumper_starting (void);
  346.  
  347. /* ------------------------------------------------------------------------
  348.  * Function:      service_pdumper_dying()
  349.  *
  350.  * Description:   PDriverDP module dying
  351.  *
  352.  * Other notes:   Calls SWI 0x30 with R1 = 0x67.
  353.  */
  354.  
  355. extern os_error *xservice_pdumper_dying (void);
  356. extern void service_pdumper_dying (void);
  357.  
  358. #ifdef __cplusplus
  359.    }
  360. #endif
  361.  
  362. #endif
  363.