|
fltk 1.3.0rc3
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. Release candidate.
SfR Fresh Dox: fltk-1.3.0rc3-source.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation) ![]() |
OS-independent print support. More...
#include <Fl_Printer.H>


Public Member Functions | |
| Fl_Printer (void) | |
| The constructor. | |
| int | start_job (int pagecount, int *frompage=NULL, int *topage=NULL) |
| Starts a print job. | |
| int | start_page (void) |
| Starts a new printed page. | |
| int | printable_rect (int *w, int *h) |
| Computes the width and height of the printable area of the page. | |
| void | margins (int *left, int *top, int *right, int *bottom) |
| Computes the dimensions of margins that lie between the printable page area and the full page. | |
| void | origin (int x, int y) |
| Sets the position in page coordinates of the origin of graphics functions. | |
| void | scale (float scale_x, float scale_y) |
| Changes the scaling of page coordinates. | |
| void | rotate (float angle) |
| Rotates the graphics operations relatively to paper. | |
| void | translate (int x, int y) |
| Translates the current graphics origin accounting for the current rotation. | |
| void | untranslate (void) |
| Undoes the effect of a previous translate() call. | |
| int | end_page (void) |
| To be called at the end of each page. | |
| void | end_job (void) |
| To be called at the end of a print job. | |
| ~Fl_Printer (void) | |
| The destructor. | |
Static Public Attributes | |
| static const char * | class_id = "Fl_Printer" |
| A string that identifies each subclass of Fl_Device. | |
These attributes are effective under the Xlib platform only. | |
| static const char * | dialog_title = "Print" |
| static const char * | dialog_printer = "Printer:" |
| static const char * | dialog_range = "Print Range" |
| static const char * | dialog_copies = "Copies" |
| static const char * | dialog_all = "All" |
| static const char * | dialog_pages = "Pages" |
| static const char * | dialog_from = "From:" |
| static const char * | dialog_to = "To:" |
| static const char * | dialog_properties = "Properties..." |
| static const char * | dialog_copyNo = "# Copies:" |
| static const char * | dialog_print_button = "Print" |
| static const char * | dialog_cancel_button = "Cancel" |
| static const char * | dialog_print_to_file = "Print To File" |
| static const char * | property_title = "Printer Properties" |
| static const char * | property_pagesize = "Page Size:" |
| static const char * | property_mode = "Output Mode:" |
| static const char * | property_use = "Use" |
| static const char * | property_save = "Save" |
| static const char * | property_cancel = "Cancel" |
OS-independent print support.
Fl_Printer allows to use all FLTK drawing, color, text, and clip functions, and to have them operate on printed page(s). There are two main, non exclusive, ways to use it.
In both cases, begin by start_job(), start_page(), printable_rect() and origin() calls and finish by end_page() and end_job() calls.
Platform specifics
Fl_Printer::dialog_printer = "Imprimante:";
Definition at line 151 of file Fl_Printer.H.
| Fl_Printer::Fl_Printer | ( | void | ) |
The constructor.
Definition at line 99 of file Fl_Printer.cxx.
References class_id, and Fl_Device::class_name().
| Fl_Printer::~Fl_Printer | ( | void | ) |
The destructor.
Definition at line 163 of file Fl_Printer.cxx.
| void Fl_Printer::end_job | ( | void | ) | [virtual] |
To be called at the end of a print job.
Reimplemented from Fl_Paged_Device.
Definition at line 158 of file Fl_Printer.cxx.
References Fl_PostScript_File_Device::end_job().
| int Fl_Printer::end_page | ( | void | ) | [virtual] |
To be called at the end of each page.
Reimplemented from Fl_Paged_Device.
Definition at line 153 of file Fl_Printer.cxx.
References Fl_PostScript_File_Device::end_page().
| void Fl_Printer::margins | ( | int * | left, |
| int * | top, | ||
| int * | right, | ||
| int * | bottom | ||
| ) | [virtual] |
Computes the dimensions of margins that lie between the printable page area and the full page.
Values are in the same unit as that used by FLTK drawing functions. They are changed by scale() calls.
| [out] | left | If non-null, *left is set to the left margin size. |
| [out] | top | If non-null, *top is set to the top margin size. |
| [out] | right | If non-null, *right is set to the right margin size. |
| [out] | bottom | If non-null, *bottom is set to the bottom margin size. |
Reimplemented from Fl_Paged_Device.
Definition at line 123 of file Fl_Printer.cxx.
References Fl_PostScript_File_Device::margins().
| void Fl_Printer::origin | ( | int | x, |
| int | y | ||
| ) | [virtual] |
Sets the position in page coordinates of the origin of graphics functions.
Arguments should be expressed relatively to the result of a previous printable_rect() call. That is, printable_rect(&w, &h); origin(w/2, 0); sets the graphics origin at the top center of the page printable area. Origin() calls are not affected by rotate() calls. Successive origin() calls don't combine their effects.
| [in] | x | Horizontal position in page coordinates of the desired origin of graphics functions. |
| [in] | y | Same as above, vertically. |
Reimplemented from Fl_Paged_Device.
Definition at line 128 of file Fl_Printer.cxx.
References Fl_PostScript_File_Device::origin().
| int Fl_Printer::printable_rect | ( | int * | w, |
| int * | h | ||
| ) | [virtual] |
Computes the width and height of the printable area of the page.
Values are in the same unit as that used by FLTK drawing functions, are unchanged by calls to origin(), but are changed by scale() calls. Values account for the user-selected paper type and print orientation.
Reimplemented from Fl_Paged_Device.
Definition at line 118 of file Fl_Printer.cxx.
References Fl_PostScript_File_Device::printable_rect().
| void Fl_Printer::rotate | ( | float | angle | ) | [virtual] |
Rotates the graphics operations relatively to paper.
The rotation is centered on the current graphics origin. Successive rotate() calls don't combine their effects.
| angle | Rotation angle in counterclockwise degrees. |
Reimplemented from Fl_Paged_Device.
Definition at line 138 of file Fl_Printer.cxx.
References Fl_PostScript_File_Device::rotate().
| void Fl_Printer::scale | ( | float | scale_x, |
| float | scale_y | ||
| ) | [virtual] |
Changes the scaling of page coordinates.
This function also resets the origin of graphics functions at top left of printable page area. After a scale() call, do a printable_rect() call to get the new dimensions of the printable page area. Successive scale() calls don't combine their effects.
| scale_x | Horizontal dimensions of plot are multiplied by this quantity. |
| scale_y | Same as above, vertically. |
Reimplemented from Fl_Paged_Device.
Definition at line 133 of file Fl_Printer.cxx.
References Fl_PostScript_File_Device::scale().
| int Fl_Printer::start_job | ( | int | pagecount, |
| int * | frompage = NULL, |
||
| int * | topage = NULL |
||
| ) | [virtual] |
Starts a print job.
| [in] | pagecount | the total number of pages of the job |
| [out] | frompage | if non-null, *frompage is set to the first page the user wants printed |
| [out] | topage | if non-null, *topage is set to the last page the user wants printed |
Reimplemented from Fl_Paged_Device.
Definition at line 108 of file Fl_Printer.cxx.
References Fl_PostScript_Printer::start_job().
| int Fl_Printer::start_page | ( | void | ) | [virtual] |
Starts a new printed page.
The page coordinates are initially in points, i.e., 1/72 inch, and with origin at the top left of the printable page area.
Reimplemented from Fl_Paged_Device.
Definition at line 113 of file Fl_Printer.cxx.
References Fl_PostScript_File_Device::start_page().
| void Fl_Printer::translate | ( | int | x, |
| int | y | ||
| ) | [virtual] |
Translates the current graphics origin accounting for the current rotation.
This function is only useful after a rotate() call. Each translate() call must be matched by an untranslate() call. Successive translate() calls add up their effects.
Reimplemented from Fl_Paged_Device.
Definition at line 143 of file Fl_Printer.cxx.
References Fl_PostScript_File_Device::translate().
| void Fl_Printer::untranslate | ( | void | ) | [virtual] |
Undoes the effect of a previous translate() call.
Reimplemented from Fl_Paged_Device.
Definition at line 148 of file Fl_Printer.cxx.
References Fl_PostScript_File_Device::untranslate().
const char * Fl_Printer::class_id = "Fl_Printer" [static] |
A string that identifies each subclass of Fl_Device.
Function class_name() applied to a device of this class returns this string.
Reimplemented from Fl_Paged_Device.
Definition at line 153 of file Fl_Printer.H.
Referenced by Fl_Graphics_Driver::clip_box(), Fl_Printer(), Fl_Graphics_Driver::line_style(), and Fl_Graphics_Driver::not_clipped().
const char * Fl_Printer::dialog_all = "All" [static] |
[this text may be customized at run-time]
Definition at line 177 of file Fl_Printer.H.
Referenced by make_print_panel().
const char * Fl_Printer::dialog_cancel_button = "Cancel" [static] |
[this text may be customized at run-time]
Definition at line 184 of file Fl_Printer.H.
Referenced by make_print_panel().
const char * Fl_Printer::dialog_copies = "Copies" [static] |
[this text may be customized at run-time]
Definition at line 176 of file Fl_Printer.H.
Referenced by make_print_panel().
const char * Fl_Printer::dialog_copyNo = "# Copies:" [static] |
[this text may be customized at run-time]
Definition at line 182 of file Fl_Printer.H.
Referenced by make_print_panel().
const char * Fl_Printer::dialog_from = "From:" [static] |
[this text may be customized at run-time]
Definition at line 179 of file Fl_Printer.H.
Referenced by make_print_panel().
const char * Fl_Printer::dialog_pages = "Pages" [static] |
[this text may be customized at run-time]
Definition at line 178 of file Fl_Printer.H.
Referenced by make_print_panel().
const char * Fl_Printer::dialog_print_button = "Print" [static] |
[this text may be customized at run-time]
Definition at line 183 of file Fl_Printer.H.
Referenced by make_print_panel().
const char * Fl_Printer::dialog_print_to_file = "Print To File" [static] |
[this text may be customized at run-time]
Definition at line 185 of file Fl_Printer.H.
Referenced by print_load().
const char * Fl_Printer::dialog_printer = "Printer:" [static] |
[this text may be customized at run-time]
Definition at line 174 of file Fl_Printer.H.
Referenced by make_print_panel().
const char * Fl_Printer::dialog_properties = "Properties..." [static] |
[this text may be customized at run-time]
Definition at line 181 of file Fl_Printer.H.
Referenced by make_print_panel().
const char * Fl_Printer::dialog_range = "Print Range" [static] |
[this text may be customized at run-time]
Definition at line 175 of file Fl_Printer.H.
Referenced by make_print_panel().
const char * Fl_Printer::dialog_title = "Print" [static] |
[this text may be customized at run-time]
Definition at line 173 of file Fl_Printer.H.
Referenced by make_print_panel().
const char * Fl_Printer::dialog_to = "To:" [static] |
[this text may be customized at run-time]
Definition at line 180 of file Fl_Printer.H.
Referenced by make_print_panel().
const char * Fl_Printer::property_cancel = "Cancel" [static] |
[this text may be customized at run-time]
Definition at line 191 of file Fl_Printer.H.
Referenced by make_print_panel().
const char * Fl_Printer::property_mode = "Output Mode:" [static] |
[this text may be customized at run-time]
Definition at line 188 of file Fl_Printer.H.
Referenced by make_print_panel().
const char * Fl_Printer::property_pagesize = "Page Size:" [static] |
[this text may be customized at run-time]
Definition at line 187 of file Fl_Printer.H.
Referenced by make_print_panel().
const char * Fl_Printer::property_save = "Save" [static] |
[this text may be customized at run-time]
Definition at line 190 of file Fl_Printer.H.
Referenced by make_print_panel().
const char * Fl_Printer::property_title = "Printer Properties" [static] |
[this text may be customized at run-time]
Definition at line 186 of file Fl_Printer.H.
Referenced by make_print_panel().
const char * Fl_Printer::property_use = "Use" [static] |
[this text may be customized at run-time]
Definition at line 189 of file Fl_Printer.H.
Referenced by make_print_panel().