home *** CD-ROM | disk | FTP | other *** search
- #ifndef pdumper_H
- #define pdumper_H
-
- /* C header file for PDumper
- * written by DefMod (Sep 7 1994) on Wed Sep 7 21:19:47 1994
- * Copyright © Acorn Computers Ltd, 1994
- */
-
- /*************************************************************************
- * This source file was written by Acorn Computers Limited. It is part *
- * of the OSLib library for writing applications for RISC OS. It may be *
- * used freely in the creation of programs for RISC OS. *
- *************************************************************************/
-
- #ifndef types_H
- #include "types.h"
- #endif
-
- #ifndef os_H
- #include "os.h"
- #endif
-
- /**********************************
- * SWI names and SWI reason codes *
- **********************************/
- #undef PDumper_Info
- #define PDumper_Info 0x41B00
- #undef XPDumper_Info
- #define XPDumper_Info 0x61B00
- #undef PDumper_Claim
- #define PDumper_Claim 0x41B01
- #undef XPDumper_Claim
- #define XPDumper_Claim 0x61B01
- #undef PDumper_Free
- #define PDumper_Free 0x41B02
- #undef XPDumper_Free
- #define XPDumper_Free 0x61B02
- #undef PDumper_Find
- #define PDumper_Find 0x41B03
- #undef XPDumper_Find
- #define XPDumper_Find 0x61B03
- #undef PDumper_StartJob
- #define PDumper_StartJob 0x41B04
- #undef XPDumper_StartJob
- #define XPDumper_StartJob 0x61B04
- #undef PDumper_TidyJob
- #define PDumper_TidyJob 0x41B05
- #undef XPDumper_TidyJob
- #define XPDumper_TidyJob 0x61B05
- #undef PDumper_SetColour
- #define PDumper_SetColour 0x41B06
- #undef XPDumper_SetColour
- #define XPDumper_SetColour 0x61B06
- #undef PDumper_PrepareStrip
- #define PDumper_PrepareStrip 0x41B07
- #undef XPDumper_PrepareStrip
- #define XPDumper_PrepareStrip 0x61B07
- #undef PDumper_LookupError
- #define PDumper_LookupError 0x41B08
- #undef XPDumper_LookupError
- #define XPDumper_LookupError 0x61B08
- #undef PDumper_CopyFilename
- #define PDumper_CopyFilename 0x41B09
- #undef XPDumper_CopyFilename
- #define XPDumper_CopyFilename 0x61B09
- #undef Service_PDumperStarting
- #define Service_PDumperStarting 0x66
- #undef Service_PDumperDying
- #define Service_PDumperDying 0x67
-
- /************************
- * Constant definitions *
- ************************/
- #define error_PDUMPER_UNDECLARED 0x5D7u
- #define error_PDUMPER_TOO_OLD 0x5D8u
- #define error_PDUMPER_DUPLICATE_MODULE 0x5D9u
- #define error_PDUMPER_BAD_CALL 0x5DAu
- #define error_PDUMPER_BAD_STRIP 0x5DBu
- #define error_PDUMPER_BAD_PALETTE 0x5DCu
- #define error_PDUMPER_NOT_LINKED 0x5DDu
- #define error_PDUMPER_RESERVED 0x5DEu
- #define error_PDUMPER_BAD_OUTPUT_TYPE 0x5DFu
- #define error_PDUMPER_BLOCK_NOT_FOUND 0x5E0u
- #define error_PDUMPER_IN_USE 0x5E1u
- #define pdumper_DEVICE_SPRITE_DEVICE 0
- #define pdumper_DEVICE_GENERIC_DOT_MATRIX 1
- #define pdumper_DEVICE_LASERJET 2
- #define pdumper_DEVICE_IMAGEWRITER 3
- #define pdumper_DEVICE24_PIN 4
- #define pdumper_DEVICE_DESKJET 5
- #define pdumper_STRIP_MONOCHROME 0
- #define pdumper_STRIP_GREY_SCALE 1
- #define pdumper_STRIP8_BIT 2
- #define pdumper_STRIP24_BIT_MULTIPLE 3
- #define pdumper_STRIP16_BIT 4
- #define pdumper_STRIP24_BIT 5
- #define pdumper_FEATURE_HALFTONE_GREY 0x1u
- #define pdumper_FEATURE_DIFFUSED_GREY 0x2u
- #define pdumper_FEATURE_HALFTONE_COLOUR 0x4u
- #define pdumper_FEATURE_DIFFUSED_COLOUR 0x8u
- #define pdumper_FORMAT_HALFTONE_GREY 0x1u
- #define pdumper_FORMAT_DIFFUSED_GREY 0x2u
- #define pdumper_FORMAT_HALFTONE_COLOUR 0x4u
- #define pdumper_FORMAT_DIFFUSED_COLOUR 0x8u
- #define pdumper_HALFTONE_XRESOLUTION 0xFFu
- #define pdumper_HALFTONE_XRESOLUTION_SHIFT 0
- #define pdumper_HALFTONE_YRESOLUTION 0xFF00u
- #define pdumper_HALFTONE_YRESOLUTION_SHIFT 8
-
- /*************************
- * Function declarations *
- *************************/
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /*************************************************************
- * NOTE: The following functions provide direct access to *
- * the SWI's noted in the function description. *
- * Please read the relevant PRM section for more *
- * information on their input/output parameters. *
- *************************************************************/
-
- /* ------------------------------------------------------------------------
- * Function: pdumper_info()
- *
- * Description: Returns information about the PDumper support module
- *
- * Output: version - value of R0 on exit
- * features - value of R1 on exit
- *
- * Other notes: Calls SWI 0x41B00.
- */
-
- extern os_error *xpdumper_info (int *version,
- bits *features);
- extern void pdumper_info (int *version,
- bits *features);
-
- /* ------------------------------------------------------------------------
- * Function: pdumper_claim()
- *
- * Description: Allocates a block of memory and links it into the chain
- *
- * Input: anchor - value of R0 on entry
- * size - value of R3 on entry
- * tag - value of R4 on entry
- *
- * Output: blk - value of R2 on exit (X version only)
- *
- * Returns: R2 (non-X version only)
- *
- * Other notes: Calls SWI 0x41B01.
- */
-
- extern os_error *xpdumper_claim (int *anchor,
- int size,
- bits tag,
- void **blk);
- extern void *pdumper_claim (int *anchor,
- int size,
- bits tag);
-
- /* ------------------------------------------------------------------------
- * Function: pdumper_free()
- *
- * Description: Unlinks a block of memory from the chain and releases it
- *
- * Input: anchor - value of R0 on entry
- * blk - value of R2 on entry
- *
- * Other notes: Calls SWI 0x41B02.
- */
-
- extern os_error *xpdumper_free (int *anchor,
- void *blk);
- extern void pdumper_free (int *anchor,
- void *blk);
-
- /* ------------------------------------------------------------------------
- * Function: pdumper_find()
- *
- * Description: Scans the printer dumper's chain for a block of memory
- * with the given tag
- *
- * Input: anchor - value of R0 on entry
- * tag - value of R2 on entry
- *
- * Output: blk - value of R2 on exit (X version only)
- *
- * Returns: R2 (non-X version only)
- *
- * Other notes: Calls SWI 0x41B03.
- */
-
- extern os_error *xpdumper_find (int *anchor,
- bits tag,
- void **blk);
- extern void *pdumper_find (int *anchor,
- bits tag);
-
- /* ------------------------------------------------------------------------
- * Function: pdumper_start_job()
- *
- * Description: Sets up any workspace that is required for a job
- *
- * Input: anchor - value of R0 on entry
- * flags - value of R1 on entry
- * palette_file_name - value of R2 on entry
- *
- * Other notes: Calls SWI 0x41B04.
- */
-
- extern os_error *xpdumper_start_job (int *anchor,
- bits flags,
- char *palette_file_name);
- extern void pdumper_start_job (int *anchor,
- bits flags,
- char *palette_file_name);
-
- /* ------------------------------------------------------------------------
- * Function: pdumper_tidy_job()
- *
- * Description: Releases workspace used for a job
- *
- * Input: anchor - value of R0 on entry
- * end_of_document - value of R2 on entry
- * tags - value of R3 on entry
- *
- * Other notes: Calls SWI 0x41B05.
- */
-
- extern os_error *xpdumper_tidy_job (int *anchor,
- bool end_of_document,
- int *tags);
- extern void pdumper_tidy_job (int *anchor,
- bool end_of_document,
- int *tags);
-
- /* ------------------------------------------------------------------------
- * Function: pdumper_set_colour()
- *
- * Description: Processes the colour setting required by the printer
- * dumper
- *
- * Input: anchor - value of R0 on entry
- * colour - value of R1 on entry
- * strip_and_pass_no - value of R2 on entry
- * halftone_info - value of R4 on entry
- *
- * Output: col - value of R3 on exit (X version only)
- *
- * Returns: R3 (non-X version only)
- *
- * Other notes: Calls SWI 0x41B06.
- */
-
- extern os_error *xpdumper_set_colour (int *anchor,
- os_colour colour,
- bits strip_and_pass_no,
- int halftone_info,
- int *col);
- extern int pdumper_set_colour (int *anchor,
- os_colour colour,
- bits strip_and_pass_no,
- int halftone_info);
-
- /* ------------------------------------------------------------------------
- * Function: pdumper_prepare_strip()
- *
- * Description: Processes a bitmap into a format suitable for printing
- *
- * Input: anchor - value of R0 on entry
- * image - value of R1 on entry
- * format - value of R2 on entry
- * width - value of R3 on entry
- * height - value of R4 on entry
- * stride - value of R5 on entry
- * halftone_info - value of R6 on entry
- *
- * Other notes: Calls SWI 0x41B07.
- */
-
- extern os_error *xpdumper_prepare_strip (int *anchor,
- byte *image,
- int format,
- int width,
- int height,
- int stride,
- bits halftone_info);
- extern void pdumper_prepare_strip (int *anchor,
- byte *image,
- int format,
- int width,
- int height,
- int stride,
- bits halftone_info);
-
- /* ------------------------------------------------------------------------
- * Function: pdumper_lookup_error()
- *
- * Description: Accesses the internal error handling routines within the
- * support module
- *
- * Input: error - value of R0 on entry
- * arg0 - value of R1 on entry
- *
- * Other notes: Calls SWI 0x41B08.
- */
-
- extern os_error *xpdumper_lookup_error (os_error *error,
- char *arg0);
- extern void pdumper_lookup_error (os_error *error,
- char *arg0);
-
- /* ------------------------------------------------------------------------
- * Function: pdumper_copy_filename()
- *
- * Description: Copies a specified file name into a buffer
- *
- * Input: buffer - value of R0 on entry
- * size - value of R1 on entry
- * file_name - value of R2 on entry
- *
- * Other notes: Calls SWI 0x41B09.
- */
-
- extern os_error *xpdumper_copy_filename (char *buffer,
- int size,
- char *file_name);
- extern void pdumper_copy_filename (char *buffer,
- int size,
- char *file_name);
-
- /* ------------------------------------------------------------------------
- * Function: service_pdumper_starting()
- *
- * Description: PDriverDP module starting up
- *
- * Other notes: Calls SWI 0x30 with R1 = 0x66.
- */
-
- extern os_error *xservice_pdumper_starting (void);
- extern void service_pdumper_starting (void);
-
- /* ------------------------------------------------------------------------
- * Function: service_pdumper_dying()
- *
- * Description: PDriverDP module dying
- *
- * Other notes: Calls SWI 0x30 with R1 = 0x67.
- */
-
- extern os_error *xservice_pdumper_dying (void);
- extern void service_pdumper_dying (void);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-