X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/489468feaa08b8f504735eecca522fb8d0f825d2..c6427d4da424cadbea08b70e964ab1a93246f67d:/src/osx/carbon/dcprint.cpp diff --git a/src/osx/carbon/dcprint.cpp b/src/osx/carbon/dcprint.cpp index ccc58d99ff..f9353bc42c 100644 --- a/src/osx/carbon/dcprint.cpp +++ b/src/osx/carbon/dcprint.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: src/mac/carbon/dcprint.cpp +// Name: src/osx/carbon/dcprint.cpp // Purpose: wxPrinterDC class // Author: Julian Smart // Modified by: @@ -25,9 +25,9 @@ #include "wx/math.h" #endif -#include "wx/mac/uma.h" -#include "wx/mac/private/print.h" -#include "wx/mac/carbon/dcprint.h" +#include "wx/osx/private.h" +#include "wx/osx/private/print.h" +#include "wx/osx/carbon/dcprint.h" #include "wx/graphics.h" IMPLEMENT_ABSTRACT_CLASS(wxPrinterDCImpl, wxGCDCImpl) @@ -85,7 +85,7 @@ wxMacCarbonPrinterDC::wxMacCarbonPrinterDC( wxPrintData* data ) PMResolution res; -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 if ( PMPrinterGetOutputResolution != NULL ) { PMPrinter printer; @@ -103,11 +103,11 @@ wxMacCarbonPrinterDC::wxMacCarbonPrinterDC( wxPrintData* data ) else #endif { -#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 +#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 m_err = PMGetResolution((PMPageFormat) (native->m_macPageFormat), &res); #endif } - + m_ppi = wxSize(int(res.hRes), int(res.vRes)); } @@ -120,7 +120,7 @@ wxNativePrinterDC* wxNativePrinterDC::Create(wxPrintData* data) return new wxMacCarbonPrinterDC(data) ; } -bool wxMacCarbonPrinterDC::StartDoc( wxPrinterDC* dc , const wxString& WXUNUSED(message) ) +bool wxMacCarbonPrinterDC::StartDoc( wxPrinterDC* dc , const wxString& message ) { if ( m_err ) return false ; @@ -128,9 +128,14 @@ bool wxMacCarbonPrinterDC::StartDoc( wxPrinterDC* dc , const wxString& WXUNUSED wxPrinterDCImpl *impl = (wxPrinterDCImpl*) dc->GetImpl(); wxMacCarbonPrintData *native = (wxMacCarbonPrintData*) impl->GetPrintData().GetNativeData() ; +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 + if ( PMPrintSettingsSetJobName != NULL ) + PMPrintSettingsSetJobName(native->m_macPrintSettings, wxCFStringRef(message)); +#endif + m_err = PMSessionBeginCGDocumentNoDialog(native->m_macPrintSession, native->m_macPrintSettings, - native->m_macPageFormat); + native->m_macPageFormat); if ( m_err != noErr ) return false; @@ -143,7 +148,7 @@ bool wxMacCarbonPrinterDC::StartDoc( wxPrinterDC* dc , const wxString& WXUNUSED m_maxY = wxCoord(rPage.bottom - rPage.top); PMResolution res; -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 if ( PMPrinterGetOutputResolution != NULL ) { PMPrinter printer; @@ -161,7 +166,7 @@ bool wxMacCarbonPrinterDC::StartDoc( wxPrinterDC* dc , const wxString& WXUNUSED else #endif { -#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 +#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 m_err = PMGetResolution((PMPageFormat) (native->m_macPageFormat), &res); #endif } @@ -251,7 +256,7 @@ void wxMacCarbonPrinterDC::GetSize( int *w , int *h) const *h = m_maxY ; } -wxSize wxMacCarbonPrinterDC::GetPPI() const +wxSize wxMacCarbonPrinterDC::GetPPI() const { return m_ppi ; }; @@ -281,7 +286,7 @@ wxPrinterDCImpl::wxPrinterDCImpl( wxPrinterDC *owner, const wxPrintData& printda { wxSize sz = GetPPI(); m_mm_to_pix_x = mm2inches * sz.x; - m_mm_to_pix_y = mm2inches * sz.y; + m_mm_to_pix_y = mm2inches * sz.y; } // we need at least a measuring context because people start measuring before a page // gets printed at all @@ -339,7 +344,7 @@ void wxPrinterDCImpl::EndDoc(void) } } -wxRect wxPrinterDCImpl::GetPaperRect() +wxRect wxPrinterDCImpl::GetPaperRect() const { wxCoord w, h; GetOwner()->GetSize(&w, &h);