PMPrintSession macPrintSession = kPMNoReference;
OSStatus err;
- err = ::UMAPrOpen(&macPrintSession) ;
- if ( err == noErr )
- {
- err = PMCreatePageFormat(&m_macPageFormat);
-
- // Note that PMPageFormat is not session-specific, but calling
- // PMSessionDefaultPageFormat assigns values specific to the printer
- // associated with the current printing session.
- if ((err == noErr) && (m_macPageFormat != kPMNoPageFormat))
- {
- err = PMSessionDefaultPageFormat(macPrintSession, m_macPageFormat);
- }
-
- err = PMCreatePrintSettings(&m_macPrintSettings);
-
- // Note that PMPrintSettings is not session-specific, but calling
- // PMSessionDefaultPrintSettings assigns values specific to the printer
- // associated with the current printing session.
- if ((err == noErr) && (m_macPrintSettings != kPMNoPrintSettings))
- {
- err = PMSessionDefaultPrintSettings(macPrintSession, m_macPrintSettings);
- }
- }
- ::UMAPrClose(&macPrintSession) ;
+ err = ::UMAPrOpen(&macPrintSession) ;
+ if ( err == noErr )
+ {
+ err = PMCreatePageFormat((PMPageFormat *)&m_macPageFormat);
+
+ // Note that PMPageFormat is not session-specific, but calling
+ // PMSessionDefaultPageFormat assigns values specific to the printer
+ // associated with the current printing session.
+ if ((err == noErr) && (m_macPageFormat != kPMNoPageFormat))
+ {
+ err = PMSessionDefaultPageFormat((PMPrintSession)macPrintSession,
+ (PMPageFormat)m_macPageFormat);
+ }
+
+ err = PMCreatePrintSettings((PMPrintSettings *)&m_macPrintSettings);
+
+ // Note that PMPrintSettings is not session-specific, but calling
+ // PMSessionDefaultPrintSettings assigns values specific to the printer
+ // associated with the current printing session.
+ if ((err == noErr) && (m_macPrintSettings != kPMNoPrintSettings))
+ {
+ err = PMSessionDefaultPrintSettings((PMPrintSession)macPrintSession,
+ (PMPrintSettings)m_macPrintSettings);
+ }
+ }
+ ::UMAPrClose(&macPrintSession) ;
#endif
#else
m_macPrintInfo = (THPrint) NewHandleClear( sizeof( TPrint ) );
Cell cell, short dataOffset, short dataLength,
ListHandle listHandle )
{
- FontInfo fontInfo;
GrafPtr savePort;
GrafPtr grafPtr;
RgnHandle savedClipRegion;
Size asize;
- CreateListBoxControl( parent->MacGetRootWindow(), &bounds, false, 0, 1, false, true,
- 14, 14, false, &listDef, &m_macControl );
+ CreateListBoxControl( MAC_WXHWND(parent->MacGetRootWindow()), &bounds, false, 0, 1, false, true,
+ 14, 14, false, &listDef, (ControlRef *)&m_macControl );
GetControlData( (ControlHandle) m_macControl, kControlNoPart, kControlListBoxListHandleTag,
sizeof(ListHandle), (Ptr) &m_macList, &asize);
int topcell ;
#if TARGET_CARBON
Point pt ;
- GetListCellSize( m_macList , &pt ) ;
+ GetListCellSize( (ListHandle)m_macList , &pt ) ;
lineheight = pt.v ;
ListBounds visible ;
- GetListVisibleCells( m_macList , &visible ) ;
+ GetListVisibleCells( (ListHandle)m_macList , &visible ) ;
topcell = visible.top ;
#else
lineheight = (**(ListHandle)m_macList).cellSize.v ;
m_printData.ConvertToNative() ;
#if TARGET_CARBON && PM_USE_SESSION_APIS
- err = UMAPrOpen(&m_macPrintSession) ;
+ err = UMAPrOpen((PMPrintSession *)&m_macPrintSession) ;
if ( err != noErr || m_macPrintSession == kPMNoData )
#else
err = UMAPrOpen() ;
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal();
#if TARGET_CARBON && PM_USE_SESSION_APIS
- UMAPrClose(&m_macPrintSession) ;
+ UMAPrClose((PMPrintSession *)&m_macPrintSession) ;
#else
UMAPrClose() ;
#endif
m_macPort = (GrafPtr ) m_macPrintPort ;
#else
#if PM_USE_SESSION_APIS
- err = PMSessionBeginDocument(m_macPrintSession,
- m_printData.m_macPrintSettings,
- m_printData.m_macPageFormat);
+ err = PMSessionBeginDocument((PMPrintSession)m_macPrintSession,
+ (PMPrintSettings)m_printData.m_macPrintSettings,
+ (PMPageFormat)m_printData.m_macPageFormat);
if ( err != noErr )
#else
m_macPrintPort = kPMNoReference ;
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal();
#if TARGET_CARBON && PM_USE_SESSION_APIS
- UMAPrClose(&m_macPrintSession) ;
+ UMAPrClose((PMPrintSession *)&m_macPrintSession) ;
#else
UMAPrClose() ;
#endif
return;
}
// sets current port
- ::GetPort( &m_macPort ) ;
+ ::GetPort( (GrafPtr *)&m_macPort ) ;
#endif
m_ok = TRUE ;
m_minY = m_minX = 0 ;
#if TARGET_CARBON
PMRect rPaper;
- err = PMGetAdjustedPaperRect(m_printData.m_macPageFormat, &rPaper);
+ err = PMGetAdjustedPaperRect((PMPageFormat)m_printData.m_macPageFormat, &rPaper);
if ( err != noErr )
{
message.Printf( "Print Error %d", err ) ;
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal();
#if TARGET_CARBON && PM_USE_SESSION_APIS
- UMAPrClose(&m_macPrintSession) ;
+ UMAPrClose((PMPrintSession *)&m_macPrintSession) ;
#else
UMAPrClose() ;
#endif
if ( m_ok )
{
#if PM_USE_SESSION_APIS
- err = PMSessionEndDocument(m_macPrintSession);
+ err = PMSessionEndDocument((PMPrintSession)m_macPrintSession);
#else
err = PMEndDocument(m_macPrintPort);
#endif
dialog.ShowModal();
}
#if TARGET_CARBON && PM_USE_SESSION_APIS
- UMAPrClose(&m_macPrintSession) ;
+ UMAPrClose((PMPrintSession *)&m_macPrintSession) ;
#else
UMAPrClose() ;
#endif
}
#else
#if PM_USE_SESSION_APIS
- err = PMSessionBeginPage(m_macPrintSession,
- m_printData.m_macPageFormat,
+ err = PMSessionBeginPage((PMPrintSession)m_macPrintSession,
+ (PMPageFormat)m_printData.m_macPageFormat,
nil);
#else
err = PMBeginPage(m_macPrintPort, nil);
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal();
#if PM_USE_SESSION_APIS
- PMSessionEndPage(m_macPrintSession);
- PMSessionEndDocument(m_macPrintSession);
- UMAPrClose(&m_macPrintSession) ;
+ PMSessionEndPage((PMPrintSession)m_macPrintSession);
+ PMSessionEndDocument((PMPrintSession)m_macPrintSession);
+ UMAPrClose((PMPrintSession *)&m_macPrintSession) ;
#else
PMEndPage(m_macPrintPort);
PMEndDocument(m_macPrintPort);
}
#else
#if PM_USE_SESSION_APIS
- err = PMSessionEndPage(m_macPrintSession);
+ err = PMSessionEndPage((PMPrintSession)m_macPrintSession);
#else
err = PMEndPage(m_macPrintPort);
#endif
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal();
#if PM_USE_SESSION_APIS
- PMSessionEndDocument(m_macPrintSession);
- UMAPrClose(&m_macPrintSession) ;
+ PMSessionEndDocument((PMPrintSession)m_macPrintSession);
+ UMAPrClose((PMPrintSession *)&m_macPrintSession) ;
#else
PMEndDocument(m_macPrintPort);
UMAPrClose() ;
Size asize;
- CreateListBoxControl( parent->MacGetRootWindow(), &bounds, false, 0, 1, false, true,
- kwxMacListItemHeight, kwxMacListItemHeight, false, &listDef, &m_macControl );
+ CreateListBoxControl( MAC_WXHWND(parent->MacGetRootWindow()), &bounds, false, 0, 1, false, true,
+ kwxMacListItemHeight, kwxMacListItemHeight, false, &listDef, (ControlRef *)&m_macControl );
GetControlData( (ControlHandle) m_macControl, kControlNoPart, kControlListBoxListHandleTag,
sizeof(ListHandle), (Ptr) &m_macList, &asize);
#if TARGET_CARBON
Rect bounds ;
GetControlBounds( (ControlHandle) m_macControl , &bounds ) ;
- ControlRef control = GetListVerticalScrollBar( m_macList ) ;
+ ControlRef control = GetListVerticalScrollBar( (ListHandle)m_macList ) ;
if ( control )
{
Rect scrollbounds ;
Point pt;
#if TARGET_CARBON
- GetListCellSize(m_macList, &pt);
+ GetListCellSize((ListHandle)m_macList, &pt);
#else
pt = (**(ListHandle)m_macList).cellSize ;
#endif
PMPrintSession macPrintSession = kPMNoReference;
Boolean accepted;
- err = ::UMAPrOpen(&macPrintSession) ;
- if ( err == noErr )
- {
- m_printDialogData.ConvertToNative() ;
-
- // Set up a valid PageFormat object.
- if (m_printDialogData.GetPrintData().m_macPageFormat == kPMNoPageFormat)
- {
- err = PMCreatePageFormat(&m_printDialogData.GetPrintData().m_macPageFormat);
-
- // Note that PMPageFormat is not session-specific, but calling
- // PMSessionDefaultPageFormat assigns values specific to the printer
- // associated with the current printing session.
- if ((err == noErr) &&
- (m_printDialogData.GetPrintData().m_macPageFormat != kPMNoPageFormat))
- {
- err = PMSessionDefaultPageFormat(macPrintSession,
- m_printDialogData.GetPrintData().m_macPageFormat);
- }
- }
- else
- {
- err = PMSessionValidatePageFormat(macPrintSession,
- m_printDialogData.GetPrintData().m_macPageFormat,
- kPMDontWantBoolean);
- }
+ err = ::UMAPrOpen(&macPrintSession) ;
+ if ( err == noErr )
+ {
+ m_printDialogData.ConvertToNative() ;
+
+ // Set up a valid PageFormat object.
+ if (m_printDialogData.GetPrintData().m_macPageFormat == kPMNoPageFormat)
+ {
+ err = PMCreatePageFormat((PMPageFormat *)&m_printDialogData.GetPrintData().m_macPageFormat);
+
+ // Note that PMPageFormat is not session-specific, but calling
+ // PMSessionDefaultPageFormat assigns values specific to the printer
+ // associated with the current printing session.
+ if ((err == noErr) &&
+ (m_printDialogData.GetPrintData().m_macPageFormat != kPMNoPageFormat))
+ {
+ err = PMSessionDefaultPageFormat((PMPrintSession)macPrintSession,
+ (PMPageFormat)m_printDialogData.GetPrintData().m_macPageFormat);
+ }
+ }
+ else
+ {
+ err = PMSessionValidatePageFormat((PMPrintSession)macPrintSession,
+ (PMPageFormat)m_printDialogData.GetPrintData().m_macPageFormat,
+ kPMDontWantBoolean);
+ }
- // Set up a valid PrintSettings object.
- if (m_printDialogData.GetPrintData().m_macPrintSettings == kPMNoPrintSettings)
- {
- err = PMCreatePrintSettings(&m_printDialogData.GetPrintData().m_macPrintSettings);
-
- // Note that PMPrintSettings is not session-specific, but calling
- // PMSessionDefaultPrintSettings assigns values specific to the printer
- // associated with the current printing session.
- if ((err == noErr) &&
- (m_printDialogData.GetPrintData().m_macPrintSettings != kPMNoPrintSettings))
- {
- err = PMSessionDefaultPrintSettings(macPrintSession,
- m_printDialogData.GetPrintData().m_macPrintSettings);
- }
- }
- else
- {
- err = PMSessionValidatePrintSettings(macPrintSession,
- m_printDialogData.GetPrintData().m_macPrintSettings,
- kPMDontWantBoolean);
- }
- // Set a valid page range before displaying the Print dialog
- if (err == noErr)
- {
- // err = PMSetPageRange(m_printDialogData.GetPrintData().m_macPrintSettings,
- // minPage, maxPage);
- }
-
- // Display the Print dialog.
- if (err == noErr)
- {
- err = PMSessionPrintDialog(macPrintSession,
- m_printDialogData.GetPrintData().m_macPrintSettings,
- m_printDialogData.GetPrintData().m_macPageFormat,
- &accepted);
- if ((err == noErr) && !accepted)
- {
- err = kPMCancel; // user clicked Cancel button
- }
- }
- if ( err == noErr )
- {
- m_printDialogData.ConvertFromNative() ;
- result = wxID_OK ;
- }
- }
- if ((err != noErr) && (err != kPMCancel))
- {
- message.Printf( "Print Error %d", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
- dialog.ShowModal();
- }
- ::UMAPrClose(&macPrintSession) ;
+ // Set up a valid PrintSettings object.
+ if (m_printDialogData.GetPrintData().m_macPrintSettings == kPMNoPrintSettings)
+ {
+ err = PMCreatePrintSettings((PMPrintSettings *)&m_printDialogData.GetPrintData().m_macPrintSettings);
+
+ // Note that PMPrintSettings is not session-specific, but calling
+ // PMSessionDefaultPrintSettings assigns values specific to the printer
+ // associated with the current printing session.
+ if ((err == noErr) &&
+ (m_printDialogData.GetPrintData().m_macPrintSettings != kPMNoPrintSettings))
+ {
+ err = PMSessionDefaultPrintSettings((PMPrintSession)macPrintSession,
+ (PMPrintSettings)m_printDialogData.GetPrintData().m_macPrintSettings);
+ }
+ }
+ else
+ {
+ err = PMSessionValidatePrintSettings((PMPrintSession)macPrintSession,
+ (PMPrintSettings)m_printDialogData.GetPrintData().m_macPrintSettings,
+ kPMDontWantBoolean);
+ }
+ // Set a valid page range before displaying the Print dialog
+ if (err == noErr)
+ {
+ // err = PMSetPageRange(m_printDialogData.GetPrintData().m_macPrintSettings,
+ // minPage, maxPage);
+ }
+
+ // Display the Print dialog.
+ if (err == noErr)
+ {
+ err = PMSessionPrintDialog((PMPrintSession)macPrintSession,
+ (PMPrintSettings)m_printDialogData.GetPrintData().m_macPrintSettings,
+ (PMPageFormat)m_printDialogData.GetPrintData().m_macPageFormat,
+ &accepted);
+ if ((err == noErr) && !accepted)
+ {
+ err = kPMCancel; // user clicked Cancel button
+ }
+ }
+ if ( err == noErr )
+ {
+ m_printDialogData.ConvertFromNative() ;
+ result = wxID_OK ;
+ }
+ }
+ if ((err != noErr) && (err != kPMCancel))
+ {
+ message.Printf( "Print Error %d", err ) ;
+ wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ dialog.ShowModal();
+ }
+ ::UMAPrClose(&macPrintSession) ;
#else
#pragma warning "TODO: Printing for carbon without session apis"
#endif
PMPrintSession macPrintSession = kPMNoReference;
Boolean accepted;
- err = ::UMAPrOpen(&macPrintSession) ;
- if ( err == noErr )
- {
- m_pageSetupData.ConvertToNative() ;
-
- // Set up a valid PageFormat object.
- if (m_pageSetupData.GetPrintData().m_macPageFormat == kPMNoPageFormat)
- {
- err = PMCreatePageFormat(&m_pageSetupData.GetPrintData().m_macPageFormat);
-
- // Note that PMPageFormat is not session-specific, but calling
- // PMSessionDefaultPageFormat assigns values specific to the printer
- // associated with the current printing session.
- if ((err == noErr) &&
- (m_pageSetupData.GetPrintData().m_macPageFormat != kPMNoPageFormat))
- {
- err = PMSessionDefaultPageFormat(macPrintSession,
- m_pageSetupData.GetPrintData().m_macPageFormat);
- }
- }
- else
- {
- err = PMSessionValidatePageFormat(macPrintSession,
- m_pageSetupData.GetPrintData().m_macPageFormat,
- kPMDontWantBoolean);
- }
-
- // Display the Page Setup dialog.
- if (err == noErr)
- {
- err = PMSessionPageSetupDialog(macPrintSession,
- m_pageSetupData.GetPrintData().m_macPageFormat,
- &accepted);
- if ((err == noErr) && !accepted)
- {
- err = kPMCancel; // user clicked Cancel button
- }
- }
-
- // If the user did not cancel, flatten and save the PageFormat object
- // with our document.
- if (err == noErr) {
- // err = FlattenAndSavePageFormat(m_pageSetupData.GetPrintData().m_macPageFormat);
- m_pageSetupData.ConvertFromNative() ;
- result = wxID_OK ;
- }
- }
- if ((err != noErr) && (err != kPMCancel))
- {
- message.Printf( "Print Error %d", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
- dialog.ShowModal();
- }
- ::UMAPrClose(&macPrintSession) ;
+ err = ::UMAPrOpen(&macPrintSession) ;
+ if ( err == noErr )
+ {
+ m_pageSetupData.ConvertToNative() ;
+
+ // Set up a valid PageFormat object.
+ if (m_pageSetupData.GetPrintData().m_macPageFormat == kPMNoPageFormat)
+ {
+ err = PMCreatePageFormat((PMPageFormat *)&m_pageSetupData.GetPrintData().m_macPageFormat);
+
+ // Note that PMPageFormat is not session-specific, but calling
+ // PMSessionDefaultPageFormat assigns values specific to the printer
+ // associated with the current printing session.
+ if ((err == noErr) &&
+ (m_pageSetupData.GetPrintData().m_macPageFormat != kPMNoPageFormat))
+ {
+ err = PMSessionDefaultPageFormat((PMPrintSession)macPrintSession,
+ (PMPageFormat)m_pageSetupData.GetPrintData().m_macPageFormat);
+ }
+ }
+ else
+ {
+ err = PMSessionValidatePageFormat((PMPrintSession)macPrintSession,
+ (PMPageFormat)m_pageSetupData.GetPrintData().m_macPageFormat,
+ kPMDontWantBoolean);
+ }
+
+ // Display the Page Setup dialog.
+ if (err == noErr)
+ {
+ err = PMSessionPageSetupDialog((PMPrintSession)macPrintSession,
+ (PMPageFormat)m_pageSetupData.GetPrintData().m_macPageFormat,
+ &accepted);
+ if ((err == noErr) && !accepted)
+ {
+ err = kPMCancel; // user clicked Cancel button
+ }
+ }
+
+ // If the user did not cancel, flatten and save the PageFormat object
+ // with our document.
+ if (err == noErr) {
+ // err = FlattenAndSavePageFormat(m_pageSetupData.GetPrintData().m_macPageFormat);
+ m_pageSetupData.ConvertFromNative() ;
+ result = wxID_OK ;
+ }
+ }
+ if ((err != noErr) && (err != kPMCancel))
+ {
+ message.Printf( "Print Error %d", err ) ;
+ wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ dialog.ShowModal();
+ }
+ ::UMAPrClose(&macPrintSession) ;
#else
#pragma warning "TODO: Printing for carbon without session apis"
#endif
Cell cell, short dataOffset, short dataLength,
ListHandle listHandle )
{
- FontInfo fontInfo;
GrafPtr savePort;
GrafPtr grafPtr;
RgnHandle savedClipRegion;
Size asize;
- CreateListBoxControl( parent->MacGetRootWindow(), &bounds, false, 0, 1, false, true,
- 14, 14, false, &listDef, &m_macControl );
+ CreateListBoxControl( MAC_WXHWND(parent->MacGetRootWindow()), &bounds, false, 0, 1, false, true,
+ 14, 14, false, &listDef, (ControlRef *)&m_macControl );
GetControlData( (ControlHandle) m_macControl, kControlNoPart, kControlListBoxListHandleTag,
sizeof(ListHandle), (Ptr) &m_macList, &asize);
int topcell ;
#if TARGET_CARBON
Point pt ;
- GetListCellSize( m_macList , &pt ) ;
+ GetListCellSize( (ListHandle)m_macList , &pt ) ;
lineheight = pt.v ;
ListBounds visible ;
- GetListVisibleCells( m_macList , &visible ) ;
+ GetListVisibleCells( (ListHandle)m_macList , &visible ) ;
topcell = visible.top ;
#else
lineheight = (**(ListHandle)m_macList).cellSize.v ;
m_printData.ConvertToNative() ;
#if TARGET_CARBON && PM_USE_SESSION_APIS
- err = UMAPrOpen(&m_macPrintSession) ;
+ err = UMAPrOpen((PMPrintSession *)&m_macPrintSession) ;
if ( err != noErr || m_macPrintSession == kPMNoData )
#else
err = UMAPrOpen() ;
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal();
#if TARGET_CARBON && PM_USE_SESSION_APIS
- UMAPrClose(&m_macPrintSession) ;
+ UMAPrClose((PMPrintSession *)&m_macPrintSession) ;
#else
UMAPrClose() ;
#endif
m_macPort = (GrafPtr ) m_macPrintPort ;
#else
#if PM_USE_SESSION_APIS
- err = PMSessionBeginDocument(m_macPrintSession,
- m_printData.m_macPrintSettings,
- m_printData.m_macPageFormat);
+ err = PMSessionBeginDocument((PMPrintSession)m_macPrintSession,
+ (PMPrintSettings)m_printData.m_macPrintSettings,
+ (PMPageFormat)m_printData.m_macPageFormat);
if ( err != noErr )
#else
m_macPrintPort = kPMNoReference ;
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal();
#if TARGET_CARBON && PM_USE_SESSION_APIS
- UMAPrClose(&m_macPrintSession) ;
+ UMAPrClose((PMPrintSession *)&m_macPrintSession) ;
#else
UMAPrClose() ;
#endif
return;
}
// sets current port
- ::GetPort( &m_macPort ) ;
+ ::GetPort( (GrafPtr *)&m_macPort ) ;
#endif
m_ok = TRUE ;
m_minY = m_minX = 0 ;
#if TARGET_CARBON
PMRect rPaper;
- err = PMGetAdjustedPaperRect(m_printData.m_macPageFormat, &rPaper);
+ err = PMGetAdjustedPaperRect((PMPageFormat)m_printData.m_macPageFormat, &rPaper);
if ( err != noErr )
{
message.Printf( "Print Error %d", err ) ;
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal();
#if TARGET_CARBON && PM_USE_SESSION_APIS
- UMAPrClose(&m_macPrintSession) ;
+ UMAPrClose((PMPrintSession *)&m_macPrintSession) ;
#else
UMAPrClose() ;
#endif
if ( m_ok )
{
#if PM_USE_SESSION_APIS
- err = PMSessionEndDocument(m_macPrintSession);
+ err = PMSessionEndDocument((PMPrintSession)m_macPrintSession);
#else
err = PMEndDocument(m_macPrintPort);
#endif
dialog.ShowModal();
}
#if TARGET_CARBON && PM_USE_SESSION_APIS
- UMAPrClose(&m_macPrintSession) ;
+ UMAPrClose((PMPrintSession *)&m_macPrintSession) ;
#else
UMAPrClose() ;
#endif
}
#else
#if PM_USE_SESSION_APIS
- err = PMSessionBeginPage(m_macPrintSession,
- m_printData.m_macPageFormat,
+ err = PMSessionBeginPage((PMPrintSession)m_macPrintSession,
+ (PMPageFormat)m_printData.m_macPageFormat,
nil);
#else
err = PMBeginPage(m_macPrintPort, nil);
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal();
#if PM_USE_SESSION_APIS
- PMSessionEndPage(m_macPrintSession);
- PMSessionEndDocument(m_macPrintSession);
- UMAPrClose(&m_macPrintSession) ;
+ PMSessionEndPage((PMPrintSession)m_macPrintSession);
+ PMSessionEndDocument((PMPrintSession)m_macPrintSession);
+ UMAPrClose((PMPrintSession *)&m_macPrintSession) ;
#else
PMEndPage(m_macPrintPort);
PMEndDocument(m_macPrintPort);
}
#else
#if PM_USE_SESSION_APIS
- err = PMSessionEndPage(m_macPrintSession);
+ err = PMSessionEndPage((PMPrintSession)m_macPrintSession);
#else
err = PMEndPage(m_macPrintPort);
#endif
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal();
#if PM_USE_SESSION_APIS
- PMSessionEndDocument(m_macPrintSession);
- UMAPrClose(&m_macPrintSession) ;
+ PMSessionEndDocument((PMPrintSession)m_macPrintSession);
+ UMAPrClose((PMPrintSession *)&m_macPrintSession) ;
#else
PMEndDocument(m_macPrintPort);
UMAPrClose() ;
Size asize;
- CreateListBoxControl( parent->MacGetRootWindow(), &bounds, false, 0, 1, false, true,
- kwxMacListItemHeight, kwxMacListItemHeight, false, &listDef, &m_macControl );
+ CreateListBoxControl( MAC_WXHWND(parent->MacGetRootWindow()), &bounds, false, 0, 1, false, true,
+ kwxMacListItemHeight, kwxMacListItemHeight, false, &listDef, (ControlRef *)&m_macControl );
GetControlData( (ControlHandle) m_macControl, kControlNoPart, kControlListBoxListHandleTag,
sizeof(ListHandle), (Ptr) &m_macList, &asize);
#if TARGET_CARBON
Rect bounds ;
GetControlBounds( (ControlHandle) m_macControl , &bounds ) ;
- ControlRef control = GetListVerticalScrollBar( m_macList ) ;
+ ControlRef control = GetListVerticalScrollBar( (ListHandle)m_macList ) ;
if ( control )
{
Rect scrollbounds ;
Point pt;
#if TARGET_CARBON
- GetListCellSize(m_macList, &pt);
+ GetListCellSize((ListHandle)m_macList, &pt);
#else
pt = (**(ListHandle)m_macList).cellSize ;
#endif
PMPrintSession macPrintSession = kPMNoReference;
Boolean accepted;
- err = ::UMAPrOpen(&macPrintSession) ;
- if ( err == noErr )
- {
- m_printDialogData.ConvertToNative() ;
-
- // Set up a valid PageFormat object.
- if (m_printDialogData.GetPrintData().m_macPageFormat == kPMNoPageFormat)
- {
- err = PMCreatePageFormat(&m_printDialogData.GetPrintData().m_macPageFormat);
-
- // Note that PMPageFormat is not session-specific, but calling
- // PMSessionDefaultPageFormat assigns values specific to the printer
- // associated with the current printing session.
- if ((err == noErr) &&
- (m_printDialogData.GetPrintData().m_macPageFormat != kPMNoPageFormat))
- {
- err = PMSessionDefaultPageFormat(macPrintSession,
- m_printDialogData.GetPrintData().m_macPageFormat);
- }
- }
- else
- {
- err = PMSessionValidatePageFormat(macPrintSession,
- m_printDialogData.GetPrintData().m_macPageFormat,
- kPMDontWantBoolean);
- }
+ err = ::UMAPrOpen(&macPrintSession) ;
+ if ( err == noErr )
+ {
+ m_printDialogData.ConvertToNative() ;
+
+ // Set up a valid PageFormat object.
+ if (m_printDialogData.GetPrintData().m_macPageFormat == kPMNoPageFormat)
+ {
+ err = PMCreatePageFormat((PMPageFormat *)&m_printDialogData.GetPrintData().m_macPageFormat);
+
+ // Note that PMPageFormat is not session-specific, but calling
+ // PMSessionDefaultPageFormat assigns values specific to the printer
+ // associated with the current printing session.
+ if ((err == noErr) &&
+ (m_printDialogData.GetPrintData().m_macPageFormat != kPMNoPageFormat))
+ {
+ err = PMSessionDefaultPageFormat((PMPrintSession)macPrintSession,
+ (PMPageFormat)m_printDialogData.GetPrintData().m_macPageFormat);
+ }
+ }
+ else
+ {
+ err = PMSessionValidatePageFormat((PMPrintSession)macPrintSession,
+ (PMPageFormat)m_printDialogData.GetPrintData().m_macPageFormat,
+ kPMDontWantBoolean);
+ }
- // Set up a valid PrintSettings object.
- if (m_printDialogData.GetPrintData().m_macPrintSettings == kPMNoPrintSettings)
- {
- err = PMCreatePrintSettings(&m_printDialogData.GetPrintData().m_macPrintSettings);
-
- // Note that PMPrintSettings is not session-specific, but calling
- // PMSessionDefaultPrintSettings assigns values specific to the printer
- // associated with the current printing session.
- if ((err == noErr) &&
- (m_printDialogData.GetPrintData().m_macPrintSettings != kPMNoPrintSettings))
- {
- err = PMSessionDefaultPrintSettings(macPrintSession,
- m_printDialogData.GetPrintData().m_macPrintSettings);
- }
- }
- else
- {
- err = PMSessionValidatePrintSettings(macPrintSession,
- m_printDialogData.GetPrintData().m_macPrintSettings,
- kPMDontWantBoolean);
- }
- // Set a valid page range before displaying the Print dialog
- if (err == noErr)
- {
- // err = PMSetPageRange(m_printDialogData.GetPrintData().m_macPrintSettings,
- // minPage, maxPage);
- }
-
- // Display the Print dialog.
- if (err == noErr)
- {
- err = PMSessionPrintDialog(macPrintSession,
- m_printDialogData.GetPrintData().m_macPrintSettings,
- m_printDialogData.GetPrintData().m_macPageFormat,
- &accepted);
- if ((err == noErr) && !accepted)
- {
- err = kPMCancel; // user clicked Cancel button
- }
- }
- if ( err == noErr )
- {
- m_printDialogData.ConvertFromNative() ;
- result = wxID_OK ;
- }
- }
- if ((err != noErr) && (err != kPMCancel))
- {
- message.Printf( "Print Error %d", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
- dialog.ShowModal();
- }
- ::UMAPrClose(&macPrintSession) ;
+ // Set up a valid PrintSettings object.
+ if (m_printDialogData.GetPrintData().m_macPrintSettings == kPMNoPrintSettings)
+ {
+ err = PMCreatePrintSettings((PMPrintSettings *)&m_printDialogData.GetPrintData().m_macPrintSettings);
+
+ // Note that PMPrintSettings is not session-specific, but calling
+ // PMSessionDefaultPrintSettings assigns values specific to the printer
+ // associated with the current printing session.
+ if ((err == noErr) &&
+ (m_printDialogData.GetPrintData().m_macPrintSettings != kPMNoPrintSettings))
+ {
+ err = PMSessionDefaultPrintSettings((PMPrintSession)macPrintSession,
+ (PMPrintSettings)m_printDialogData.GetPrintData().m_macPrintSettings);
+ }
+ }
+ else
+ {
+ err = PMSessionValidatePrintSettings((PMPrintSession)macPrintSession,
+ (PMPrintSettings)m_printDialogData.GetPrintData().m_macPrintSettings,
+ kPMDontWantBoolean);
+ }
+ // Set a valid page range before displaying the Print dialog
+ if (err == noErr)
+ {
+ // err = PMSetPageRange(m_printDialogData.GetPrintData().m_macPrintSettings,
+ // minPage, maxPage);
+ }
+
+ // Display the Print dialog.
+ if (err == noErr)
+ {
+ err = PMSessionPrintDialog((PMPrintSession)macPrintSession,
+ (PMPrintSettings)m_printDialogData.GetPrintData().m_macPrintSettings,
+ (PMPageFormat)m_printDialogData.GetPrintData().m_macPageFormat,
+ &accepted);
+ if ((err == noErr) && !accepted)
+ {
+ err = kPMCancel; // user clicked Cancel button
+ }
+ }
+ if ( err == noErr )
+ {
+ m_printDialogData.ConvertFromNative() ;
+ result = wxID_OK ;
+ }
+ }
+ if ((err != noErr) && (err != kPMCancel))
+ {
+ message.Printf( "Print Error %d", err ) ;
+ wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ dialog.ShowModal();
+ }
+ ::UMAPrClose(&macPrintSession) ;
#else
#pragma warning "TODO: Printing for carbon without session apis"
#endif
PMPrintSession macPrintSession = kPMNoReference;
Boolean accepted;
- err = ::UMAPrOpen(&macPrintSession) ;
- if ( err == noErr )
- {
- m_pageSetupData.ConvertToNative() ;
-
- // Set up a valid PageFormat object.
- if (m_pageSetupData.GetPrintData().m_macPageFormat == kPMNoPageFormat)
- {
- err = PMCreatePageFormat(&m_pageSetupData.GetPrintData().m_macPageFormat);
-
- // Note that PMPageFormat is not session-specific, but calling
- // PMSessionDefaultPageFormat assigns values specific to the printer
- // associated with the current printing session.
- if ((err == noErr) &&
- (m_pageSetupData.GetPrintData().m_macPageFormat != kPMNoPageFormat))
- {
- err = PMSessionDefaultPageFormat(macPrintSession,
- m_pageSetupData.GetPrintData().m_macPageFormat);
- }
- }
- else
- {
- err = PMSessionValidatePageFormat(macPrintSession,
- m_pageSetupData.GetPrintData().m_macPageFormat,
- kPMDontWantBoolean);
- }
-
- // Display the Page Setup dialog.
- if (err == noErr)
- {
- err = PMSessionPageSetupDialog(macPrintSession,
- m_pageSetupData.GetPrintData().m_macPageFormat,
- &accepted);
- if ((err == noErr) && !accepted)
- {
- err = kPMCancel; // user clicked Cancel button
- }
- }
-
- // If the user did not cancel, flatten and save the PageFormat object
- // with our document.
- if (err == noErr) {
- // err = FlattenAndSavePageFormat(m_pageSetupData.GetPrintData().m_macPageFormat);
- m_pageSetupData.ConvertFromNative() ;
- result = wxID_OK ;
- }
- }
- if ((err != noErr) && (err != kPMCancel))
- {
- message.Printf( "Print Error %d", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
- dialog.ShowModal();
- }
- ::UMAPrClose(&macPrintSession) ;
+ err = ::UMAPrOpen(&macPrintSession) ;
+ if ( err == noErr )
+ {
+ m_pageSetupData.ConvertToNative() ;
+
+ // Set up a valid PageFormat object.
+ if (m_pageSetupData.GetPrintData().m_macPageFormat == kPMNoPageFormat)
+ {
+ err = PMCreatePageFormat((PMPageFormat *)&m_pageSetupData.GetPrintData().m_macPageFormat);
+
+ // Note that PMPageFormat is not session-specific, but calling
+ // PMSessionDefaultPageFormat assigns values specific to the printer
+ // associated with the current printing session.
+ if ((err == noErr) &&
+ (m_pageSetupData.GetPrintData().m_macPageFormat != kPMNoPageFormat))
+ {
+ err = PMSessionDefaultPageFormat((PMPrintSession)macPrintSession,
+ (PMPageFormat)m_pageSetupData.GetPrintData().m_macPageFormat);
+ }
+ }
+ else
+ {
+ err = PMSessionValidatePageFormat((PMPrintSession)macPrintSession,
+ (PMPageFormat)m_pageSetupData.GetPrintData().m_macPageFormat,
+ kPMDontWantBoolean);
+ }
+
+ // Display the Page Setup dialog.
+ if (err == noErr)
+ {
+ err = PMSessionPageSetupDialog((PMPrintSession)macPrintSession,
+ (PMPageFormat)m_pageSetupData.GetPrintData().m_macPageFormat,
+ &accepted);
+ if ((err == noErr) && !accepted)
+ {
+ err = kPMCancel; // user clicked Cancel button
+ }
+ }
+
+ // If the user did not cancel, flatten and save the PageFormat object
+ // with our document.
+ if (err == noErr) {
+ // err = FlattenAndSavePageFormat(m_pageSetupData.GetPrintData().m_macPageFormat);
+ m_pageSetupData.ConvertFromNative() ;
+ result = wxID_OK ;
+ }
+ }
+ if ((err != noErr) && (err != kPMCancel))
+ {
+ message.Printf( "Print Error %d", err ) ;
+ wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ dialog.ShowModal();
+ }
+ ::UMAPrClose(&macPrintSession) ;
#else
#pragma warning "TODO: Printing for carbon without session apis"
#endif