Moved deletion of wxPrintFacory to module.
Added wxWidgets 2.4 backward comp methods to wxPrintData which make use of the PostScript native print data if used. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30334 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -217,6 +217,29 @@ public:
|
|||||||
|
|
||||||
void operator=(const wxPrintData& data);
|
void operator=(const wxPrintData& data);
|
||||||
|
|
||||||
|
#if WXWIN_COMPATIBILITY_2_4
|
||||||
|
// PostScript-specific data
|
||||||
|
wxString GetPrinterCommand() const;
|
||||||
|
wxString GetPrinterOptions() const;
|
||||||
|
wxString GetPreviewCommand() const;
|
||||||
|
wxString GetFontMetricPath() const;
|
||||||
|
double GetPrinterScaleX() const;
|
||||||
|
double GetPrinterScaleY() const;
|
||||||
|
long GetPrinterTranslateX() const;
|
||||||
|
long GetPrinterTranslateY() const;
|
||||||
|
|
||||||
|
void SetPrinterCommand(const wxString& command);
|
||||||
|
void SetPrinterOptions(const wxString& options);
|
||||||
|
void SetPreviewCommand(const wxString& command);
|
||||||
|
void SetFontMetricPath(const wxString& path);
|
||||||
|
void SetPrinterScaleX(double x);
|
||||||
|
void SetPrinterScaleY(double y);
|
||||||
|
void SetPrinterScaling(double x, double y);
|
||||||
|
void SetPrinterTranslateX(long x);
|
||||||
|
void SetPrinterTranslateY(long y);
|
||||||
|
void SetPrinterTranslation(long x, long y);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Convert between wxPrintData and native data
|
// Convert between wxPrintData and native data
|
||||||
void ConvertToNative();
|
void ConvertToNative();
|
||||||
void ConvertFromNative();
|
void ConvertFromNative();
|
||||||
|
@@ -204,7 +204,6 @@ wxPrintData::~wxPrintData()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void wxPrintData::ConvertToNative()
|
void wxPrintData::ConvertToNative()
|
||||||
{
|
{
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
@@ -259,6 +258,163 @@ bool wxPrintData::Ok() const
|
|||||||
return m_nativeData->Ok();
|
return m_nativeData->Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if WXWIN_COMPATIBILITY_2_4
|
||||||
|
|
||||||
|
#include "wx/generic/prntdlgg.h"
|
||||||
|
|
||||||
|
wxString wxPrintData::GetPrinterCommand() const
|
||||||
|
{
|
||||||
|
#if wxUSE_POSTSCRIPT
|
||||||
|
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
|
||||||
|
return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPrinterCommand();
|
||||||
|
#endif
|
||||||
|
return wxT("");
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxPrintData::GetPrinterOptions() const
|
||||||
|
{
|
||||||
|
#if wxUSE_POSTSCRIPT
|
||||||
|
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
|
||||||
|
return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPrinterOptions();
|
||||||
|
#endif
|
||||||
|
return wxT("");
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxPrintData::GetPreviewCommand() const
|
||||||
|
{
|
||||||
|
#if wxUSE_POSTSCRIPT
|
||||||
|
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
|
||||||
|
return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPreviewCommand();
|
||||||
|
#endif
|
||||||
|
return wxT("");
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxPrintData::GetFontMetricPath() const
|
||||||
|
{
|
||||||
|
#if wxUSE_POSTSCRIPT
|
||||||
|
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
|
||||||
|
return ((wxPostScriptPrintNativeData*)m_nativeData)->GetFontMetricPath();
|
||||||
|
#endif
|
||||||
|
return wxT("");
|
||||||
|
}
|
||||||
|
|
||||||
|
double wxPrintData::GetPrinterScaleX() const
|
||||||
|
{
|
||||||
|
#if wxUSE_POSTSCRIPT
|
||||||
|
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
|
||||||
|
return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPrinterScaleX();
|
||||||
|
#endif
|
||||||
|
return 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
double wxPrintData::GetPrinterScaleY() const
|
||||||
|
{
|
||||||
|
#if wxUSE_POSTSCRIPT
|
||||||
|
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
|
||||||
|
return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPrinterScaleY();
|
||||||
|
#endif
|
||||||
|
return 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
long wxPrintData::GetPrinterTranslateX() const
|
||||||
|
{
|
||||||
|
#if wxUSE_POSTSCRIPT
|
||||||
|
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
|
||||||
|
return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPrinterTranslateX();
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
long wxPrintData::GetPrinterTranslateY() const
|
||||||
|
{
|
||||||
|
#if wxUSE_POSTSCRIPT
|
||||||
|
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
|
||||||
|
return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPrinterTranslateY();
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxPrintData::SetPrinterCommand(const wxString& command)
|
||||||
|
{
|
||||||
|
#if wxUSE_POSTSCRIPT
|
||||||
|
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
|
||||||
|
((wxPostScriptPrintNativeData*)m_nativeData)->SetPrinterCommand( command );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxPrintData::SetPrinterOptions(const wxString& options)
|
||||||
|
{
|
||||||
|
#if wxUSE_POSTSCRIPT
|
||||||
|
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
|
||||||
|
((wxPostScriptPrintNativeData*)m_nativeData)->SetPrinterOptions( options );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxPrintData::SetPreviewCommand(const wxString& command)
|
||||||
|
{
|
||||||
|
#if wxUSE_POSTSCRIPT
|
||||||
|
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
|
||||||
|
((wxPostScriptPrintNativeData*)m_nativeData)->SetPreviewCommand( command );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxPrintData::SetFontMetricPath(const wxString& path)
|
||||||
|
{
|
||||||
|
#if wxUSE_POSTSCRIPT
|
||||||
|
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
|
||||||
|
((wxPostScriptPrintNativeData*)m_nativeData)->SetFontMetricPath( path );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxPrintData::SetPrinterScaleX(double x)
|
||||||
|
{
|
||||||
|
#if wxUSE_POSTSCRIPT
|
||||||
|
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
|
||||||
|
((wxPostScriptPrintNativeData*)m_nativeData)->SetPrinterScaleX( x );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxPrintData::SetPrinterScaleY(double y)
|
||||||
|
{
|
||||||
|
#if wxUSE_POSTSCRIPT
|
||||||
|
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
|
||||||
|
((wxPostScriptPrintNativeData*)m_nativeData)->SetPrinterScaleY( y );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxPrintData::SetPrinterScaling(double x, double y)
|
||||||
|
{
|
||||||
|
#if wxUSE_POSTSCRIPT
|
||||||
|
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
|
||||||
|
((wxPostScriptPrintNativeData*)m_nativeData)->SetPrinterScaling( x, y );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxPrintData::SetPrinterTranslateX(long x)
|
||||||
|
{
|
||||||
|
#if wxUSE_POSTSCRIPT
|
||||||
|
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
|
||||||
|
((wxPostScriptPrintNativeData*)m_nativeData)->SetPrinterTranslateX( x );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxPrintData::SetPrinterTranslateY(long y)
|
||||||
|
{
|
||||||
|
#if wxUSE_POSTSCRIPT
|
||||||
|
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
|
||||||
|
((wxPostScriptPrintNativeData*)m_nativeData)->SetPrinterTranslateY( y );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxPrintData::SetPrinterTranslation(long x, long y)
|
||||||
|
{
|
||||||
|
#if wxUSE_POSTSCRIPT
|
||||||
|
if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData))
|
||||||
|
((wxPostScriptPrintNativeData*)m_nativeData)->SetPrinterTranslation( x, y );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// Print dialog data
|
// Print dialog data
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -246,6 +246,23 @@ wxPrintNativeDataBase::wxPrintNativeDataBase()
|
|||||||
m_ref = 1;
|
m_ref = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
// wxPrintFactoryModule
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class wxPrintFactoryModule: public wxModule
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxPrintFactoryModule() {}
|
||||||
|
bool OnInit() { return true; }
|
||||||
|
void OnExit() { wxPrintFactory::SetPrintFactory( NULL ); }
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxPrintFactoryModule)
|
||||||
|
};
|
||||||
|
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxPrintFactoryModule, wxModule)
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
// wxPrinterBase
|
// wxPrinterBase
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user