Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

MagiC/WDIALOG extension: Printer Dialog Library
[AES Function Reference]

printer dialog functions More...

Data Structures

struct  _prn_tray
struct  _media_size
struct  _media_type
struct  _prn_mode
struct  _prn_entry
struct  _dither_mode
struct  DRV_INFO
struct  _drv_entry
struct  PDLG_HNDL_args
struct  _pdlg_sub
struct  _prn_settings

Defines

#define PRN_STD_SUBS   0x0001
#define PRN_FSM_SUBS   0x0002
#define PRN_QD_SUBS   0x0004
#define PDLG_CHG_SUB   0x80000000L
#define PDLG_IS_BUTTON   0x40000000L
#define PDLG_PREBUTTON   0x20000000L
#define PDLG_PB_OK   1
#define PDLG_PB_CANCEL   2
#define PDLG_PB_DEVICE   3
#define PDLG_BUT_OK   (PDLG_PREBUTTON + PDLG_PB_OK)
#define PDLG_BUT_CNCL   (PDLG_PREBUTTON + PDLG_PB_CANCEL)
#define PDLG_BUT_DEV   (PDLG_PREBUTTON + PDLG_PB_DEVICE)
#define CC_MONO   0x0001
#define CC_4_GREY   0x0002
#define CC_8_GREY   0x0004
#define CC_16_GREY   0x0008
#define CC_256_GREY   0x0010
#define CC_32K_GREY   0x0020
#define CC_65K_GREY   0x0040
#define CC_16M_GREY   0x0080
#define CC_2_COLOR   0x0100
#define CC_4_COLOR   0x0200
#define CC_8_COLOR   0x0400
#define CC_16_COLOR   0x0800
#define CC_256_COLOR   0x1000
#define CC_32K_COLOR   0x2000
#define CC_65K_COLOR   0x4000
#define CC_16M_COLOR   0x8000
#define NO_CC_BITS   16
#define DC_NONE   0
#define DC_FLOYD   1
#define NO_DC_BITS   1
#define PC_FILE   0x0001
#define PC_SERIAL   0x0002
#define PC_PARALLEL   0x0004
#define PC_ACSI   0x0008
#define PC_SCSI   0x0010
#define PC_BACKGROUND   0x0080
#define PC_SCALING   0x0100
#define PC_COPIES   0x0200
#define MC_PORTRAIT   0x0001
#define MC_LANDSCAPE   0x0002
#define MC_REV_PTRT   0x0004
#define MC_REV_LNDSCP   0x0008
#define MC_ORIENTATION   0x000f
#define MC_SLCT_CMYK   0x0400
#define MC_CTRST_BRGHT   0x0800
#define PLANE_BLACK   0x0001
#define PLANE_YELLOW   0x0002
#define PLANE_MAGENTA   0x0004
#define PLANE_CYAN   0x0008
#define DM_BG_PRINTING   0x0001
#define PG_EVEN_PAGES   0x0001
#define PG_ODD_PAGES   0x0002
#define PG_MIN_PAGE   1
#define PG_MAX_PAGE   9999
#define PG_UNKNOWN   0x0000
#define PG_PORTRAIT   0x0001
#define PG_LANDSCAPE   0x0002
#define PDLG_3D   0x0001
#define PDLG_PREFS   0x0000
#define PDLG_PRINT   0x0001
#define PDLG_ALWAYS_COPIES   0x0010
#define PDLG_ALWAYS_ORIENT   0x0020
#define PDLG_ALWAYS_SCALE   0x0040
#define PDLG_EVENODD   0x0100
#define PDLG_CANCEL   1
#define PDLG_OK   2

Typedefs

typedef void * PRN_DIALOG
typedef _prn_tray PRN_TRAY
typedef _media_size MEDIA_SIZE
typedef _media_type MEDIA_TYPE
typedef _prn_mode PRN_MODE
typedef _prn_entry PRN_ENTRY
typedef _dither_mode DITHER_MODE
typedef _drv_entry DRV_ENTRY
typedef _pdlg_sub PDLG_SUB
typedef _prn_settings PRN_SETTINGS
typedef long __CDECL(* PRN_SWITCH )(DRV_ENTRY *drivers, PRN_SETTINGS *settings, PRN_ENTRY *old_printer, PRN_ENTRY *new_printer)
typedef long __CDECL(* PDLG_INIT )(PRN_SETTINGS *settings, PDLG_SUB *sub)
typedef long __CDECL(* PDLG_HNDL )(struct PDLG_HNDL_args)
typedef long __CDECL(* PDLG_RESET )(PRN_SETTINGS *settings, PDLG_SUB *sub)

