Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

ScPrintEngine_GDI Class Reference

#include <scprintengine_gdi.h>

Inheritance diagram for ScPrintEngine_GDI:

Inheritance graph
[legend]
Collaboration diagram for ScPrintEngine_GDI:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ScPrintEngine_GDI (void)
void setForceGDI (bool force)
 Force use of gdi even on ps printers.
virtual bool print (ScribusDoc &doc, PrintOptions &options)
 Print a document using gdi or ps methods.
bool gdiPrintPreview (ScribusDoc *doc, Page *page, QImage *image, PrintOptions &options, double scale=1.0)
 Draw print preview to an image using gdi method.

Static Public Member Functions

static QString getDefaultPrinter (void)
 Get the default printer name.

Protected Types

typedef bool(ScPrintEngine_GDI::* PrintPageFunc )(ScribusDoc *doc, Page *page, PrintOptions &options, HDC printerDC, DEVMODEW *devMode)

Protected Member Functions

void resetData (void)
bool printPages (ScribusDoc *doc, PrintOptions &options, HDC printerDC, DEVMODEW *devMode, QString &fileName)
 Print selected pages to a printer or a file.
bool printPage_GDI (ScribusDoc *doc, Page *page, PrintOptions &options, HDC printerDC, DEVMODEW *devMode)
 Print a page to a gdi printer Print a page using GDI drawing code ( works on all printers : PS, PCL, GDI... ).
bool printPage_PS (ScribusDoc *doc, Page *page, PrintOptions &options, HDC printerDC, DEVMODEW *devMode)
 Print a page to a PostScript printer using passthroughs Print a page using PS drawing code and PS passthroughs ( works on PS printers only ).
bool sendPSFile (QString filePath, HDC printerDC, int pageWidth, int pageHeight)
 Send a file to printer using PostScript Passthrough Send a postscript file to a printer using ps passthrough ( works on PS printers only ).
void setDeviceParams (ScribusDoc *doc, PrintOptions &options, DEVMODEW *devMode)
 Set device params into DEVMODE structure according to print options Set printing params according to options and DEVMODE structure.
int getPSPassthroughSupport (HDC printerDC)
 Get support for PostScript Passthrough Get ps passthrough support and escape code.
bool printerUseFilePort (QString &printerName)
 Check if a specified printer use the FILE: port.
bool isPostscriptPrinter (HDC dc)
 Check if PostScript is supported by a printer device context.

Protected Attributes

bool m_forceGDI


Detailed Description

Definition at line 19 of file scprintengine_gdi.h.


Member Typedef Documentation

typedef bool(ScPrintEngine_GDI::* ScPrintEngine_GDI::PrintPageFunc)(ScribusDoc *doc, Page *page, PrintOptions &options, HDC printerDC, DEVMODEW *devMode) [protected]


Constructor & Destructor Documentation

ScPrintEngine_GDI::ScPrintEngine_GDI ( void   ) 

Definition at line 77 of file scprintengine_gdi.cpp.

References ScPrintEngine::m_abort, and m_forceGDI.


Member Function Documentation

void ScPrintEngine_GDI::resetData ( void   )  [protected]

Definition at line 88 of file scprintengine_gdi.cpp.

References ScPrintEngine::m_abort.

Referenced by gdiPrintPreview(), and print().

bool ScPrintEngine_GDI::printPages ( ScribusDoc doc,
PrintOptions options,
HDC  printerDC,
DEVMODEW *  devMode,
QString &  fileName 
) [protected]

Print selected pages to a printer or a file.

Parameters:
doc the document whose pages are to be printer
options print options
printerDC an initialized printer device context
devMode the DEVMODE structure used for creating printerDC
fileName file name to print into
forceGDI optional boolean. false as default.
Return values:
bool true on success
Author:
Jean Ghali

Definition at line 300 of file scprintengine_gdi.cpp.

