Fl_System_Printer Class Reference

Print support under MSWindows and Mac OS X. More...

#include <Fl_Printer.H>

Inheritance diagram for Fl_System_Printer:

Fl_Paged_Device Fl_Surface_Device Fl_Device Fl_Printer

List of all members.

Public Member Functions

void end_job (void)
 To be called at the end of a print job.
int end_page (void)
 To be called at the end of each page.
 Fl_System_Printer (void)
 The constructor.
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.
int printable_rect (int *w, int *h)
 Computes the width and height of the printable area of the page.
void rotate (float angle)
 Rotates the graphics operations relatively to paper.
void scale (float scale_x, float scale_y)
 Changes the scaling of page coordinates.
int start_job (int pagecount, int *frompage=NULL, int *topage=NULL)
 Starts a print job.
int start_page (void)
 Starts a new printed page.
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.
 ~Fl_System_Printer (void)
 The destructor.

Static Public Attributes

static const char * device_type
 A string that identifies each subclass of Fl_Device.


Detailed Description

Print support under MSWindows and Mac OS X.

Class Fl_System_Printer is implemented only on the MSWindows and Mac OS X platforms. Use Fl_Printer instead that is cross-platform and has the same API. Fl_Printer is typedef'ed to Fl_System_Printer under MSWindows and Mac OS X.


Member Function Documentation

int Fl_System_Printer::end_page ( void   )  [virtual]

To be called at the end of each page.

Returns:
0 iff OK.

Reimplemented from Fl_Paged_Device.

Reimplemented in Fl_Printer.

void Fl_System_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.

Parameters:
[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.

Reimplemented in Fl_Printer.

void Fl_System_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.

Parameters:
[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.

Reimplemented in Fl_Printer.

int Fl_System_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.

Returns:
0 iff OK.

Reimplemented from Fl_Paged_Device.

Reimplemented in Fl_Printer.

void Fl_System_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.

Parameters:
angle Rotation angle in counterclockwise degrees.

Reimplemented from Fl_Paged_Device.

Reimplemented in Fl_Printer.

void Fl_System_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.

Parameters:
scale_x Horizontal dimensions of plot are multiplied by this quantity.
scale_y Same as above, vertically.

Reimplemented from Fl_Paged_Device.

Reimplemented in Fl_Printer.

int Fl_System_Printer::start_job ( int  pagecount,
int *  frompage = NULL,
int *  topage = NULL 
) [virtual]

Starts a print job.

Parameters:
[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
Returns:
0 iff OK

Reimplemented from Fl_Paged_Device.

Reimplemented in Fl_Printer.

int Fl_System_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.

Returns:
0 iff OK

Reimplemented from Fl_Paged_Device.

Reimplemented in Fl_Printer.

void Fl_System_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.

Reimplemented in Fl_Printer.


Member Data Documentation

const char* Fl_System_Printer::device_type [static]

A string that identifies each subclass of Fl_Device.

Function type() applied to a device of this class returns this string.

Reimplemented from Fl_Paged_Device.

Reimplemented in Fl_Printer.


The documentation for this class was generated from the following file:

FLTK © 1998-2010 by Bill Spitzak and others.    Permission is granted to reproduce this manual or any portion for any purpose, provided this copyright and permission notice are preserved.