if ( papersize != wxDefaultSize )
{
papersize.x = (wxInt32) (papersize.x * mm2pt);
papersize.y = (wxInt32) (papersize.y * mm2pt);
if ( papersize != wxDefaultSize )
{
papersize.x = (wxInt32) (papersize.x * mm2pt);
papersize.y = (wxInt32) (papersize.y * mm2pt);
double height, width;
PMPaperGetHeight(m_macPaper, &height);
PMPaperGetWidth(m_macPaper, &width);
double height, width;
PMPaperGetHeight(m_macPaper, &height);
PMPaperGetWidth(m_macPaper, &width);
PMPaper paper = (PMPaper) CFArrayGetValueAtIndex( paperlist, i );
PMPaperGetHeight(paper, &height);
PMPaperGetWidth(paper, &width);
PMPaper paper = (PMPaper) CFArrayGetValueAtIndex( paperlist, i );
PMPaperGetHeight(paper, &height);
PMPaperGetWidth(paper, &width);
if ( bestPaper == kPMNoData )
{
const PMPaperMargins margins = { 0.0, 0.0, 0.0, 0.0 };
if ( bestPaper == kPMNoData )
{
const PMPaperMargins margins = { 0.0, 0.0, 0.0, 0.0 };
- wxString id, name(_T("Custom paper"));
- id.Printf(_T("wxPaperCustom%dx%d"), papersize.x, papersize.y);
+ wxString id, name(wxT("Custom paper"));
+ id.Printf(wxT("wxPaperCustom%dx%d"), papersize.x, papersize.y);
papersize.x, papersize.y, &margins, &paper);
}
#endif
papersize.x, papersize.y, &margins, &paper);
}
#endif
- PMPaperCreate(printer, wxCFStringRef( id, wxFont::GetDefaultEncoding() ), wxCFStringRef( name, wxFont::GetDefaultEncoding() ),
+ PMPaperCreate(printer, wxCFStringRef( id, wxFont::GetDefaultEncoding() ), wxCFStringRef( name, wxFont::GetDefaultEncoding() ),
papersize.x, papersize.y, &margins, &paper);
}
#endif
papersize.x, papersize.y, &margins, &paper);
}
#endif
if (PMServerCreatePrinterList(kPMServerLocal, &printerList) == noErr)
{
count = CFArrayGetCount(printerList);
if (PMServerCreatePrinterList(kPMServerLocal, &printerList) == noErr)
{
count = CFArrayGetCount(printerList);
PMSetCopies( m_macPrintSettings , data.GetNoCopies() , false ) ;
PMSetCollate(m_macPrintSettings, data.GetCollate());
if ( data.IsOrientationReversed() )
PMSetCopies( m_macPrintSettings , data.GetNoCopies() , false ) ;
PMSetCollate(m_macPrintSettings, data.GetCollate());
if ( data.IsOrientationReversed() )
else
PMSetOrientation( m_macPageFormat , ( data.GetOrientation() == wxLANDSCAPE ) ?
kPMLandscape : kPMPortrait , false ) ;
else
PMSetOrientation( m_macPageFormat , ( data.GetOrientation() == wxLANDSCAPE ) ?
kPMLandscape : kPMPortrait , false ) ;
PMSetDuplex( m_macPrintSettings, mode ) ;
// PMQualityMode not yet accessible via API
PMSetDuplex( m_macPrintSettings, mode ) ;
// PMQualityMode not yet accessible via API
if ( data.IsOrientationReversed() )
PMSetOrientation( m_macPageFormat , ( data.GetOrientation() == wxLANDSCAPE ) ?
kPMReverseLandscape : kPMReversePortrait , false ) ;
else
PMSetOrientation( m_macPageFormat , ( data.GetOrientation() == wxLANDSCAPE ) ?
kPMLandscape : kPMPortrait , false ) ;
if ( data.IsOrientationReversed() )
PMSetOrientation( m_macPageFormat , ( data.GetOrientation() == wxLANDSCAPE ) ?
kPMReverseLandscape : kPMReversePortrait , false ) ;
else
PMSetOrientation( m_macPageFormat , ( data.GetOrientation() == wxLANDSCAPE ) ?
kPMLandscape : kPMPortrait , false ) ;
// PMQualityMode not accessible via API
// TODO: use our quality property to determine optimal resolution
PMResolution res;
PMTag tag = kPMMaxSquareResolution;
PMPrinterGetPrinterResolution(printer, tag, &res);
PMSetResolution( m_macPageFormat, &res);
// PMQualityMode not accessible via API
// TODO: use our quality property to determine optimal resolution
PMResolution res;
PMTag tag = kPMMaxSquareResolution;
PMPrinterGetPrinterResolution(printer, tag, &res);
PMSetResolution( m_macPageFormat, &res);
PMSessionValidatePageFormat(m_macPrintSession,
m_macPageFormat, kPMDontWantBoolean);
PMSessionValidatePrintSettings(m_macPrintSession,
PMSessionValidatePageFormat(m_macPrintSession,
m_macPageFormat, kPMDontWantBoolean);
PMSessionValidatePrintSettings(m_macPrintSession,
Boolean collate;
if (PMGetCollate(m_macPrintSettings, &collate) == noErr)
data.SetCollate(collate);
Boolean collate;
if (PMGetCollate(m_macPrintSettings, &collate) == noErr)
data.SetCollate(collate);
double height, width;
PMPaperGetHeight(m_macPaper, &height);
PMPaperGetWidth(m_macPaper, &width);
double height, width;
PMPaperGetHeight(m_macPaper, &height);
PMPaperGetWidth(m_macPaper, &width);
// on the mac we have always pixels as addressing mode with 72 dpi
printout->SetPPIScreen(72, 72);
// on the mac we have always pixels as addressing mode with 72 dpi
printout->SetPPIScreen(72, 72);
PMResolution res;
wxOSXPrintData* nativeData = (wxOSXPrintData*)
(m_printDialogData.GetPrintData().GetNativeData());
PMGetResolution( (nativeData->GetPageFormat()), &res);
printout->SetPPIPrinter(int(res.hRes), int(res.vRes));
PMResolution res;
wxOSXPrintData* nativeData = (wxOSXPrintData*)
(m_printDialogData.GetPrintData().GetNativeData());
PMGetResolution( (nativeData->GetPageFormat()), &res);
printout->SetPPIPrinter(int(res.hRes), int(res.vRes));
wxPrintDialog dialog(parent, & m_printDialogData);
int ret = dialog.ShowModal();
wxPrintDialog dialog(parent, & m_printDialogData);
int ret = dialog.ShowModal();
wxSize ppiScreen( 72 , 72 ) ;
wxSize ppiPrinter( 72 , 72 ) ;
wxSize ppiScreen( 72 , 72 ) ;
wxSize ppiPrinter( 72 , 72 ) ;
// Note that with Leopard, screen dpi=72 is no longer a given
m_previewPrintout->SetPPIScreen( ppiScreen.x , ppiScreen.y ) ;
// Note that with Leopard, screen dpi=72 is no longer a given
m_previewPrintout->SetPPIScreen( ppiScreen.x , ppiScreen.y ) ;
m_previewPrintout->SetPageSizePixels(w , h) ;
m_previewPrintout->SetPageSizeMM(ww, hh);
m_previewPrintout->SetPaperRectPixels(paperRect);
m_previewPrintout->SetPageSizePixels(w , h) ;
m_previewPrintout->SetPageSizeMM(ww, hh);
m_previewPrintout->SetPaperRectPixels(paperRect);
if ( PMCreatePrintSettings(&m_macPrintSettings) == noErr )
{
PMSessionDefaultPrintSettings(m_macPrintSession,
if ( PMCreatePrintSettings(&m_macPrintSettings) == noErr )
{
PMSessionDefaultPrintSettings(m_macPrintSession,