FLTK 1.4.4

Loading...
Searching...
No Matches
Fl_Paged_Device.H
Go to the documentation of this file.
1//
2// Printing support for the Fast Light Tool Kit (FLTK).
3//
4// Copyright 2010-2024 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
20
21#ifndef Fl_Paged_Device_H
22#define Fl_Paged_Device_H
23
24#include <FL/Fl_Widget_Surface.H>
25
26
28#define NO_PAGE_FORMATS 30 /* MSVC6 compilation fix */
29
36 class FL_EXPORT Fl_Paged_Device : public Fl_Widget_Surface {
37 protected:
39 Fl_Paged_Device() : Fl_Widget_Surface(NULL) {}
40 public:
45 enum Page_Format {
46 A0 = 0,
47 A1,
48 A2,
49 A3,
50 A4,
51 A5,
52 A6,
53 A7,
54 A8,
55 A9,
56 B0,
57 B1,
58 B2,
59 B3,
60 B4,
61 B5,
62 B6,
63 B7,
64 B8,
65 B9,
66 B10,
67 C5E,
68 DLE,
69 EXECUTIVE,
70 FOLIO,
71 LEDGER,
72 LEGAL,
73 LETTER,
74 TABLOID,
75 ENVELOPE,
76 MEDIA = 0x1000
77 };
78
81 enum Page_Layout {
82 PORTRAIT = 0,
83 LANDSCAPE = 0x100,
84 REVERSED = 0x200,
85 ORIENTATION = 0x300
86 };
87
90 typedef struct {
92 int width;
94 int height;
96 const char *name;
97 } page_format;
98
100 static const page_format page_formats[NO_PAGE_FORMATS];
102 virtual ~Fl_Paged_Device() {}
103 virtual int begin_job(int pagecount = 0, int *frompage = NULL, int *topage = NULL, char **perr_message = NULL);
106 int start_job(int pagecount = 0, int *frompage = NULL, int *topage = NULL, char **perr_message = NULL) {
107 return begin_job(pagecount, frompage, topage, perr_message);
108 }
109 virtual int begin_page(void);
112 int start_page() {return begin_page();}
113 virtual void margins(int *left, int *top, int *right, int *bottom);
114 virtual void scale(float scale_x, float scale_y = 0.);
115 virtual void rotate(float angle);
117 void print_widget(Fl_Widget* widget, int delta_x = 0, int delta_y = 0) {draw(widget, delta_x, delta_y);}
119 void print_window(Fl_Window *win, int x_off = 0, int y_off = 0) {
120 draw_decorated_window(win, x_off, y_off);
121 }
122 virtual int end_page (void);
123 virtual void end_job (void);
124};
125
126#endif // Fl_Paged_Device_H
NO_PAGE_FORMATS
#define NO_PAGE_FORMATS
Number of elements in enum Page_Format.
Definition Fl_Paged_Device.H:28
Fl_Paged_Device::begin_page
virtual int begin_page(void)
Begins a new printed page.
Definition Fl_Paged_Device.cxx:54
Fl_Paged_Device::~Fl_Paged_Device
virtual ~Fl_Paged_Device()
The destructor.
Definition Fl_Paged_Device.H:102
Fl_Paged_Device::print_widget
void print_widget(Fl_Widget *widget, int delta_x=0, int delta_y=0)
Synonym of draw(Fl_Widget*, int, int).
Definition Fl_Paged_Device.H:117
Fl_Paged_Device::print_window
void print_window(Fl_Window *win, int x_off=0, int y_off=0)
Synonym of draw_decorated_window(Fl_Window*, int, int).
Definition Fl_Paged_Device.H:119
Fl_Paged_Device::Fl_Paged_Device
Fl_Paged_Device()
The constructor.
Definition Fl_Paged_Device.H:39
Fl_Paged_Device::start_page
int start_page()
Synonym of begin_page().
Definition Fl_Paged_Device.H:112
Fl_Paged_Device::begin_job
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
Fl_Paged_Device::start_job
int start_job(int pagecount=0, int *frompage=NULL, int *topage=NULL, char **perr_message=NULL)
Synonym of begin_job(int pagecount, int *frompage, int *topage, char **perr_message).
Definition Fl_Paged_Device.H:106
Fl_Paged_Device::Page_Layout
Page_Layout
Possible page layouts.
Definition Fl_Paged_Device.H:81
Fl_Paged_Device::REVERSED
@ REVERSED
Reversed orientation.
Definition Fl_Paged_Device.H:84
Fl_Paged_Device::ORIENTATION
@ ORIENTATION
orientation
Definition Fl_Paged_Device.H:85
Fl_Paged_Device::PORTRAIT
@ PORTRAIT
Portrait orientation.
Definition Fl_Paged_Device.H:82
Fl_Paged_Device::LANDSCAPE
@ LANDSCAPE
Landscape orientation.
Definition Fl_Paged_Device.H:83
Fl_Paged_Device::Page_Format
Page_Format
Possible page formats.
Definition Fl_Paged_Device.H:45
Fl_Paged_Device::A2
@ A2
A2 format.
Definition Fl_Paged_Device.H:48
Fl_Paged_Device::A3
@ A3
A3 format.
Definition Fl_Paged_Device.H:49
Fl_Paged_Device::B10
@ B10
B10 format.
Definition Fl_Paged_Device.H:66
Fl_Paged_Device::A8
@ A8
A8 format.
Definition Fl_Paged_Device.H:54
Fl_Paged_Device::B9
@ B9
B9 format.
Definition Fl_Paged_Device.H:65
Fl_Paged_Device::A5
@ A5
A5 format.
Definition Fl_Paged_Device.H:51
Fl_Paged_Device::LEGAL
@ LEGAL
Legal format.
Definition Fl_Paged_Device.H:72
Fl_Paged_Device::B4
@ B4
B4 format.
Definition Fl_Paged_Device.H:60
Fl_Paged_Device::A9
@ A9
A9 format.
Definition Fl_Paged_Device.H:55
Fl_Paged_Device::LEDGER
@ LEDGER
Ledger format.
Definition Fl_Paged_Device.H:71
Fl_Paged_Device::A6
@ A6
A6 format.
Definition Fl_Paged_Device.H:52
Fl_Paged_Device::A4
@ A4
A4 format.
Definition Fl_Paged_Device.H:50
Fl_Paged_Device::A1
@ A1
A1 format.
Definition Fl_Paged_Device.H:47
Fl_Paged_Device::B2
@ B2
B2 format.
Definition Fl_Paged_Device.H:58
Fl_Paged_Device::B3
@ B3
B3 format.
Definition Fl_Paged_Device.H:59
Fl_Paged_Device::B8
@ B8
B8 format.
Definition Fl_Paged_Device.H:64
Fl_Paged_Device::LETTER
@ LETTER
Letter format.
Definition Fl_Paged_Device.H:73
Fl_Paged_Device::B6
@ B6
B6 format.
Definition Fl_Paged_Device.H:62
Fl_Paged_Device::A7
@ A7
A7 format.
Definition Fl_Paged_Device.H:53
Fl_Paged_Device::B0
@ B0
B0 format.
Definition Fl_Paged_Device.H:56
Fl_Paged_Device::B7
@ B7
B7 format.
Definition Fl_Paged_Device.H:63
Fl_Paged_Device::B1
@ B1
B1 format.
Definition Fl_Paged_Device.H:57
Fl_Paged_Device::A0
@ A0
A0 format.
Definition Fl_Paged_Device.H:46
Fl_Paged_Device::TABLOID
@ TABLOID
Tabloid format.
Definition Fl_Paged_Device.H:74
Fl_Paged_Device::B5
@ B5
B5 format.
Definition Fl_Paged_Device.H:61
Fl_Paged_Device::EXECUTIVE
@ EXECUTIVE
Executive format.
Definition Fl_Paged_Device.H:69
Fl_Paged_Device::FOLIO
@ FOLIO
Folio format.
Definition Fl_Paged_Device.H:70
Fl_Paged_Device::page_formats
static const page_format page_formats[NO_PAGE_FORMATS]
width, height and name of all elements of the enum Page_Format.
Definition Fl_Paged_Device.H:112
Fl_Widget_Surface::draw
void draw(Fl_Widget *widget, int delta_x=0, int delta_y=0)
Draws the widget on the drawing surface.
Definition Fl_Widget_Surface.cxx:43
Fl_Widget_Surface::Fl_Widget_Surface
Fl_Widget_Surface(Fl_Graphics_Driver *d)
The constructor.
Definition Fl_Widget_Surface.cxx:28
Fl_Widget_Surface::draw_decorated_window
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
Fl_Widget
Fl_Widget is the base class for all widgets in FLTK.
Definition Fl_Widget.H:112
Fl_Window
This widget produces an actual window.
Definition Fl_Window.H:55
Fl_Paged_Device::page_format
width, height and name of a page format
Definition Fl_Paged_Device.H:90
Fl_Paged_Device::page_format::width
int width
width in points
Definition Fl_Paged_Device.H:92
Fl_Paged_Device::page_format::height
int height
height in points
Definition Fl_Paged_Device.H:94
Fl_Paged_Device::page_format::name
const char * name
format name
Definition Fl_Paged_Device.H:96