With ADD PRIVATE PRINTERS a program can add its own private printer descriptions to the dialog. <drv_info> contains a pointer to a list of available printers and dither processes. The driver number should be set to 0x7fff to differentiate the private driver from the OS-drivers.
Declaration:
WORD pdlg_add_printers( PRN_DIALOG *prn_dialog, DRV_INFO *drv_info );
Call:
ret = pdlg_add_printers( prn_dialog, &drv_info );
Variable Argument Meaning
Inputs:
contrl[0] 205 pdlg_set
contrl[1] 1 Entries in intin
contrl[3] 2 Entries in addrin
intin[0] 0 pdlg_add_driver
addrin[0] prn_dialog Pointer to management structure
addrin[1] driver
Outputs:
contrl[2] 1 Entries in intout
contrl[4] 0 Entries in addrout
intout[0] ret 0: Error 1: All OK
Structure description:
typedef struct
{
LONG magic; /* 'pdnf' */
LONG length; /* Structure length */
LONG format; /* Data format */
LONG reserved; /* Reserved */
WORD driver_id; /* Driver number for the VDI */
WORD driver_type; /* Driver type */
LONG reserved1;
LONG reserved2;
LONG reserved3;
PRN_ENTRY *printers; /* List of printers belonging to
the driver */
DITHER_MODE *dither_modes; /* List of dither processes
supported by the driver */
LONG reserved4;
LONG reserved5;
LONG reserved6;
LONG reserved7;
LONG reserved8;
LONG reserved9;
BYTE device[128]; /* Printer driver output file */
} DRV_INFO;
typedef struct _dither_mode
{
struct _dither_mode *next;
LONG length; /* Structure length */
LONG format; /* Data format */
LONG reserved; /* Reserved */
LONG dither_id; /* Dither ID */
LONG color_modes; /* Colour depths supported */
LONG reserved1;
LONG reserved2;
BYTE name[32]; /* Name of the dither process */
} DITHER_MODE;
typedef struct _prn_entry /* Device description */
{
struct _prn_entry *next; /* Pointer to next device description */
LONG length; /* Structure length */
LONG format; /* Data format */
LONG reserved; /* Reserved */
WORD driver_id; /* Driver ID */
WORD driver_type; /* Driver type */
LONG printer_id; /* Printer ID */
LONG printer_capabilities; /* Printer capabilities */
LONG reserved1;
LONG flags;
struct _pdlg_sub *sub_dialogs; /* Pointer to the list of subdialogs
for this printer */
PRN_SWITCH setup_panel; /* Initialise subdialog at printer
change */
PRN_SWITCH close_panel; /* Close subdialog at printer change */
PRN_MODE *modes; /* List of available resolutions */
MEDIA_SIZE *papers; /* List of available paper formats */
PRN_TRAY *input_trays; /* List of feed trays */
PRN_TRAY *output_trays; /* List of output trays */
BYTE name[32]; /* Name of the printer */
} PRN_ENTRY;
/* old_printer can also be 0L */
typedef LONG (cdecl *PRN_SWITCH)( struct _drv_entry *drivers,
struct _prn_settings *settings, struct _prn_entry *old_printer,
struct _prn_entry *new_printer );
#define PRN_STD_SUBS 0x0001
typedef struct _prn_mode /* Description of a print mode */
{
struct _prn_mode *next; /* Pointer to the next print mode */
LONG mode_id; /* Mode ID (index within the file) */
WORD hdpi; /* Horizontal resolution in dpi */
WORD vdpi; /* Vertical resolution in dpi */
LONG mode_capabilities; /* Mode capabilities */
LONG color_capabilities; /* Colour capabilities */
LONG dither_flags; /* Flags specifying whether the corres-
ponding colour mode is accessible
with or without dithering */
MEDIA_TYPE *paper_types; /* Suitable paper types */
LONG reserved;
BYTE name[32]; /* Mode name */
} PRN_MODE;
typedef struct _media_type /* Description of a paper type/print
medium */
{
struct _media_type *next;
LONG type_id; /* Paper format type ID */
BYTE name[32]; /* Name of the paper format */
} MEDIA_TYPE;
typedef struct _media_size /* Description of a paper format */
{
struct _media_size *next;
LONG size_id; /* Paper format size ID */
BYTE name[32]; /* Name of the paper format */
} MEDIA_SIZE;
typedef struct _prn_tray /* Description of a feed/output tray */
{
struct _prn_tray *next;
LONG tray_id; /* Number of the feed or output tray */
BYTE name[32]; /* Name of the tray */
} PRN_TRAY;