Functions

short mt_pdlg_add_printers (PRN_DIALOG *prn_dialog, DRV_INFO *drv_info, short *global)
short mt_pdlg_add_sub_dialogs (PRN_DIALOG *prn_dialog, PDLG_SUB *sub_dialogs, short *global)
short mt_pdlg_close (PRN_DIALOG *prn_dialog, short *x, short *y, short *global)
PRN_DIALOGmt_pdlg_create (short dialog_flags, short *global)
short mt_pdlg_delete (PRN_DIALOG *prn_dialog, short *global)
short mt_pdlg_dflt_settings (PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, short *global)
short mt_pdlg_do (PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, char *document_name, short option_flags, short *global)
short mt_pdlg_evnt (PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, EVNT *events, short *button, short *global)
short mt_pdlg_free_settings (PRN_SETTINGS *settings, short *global)
long mt_pdlg_get_setsize (short *global)
PRN_SETTINGSmt_pdlg_new_settings (PRN_DIALOG *prn_dialog, short *global)
short mt_pdlg_open (PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, char *document_name, short option_flags, short x, short y, short *global)
short mt_pdlg_remove_printers (PRN_DIALOG *prn_dialog, short *global)
short mt_pdlg_remove_sub_dialogs (PRN_DIALOG *prn_dialog, short *global)
short mt_pdlg_save_default_settings (PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, short *global)
short mt_pdlg_update (PRN_DIALOG *prn_dialog, char *document_name, short *global)
short mt_pdlg_use_settings (PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, short *global)
short mt_pdlg_validate_settings (PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, short *global)

Detailed Description

printer dialog functions

This Printer Dialog library availability can be found calling mt_appl_getinfo(7). Bit 4 of ap_gout1, if equal to 1, says that mt_pdlg_xx() functions are available.


Define Documentation

#define CC_16_COLOR   0x0800
 

16 Farben

#define CC_16_GREY   0x0008
 

16 Graut”ne

#define CC_16M_COLOR   0x8000
 

16777216 Farben

#define CC_16M_GREY   0x0080
 

16777216 Farben in Graut”ne wandeln

#define CC_256_COLOR   0x1000
 

256 Farben

#define CC_256_GREY   0x0010
 

256 Graut”ne

#define CC_2_COLOR   0x0100
 

2 Farben

#define CC_32K_COLOR   0x2000
 

32768 Farben

#define CC_32K_GREY   0x0020
 

32768 Farben in Graut”ne wandeln

#define CC_4_COLOR   0x0200
 

4 Farben

#define CC_4_GREY   0x0002
 

4 Graut”ne

#define CC_65K_COLOR   0x4000
 

65536 Farben

#define CC_65K_GREY   0x0040
 

65536 Farben in Graut”ne wandeln

#define CC_8_COLOR   0x0400
 

8 Farben

#define CC_8_GREY   0x0004
 

8 Graut”ne

#define CC_MONO   0x0001
 

2 Graut”ne

#define DC_FLOYD   1
 

einfacher Floyd-Steinberg

#define DC_NONE   0
 

keine Rasterverfahren

#define DM_BG_PRINTING   0x0001
 

Flag fr Hintergrunddruck

#define MC_CTRST_BRGHT   0x0800
 

Treiber kann Kontrast und Helligkeit ver„ndern

#define MC_LANDSCAPE   0x0002
 

Seite kann im Querformat ausgegeben werden

#define MC_ORIENTATION   0x000f
 

TODO

#define MC_PORTRAIT   0x0001
 

Seite kann im Hochformat ausgegeben werden

#define MC_REV_LNDSCP   0x0008
 

Seite kann um 180 Grad gedreht im Querformat ausgegeben werden

#define MC_REV_PTRT   0x0004
 

Seite kann um 180 Grad gedreht im Hochformat ausgegeben werden

#define MC_SLCT_CMYK   0x0400
 

Treiber kann bestimmte Farbebenen ausgeben

#define NO_CC_BITS   16
 

TODO

#define NO_DC_BITS   1
 

TODO

#define PC_ACSI   0x0008
 

Drucker kann auf der ACSI-Schnittstelle ausgeben

#define PC_BACKGROUND   0x0080
 

Treiber kann im Hintergrund ausdrucken

#define PC_COPIES   0x0200
 

Treiber kann Kopien einer Seite erstellen

#define PC_FILE   0x0001
 

Drucker kann ber GEMDOS-Dateien angesprochen werden

#define PC_PARALLEL   0x0004
 

Drucker kann auf der parallelen Schnittstelle angesteuert werden

#define PC_SCALING   0x0100
 

