|
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) ![]() |
To send graphical output to a PostScript file. More...
#include <Fl_PostScript.H>


Public Member Functions | |
| Fl_PostScript_File_Device () | |
| The constructor. | |
| ~Fl_PostScript_File_Device () | |
| The destructor. | |
| int | start_job (int pagecount, enum Fl_Paged_Device::Page_Format format=Fl_Paged_Device::A4, enum Fl_Paged_Device::Page_Layout layout=Fl_Paged_Device::PORTRAIT) |
| Begins the session where all graphics requests will go to a local PostScript file. | |
| int | start_job (FILE *ps_output, int pagecount, enum Fl_Paged_Device::Page_Format format=Fl_Paged_Device::A4, enum Fl_Paged_Device::Page_Layout layout=Fl_Paged_Device::PORTRAIT) |
| Begins the session where all graphics requests will go to FILE pointer. | |
| 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. | |
Static Public Attributes | |
| static const char * | class_id = "Fl_PostScript_File_Device" |
| A string that identifies each subclass of Fl_Device. | |
| static const char * | file_chooser_title = "Select a .ps file" |
| Label of the PostScript file chooser window. | |
Protected Member Functions | |
| Fl_PostScript_Graphics_Driver * | driver () |
| Returns the PostScript driver of this drawing surface. | |
To send graphical output to a PostScript file.
Definition at line 223 of file Fl_PostScript.H.
| Fl_PostScript_File_Device::Fl_PostScript_File_Device | ( | void | ) |
The constructor.
Definition at line 63 of file Fl_PostScript.cxx.
References class_id, Fl_Device::class_name(), driver(), fl_gc, and gc.
| Fl_PostScript_File_Device::~Fl_PostScript_File_Device | ( | ) |
| Fl_PostScript_Graphics_Driver * Fl_PostScript_File_Device::driver | ( | ) | [protected] |
Returns the PostScript driver of this drawing surface.
Reimplemented from Fl_Surface_Device.
Definition at line 75 of file Fl_PostScript.cxx.
Referenced by end_job(), Fl_PostScript_File_Device(), margins(), origin(), printable_rect(), rotate(), scale(), Fl_PostScript_Printer::start_job(), start_job(), start_page(), translate(), untranslate(), and ~Fl_PostScript_File_Device().
| void Fl_PostScript_File_Device::end_job | ( | void | ) | [virtual] |
To be called at the end of a print job.
Reimplemented from Fl_Paged_Device.
Definition at line 1442 of file Fl_PostScript.cxx.
References Fl_PostScript_Graphics_Driver::clip_, Fl_PostScript_Graphics_Driver::close_cmd_, Fl_Display_Device::display_device(), driver(), fl_alert(), Fl_PostScript_Graphics_Driver::nPages, Fl_PostScript_Graphics_Driver::output, Fl_PostScript_Graphics_Driver::pages_, Fl_PostScript_Graphics_Driver::reset(), and Fl_Surface_Device::set_current().
Referenced by Fl_Printer::end_job().
| int Fl_PostScript_File_Device::end_page | ( | void | ) | [virtual] |
To be called at the end of each page.
Reimplemented from Fl_Paged_Device.
Definition at line 1437 of file Fl_PostScript.cxx.
Referenced by Fl_Printer::end_page().
| void Fl_PostScript_File_Device::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 1371 of file Fl_PostScript.cxx.
References driver(), int, Fl_PostScript_Graphics_Driver::left_margin, Fl_PostScript_Graphics_Driver::scale_x, Fl_PostScript_Graphics_Driver::scale_y, and Fl_PostScript_Graphics_Driver::top_margin.
Referenced by Fl_Printer::margins().
| void Fl_PostScript_File_Device::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 1389 of file Fl_PostScript.cxx.
References Fl_PostScript_Graphics_Driver::angle, driver(), Fl_PostScript_Graphics_Driver::left_margin, Fl_PostScript_Graphics_Driver::output, Fl_PostScript_Graphics_Driver::scale_x, Fl_PostScript_Graphics_Driver::scale_y, Fl_PostScript_Graphics_Driver::top_margin, x, Fl_Paged_Device::x_offset, y, and Fl_Paged_Device::y_offset.
Referenced by Fl_Printer::origin().
| int Fl_PostScript_File_Device::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 1380 of file Fl_PostScript.cxx.
References driver(), int, Fl_PostScript_Graphics_Driver::left_margin, Fl_PostScript_Graphics_Driver::ph_, Fl_PostScript_Graphics_Driver::pw_, Fl_PostScript_Graphics_Driver::scale_x, Fl_PostScript_Graphics_Driver::scale_y, and Fl_PostScript_Graphics_Driver::top_margin.
Referenced by Fl_Printer::printable_rect().
| void Fl_PostScript_File_Device::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 1407 of file Fl_PostScript.cxx.
References Fl_PostScript_Graphics_Driver::angle, driver(), Fl_PostScript_Graphics_Driver::left_margin, Fl_PostScript_Graphics_Driver::output, Fl_PostScript_Graphics_Driver::scale_x, Fl_PostScript_Graphics_Driver::scale_y, Fl_PostScript_Graphics_Driver::top_margin, Fl_Paged_Device::x_offset, and Fl_Paged_Device::y_offset.
Referenced by Fl_Printer::rotate().
| void Fl_PostScript_File_Device::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 1398 of file Fl_PostScript.cxx.
References Fl_PostScript_Graphics_Driver::angle, driver(), Fl_PostScript_Graphics_Driver::left_margin, Fl_PostScript_Graphics_Driver::output, Fl_PostScript_Graphics_Driver::scale_x, Fl_PostScript_Graphics_Driver::scale_y, and Fl_PostScript_Graphics_Driver::top_margin.
Referenced by Fl_Printer::scale().
| int Fl_PostScript_File_Device::start_job | ( | int | pagecount, |
| enum Fl_Paged_Device::Page_Format | format = Fl_Paged_Device::A4, |
||
| enum Fl_Paged_Device::Page_Layout | layout = Fl_Paged_Device::PORTRAIT |
||
| ) |
Begins the session where all graphics requests will go to a local PostScript file.
Opens a file dialog entitled with Fl_PostScript_File_Device::file_chooser_title to select an output PostScript file.
| pagecount | The total number of pages to be created. |
| format | Desired page format. |
| layout | Desired page layout. |
Definition at line 90 of file Fl_PostScript.cxx.
References Fl_Native_File_Chooser::BROWSE_SAVE_FILE, driver(), file_chooser_title, Fl_Native_File_Chooser::filename(), Fl_Native_File_Chooser::filter(), NULL, Fl_Native_File_Chooser::options(), Fl_PostScript_Graphics_Driver::output, Fl_PostScript_Graphics_Driver::ps_filename_, Fl_Native_File_Chooser::SAVEAS_CONFIRM, Fl_Surface_Device::set_current(), Fl_Native_File_Chooser::show(), Fl_PostScript_Graphics_Driver::start_postscript(), Fl_Native_File_Chooser::title(), and Fl_Native_File_Chooser::type().
| int Fl_PostScript_File_Device::start_job | ( | FILE * | ps_output, |
| int | pagecount, | ||
| enum Fl_Paged_Device::Page_Format | format = Fl_Paged_Device::A4, |
||
| enum Fl_Paged_Device::Page_Layout | layout = Fl_Paged_Device::PORTRAIT |
||
| ) |
Begins the session where all graphics requests will go to FILE pointer.
| ps_output | A writable FILE pointer that will receive PostScript output and that should not be closed until after end_job() has been called. |
| pagecount | The total number of pages to be created. |
| format | Desired page format. |
| layout | Desired page layout. |
Definition at line 124 of file Fl_PostScript.cxx.
References Fl_PostScript_Graphics_Driver::close_command(), driver(), NULL, Fl_PostScript_Graphics_Driver::output, Fl_PostScript_Graphics_Driver::ps_filename_, Fl_Surface_Device::set_current(), and Fl_PostScript_Graphics_Driver::start_postscript().
| int Fl_PostScript_File_Device::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 1425 of file Fl_PostScript.cxx.
References Fl_PostScript_Graphics_Driver::angle, driver(), Fl_PostScript_Graphics_Driver::left_margin, Fl_PostScript_Graphics_Driver::output, Fl_PostScript_Graphics_Driver::page(), Fl_PostScript_Graphics_Driver::page_format_, Fl_PostScript_Graphics_Driver::scale_x, Fl_PostScript_Graphics_Driver::scale_y, Fl_PostScript_Graphics_Driver::top_margin, Fl_Paged_Device::x_offset, and Fl_Paged_Device::y_offset.
Referenced by Fl_Printer::start_page().
| void Fl_PostScript_File_Device::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 1415 of file Fl_PostScript.cxx.
References driver().
Referenced by Fl_Printer::translate().
| void Fl_PostScript_File_Device::untranslate | ( | void | ) | [virtual] |
Undoes the effect of a previous translate() call.
Reimplemented from Fl_Paged_Device.
Definition at line 1420 of file Fl_PostScript.cxx.
References driver().
Referenced by Fl_Printer::untranslate().
const char * Fl_PostScript_File_Device::class_id = "Fl_PostScript_File_Device" [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.
Reimplemented in Fl_PostScript_Printer.
Definition at line 230 of file Fl_PostScript.H.
Referenced by Fl_PostScript_File_Device().
const char * Fl_PostScript_File_Device::file_chooser_title = "Select a .ps file" [static] |
Label of the PostScript file chooser window.
Definition at line 251 of file Fl_PostScript.H.
Referenced by start_job().