home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / oslib / oslib_1 / OSLib / User / h / pdumper < prev    next >
Encoding:
Text File  |  1995-06-22  |  11.9 KB  |  366 lines

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