Treiber kann Seite skalieren

#define PC_SCSI   0x0010
 

Drucker kann auf der SCSI-Schnittstelle ausgeben

#define PC_SERIAL   0x0002
 

Drucker kann auf der seriellen Schnittstelle angesteuert werden

#define PDLG_3D   0x0001
 

Use 3D-look

#define PDLG_ALWAYS_COPIES   0x0010
 

Always offer No. of copies

#define PDLG_ALWAYS_ORIENT   0x0020
 

Always offer landscape format

#define PDLG_ALWAYS_SCALE   0x0040
 

Always offer scaling

#define PDLG_BUT_CNCL   (PDLG_PREBUTTON + PDLG_PB_CANCEL)
 

TODO

#define PDLG_BUT_DEV   (PDLG_PREBUTTON + PDLG_PB_DEVICE)
 

TODO

#define PDLG_BUT_OK   (PDLG_PREBUTTON + PDLG_PB_OK)
 

TODO

#define PDLG_CANCEL   1
 

"Abbruch" wurde angew„hlt

#define PDLG_CHG_SUB   0x80000000L
 

TODO

#define PDLG_EVENODD   0x0100
 

Offer option for even and odd pages

#define PDLG_IS_BUTTON   0x40000000L
 

TODO

#define PDLG_OK   2
 

"OK" wurde gedrckt

#define PDLG_PB_CANCEL   2
 

TODO

#define PDLG_PB_DEVICE   3
 

TODO

#define PDLG_PB_OK   1
 

TODO

#define PDLG_PREBUTTON   0x20000000L
 

TODO

#define PDLG_PREFS   0x0000
 

Display settings dialog

#define PDLG_PRINT   0x0001
 

Display print dialog

#define PG_EVEN_PAGES   0x0001
 

Only output pages with even page numbers

#define PG_LANDSCAPE   0x0002
 

Output page in landscape format

#define PG_MAX_PAGE   9999
 

TODO

#define PG_MIN_PAGE   1
 

TODO

#define PG_ODD_PAGES   0x0002
 

Only output pages with odd page numbers

#define PG_PORTRAIT   0x0001
 

Output page in portrait format

#define PG_UNKNOWN   0x0000
 

Orientation unknown and not adjustable

#define PLANE_BLACK   0x0001
 

TODO

#define PLANE_CYAN   0x0008
 

TODO

#define PLANE_MAGENTA   0x0004
 

TODO

#define PLANE_YELLOW   0x0002
 

TODO

#define PRN_FSM_SUBS   0x0002
 

Standard-Unterdialoge fr FSM-Drucker

#define PRN_QD_SUBS   0x0004
 

Standard-Unterdialoge fr QuickDraw-Drucker

#define PRN_STD_SUBS   0x0001
 

Standard-Unterdialoge fr NVDI-Drucker


Typedef Documentation

typedef struct _dither_mode DITHER_MODE
 

TODO

typedef struct _drv_entry DRV_ENTRY
 

TODO

typedef struct _media_size MEDIA_SIZE
 

TODO

typedef struct _media_type MEDIA_TYPE
 

TODO

typedef long __CDECL(* PDLG_HNDL)(struct PDLG_HNDL_args)
 

TODO

typedef long __CDECL(* PDLG_INIT)(PRN_SETTINGS *settings, PDLG_SUB *sub)
 

TODO

typedef long __CDECL(* PDLG_RESET)(PRN_SETTINGS *settings, PDLG_SUB *sub)
 

TODO

typedef struct _pdlg_sub PDLG_SUB
 

TODO

typedef void* PRN_DIALOG
 

TODO

typedef struct _prn_entry PRN_ENTRY
 

TODO

typedef struct _prn_mode PRN_MODE
 

TODO

typedef struct _prn_settings PRN_SETTINGS
 

TODO

typedef long __CDECL(* PRN_SWITCH)(DRV_ENTRY *drivers, PRN_SETTINGS *settings, PRN_ENTRY *old_printer, PRN_ENTRY *new_printer)
 

old_printer can also be 0L

typedef struct _prn_tray PRN_TRAY
 

TODO


Function Documentation

short mt_pdlg_add_printers PRN_DIALOG prn_dialog,
DRV_INFO drv_info,
short global_aes
 

Add application's printers

Parameters:
prn_dialog Pointer to management structure
drv_info contains a pointer to a list of available printers and dither processes.
global_aes global AES array
Returns:
0: Error
1: All OK
Since:
mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability
With mt_pdlg_add_printers() a program can add its own private printer descriptions to the dialog. The driver number should be set to 0x7fff to differentiate the private driver from the OS-drivers.

