FLTK 1.4.0
Fl_Printer.H
Go to the documentation of this file.
1 //
2 // Printing support for the Fast Light Tool Kit (FLTK).
3 //
4 // Copyright 2010-2016 by Bill Spitzak and others.
5 //
6 // This library is free software. Distribution and use rights are outlined in
7 // the file "COPYING" which should have been included with this file. If this
8 // file is missing or damaged, see the license at:
9 //
10 // https://www.fltk.org/COPYING.php
11 //
12 // Please see the following page on how to report bugs and issues:
13 //
14 // https://www.fltk.org/bugs.php
15 //
16 
21 #ifndef Fl_Printer_H
22 #define Fl_Printer_H
23 
24 #include <FL/Fl_Paged_Device.H>
25 
86 class FL_EXPORT Fl_Printer : public Fl_Paged_Device {
87 private:
88  Fl_Paged_Device *printer;
90  static Fl_Paged_Device* newPrinterDriver(void);
91 public:
93  Fl_Printer(void);
94  int begin_job(int pagecount = 0, int *frompage = NULL, int *topage = NULL, char **perr_message = NULL);
95  int begin_page(void);
96  int printable_rect(int *w, int *h);
97  void margins(int *left, int *top, int *right, int *bottom);
98  void origin(int *x, int *y);
99  void origin(int x, int y);
100  void scale(float scale_x, float scale_y = 0.);
101  void rotate(float angle);
102  void translate(int x, int y);
103  void untranslate(void);
104  int end_page (void);
105  void end_job (void);
106  void draw_decorated_window(Fl_Window *win, int x_offset = 0, int y_offset = 0);
107  void set_current(void);
108  virtual bool is_current();
109 
113  static const char *dialog_title;
114  static const char *dialog_printer;
115  static const char *dialog_range;
116  static const char *dialog_copies;
117  static const char *dialog_all;
118  static const char *dialog_pages;
119  static const char *dialog_from;
120  static const char *dialog_to;
121  static const char *dialog_properties;
122  static const char *dialog_copyNo;
123  static const char *dialog_print_button;
124  static const char *dialog_cancel_button;
125  static const char *dialog_print_to_file;
126  static const char *property_title;
127  static const char *property_pagesize;
128  static const char *property_mode;
129  static const char *property_use;
130  static const char *property_save;
131  static const char *property_cancel;
134  ~Fl_Printer(void);
135 };
136 
137 #endif // Fl_Printer_H
static const char * dialog_range
[this text may be customized at run-time]
Definition: Fl_Printer.H:115
static const char * dialog_from
[this text may be customized at run-time]
Definition: Fl_Printer.H:119
Represents page-structured drawing surfaces.
Definition: Fl_Paged_Device.H:36
This widget produces an actual window.
Definition: Fl_Window.H:53
static const char * property_use
[this text may be customized at run-time]
Definition: Fl_Printer.H:129
virtual 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...
Definition: Fl_Paged_Device.cxx:58
static const char * dialog_pages
[this text may be customized at run-time]
Definition: Fl_Printer.H:118
static const char * dialog_properties
[this text may be customized at run-time]
Definition: Fl_Printer.H:121
virtual void set_current(void)
Make this surface the current drawing surface.
Definition: Fl_Device.cxx:64
virtual void scale(float scale_x, float scale_y=0.)
Changes the scaling of page coordinates.
Definition: Fl_Paged_Device.cxx:72
virtual void untranslate()
Undoes the effect of a previous translate() call.
Definition: Fl_Widget_Surface.cxx:121
OS-independent print support.
Definition: Fl_Printer.H:86
virtual int begin_page(void)
Begins a new printed page.
Definition: Fl_Paged_Device.cxx:45
virtual int printable_rect(int *w, int *h)
Computes the width and height of the drawable area of the drawing surface.
Definition: Fl_Widget_Surface.cxx:190
virtual int begin_job(int pagecount=0, int *frompage=NULL, int *topage=NULL, char **perr_message=NULL)
Begins a print job.
Definition: Fl_Paged_Device.cxx:36
static const char * dialog_all
[this text may be customized at run-time]
Definition: Fl_Printer.H:117
virtual void draw_decorated_window(Fl_Window *win, int x_offset=0, int y_offset=0)
Draws a window with its title bar and frame if any.
Definition: Fl_Widget_Surface.cxx:198
virtual void end_job(void)
To be called at the end of a print job.
Definition: Fl_Paged_Device.cxx:93
virtual bool is_current()
Is this surface the current drawing surface?
Definition: Fl_Device.cxx:76
static const char * dialog_print_button
[this text may be customized at run-time]
Definition: Fl_Printer.H:123
static const char * property_pagesize
[this text may be customized at run-time]
Definition: Fl_Printer.H:127
static const char * property_save
[this text may be customized at run-time]
Definition: Fl_Printer.H:130
static const char * property_mode
[this text may be customized at run-time]
Definition: Fl_Printer.H:128
virtual void rotate(float angle)
Rotates the graphics operations relatively to paper.
Definition: Fl_Paged_Device.cxx:81
declaration of class Fl_Paged_Device.
static const char * dialog_cancel_button
[this text may be customized at run-time]
Definition: Fl_Printer.H:124
static const char * dialog_title
[this text may be customized at run-time]
Definition: Fl_Printer.H:113
static const char * dialog_to
[this text may be customized at run-time]
Definition: Fl_Printer.H:120
static const char * property_title
[this text may be customized at run-time]
Definition: Fl_Printer.H:126
virtual void translate(int x, int y)
Translates the current graphics origin accounting for the current rotation.
Definition: Fl_Widget_Surface.cxx:114
static const char * dialog_printer
[this text may be customized at run-time]
Definition: Fl_Printer.H:114
virtual int end_page(void)
To be called at the end of each page.
Definition: Fl_Paged_Device.cxx:88
static const char * property_cancel
[this text may be customized at run-time]
Definition: Fl_Printer.H:131
static const char * dialog_copies
[this text may be customized at run-time]
Definition: Fl_Printer.H:116
static const char * dialog_copyNo
[this text may be customized at run-time]
Definition: Fl_Printer.H:122
static const char * dialog_print_to_file
[this text may be customized at run-time]
Definition: Fl_Printer.H:125
virtual void origin(int x, int y)
Sets the position of the origin of graphics in the drawable part of the drawing surface.
Definition: Fl_Widget_Surface.cxx:145