-void wxSetPrinterOptions(const wxString& flags)
-{
- wxThePrintSetupData->SetPrinterOptions(flags);
-}
-
-void wxSetPrinterFile(const wxString& f)
-{
- wxThePrintSetupData->SetPrinterFile(f);
-}
-
-void wxSetPrinterOrientation(int orient)
-{
- wxThePrintSetupData->SetPrinterOrientation(orient);
-}
-
-void wxSetPrinterScaling(double x, double y)
-{
- wxThePrintSetupData->SetPrinterScaling(x, y);
-}
-
-void wxSetPrinterTranslation(long x, long y)
-{
- wxThePrintSetupData->SetPrinterTranslation(x, y);
-}
-
-// 1 = Preview, 2 = print to file, 3 = send to printer
-void wxSetPrinterMode(int mode)
-{
- wxThePrintSetupData->SetPrinterMode(mode);
-}
-
-void wxSetAFMPath(const wxString& f)
-{
- wxThePrintSetupData->SetAFMPath(f);
-}
-
-// Get current values
-wxString wxGetPrinterCommand()
-{
- return wxThePrintSetupData->GetPrinterCommand();
-}
-
-wxString wxGetPrintPreviewCommand()
-{
- return wxThePrintSetupData->GetPrintPreviewCommand();
-}
-
-wxString wxGetPrinterOptions()
-{
- return wxThePrintSetupData->GetPrinterOptions();
-}
-
-wxString wxGetPrinterFile()
-{
- return wxThePrintSetupData->GetPrinterFile();
-}
-
-int wxGetPrinterOrientation()
-{
- return wxThePrintSetupData->GetPrinterOrientation();
-}
-
-void wxGetPrinterScaling(double* x, double* y)
-{
- wxThePrintSetupData->GetPrinterScaling(x, y);
-}
-
-void wxGetPrinterTranslation(long *x, long *y)
-{
- wxThePrintSetupData->GetPrinterTranslation(x, y);
-}
-
-int wxGetPrinterMode()
-{
- return wxThePrintSetupData->GetPrinterMode();
-}
-
-wxString wxGetAFMPath()
-{
- return wxThePrintSetupData->GetAFMPath();
-}
-
-/*
- * Print setup data
- */
-
-wxPrintSetupData::wxPrintSetupData()
-{
- m_printerOrient = wxPORTRAIT;
- m_printerScaleX = (double)1.0;
- m_printerScaleY = (double)1.0;
- m_printerTranslateX = 0;
- m_printerTranslateY = 0;
- m_printerMode = wxPRINT_MODE_FILE;
- m_printColour = TRUE;
-}
-
-wxPrintSetupData::~wxPrintSetupData()
-{
-}
-
-void wxPrintSetupData::operator=(wxPrintSetupData& data)
-{
- SetPrinterCommand(data.GetPrinterCommand());
- SetPrintPreviewCommand(data.GetPrintPreviewCommand());
- SetPrinterOptions(data.GetPrinterOptions());
- long x, y;
- data.GetPrinterTranslation(&x, &y);
- SetPrinterTranslation(x, y);
-
- double x1, y1;
- data.GetPrinterScaling(&x1, &y1);
- SetPrinterScaling(x1, y1);
-
- SetPrinterOrientation(data.GetPrinterOrientation());
- SetPrinterMode(data.GetPrinterMode());
- SetAFMPath(data.GetAFMPath());
- SetPaperName(data.GetPaperName());
- SetColour(data.GetColour());
-}
-
-// Initialize from a wxPrintData object (wxPrintData should now be used instead of wxPrintSetupData).
-void wxPrintSetupData::operator=(const wxPrintData& data)
-{
- SetPrinterCommand(data.GetPrinterCommand());
- SetPrintPreviewCommand(data.GetPreviewCommand());
- SetPrinterOptions(data.GetPrinterOptions());
- SetPrinterTranslation(data.GetPrinterTranslateX(), data.GetPrinterTranslateY());
- SetPrinterScaling(data.GetPrinterScaleX(), data.GetPrinterScaleY());
- SetPrinterOrientation(data.GetOrientation());
- SetPrinterMode((int) data.GetPrintMode());
- SetAFMPath(data.GetFontMetricPath());
- SetPaperName(wxThePrintPaperDatabase->ConvertIdToName(data.GetPaperId()));
- SetColour(data.GetColour());
- SetPrinterFile(data.GetFilename());
-}
-
-void wxInitializePrintSetupData(bool init)
-{
- if (init)
- {
- wxThePrintSetupData = new wxPrintSetupData;
-
- wxThePrintSetupData->SetPrintPreviewCommand(PS_VIEWER_PROG);
- wxThePrintSetupData->SetPrinterOrientation(wxPORTRAIT);
- wxThePrintSetupData->SetPrinterMode(wxPRINT_MODE_PREVIEW);
- wxThePrintSetupData->SetPaperName(_("A4 sheet, 210 x 297 mm"));
-
- // Could have a .ini file to read in some defaults
- // - and/or use environment variables, e.g. WXWIN
-#ifdef __VMS__
- wxThePrintSetupData->SetPrinterCommand("print");
- wxThePrintSetupData->SetPrinterOptions("/nonotify/queue=psqueue");
- wxThePrintSetupData->SetAFMPath("sys$ps_font_metrics:");
-#endif
-#ifdef __WXMSW__
- wxThePrintSetupData->SetPrinterCommand("print");
- wxThePrintSetupData->SetAFMPath("c:\\windows\\system\\");
- wxThePrintSetupData->SetPrinterOptions("");
-#endif
-#if !defined(__VMS__) && !defined(__WXMSW__)
- wxThePrintSetupData->SetPrinterCommand("lpr");
- wxThePrintSetupData->SetPrinterOptions("");
- wxThePrintSetupData->SetAFMPath("");
-#endif
- }
- else
- {
- if (wxThePrintSetupData)
- delete wxThePrintSetupData;
- wxThePrintSetupData = (wxPrintSetupData *) NULL;
- }
-}
-
-// A module to allow initialization/cleanup of PostScript-related
-// things without calling these functions from app.cpp.
-
-class WXDLLEXPORT wxPostScriptModule: public wxModule
-{
-DECLARE_DYNAMIC_CLASS(wxPostScriptModule)
-public:
- wxPostScriptModule() {}
- bool OnInit();
- void OnExit();
-};
-
-IMPLEMENT_DYNAMIC_CLASS(wxPostScriptModule, wxModule)
-
-/*
- * Initialization/cleanup module
- */
-
-bool wxPostScriptModule::OnInit()
-{
- wxInitializePrintSetupData();
-
- return TRUE;
-}
-
-void wxPostScriptModule::OnExit()
-{
- wxInitializePrintSetupData(FALSE);
-}
-
-#endif
- // wxUSE_POSTSCRIPT