|
JX Application Framework
|
#include <JPSPrinterBase.h>
Public Member Functions | |
| JPSPrinterBase (JFontManager *fontManager) | |
| virtual | ~JPSPrinterBase () |
| void | SetCreator (const JString &str) |
| void | SetTitle (const JString &str) |
| bool | PSOpenDocument () |
| void | PSCloseDocument () |
| void | PSCancelDocument () |
| bool | PSDocumentIsOpen () const |
| const JString & | GetOutputFileName () const |
| void | SetOutputFileName (const JString &name) |
| bool | PSWillPrintBlackWhite () const |
| void | PSPrintBlackWhite (const bool doIt) |
| void | PSSetClipRect (const JRect &r) |
| void | PSSetDashList (const JArray< JSize > &dashList, const JSize dashOffset=0) |
| void | PSString (const JFont &font, const JCoordinate ascent, const JCoordinate aligndx, const JCoordinate aligndy, const JFloat angle, const JCoordinate left, const JCoordinate top, const JString &str) |
| void | PSLine (const JCoordinate x1, const JCoordinate y1, const JCoordinate x2, const JCoordinate y2, const JColorID color, const JSize lineWidth, const bool drawDashedLines) |
| void | PSRect (const JCoordinate x, const JCoordinate y, const JCoordinate w, const JCoordinate h, const JColorID color, const JSize lineWidth, const bool drawDashedLines, const bool fill) |
| void | PSArc (const JCoordinate x, const JCoordinate y, const JCoordinate w, const JCoordinate h, const JFloat startAngle, const JFloat deltaAngle, const JColorID color, const JSize lineWidth, const bool drawDashedLines, const bool fill) |
| void | PSPolygon (const JCoordinate left, const JCoordinate top, const JPolygon &poly, const JColorID color, const JSize lineWidth, const bool drawDashedLines, const bool fill) |
| void | PSColorImage (const JImage &image, const JRect &srcRect, const JRect &destRect) |
Static Public Attributes | |
| static const JCoordinate | kPixelsPerInch = 72 |
Protected Member Functions | |
| std::ostream & | GetOutputStream () |
| void | PSSaveGraphicsState () |
| void | PSRestoreGraphicsState () |
| JPoint | ConvertToPS (const JCoordinate x, const JCoordinate y) const |
| JPoint | ConvertToPS (const JPoint &pt) const |
| virtual const JPoint & | PSGetOrigin () const =0 |
| virtual void | PSResetCoordinates ()=0 |
| virtual JCoordinate | PSGetPrintableHeight () const =0 |
| virtual bool | PSShouldPrintCurrentPage () const =0 |
| virtual void | PSPrintVersionComment (std::ostream &output)=0 |
| virtual void | PSPrintHeaderComments (std::ostream &output)=0 |
| virtual void | PSPrintSetupComments (std::ostream &output)=0 |
| void | PSConvertToRGB (const JColorID color, JSize *red, JSize *green, JSize *blue) const |
This class implements the functions required to draw to a PostScript file.
This class is required because JEPSPrinter cannot inherit from JPagePrinter.
To generate postscript output beyond what is provided by this class,
create a derived class. Inside each customized function, call
GetOutputStream() to get the output file and then write directly to it.
You *must* our functions whenever possible, because otherwise, you will
destroy our buffered values, and the results will be unpredictable.
Derived classes must implement the following functions:
PSGetOrigin
Return the current JPainter origin.
PSResetCoordinates
Set the origin and page size.
PSGetPrintableHeight
Return the height of the printable area. This is used to
transform screen coordinates into PS coordinates.
PSShouldPrintCurrentPage
Return false if the drawing commands should do nothing.
PSPrintVersionComment
Print the first line in the PostScript file.
PSPrintHeaderComments
Print any required header comments.
PSPrintSetupComments
Print any required setup comments.
| JPSPrinterBase::JPSPrinterBase | ( | JFontManager * | fontManager | ) |
Derived classes must call PSResetCoordinates().
|
virtual |
|
inlineprotected |
|
inline |
|
protected |
| void JPSPrinterBase::PSArc | ( | const JCoordinate | x, |
| const JCoordinate | y, | ||
| const JCoordinate | w, | ||
| const JCoordinate | h, | ||
| const JFloat | startAngle, | ||
| const JFloat | deltaAngle, | ||
| const JColorID | color, | ||
| const JSize | lineWidth, | ||
| const bool | drawDashedLines, | ||
| const bool | fill | ||
| ) |
| void JPSPrinterBase::PSCancelDocument | ( | ) |
| void JPSPrinterBase::PSCloseDocument | ( | ) |
| void JPSPrinterBase::PSColorImage | ( | const JImage & | image, |
| const JRect & | srcRect, | ||
| const JRect & | destRect | ||
| ) |
|
protected |
Convert JColorID (16-bit RGB) to 8-bit RGB Postscript color.
|
inline |
|
protectedpure virtual |
Implemented in JEPSPrinter, and JPSPrinter.
|
protectedpure virtual |
Implemented in JEPSPrinter, and JPSPrinter.
| void JPSPrinterBase::PSLine | ( | const JCoordinate | x1, |
| const JCoordinate | y1, | ||
| const JCoordinate | x2, | ||
| const JCoordinate | y2, | ||
| const JColorID | color, | ||
| const JSize | lineWidth, | ||
| const bool | drawDashedLines | ||
| ) |
| bool JPSPrinterBase::PSOpenDocument | ( | ) |
| void JPSPrinterBase::PSPolygon | ( | const JCoordinate | left, |
| const JCoordinate | top, | ||
| const JPolygon & | poly, | ||
| const JColorID | color, | ||
| const JSize | lineWidth, | ||
| const bool | drawDashedLines, | ||
| const bool | fill | ||
| ) |
|
inline |
|
protectedpure virtual |
Implemented in JEPSPrinter, and JPSPrinter.
|
protectedpure virtual |
Implemented in JEPSPrinter, and JPSPrinter.
|
protectedpure virtual |
Implemented in JEPSPrinter, and JPSPrinter.
| void JPSPrinterBase::PSRect | ( | const JCoordinate | x, |
| const JCoordinate | y, | ||
| const JCoordinate | w, | ||
| const JCoordinate | h, | ||
| const JColorID | color, | ||
| const JSize | lineWidth, | ||
| const bool | drawDashedLines, | ||
| const bool | fill | ||
| ) |
|
protectedpure virtual |
Implemented in JEPSPrinter, and JPSPrinter.
|
protected |
Restore the original graphics state. This balances PSSaveGraphicsState().
|
protected |
Save the current graphics state. This is mainly needed for adjusting the clipping.
| void JPSPrinterBase::PSSetClipRect | ( | const JRect & | r | ) |
This can be called even if a document is not open.
This can be called even if a document is not open.
|
protectedpure virtual |
Implemented in JEPSPrinter, and JPSPrinter.
| void JPSPrinterBase::PSString | ( | const JFont & | font, |
| const JCoordinate | ascent, | ||
| const JCoordinate | aligndx, | ||
| const JCoordinate | aligndy, | ||
| const JFloat | angle, | ||
| const JCoordinate | left, | ||
| const JCoordinate | top, | ||
| const JString & | str | ||
| ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
static |