- err = UMAPrOpen(&m_macPrintSessionPort) ;
- if ( err != noErr || m_macPrintSessionPort == kPMNoData )
+ err = UMAPrOpen(&m_macPrintSessionPort) ;
+ if ( err != noErr || m_macPrintSessionPort == kPMNoData )
- {
- message.Printf( "Print Error %ld", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
- dialog.ShowModal();
+ {
+ message.Printf( "Print Error %ld", err ) ;
+ wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ dialog.ShowModal();
- if ( ::PrValidate( (THPrint) m_printData.m_macPrintSettings ) )
- {
- ::PrStlDialog( (THPrint) m_printData.m_macPrintSettings ) ;
- // the driver has changed in the mean time, should we pop up a page setup dialog ?
- }
- err = PrError() ;
- if ( err != noErr )
- {
- message.Printf( "Print Error %ld", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
- dialog.ShowModal();
- UMAPrClose(NULL) ;
- m_ok = FALSE;
- return;
- }
- ::GetPort( &macPrintFormerPort ) ;
- m_macPrintSessionPort = ::PrOpenDoc( (THPrint) m_printData.m_macPrintSettings , NULL , NULL ) ;
- err = PrError() ;
- if ( err )
- {
- message.Printf( "Print Error %ld", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
- dialog.ShowModal();
- UMAPrClose(NULL) ;
- m_ok = FALSE;
- return;
- }
- // sets current port
- m_macPort = (GrafPtr ) m_macPrintSessionPort ;
+ if ( ::PrValidate( (THPrint) m_printData.m_macPrintSettings ) )
+ {
+ ::PrStlDialog( (THPrint) m_printData.m_macPrintSettings ) ;
+ // the driver has changed in the mean time, should we pop up a page setup dialog ?
+ }
+ err = PrError() ;
+ if ( err != noErr )
+ {
+ message.Printf( "Print Error %ld", err ) ;
+ wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ dialog.ShowModal();
+ UMAPrClose(NULL) ;
+ m_ok = FALSE;
+ return;
+ }
+ ::GetPort( &macPrintFormerPort ) ;
+ m_macPrintSessionPort = ::PrOpenDoc( (THPrint) m_printData.m_macPrintSettings , NULL , NULL ) ;
+ err = PrError() ;
+ if ( err )
+ {
+ message.Printf( "Print Error %ld", err ) ;
+ wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ dialog.ShowModal();
+ UMAPrClose(NULL) ;
+ m_ok = FALSE;
+ return;
+ }
+ // sets current port
+ m_macPort = (GrafPtr ) m_macPrintSessionPort ;
#else
#if PM_USE_SESSION_APIS
err = PMSessionBeginDocument((PMPrintSession)m_macPrintSessionPort,
(PMPrintSettings)m_printData.m_macPrintSettings,
#else
#if PM_USE_SESSION_APIS
err = PMSessionBeginDocument((PMPrintSession)m_macPrintSessionPort,
(PMPrintSettings)m_printData.m_macPrintSettings,
- m_printData.m_macPrintSettings,
- m_printData.m_macPageFormat,
- &m_macPrintSessionPort);
+ m_printData.m_macPrintSettings,
+ m_printData.m_macPageFormat,
+ &m_macPrintSessionPort);
- message.Printf( "Print Error %ld", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
- dialog.ShowModal();
+ message.Printf( "Print Error %ld", err ) ;
+ wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ dialog.ShowModal();
- message.Printf( "Print Error %ld", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
- dialog.ShowModal();
+ message.Printf( "Print Error %ld", err ) ;
+ wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ dialog.ShowModal();
- m_maxX = (**(THPrint)m_printData.m_macPrintSettings).rPaper.right - (**(THPrint)m_printData.m_macPrintSettings).rPaper.left ;
- m_maxY = (**(THPrint)m_printData.m_macPrintSettings).rPaper.bottom - (**(THPrint)m_printData.m_macPrintSettings).rPaper.top ;
+ m_maxX = (**(THPrint)m_printData.m_macPrintSettings).rPaper.right - (**(THPrint)m_printData.m_macPrintSettings).rPaper.left ;
+ m_maxY = (**(THPrint)m_printData.m_macPrintSettings).rPaper.bottom - (**(THPrint)m_printData.m_macPrintSettings).rPaper.top ;
- if ( m_ok )
- {
- ::PrCloseDoc( (TPPrPort) m_macPrintSessionPort ) ;
- err = PrError() ;
-
- if ( err == noErr )
- {
- if ( (**(THPrint)m_printData.m_macPrintSettings).prJob.bJDocLoop == bSpoolLoop )
- {
- TPrStatus status ;
- ::PrPicFile( (THPrint) m_printData.m_macPrintSettings , NULL , NULL , NULL , &status ) ;
- }
- }
- else
- {
- message.Printf( "Print Error %ld", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
- dialog.ShowModal();
- }
- ::UMAPrClose(NULL) ;
-// ::SetPort( macPrintFormerPort ) ;
- ::SetPort( LMGetWMgrPort() ) ;
- }
+ if ( m_ok )
+ {
+ ::PrCloseDoc( (TPPrPort) m_macPrintSessionPort ) ;
+ err = PrError() ;
+
+ if ( err == noErr )
+ {
+ if ( (**(THPrint)m_printData.m_macPrintSettings).prJob.bJDocLoop == bSpoolLoop )
+ {
+ TPrStatus status ;
+ ::PrPicFile( (THPrint) m_printData.m_macPrintSettings , NULL , NULL , NULL , &status ) ;
+ }
+ }
+ else
+ {
+ message.Printf( "Print Error %ld", err ) ;
+ wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ dialog.ShowModal();
+ }
+ ::UMAPrClose(NULL) ;
+// ::SetPort( macPrintFormerPort ) ;
+ ::SetPort( LMGetWMgrPort() ) ;
+ }
- if ( err != noErr )
- {
- message.Printf( "Print Error %ld", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
- dialog.ShowModal();
- }
+ if ( err != noErr )
+ {
+ message.Printf( "Print Error %ld", err ) ;
+ wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ dialog.ShowModal();
+ }
- m_textForegroundColour = *wxBLACK;
- m_textBackgroundColour = *wxWHITE;
- m_pen = *wxBLACK_PEN;
- m_font = *wxNORMAL_FONT;
- m_brush = *wxTRANSPARENT_BRUSH;
- m_backgroundBrush = *wxWHITE_BRUSH;
+ m_textForegroundColour = *wxBLACK;
+ m_textBackgroundColour = *wxWHITE;
+ m_pen = *wxBLACK_PEN;
+ m_font = *wxNORMAL_FONT;
+ m_brush = *wxTRANSPARENT_BRUSH;
+ m_backgroundBrush = *wxWHITE_BRUSH;
- m_macFontInstalled = false ;
- m_macBrushInstalled = false ;
- m_macPenInstalled = false ;
+ m_macFontInstalled = false ;
+ m_macBrushInstalled = false ;
+ m_macPenInstalled = false ;
- PrOpenPage( (TPPrPort) m_macPrintSessionPort , NULL ) ;
- m_macLocalOrigin.x = (**(THPrint)m_printData.m_macPrintSettings).rPaper.left ;
- m_macLocalOrigin.y = (**(THPrint)m_printData.m_macPrintSettings).rPaper.top ;
-
- Rect clip = { -32000 , -32000 , 32000 , 32000 } ;
- ::ClipRect( &clip ) ;
- err = PrError() ;
- if ( err != noErr )
- {
- message.Printf( "Print Error %ld", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
- dialog.ShowModal();
- ::PrClosePage( (TPPrPort) m_macPrintSessionPort ) ;
- ::PrCloseDoc( (TPPrPort) m_macPrintSessionPort ) ;
- ::UMAPrClose(NULL) ;
- ::SetPort( macPrintFormerPort ) ;
- m_ok = FALSE ;
- }
+ PrOpenPage( (TPPrPort) m_macPrintSessionPort , NULL ) ;
+ m_macLocalOrigin.x = (**(THPrint)m_printData.m_macPrintSettings).rPaper.left ;
+ m_macLocalOrigin.y = (**(THPrint)m_printData.m_macPrintSettings).rPaper.top ;
+
+ Rect clip = { -32000 , -32000 , 32000 , 32000 } ;
+ ::ClipRect( &clip ) ;
+ err = PrError() ;
+ if ( err != noErr )
+ {
+ message.Printf( "Print Error %ld", err ) ;
+ wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ dialog.ShowModal();
+ ::PrClosePage( (TPPrPort) m_macPrintSessionPort ) ;
+ ::PrCloseDoc( (TPPrPort) m_macPrintSessionPort ) ;
+ ::UMAPrClose(NULL) ;
+ ::SetPort( macPrintFormerPort ) ;
+ m_ok = FALSE ;
+ }
- err = PMSessionBeginPage((PMPrintSession)m_macPrintSessionPort,
- (PMPageFormat)m_printData.m_macPageFormat,
- nil);
+ err = PMSessionBeginPage((PMPrintSession)m_macPrintSessionPort,
+ (PMPageFormat)m_printData.m_macPageFormat,
+ nil);
- if ( err != noErr )
- {
- message.Printf( "Print Error %ld", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
- dialog.ShowModal();
+ if ( err != noErr )
+ {
+ message.Printf( "Print Error %ld", err ) ;
+ wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ dialog.ShowModal();
- PMSessionEndPage((PMPrintSession)m_macPrintSessionPort);
- PMSessionEndDocument((PMPrintSession)m_macPrintSessionPort);
- UMAPrClose(&m_macPrintSessionPort) ;
+ PMSessionEndPage((PMPrintSession)m_macPrintSessionPort);
+ PMSessionEndDocument((PMPrintSession)m_macPrintSessionPort);
+ UMAPrClose(&m_macPrintSessionPort) ;
- PrClosePage( (TPPrPort) m_macPort ) ;
- err = PrError() ;
- if ( err != noErr )
- {
- message.Printf( "Print Error %ld", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
- dialog.ShowModal();
- ::PrCloseDoc( (TPPrPort) m_macPrintSessionPort ) ;
- ::UMAPrClose(NULL) ;
- ::SetPort( macPrintFormerPort ) ;
- m_ok = FALSE ;
- }
+ PrClosePage( (TPPrPort) m_macPort ) ;
+ err = PrError() ;
+ if ( err != noErr )
+ {
+ message.Printf( "Print Error %ld", err ) ;
+ wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ dialog.ShowModal();
+ ::PrCloseDoc( (TPPrPort) m_macPrintSessionPort ) ;
+ ::UMAPrClose(NULL) ;
+ ::SetPort( macPrintFormerPort ) ;
+ m_ok = FALSE ;
+ }
- if ( err != noErr )
- {
- message.Printf( "Print Error %ld", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
- dialog.ShowModal();
+ if ( err != noErr )
+ {
+ message.Printf( "Print Error %ld", err ) ;
+ wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ dialog.ShowModal();
- PMSessionEndDocument((PMPrintSession)m_macPrintSessionPort);
- UMAPrClose(&m_macPrintSessionPort) ;
+ PMSessionEndDocument((PMPrintSession)m_macPrintSessionPort);
+ UMAPrClose(&m_macPrintSessionPort) ;