References ScPrintEngine::cancelRequested(), ScribusDoc::DocName, isPostscriptPrinter(), ScPrintEngine::m_abort, m_forceGDI, PrintOptions::pageNumbers, ScribusDoc::Pages, printPage_GDI(), printPage_PS(), PrintOptions::prnEngine, ScCore, ScribusDoc::scMW(), ScQApp, tr(), CommonStrings::tr_Cancel, ScribusCore::usingGUI(), and WindowsGDI.

Referenced by print().

bool ScPrintEngine_GDI::printPage_GDI ( ScribusDoc doc,
Page page,
PrintOptions options,
HDC  printerDC,
DEVMODEW *  devMode 
) [protected]

Print a page to a gdi printer Print a page using GDI drawing code ( works on all printers : PS, PCL, GDI... ).

Parameters:
doc the document whose page is to be printer
page the page to print
options print options
printerDC an initialized printer device context
devMode the DEVMODE structure used for creating printerDC
devMode pointer to a DEVMODE structure
Return values:
bool true on success
Author:
Jean Ghali

Definition at line 366 of file scprintengine_gdi.cpp.

References __FXPT16DOT16, __FXPT2DOT30, ScPainterExBase::clear(), ScribusDoc::CMSSettings, CMSData::DefaultPrinterProfile, CMSData::DefaultSolidColorRGBProfile, ScPageOutput::DrawPage(), Page::height(), ScribusCore::InputProfiles, isPostscriptPrinter(), m_forceGDI, PrintOptions::mirrorH, PrintOptions::mirrorV, ScribusCore::MonitorProfiles, ScribusCore::PrinterProfiles, ScCore, ScPageOutput::setMarksOptions(), ScPainterExBase::setWorldMatrix(), PrintOptions::useColor, PrintOptions::useICC, Page::width(), Page::xOffset(), and Page::yOffset().

Referenced by printPages().

bool ScPrintEngine_GDI::printPage_PS ( ScribusDoc doc,
Page page,
PrintOptions options,
HDC  printerDC,
DEVMODEW *  devMode 
) [protected]

Print a page to a PostScript printer using passthroughs Print a page using PS drawing code and PS passthroughs ( works on PS printers only ).

Parameters:
doc the document whose page is to be printer
page the page to print
options print options
printerDC an initialized printer device context
devMode the DEVMODE structure used for creating printerDC
devMode pointer to a DEVMODE structure
Return values:
bool true on success
Author:
Jean Ghali

Definition at line 522 of file scprintengine_gdi.cpp.

References convertPS2PS(), PSLib::CreatePS(), ScribusDoc::getUsedColors(), ScribusDoc::getUsedFonts(), Page::height(), PrefsManager::instance(), ScribusDoc::pageHeight, Page::pageNr(), PrintOptions::pageNumbers, ScribusDoc::pageWidth, PostScript1, PostScript2, PrefsManager::preferencesLocation(), PrintOptions::prnEngine, PSLib::PS_set_file(), sendPSFile(), PrintOptions::useSpotColors, and Page::width().

Referenced by printPages().

bool ScPrintEngine_GDI::sendPSFile ( QString  filePath,
HDC  printerDC,
int  pageWidth,
int  pageHeight 
) [protected]

Send a file to printer using PostScript Passthrough Send a postscript file to a printer using ps passthrough ( works on PS printers only ).

Parameters:
filePath the Postscript file path
printerDC the printer deice context
pageWidth width
pageHeight height
Return values:
bool true on success
Author:
Jean Ghali

Definition at line 575 of file scprintengine_gdi.cpp.

References sPSPassthrough::data, getPSPassthroughSupport(), and sPSPassthrough::numBytes.

Referenced by printPage_PS().

void ScPrintEngine_GDI::setDeviceParams ( ScribusDoc doc,
PrintOptions options,
DEVMODEW *  devMode 
) [protected]

Set device params into DEVMODE structure according to print options Set printing params according to options and DEVMODE structure.

