/////////////////////////////////////////////////////////////////////////////
-// Name: src/mac/carbon/dcprint.cpp
+// Name: src/osx/carbon/dcprint.cpp
// Purpose: wxPrinterDC class
// Author: Julian Smart
// Modified by:
#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)
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;
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));
}
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 ;
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;
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;
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
}
*h = m_maxY ;
}
-wxSize wxMacCarbonPrinterDC::GetPPI() const
+wxSize wxMacCarbonPrinterDC::GetPPI() const
{
return m_ppi ;
};
{
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
}
}
-wxRect wxPrinterDCImpl::GetPaperRect()
+wxRect wxPrinterDCImpl::GetPaperRect() const
{
wxCoord w, h;
GetOwner()->GetSize(&w, &h);