short mt_pdlg_add_sub_dialogs PRN_DIALOG prn_dialog,
PDLG_SUB sub_dialogs,
short global_aes
 

Add application's sub-dialogs

Parameters:
prn_dialog Pointer to management structure
sub_dialogs List of sub-dialogs
global_aes global AES array
Returns:
0: Error
1: All OK
Since:
mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability
With mt_pdlg_add_sub_dialogs() an application can add its custom sub-dialogs to the printer dialog to offer special print options (e.g. watermarks, background images etc.).

Note:
The hooking in of an application's own dialogs is demonstrated in the sample programs PDLGSMP3.C and PDLGSMP4.C (of WDIALOG documentation).

short mt_pdlg_close PRN_DIALOG prn_dialog,
short x,
short y,
short global_aes
 

closes the window of the print dialog

Parameters:
prn_dialog Pointer to management structure
x X-coordinates of the window
[option CHECK_NULLPTR] x may be NULL
y Y-coordinates of the window
[option CHECK_NULLPTR] y may be NULL
global_aes global AES array
Returns:
1
Since:
mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability

PRN_DIALOG* mt_pdlg_create short  dialog_flags,
short global_aes
 

initialises the print dialog

Parameters:
dialog_flags Only 3D-flag at present:
  • PDLG_3D (1) Display selection in 3D-look
global_aes global AES array
Returns:
Pointer to management structure
Since:
mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability
On calling the function a scan will be made for the printer drivers present and memory will be allocated for the resource.

short mt_pdlg_delete PRN_DIALOG prn_dialog,
short global_aes
 

releases the memory for the print dialog

Parameters:
prn_dialog Pointer to management structure
global_aes global AES array
Returns:
1
Since:
mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability

short mt_pdlg_dflt_settings PRN_DIALOG prn_dialog,
PRN_SETTINGS settings,
short global_aes
 

Initialises the structure to which settings points.

Parameters:
prn_dialog Pointer to management structure
settings Printer settings
global_aes global AES array
Returns:
1
Since:
mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability
Note:
Structure length can be found with mt_pdlg_get_setsize().

short mt_pdlg_do PRN_DIALOG prn_dialog,
PRN_SETTINGS settings,
char *  document_name,
short  option_flags,
short global_aes
 

is the counterpart to mt_pdlg_open()/mt_pdlg_evnt()/mt_pdlg_close(). This function opens a modal dialog and only returns to the caller when one of the exit buttons has been activated ("Cancel", "OK" ).

Parameters:
prn_dialog Pointer to management structure
settings Printer settings
document_name Document name
option_flags 
  • PDLG_PREFS 0x0000 Display settings dialog
  • PDLG_PRINT 0x0001 Display print dialog
  • PDLG_ALWAYS_COPIES 0x0010 Always offer No. of copies
  • PDLG_ALWAYS_ORIENT 0x0020 Always offer landscape format
  • PDLG_ALWAYS_SCALE 0x0040 Always offer scaling
  • PDLG_EVENODD 0x0100 Offer option for even and odd pages
global_aes global AES array
Returns:
Selected button (or 0)
  • PDLG_CANCEL 1 "Cancel" was selected
  • PDLG_OK 2 "OK" was pressed
Since:
mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability

short mt_pdlg_evnt PRN_DIALOG prn_dialog,
PRN_SETTINGS settings,
EVNT events,
short button,
short global_aes
 

evaluates the passed EVNT structure and calls mt_wdlg_evnt() internally.

Parameters:
prn_dialog Pointer to management structure
settings Printer settings
events Pointer to EVNT structure
button Selected button (or 0)
  • PDLG_CANCEL (1) "Cancel" was selected
  • PDLG_OK (2) "OK" was pressed
[option CHECK_NULLPTR] button may be NULL
global_aes global AES array
Returns:
0 (Exit button selected) or 1 (Nothing happened)
Since:
mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability
mt_pdlg_evnt() evaluates the passed EVNT structure and calls mt_wdlg_evnt() internally. If one of the exit buttons was activated ("Cancel", "OK", "Set", "Mark" or "Options") the function returns a 0 and the button that the user has selected is returned in button. If the dialog was confirmed, then the new printer settings are returned in settings.

short mt_pdlg_free_settings PRN_SETTINGS settings,
short global_aes
 

Releases the memory allocated with mt_pdlg_new_settings().

Parameters:
settings Printer settings
global_aes global AES array
Returns:
unknown ???
Since:
mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability

long mt_pdlg_get_setsize short global_aes  ) 
 

returns the length of the PRN_SETTINGS structure