Parameters:
options print options
devMode pointer to a DEVMODE structure
Author:
Jean Ghali

Definition at line 667 of file scprintengine_gdi.cpp.

References PrintOptions::copies, PrintOptions::printer, ScribusDoc::scMW(), and PrintOptions::useColor.

Referenced by print().

int ScPrintEngine_GDI::getPSPassthroughSupport ( HDC  printerDC  )  [protected]

Get support for PostScript Passthrough Get ps passthrough support and escape code.

Parameters:
printerDC the printer device context
Return values:
int the postscript passthrough escape code if success, 0 if the function fails
Author:
Jean Ghali

Definition at line 769 of file scprintengine_gdi.cpp.

Referenced by sendPSFile().

bool ScPrintEngine_GDI::printerUseFilePort ( QString &  printerName  )  [protected]

Check if a specified printer use the FILE: port.

Parameters:
printerName the printer name
Return values:
bool return true if the specified printer print to the FILE: port
Author:
Jean Ghali

Definition at line 790 of file scprintengine_gdi.cpp.

Referenced by print().

bool ScPrintEngine_GDI::isPostscriptPrinter ( HDC  dc  )  [protected]

Check if PostScript is supported by a printer device context.

Parameters:
dc the printer device context
Return values:
bool return true if PostScript is supported
Author:
Jean Ghali

Definition at line 737 of file scprintengine_gdi.cpp.

Referenced by printPage_GDI(), and printPages().

void ScPrintEngine_GDI::setForceGDI ( bool  force  ) 

Force use of gdi even on ps printers.

Parameters:
force if gdi should be forced
Author:
Jean Ghali

Definition at line 83 of file scprintengine_gdi.cpp.

References m_forceGDI.

Referenced by ScribusMainWindow::doPrint().

bool ScPrintEngine_GDI::print ( ScribusDoc doc,
PrintOptions options 
) [virtual]

Print a document using gdi or ps methods.

Parameters:
doc the document whose pages are to be printer
options print options
Return values:
bool return true if no error occured
Author:
Jean Ghali

Implements ScPrintEngine.

Definition at line 100 of file scprintengine_gdi.cpp.

References PrintOptions::devMode, ScribusDoc::DocName, PrefsManager::documentDir(), fdNone, PrefsContext::get(), PrefsFile::getContext(), PrefsManager::instance(), overwrite(), PrefsManager::prefsFile, PrintOptions::printer, printerUseFilePort(), printPages(), resetData(), ScribusDoc::scMW(), PrefsContext::set(), setDeviceParams(), PrintOptions::toFile, tr(), and ScribusMainWindow::view.

Referenced by Printer_print().

bool ScPrintEngine_GDI::gdiPrintPreview ( ScribusDoc doc,
Page page,
QImage *  image,
PrintOptions options,
double  scale = 1.0 
)

Draw print preview to an image using gdi method.

Parameters:
doc the document whose page is to be preview
page the page to be previewed
image the image on which preview is to be drawn
options print options
scale optional double value for scaling. 1:1 = 1.0
Return values:
bool true on success
Author:
Jean Ghali

Definition at line 168 of file scprintengine_gdi.cpp.

References ScPainterExBase::clear(), ScPageOutput::DrawPage(), Page::height(), m_forceGDI, PrintOptions::mirrorH, PrintOptions::mirrorV, resetData(), ScPainterExBase::setWorldMatrix(), PrintOptions::useColor, Page::width(), Page::xOffset(), and Page::yOffset().

Referenced by PPreview::RenderPreview().

QString ScPrintEngine_GDI::getDefaultPrinter ( void   )  [static]

Get the default printer name.

Return values:
QString the default printer name on success or an empty string
Author:
Jean Ghali

Definition at line 691 of file scprintengine_gdi.cpp.

References p.

Referenced by PPreview::usePostscriptPreview().


Member Data Documentation


The documentation for this class was generated from the following files:
Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.