The following routines were introduced with MagiC (also WDIALOG), and permit the creation and handling of print dialogs:
• pdlg_add_printers | Adds application's printers |
• pdlg_add_sub_dialogs | Adds application's sub-dialogs |
• pdlg_close | Close window of a print dialog |
• pdlg_create | Initialise print dialog, allocate memory |
• pdlg_delete | Frees memory |
• pdlg_dflt_settings | Initialise memory region with printer settings |
• pdlg_do | Displays modal dialog |
• pdlg_evnt | Manages events for dialog in window |
• pdlg_free_settings | Frees memory used for printer settings |
• pdlg_get_setsize | Gets size of the structure |
• pdlg_new_settings | Returns pointer to initialized printer settings |
• pdlg_open | Opens selection dialog in window |
• pdlg_remove_printers | Removes application's printers |
• pdlg_remove_sub_dialogs | Removes application's sub-dialogs |
• pdlg_save_default_settings | Saves the default settings |
• pdlg_update | Updates window title |
• pdlg_use_settings | Validates and adopt printer settings |
• pdlg_validate_settings | Validates printer settings |
Hint: The presence of this call should be checked for using appl_getinfo (opcode 7).
See also:
Display in a window Display as modal dialog AES GEM WDIALOG Style guidelines
Name: | »Print dialog - Add private printers« - Add application's own printer descriptions. | ||||||||
Opcode: | 205 (sub-opcode 0) | ||||||||
Syntax: | int16_t pdlg_add_printers ( PRN_DIALOG *prn_dialog, DRV_INFO *drv_info ); | ||||||||
Description: | The call pdlg_add_printer permits adding an application's own
printer descriptions to the print dialog. The following apply:
Note: The driver's index should be set to 0x7fff, so as to differentiate the custom driver from that of the operating system. | ||||||||
Return value: | The function returns the value 1 if all went well, else the value 0 in case of error. | ||||||||
Availability: | The presence of this function can be checked with appl_getinfo (opcode 7). | ||||||||
Group: | Print dialogs | ||||||||
See also: | Binding WDIALOG |
C: | int16_t pdlg_add_printers ( PRN_DIALOG *prn_dialog, DRV_INFO *drv_info ); | ||||||||||||||||||||||||||||||
Binding: | int16_t pdlg_add_printers ( PRN_DIALOG *prn_dialog, DRV_INFO *drv_info ) { addr_in[0] = prn_dialog; addr_in[1] = drv_info; int_in[0] = 0; crys_if (205); return ( int_out[0] ); } | ||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Print dialog - Add private dialogs« - Add sub-dialogs to the printer dialog. | ||||||
Opcode: | 205 (sub-opcode 3) | ||||||
Syntax: | int16_t pdlg_add_sub_dialogs ( PRN_DIALOG *prn_dialog, PDLG_SUB *sub_dialog ); | ||||||
Description: | The call pdlg_add_sub_dialogs permits adding an application's
own sub-dialogs to the printer dialog. The following apply:
This function could be useful to add custom print options such as markers, watermarks or background images, for instance. | ||||||
Return value: | The function returns the value 1 if all went well, else the value 0 in case of error. | ||||||
Availability: | The presence of this function can be checked with appl_getinfo (opcode 7). | ||||||
Group: | Print dialogs | ||||||
See also: | Binding WDIALOG |
C: | int16_t pdlg_add_sub_dialogs ( PRN_DIALOG *prn_dialog, PDLG_SUB *sub_dialog ); | ||||||||||||||||||||||||||||||
Binding: | int16_t pdlg_add_sub_dialogs ( PRN_DIALOG *prn_dialog, PDLG_SUB *sub_dialog ) { addr_in[0] = prn_dialog; addr_in[1] = sub_dialog; int_in[0] = 3; crys_if (205); return ( int_out[0] ); } | ||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Print dialog - Close window« - Close print dialog. | ||||||||
Opcode: | 203 | ||||||||
Syntax: | int16_t pdlg_close ( PRN_DIALOG *prn_dialog, int16_t *x, int16_t *y ); | ||||||||
Description: | The call pdlg_close closes the window of the print dialog. The
following apply:
The parameters x and y are those of the last position of the print dialog. | ||||||||
Return value: | The function always returns the value 1. | ||||||||
Availability: | The presence of this function can be checked with appl_getinfo (opcode 7). | ||||||||
Group: | Print dialogs | ||||||||
See also: | Binding WDIALOG |
C: | int16_t pdlg_close ( PRN_DIALOG *prn_dialog, int16_t *x, int16_t *y ); | ||||||||||||||||||||||||||||||
Binding: | int16_t pdlg_close ( PRN_DIALOG *prn_dialog, int16_t *x, int16_t *y ) { int_out[1] = -1; int_out[2] = -1; addr_in[0] = prn_dialog; crys_if (203); *x = int_out[1]; *y = int_out[2]; return ( int_out[0] ); } | ||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Print dialog - Create« - Initialize the print dialog. | ||||||||
Opcode: | 200 | ||||||||
Syntax: | PRN_DIALOG *pdlg_create ( int16_t dialog_flags ); | ||||||||
Description: | The call pdlg_create initializes the print dialog and allocates
memory for it. The following apply:
On calling the function a scan will be made for the printer drivers present and memory will be allocated for the resource. | ||||||||
Return value: | The function returns a pointer to a PRN_DIALOG structure. | ||||||||
Availability: | The presence of this function can be checked with appl_getinfo (opcode 7). | ||||||||
Group: | Print dialogs | ||||||||
See also: | Binding WDIALOG |
C: | PRN_DIALOG *pdlg_create ( int16_t dialog_flags ); |
Binding: | PRN_DIALOG *pdlg_create ( int16_t dialog_flags ) { int_in[0] = dialog_flags; crys_if (200); return ( addr_out[0] ); } |
GEM-Arrays: |
Name: | »Print dialog - Delete« - Release the memory of the print dialog. | ||||
Opcode: | 201 | ||||
Syntax: | int16_t pdlg_delete ( PRN_DIALOG *prn_dialog ); | ||||
Description: | The call pdlg_delete frees the memory used for the print
dialog. The following applies:
| ||||
Return value: | The function always returns the value 1. | ||||
Availability: | The presence of this function can be checked with appl_getinfo (opcode 7). | ||||
Group: | Print dialogs | ||||
See also: | Binding WDIALOG |
C: | int16_t pdlg_delete ( PRN_DIALOG *prn_dialog ); |
Binding: | int16_t pdlg_delete ( PRN_DIALOG *prn_dialog ) { addr_in[0] = prn_dialog; crys_if (201); return ( int_out[0] ); } |
GEM-Arrays: |
Name: | »Print dialog - Default settings« - Default initialization. | ||||||
Opcode: | 205 (sub-opcode 7) | ||||||
Syntax: | int16_t pdlg_dflt_settings ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings ); | ||||||
Description: | The call pdlg_dflt_settings takes on the initialization of the
default printer settings in memory. The following apply:
Structure length from PRN_SETTINGS can be found with pdlg_get_setsize. | ||||||
Return value: | The function always returns the value 1. | ||||||
Availability: | The presence of this function can be checked with appl_getinfo (opcode 7). | ||||||
Group: | Print dialogs | ||||||
See also: | Binding WDIALOG |
C: | int16_t pdlg_dflt_settings ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings ); | ||||||||||||||||||||||||||||||
Binding: | int16_t pdlg_dflt_settings ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings ) { addr_in[0] = prn_dialog; addr_in[1] = settings; int_in[0] = 7; crys_if (205); return ( int_out[0] ); } | ||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Print dialog - Do« - Open a print dialog. | ||||||||||||||||||||||||
Opcode: | 207 | ||||||||||||||||||||||||
Syntax: | int16_t pdlg_do ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, int8_t *document_name, int16_t option_flags ); | ||||||||||||||||||||||||
Description: | The call pdlg_do opens a modal print dialog. The following
apply:
The function only returns to the caller when one of the exit buttons has been activated ('Cancel', 'OK'). | ||||||||||||||||||||||||
Return value: | The function returns the value of the selected button (1 = Cancel, 2 = OK), or the value 0 in case of error. | ||||||||||||||||||||||||
Availability: | The presence of this function can be checked with appl_getinfo (opcode 7). | ||||||||||||||||||||||||
Group: | Print dialogs | ||||||||||||||||||||||||
See also: | Binding WDIALOG |
C: | int16_t pdlg_do ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, int8_t *document_name, int16_t option_flags ); | |||||||||||||||||||||||||||||||||
Binding: | int16_t pdlg_do ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, int8_t *document_name, int16_t option_flags ) { addr_in[0] = prn_dialog; addr_in[1] = settings; addr_in[2] = document_name; int_in[0] = option_flags; crys_if (207); return ( int_out[0] ); } | |||||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Print dialog - Handle event« - Event processing of the print dialog. | ||||||||||||||
Opcode: | 206 | ||||||||||||||
Syntax: | int16_t pdlg_evnt ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, EVNT *events, int16_t *button ); | ||||||||||||||
Description: | The call pdlg_evnt takes on the event management for a print
dialog. The following apply:
The funcfunc evaluat and internally calls wdlg_evnt. If the dialog was confirmed, then the new printer settings are returned in settings. | ||||||||||||||
Return value: | The function returns the value 0 if one of the EXIT buttons was clicked on, else the value 1. | ||||||||||||||
Availability: | The presence of this function can be checked with appl_getinfo (opcode 7). | ||||||||||||||
Group: | Print dialogs | ||||||||||||||
See also: | Binding WDIALOG |
C: | int16_t pdlg_evnt ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, EVNT *events, int16_t *button ); | |||||||||||||||||||||||||||||||||
Binding: | int16_t pdlg_evnt ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, EVNT *events, int16_t *button ) { addr_in[0] = prn_dialog; addr_in[1] = settings; addr_in[2] = events; crys_if (206); *button = int_out[1]; return ( int_out[0] ); } | |||||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Print dialog - Free settings« - Release memory. | ||||
Opcode: | 205 (sub-opcode 6) | ||||
Syntax: | int16_t pdlg_free_settings ( PRN_SETTINGS *settings ); | ||||
Description: | The call pdlg_free_setting frees the memory that was reserved
by the call pdlg_new_settings. The following applies:
| ||||
Return value: | The return value of the function is unknown at present. | ||||
Availability: | The presence of this function can be checked with appl_getinfo (opcode 7). | ||||
Group: | Print dialogs | ||||
See also: | Binding WDIALOG |
C: | int16_t pdlg_free_settings ( PRN_SETTINGS *settings ); | |||||||||||||||||||||||||||
Binding: | int16_t pdlg_free_settings ( PRN_SETTINGS *settings ) { addr_in[0] = settings; int_in[0] = 6; crys_if (205); return ( int_out[0] ); } | |||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Print dialog - Get setting structure size« - Obtain the length of the PRN_SETTINGS structure. |
Opcode: | 204 (sub-opcode 0) |
Syntax: | int32_t pdlg_get_setsize ( void ); |
Description: | The call pdlg_get_setsize returns the length of the PRN_SETTINGS structure. |
Return value: | The function returns the length of the structure in bytes. |
Availability: | The presence of this function can be checked with appl_getinfo (opcode 7). |
Group: | Print dialogs |
See also: | Binding WDIALOG |
C: | int32_t pdlg_get_setsize ( void ); | ||||||||||||||||||||||||
Binding: | int32_t pdlg_get_setsize ( void ) { int_in[0] = 0; crys_if (204); return ( int_out[0..1] ); } | ||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Print dialog - New default settings« - Set default printer settings. | ||||
Opcode: | 205 (sub-opcode 5) | ||||
Syntax: | PRN_SETTINGS *pdlg_new_settings ( PRN_DIALOG *prn_dialog ); | ||||
Description: | The call pdlg_new_settings returns a pointer to the initialized
printer settings. The following applies:
| ||||
Return value: | The function returns a pointer to a PRN_SETTINGS structure in which the current printer settings are stored. | ||||
Availability: | The presence of this function can be checked with appl_getinfo (opcode 7). | ||||
Group: | Print dialogs | ||||
See also: | Binding WDIALOG |
C: | PRN_SETTINGS *pdlg_new_settings ( PRN_DIALOG *prn_dialog ); | |||||||||||||||||||||||||||
Binding: | PRN_SETTINGS *pdlg_new_settings ( PRN_DIALOG *prn_dialog ) { addr_in[0] = prn_dialog; int_in[0] = 5; crys_if (205); return ( addr_out[0] ); } | |||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Print Dialog - Open Window« - Druckdialog im Fenster öffnen. | ||||||||||||||||||||||||||||
Opcode: | 202 | ||||||||||||||||||||||||||||
Syntax: | int16_t pdlg_open ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, int8_t *document_name, int16_t option_flags, int16_t x, int16_t y ); | ||||||||||||||||||||||||||||
Description: | The call pdlg_open opens a window with the print dialog. The
following apply:
Note: The structure settings contains the printer setting that should be saved with each document. If no setting exists yet for a document, it can either be created with pdlg_new_settings, or the application can call Malloc and subsequently pdlg_dflt_settings to initialize the memory. In the parameter option_flags one can decide, amongst others, whether the dialog should be displayed as a settings or a print dialog. With further flags one can also determine whether scaling, copy options and landscape printing should be offered even if a driver does not support them, so that the application has to output the page rotated, for instance. | ||||||||||||||||||||||||||||
Return value: | The function returns the ID of the created window, or the value 0 in case of error. | ||||||||||||||||||||||||||||
Availability: | The presence of this function can be checked with appl_getinfo (opcode 7). | ||||||||||||||||||||||||||||
Group: | Print dialogs | ||||||||||||||||||||||||||||
See also: | Binding WDIALOG |
C: | int16_t pdlg_open ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, int8_t *document_name, int16_t option_flags, int16_t x, int16_t y ); | |||||||||||||||||||||||||||||||||||||||
Binding: | int16_t pdlg_open ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, int8_t *document_name, int16_t option_flags, int16_t x, int16_t y) { addr_in[0] = prn_dialog; addr_in[1] = settings; addr_in[2] = document_name; int_in[0] = option_flags; int_in[1] = x; int_in[2] = y; crys_if (202); return ( int_out[0] ); } | |||||||||||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Print dialog - Remove private printers« - Remove application's printers from the list. | ||||
Opcode: | 205 (sub-opcode 1) | ||||
Syntax: | int16_t pdlg_remove_printers ( PRN_DIALOG *prn_dialog ); | ||||
Description: | The call pdlg_remove_printers removes the application's
printers registered with pdlg_add_printers. The following applies:
The function must be called before pdlg_delete. | ||||
Return value: | The return value of the function is unknown at present. | ||||
Availability: | The presence of this function can be checked with appl_getinfo (opcode 7). | ||||
Group: | Print dialogs | ||||
See also: | Binding WDIALOG |
C: | int16_t pdlg_remove_printers ( PRN_DIALOG *prn_dialog ); | |||||||||||||||||||||||||||
Binding: | int16_t pdlg_remove_printers ( PRN_DIALOG *prn_dialog ) { addr_in[0] = prn_dialog_dialog; int_in[0] = 1; crys_if (205); return ( int_out[0] ); } | |||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Print dialog - Remove private dialogs« - Remove sub-dialogs from the print dialog. | ||||
Opcode: | 205 (sub-opcode 4) | ||||
Syntax: | int16_t pdlg_remove_sub_dialogs ( PRN_DIALOG *prn_dialog ); | ||||
Description: | The call pdlg_remove_sub_dialogs removes the application's own
sub-dialogs from the print dialog. The following applies:
| ||||
Return value: | The return value of the function is unknown at present. | ||||
Availability: | The presence of this function can be checked with appl_getinfo (opcode 7). | ||||
Group: | Print dialogs | ||||
See also: | Binding WDIALOG |
C: | int16_t pdlg_remove_sub_dialogs ( PRN_DIALOG *prn_dialog ); | |||||||||||||||||||||||||||
Binding: | int16_t pdlg_remove_sub_dialogs ( PRN_DIALOG *prn_dialog ) { addr_in[0] = prn_dialog; int_in[0] = 4; crys_if (205); return ( int_out[0] ); } | |||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Print dialog - Save default settings« | ||||||
Opcode: | 205 (sub-opcode 10) | ||||||
Syntax: | int16_t pdlg_save_default_settings ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings ); | ||||||
Description: | The call pdlg_save_default_settings saves the default printer
settings that were set with pdlg_new_settings. The following apply:
| ||||||
Return value: | The return value of the function is unknown at present. | ||||||
Availability: | The presence of this function can be checked with appl_getinfo (opcode 7). | ||||||
Group: | Print dialogs | ||||||
See also: | Binding WDIALOG |
C: | int16_t pdlg_save_default_settings ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings ); | ||||||||||||||||||||||||||||||
Binding: | int16_t pdlg_save_default_settings ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings ) { addr_in[0] = prn_dialog; addr_in[1] = settings; int_in[0] = 10; crys_if (205); return ( int_out[0] ); } | ||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Print Dialog - Update Window« - neuen Fensternamen setzen. | ||||||
Opcode: | 205 (sub-opcode 2) | ||||||
Syntax: | int16_t pdlg_update ( PRN_DIALOG *prn_dialog, int8_t *document_name ); | ||||||
Description: | »Print dialog - Update window« - Set new window title.
Note: The function should be called if a window-dialog is lying in the background and the user tops a new document window (brings it to the front). | ||||||
Return value: | The function returns the value 1 if it operates correctly, else the value 0 in case of error. | ||||||
Availability: | The presence of this function can be checked with appl_getinfo (opcode 7). | ||||||
Group: | Print dialogs | ||||||
See also: | Binding WDIALOG |
C: | int16_t pdlg_update ( PRN_DIALOG *prn_dialog, int8_t *document_name ); | |||||||||||||||||||||||||||||||||
Binding: | int16_t pdlg_update ( PRN_DIALOG *prn_dialog, int8_t *document_name ) { addr_in[0] = prn_dialog; addr_in[1] = 0; /* Reserved (must be 0!) */ addr_in[2] = document_name; int_in[0] = 2; crys_if (205); return ( int_out[0] ); } | |||||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Print dialog - Use settings« - Use validated settings. | ||||||
Opcode: | 205 (sub-opcode 9) | ||||||
Syntax: | int16_t pdlg_use_settings ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings ); | ||||||
Description: | The call pdlg_use_settings serves to validate the printer
settings that were set with pdlg_new_settings before adopting them for
use. The following apply:
This function should be called if a program wants to print immediately and it is not possible to call pdlg_do or pdlg_open and pdlg_evnt (e.g. Calamus print dialogs). The passed printer settings will be validated (and saved for old drivers). | ||||||
Return value: | The function returns the value 1 if it operates correctly, else the value 0 in case of error. | ||||||
Availability: | The presence of this function can be checked with appl_getinfo (opcode 7). | ||||||
Group: | Print dialogs | ||||||
See also: | Binding WDIALOG |
C: | int16_t pdlg_use_settings ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings ); | ||||||||||||||||||||||||||||||
Binding: | int16_t pdlg_use_settings ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings ) { addr_in[0] = prn_dialog; addr_in[1] = settings; int_in[0] = 9; crys_if (205); return ( int_out[0] ); } | ||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Print dialog - Validate settings« - Validates the printer settings. | ||||||
Opcode: | 205 (sub-opcode 8) | ||||||
Syntax: | int16_t pdlg_validate_settings ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings ); | ||||||
Description: | The call pdlg_validate_settings validates the printer settings
that were set with pdlg_new_settings. The following apply:
Note: Faulty structure contents will be corrected by the function if necessary. | ||||||
Return value: | The function returns the value 1 if it operates correctly, else the value 0 in case of error. | ||||||
Availability: | The presence of this function can be checked with appl_getinfo (opcode 7). | ||||||
Group: | Print dialogs | ||||||
See also: | Binding WDIALOG |
C: | int16_t pdlg_validate_settings ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings ); | ||||||||||||||||||||||||||||||
Binding: | int16_t pdlg_validate_settings ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings ) { addr_in[0] = prn_dialog; addr_in[1] = settings; int_in[0] = 8; crys_if (205); return ( int_out[0] ); } | ||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Program start: | |
. | pdlg_create() |
. | |
Calling the print dialog: | pdlg_open() |
. | |
Event loop: | pdlg_evnt() |
. | |
Closing of the print dialog: | pdlg_close() |
. | |
. | pdlg_delete() |
Program end: |
Program start: | |
. | pdlg_create() |
. | |
Calling the print dialog: | pdlg_do() |
. | |
. | pdlg_delete() |
Program end: |