Parameters:
global_aes global AES array
Returns:
length of the PRN_SETTINGS structure in bytes
Since:
mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability

PRN_SETTINGS* mt_pdlg_new_settings PRN_DIALOG prn_dialog,
short global_aes
 

Memory for printer settings is allocated, the structure is initialised and returned

Parameters:
prn_dialog Pointer to management structure
global_aes global AES array
Returns:
Printer settings
Since:
mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability

short mt_pdlg_open PRN_DIALOG prn_dialog,
PRN_SETTINGS settings,
char *  document_name,
short  option_flags,
short  x,
short  y,
short global_aes
 

opens a window with the print dialog

Parameters:
prn_dialog Pointer to management structure
settings Printer settings
document_name Document name
option_flags 
  • PDLG_PREFS 0x0000 Display settings dialog
  • PDLG_PRINT 0x0001 Display print dialog
  • PDLG_ALWAYS_COPIES 0x0010 Always offer No. of copies
  • PDLG_ALWAYS_ORIENT 0x0020 Always offer landscape format
  • PDLG_ALWAYS_SCALE 0x0040 Always offer scaling
  • PDLG_EVENODD 0x0100 Offer option for even and odd pages
x X-coordinates of the window or -1 (centred)
y Y-coordinates of the window or -1 (centred)
global_aes global AES array
Returns:
Handle of the window or 0 (error)
Since:
mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability
mt_pdlg_open() opens a window with the print dialog. The handle of the window will be returned if no error has arisen. In case of error the return value is 0. The structure settings contains the printer settings, which should be saved with each document. If no settings exist for a document yet, one can either create them with mt_pdlg_new_settings() (the memory block belongs to the system) or the application can call Malloc() and subsequently mt_pdlg_dflt_settings() to initialise the memory.

option_flags contains information, among other things, whether the dialog is to be displayed as a settings (PDLG_PREFS) or print dialog (PDLG_PRINT). In addition the flags PDLG_ALWAYS_COPIES, PDLG_ALWAYS_ORIENT and PDLG_ALWAYS_SCALE can ensure that the number of copies, landscape printing and scaling options are offered even when the driver does not support them, so that the application has to output the page rotated to the landscape format, for instance. PDLG_EVENODD makes the buttons for even/odd pages selectable.

short mt_pdlg_remove_printers PRN_DIALOG prn_dialog,
short global_aes
 

removes the printers installed with mt_pdlg_add_printers() from the binding.

Parameters:
prn_dialog Pointer to management structure
global_aes global AES array
Returns:
unknown ???
Since:
mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability
Note:
mt_pdlg_remove_printers() must be called before mt_pdlg_delete().

short mt_pdlg_remove_sub_dialogs PRN_DIALOG prn_dialog,
short global_aes
 

removes the application's custom sub-dialogs

Parameters:
prn_dialog Pointer to management structure
global_aes global AES array
Returns:
unknown ???
Since:
mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability

short mt_pdlg_save_default_settings PRN_DIALOG prn_dialog,
PRN_SETTINGS settings,
short global_aes
 

Parameters:
prn_dialog 
settings 
global_aes global AES array
Returns:
Since:
mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability

short mt_pdlg_update PRN_DIALOG prn_dialog,
char *  document_name,
short global_aes
 

This function sets a new window name. It should be called when the window dialog lies in the background and the user tops a new document window.

Parameters:
prn_dialog Pointer to management structure
document_name New document name
global_aes global AES array
Returns:
0: Error
1: All OK
Since:
mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability

short mt_pdlg_use_settings PRN_DIALOG prn_dialog,
PRN_SETTINGS settings,
short global_aes
 

This function should be called if a program wants to print immediately and it is not possible to call mt_pdlg_do() or mt_pdlg_open() and mt_pdlg_evnt() (e.g. Calamus-print dialogs).

Parameters:
prn_dialog Pointer to management structure
settings Printer settings
global_aes global AES array
Returns:
0: Error
1: All OK
Since:
mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability
Note:
The passed printer settings will be validated (and saved for old drivers).

short mt_pdlg_validate_settings PRN_DIALOG prn_dialog,
PRN_SETTINGS settings,
short global_aes
 

Validate the printer settings and if necessary correct the structure contents.

Parameters:
prn_dialog Pointer to management structure
settings Printer settings
global_aes global AES array
Returns:
0: Error
1: All OK
Since:
mt_appl_getinfo(7) give informations on mt_pdlg_xx() functions availability


Generated on Wed Nov 3 22:42:21 2004 for GEMLIB by  doxygen 1.3.9.1