printer dialog functions
More...
|
#define | pdlg_add_printers(a, b) mt_pdlg_add_printers(a,b,aes_global) |
|
#define | pdlg_add_sub_dialogs(a, b) mt_pdlg_add_sub_dialogs(a,b,aes_global) |
|
#define | pdlg_close(a, b, c) mt_pdlg_close(a,b,c,aes_global) |
|
#define | pdlg_create(a) mt_pdlg_create(a,aes_global) |
|
#define | pdlg_delete(a) mt_pdlg_delete(a,aes_global) |
|
#define | pdlg_dflt_settings(a, b) mt_pdlg_dflt_settings(a,b,aes_global) |
|
#define | pdlg_do(a, b, c, d) mt_pdlg_do(a,b,c,d,aes_global) |
|
#define | pdlg_evnt(a, b, c, d) mt_pdlg_evnt(a,b,c,d,aes_global) |
|
#define | pdlg_free_settings(a) mt_pdlg_free_settings(a,aes_global) |
|
#define | pdlg_get_setsize() mt_pdlg_get_setsize(aes_global) |
|
#define | pdlg_new_settings(a) mt_pdlg_new_settings(a,aes_global) |
|
#define | pdlg_open(a, b, c, d, e, f) mt_pdlg_open(a,b,c,d,e,f,aes_global) |
|
#define | pdlg_remove_printers(a) mt_pdlg_remove_printers(a,aes_global) |
|
#define | pdlg_remove_sub_dialogs(a) mt_pdlg_remove_sub_dialogs(a,aes_global) |
|
#define | pdlg_save_default_settings(a, b) mt_pdlg_save_default_settings(a,b,aes_global) |
|
#define | pdlg_update(a, b) mt_pdlg_update(a,b,aes_global) |
|
#define | pdlg_use_settings(a, b) mt_pdlg_use_settings(a,b,aes_global) |
|
#define | pdlg_validate_settings(a, b) mt_pdlg_validate_settings(a,b,aes_global) |
|
#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 |
|
|
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_DIALOG * | mt_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_SETTINGS * | mt_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) |
|
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 CC_16_COLOR 0x0800 |
#define CC_16_GREY 0x0008 |
#define CC_16M_COLOR 0x8000 |
#define CC_16M_GREY 0x0080 |
16777216 Farben in Grautne wandeln
#define CC_256_COLOR 0x1000 |
#define CC_256_GREY 0x0010 |
#define CC_2_COLOR 0x0100 |
#define CC_32K_COLOR 0x2000 |
#define CC_32K_GREY 0x0020 |
32768 Farben in Grautne wandeln
#define CC_4_COLOR 0x0200 |
#define CC_65K_COLOR 0x4000 |
#define CC_65K_GREY 0x0040 |
65536 Farben in Grautne wandeln
#define CC_8_COLOR 0x0400 |
einfacher Floyd-Steinberg
#define DM_BG_PRINTING 0x0001 |
Flag fr Hintergrunddruck
#define MC_CTRST_BRGHT 0x0800 |
Treiber kann Kontrast und Helligkeit verndern
#define MC_LANDSCAPE 0x0002 |
Seite kann im Querformat ausgegeben werden
#define MC_ORIENTATION 0x000f |
#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
Drucker kann auf der ACSI-Schnittstelle ausgeben
#define PC_BACKGROUND 0x0080 |
Treiber kann im Hintergrund ausdrucken
Treiber kann Kopien einer Seite erstellen
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
Drucker kann auf der SCSI-Schnittstelle ausgeben
Drucker kann auf der seriellen Schnittstelle angesteuert werden
#define PDLG_ALWAYS_COPIES 0x0010 |
Always offer No. of copies
#define PDLG_ALWAYS_ORIENT 0x0020 |
Always offer landscape format
#define PDLG_ALWAYS_SCALE 0x0040 |
"Abbruch" wurde angewhlt
#define PDLG_CHG_SUB 0x80000000L |
#define PDLG_EVENODD 0x0100 |
Offer option for even and odd pages
#define PDLG_IS_BUTTON 0x40000000L |
#define pdlg_open |
( |
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
e, |
|
|
|
f |
|
) |
| mt_pdlg_open(a,b,c,d,e,f,aes_global) |
#define PDLG_PREBUTTON 0x20000000L |
#define PDLG_PREFS 0x0000 |
#define PDLG_PRINT 0x0001 |
#define PG_EVEN_PAGES 0x0001 |
Only output pages with even page numbers
#define PG_LANDSCAPE 0x0002 |
Output page in landscape format
#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 |
#define PLANE_CYAN 0x0008 |
#define PLANE_MAGENTA 0x0004 |
#define PLANE_YELLOW 0x0002 |
#define PRN_FSM_SUBS 0x0002 |
Standard-Unterdialoge fr FSM-Drucker
#define PRN_QD_SUBS 0x0004 |
Standard-Unterdialoge fr QuickDraw-Drucker
#define PRN_STD_SUBS 0x0001 |
Standard-Unterdialoge fr NVDI-Drucker
old_printer can also be 0L
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
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
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
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
- 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
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).
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