diff options
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/Fl_Device.H | 2 | ||||
| -rw-r--r-- | FL/Fl_Paged_Device.H | 10 | ||||
| -rw-r--r-- | FL/Fl_PostScript.H | 23 | ||||
| -rw-r--r-- | FL/Fl_Printer.H | 12 |
4 files changed, 33 insertions, 14 deletions
diff --git a/FL/Fl_Device.H b/FL/Fl_Device.H index 56483e214..9162d13b1 100644 --- a/FL/Fl_Device.H +++ b/FL/Fl_Device.H @@ -41,7 +41,7 @@ class Fl_Widget; A drawing surface other than the computer's display, is typically used as follows: <ol><li> Create \c surface, an object from a particular Fl_Surface_Device derived class (e.g., Fl_Copy_Surface, Fl_Printer). <li> Call \c Fl_Surface_Device::push_current(surface); to redirect all graphics requests to \c surface which becomes the new - current drawing surface (not necessary with class Fl_Printer because it is done by Fl_Printer::start_job()). + current drawing surface (not necessary with class Fl_Printer because it is done by Fl_Printer::begin_job()). <li> At this point all of the \ref fl_drawings (e.g., fl_rect()) or the \ref fl_attributes or \ref drawing_images functions (e.g., fl_draw_image(), Fl_Image::draw()) operate on the new current drawing surface. Certain drawing surfaces allow additional ways to draw to them (e.g., Fl_Printer::print_widget(), Fl_Image_Surface::draw()). diff --git a/FL/Fl_Paged_Device.H b/FL/Fl_Paged_Device.H index 03088712c..82de3a60c 100644 --- a/FL/Fl_Paged_Device.H +++ b/FL/Fl_Paged_Device.H @@ -105,8 +105,14 @@ public: static const page_format page_formats[NO_PAGE_FORMATS]; /** \brief The destructor */ virtual ~Fl_Paged_Device() {}; - virtual int start_job(int pagecount, int *frompage = NULL, int *topage = NULL); - virtual int start_page(void); + virtual int begin_job(int pagecount, int *frompage = NULL, int *topage = NULL); + /** Synonym of begin_job(int pagecount, int *frompage, int *topage). + For API compatibility with FLTK 1.3.x */ + int start_job(int pagecount, int *frompage = NULL, int *topage = NULL) {return begin_job(pagecount, frompage, topage);} + virtual int begin_page(void); + /** Synonym of begin_page(). + For API compatibility with FLTK 1.3.x */ + int start_page() {return begin_page();} virtual void margins(int *left, int *top, int *right, int *bottom); virtual void scale(float scale_x, float scale_y = 0.); virtual void rotate(float angle); diff --git a/FL/Fl_PostScript.H b/FL/Fl_PostScript.H index 8b6c72689..2272c6316 100644 --- a/FL/Fl_PostScript.H +++ b/FL/Fl_PostScript.H @@ -227,7 +227,7 @@ class Clip { /** To send graphical output to a PostScript file. - This class is used exactly as the Fl_Printer class except for the start_job() call, + This class is used exactly as the Fl_Printer class except for the begin_job() call, two variants of which are usable and allow to specify what page format and layout are desired. */ class FL_EXPORT Fl_PostScript_File_Device : public Fl_Paged_Device { @@ -246,7 +246,7 @@ public: */ ~Fl_PostScript_File_Device(); /** Don't use with this class. */ - int start_job(int pagecount, int* from, int* to); + int begin_job(int pagecount, int* from, int* to); /** @brief Begins the session where all graphics requests will go to a local PostScript file. * @@ -256,8 +256,14 @@ public: @param layout Desired page layout. @return 0 if OK, 1 if user cancelled the file dialog, 2 if fopen failed on user-selected output file. */ - int start_job(int pagecount, enum Fl_Paged_Device::Page_Format format = Fl_Paged_Device::A4, + int begin_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); + /** Synonym of begin_job(). + For API compatibility with FLTK 1.3.x */ + 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) { + return begin_job(pagecount, format, layout); + } /** @brief Begins the session where all graphics requests will go to FILE pointer. * @@ -268,9 +274,16 @@ public: @param layout Desired page layout. @return always 0. */ - int start_job(FILE *ps_output, int pagecount, enum Fl_Paged_Device::Page_Format format = Fl_Paged_Device::A4, + int begin_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); - int start_page (void); + /** Synonym of begin_job(). + For API compatibility with FLTK 1.3.x */ + 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) { + return begin_job(ps_output, pagecount, format, layout); + } + + int begin_page (void); int printable_rect(int *w, int *h); void margins(int *left, int *top, int *right, int *bottom); void origin(int *x, int *y); diff --git a/FL/Fl_Printer.H b/FL/Fl_Printer.H index 97ff1d19f..ca35750e9 100644 --- a/FL/Fl_Printer.H +++ b/FL/Fl_Printer.H @@ -36,7 +36,7 @@ <li>Use a series of FLTK graphics commands (e.g., font, text, lines, colors, clip, image) to compose a page appropriately shaped for printing. </ul> - In both cases, begin by start_job(), start_page(), printable_rect() and origin() calls + In both cases, begin by begin_job(), begin_page(), printable_rect() and origin() calls and finish by end_page() and end_job() calls. <p>Example of use: print a widget centered in a page \code @@ -45,8 +45,8 @@ int width, height; Fl_Widget *widget = ... // a widget we want printed Fl_Printer *printer = new Fl_Printer(); - if (printer->start_job(1) == 0) { - printer->start_page(); + if (printer->begin_job(1) == 0) { + printer->begin_page(); printer->printable_rect(&width, &height); fl_color(FL_BLACK); fl_line_style(FL_SOLID, 2); @@ -65,7 +65,7 @@ <li>Unix/Linux platforms: Unless it has been previously changed, the default paper size is A4. To change that, press the "Properties" button of the "Print" dialog window - opened by an Fl_Printer::start_job() call. This opens a "Printer Properties" window where it's + opened by an Fl_Printer::begin_job() call. This opens a "Printer Properties" window where it's possible to select the adequate paper size. Finally press the "Save" button therein to assign the chosen paper size to the chosen printer for this and all further print operations. <br>Class Fl_RGB_Image prints but loses its transparency if it has one. @@ -90,8 +90,8 @@ private: public: /** The constructor */ Fl_Printer(void); - int start_job(int pagecount, int *frompage = NULL, int *topage = NULL); - int start_page(void); + int begin_job(int pagecount, int *frompage = NULL, int *topage = NULL); + int begin_page(void); int printable_rect(int *w, int *h); void margins(int *left, int *top, int *right, int *bottom); void origin(int *x, int *y); |
