added missing casts after removal of dependancy on mac headers

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13374 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Gilles Depeyrot
2002-01-04 21:51:02 +00:00
parent 6dcc2372e8
commit 962cbf2ee0
9 changed files with 346 additions and 346 deletions

View File

@@ -186,30 +186,32 @@ wxPrintData::wxPrintData()
PMPrintSession macPrintSession = kPMNoReference; PMPrintSession macPrintSession = kPMNoReference;
OSStatus err; OSStatus err;
err = ::UMAPrOpen(&macPrintSession) ; err = ::UMAPrOpen(&macPrintSession) ;
if ( err == noErr ) if ( err == noErr )
{ {
err = PMCreatePageFormat(&m_macPageFormat); err = PMCreatePageFormat((PMPageFormat *)&m_macPageFormat);
// Note that PMPageFormat is not session-specific, but calling // Note that PMPageFormat is not session-specific, but calling
// PMSessionDefaultPageFormat assigns values specific to the printer // PMSessionDefaultPageFormat assigns values specific to the printer
// associated with the current printing session. // associated with the current printing session.
if ((err == noErr) && (m_macPageFormat != kPMNoPageFormat)) if ((err == noErr) && (m_macPageFormat != kPMNoPageFormat))
{ {
err = PMSessionDefaultPageFormat(macPrintSession, m_macPageFormat); err = PMSessionDefaultPageFormat((PMPrintSession)macPrintSession,
} (PMPageFormat)m_macPageFormat);
}
err = PMCreatePrintSettings(&m_macPrintSettings);
err = PMCreatePrintSettings((PMPrintSettings *)&m_macPrintSettings);
// Note that PMPrintSettings is not session-specific, but calling
// PMSessionDefaultPrintSettings assigns values specific to the printer // Note that PMPrintSettings is not session-specific, but calling
// associated with the current printing session. // PMSessionDefaultPrintSettings assigns values specific to the printer
if ((err == noErr) && (m_macPrintSettings != kPMNoPrintSettings)) // associated with the current printing session.
{ if ((err == noErr) && (m_macPrintSettings != kPMNoPrintSettings))
err = PMSessionDefaultPrintSettings(macPrintSession, m_macPrintSettings); {
} err = PMSessionDefaultPrintSettings((PMPrintSession)macPrintSession,
} (PMPrintSettings)m_macPrintSettings);
::UMAPrClose(&macPrintSession) ; }
}
::UMAPrClose(&macPrintSession) ;
#endif #endif
#else #else
m_macPrintInfo = (THPrint) NewHandleClear( sizeof( TPrint ) ); m_macPrintInfo = (THPrint) NewHandleClear( sizeof( TPrint ) );

View File

@@ -52,7 +52,6 @@ static pascal void wxMacCheckListDefinition( short message, Boolean isSelected,
Cell cell, short dataOffset, short dataLength, Cell cell, short dataOffset, short dataLength,
ListHandle listHandle ) ListHandle listHandle )
{ {
FontInfo fontInfo;
GrafPtr savePort; GrafPtr savePort;
GrafPtr grafPtr; GrafPtr grafPtr;
RgnHandle savedClipRegion; RgnHandle savedClipRegion;
@@ -180,8 +179,8 @@ bool wxCheckListBox::Create(wxWindow *parent,
Size asize; Size asize;
CreateListBoxControl( parent->MacGetRootWindow(), &bounds, false, 0, 1, false, true, CreateListBoxControl( MAC_WXHWND(parent->MacGetRootWindow()), &bounds, false, 0, 1, false, true,
14, 14, false, &listDef, &m_macControl ); 14, 14, false, &listDef, (ControlRef *)&m_macControl );
GetControlData( (ControlHandle) m_macControl, kControlNoPart, kControlListBoxListHandleTag, GetControlData( (ControlHandle) m_macControl, kControlNoPart, kControlListBoxListHandleTag,
sizeof(ListHandle), (Ptr) &m_macList, &asize); sizeof(ListHandle), (Ptr) &m_macList, &asize);
@@ -352,10 +351,10 @@ void wxCheckListBox::OnLeftClick(wxMouseEvent& event)
int topcell ; int topcell ;
#if TARGET_CARBON #if TARGET_CARBON
Point pt ; Point pt ;
GetListCellSize( m_macList , &pt ) ; GetListCellSize( (ListHandle)m_macList , &pt ) ;
lineheight = pt.v ; lineheight = pt.v ;
ListBounds visible ; ListBounds visible ;
GetListVisibleCells( m_macList , &visible ) ; GetListVisibleCells( (ListHandle)m_macList , &visible ) ;
topcell = visible.top ; topcell = visible.top ;
#else #else
lineheight = (**(ListHandle)m_macList).cellSize.v ; lineheight = (**(ListHandle)m_macList).cellSize.v ;

View File

@@ -43,7 +43,7 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
m_printData.ConvertToNative() ; m_printData.ConvertToNative() ;
#if TARGET_CARBON && PM_USE_SESSION_APIS #if TARGET_CARBON && PM_USE_SESSION_APIS
err = UMAPrOpen(&m_macPrintSession) ; err = UMAPrOpen((PMPrintSession *)&m_macPrintSession) ;
if ( err != noErr || m_macPrintSession == kPMNoData ) if ( err != noErr || m_macPrintSession == kPMNoData )
#else #else
err = UMAPrOpen() ; err = UMAPrOpen() ;
@@ -54,7 +54,7 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal(); dialog.ShowModal();
#if TARGET_CARBON && PM_USE_SESSION_APIS #if TARGET_CARBON && PM_USE_SESSION_APIS
UMAPrClose(&m_macPrintSession) ; UMAPrClose((PMPrintSession *)&m_macPrintSession) ;
#else #else
UMAPrClose() ; UMAPrClose() ;
#endif #endif
@@ -94,9 +94,9 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
m_macPort = (GrafPtr ) m_macPrintPort ; m_macPort = (GrafPtr ) m_macPrintPort ;
#else #else
#if PM_USE_SESSION_APIS #if PM_USE_SESSION_APIS
err = PMSessionBeginDocument(m_macPrintSession, err = PMSessionBeginDocument((PMPrintSession)m_macPrintSession,
m_printData.m_macPrintSettings, (PMPrintSettings)m_printData.m_macPrintSettings,
m_printData.m_macPageFormat); (PMPageFormat)m_printData.m_macPageFormat);
if ( err != noErr ) if ( err != noErr )
#else #else
m_macPrintPort = kPMNoReference ; m_macPrintPort = kPMNoReference ;
@@ -111,7 +111,7 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal(); dialog.ShowModal();
#if TARGET_CARBON && PM_USE_SESSION_APIS #if TARGET_CARBON && PM_USE_SESSION_APIS
UMAPrClose(&m_macPrintSession) ; UMAPrClose((PMPrintSession *)&m_macPrintSession) ;
#else #else
UMAPrClose() ; UMAPrClose() ;
#endif #endif
@@ -119,21 +119,21 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
return; return;
} }
// sets current port // sets current port
::GetPort( &m_macPort ) ; ::GetPort( (GrafPtr *)&m_macPort ) ;
#endif #endif
m_ok = TRUE ; m_ok = TRUE ;
m_minY = m_minX = 0 ; m_minY = m_minX = 0 ;
#if TARGET_CARBON #if TARGET_CARBON
PMRect rPaper; PMRect rPaper;
err = PMGetAdjustedPaperRect(m_printData.m_macPageFormat, &rPaper); err = PMGetAdjustedPaperRect((PMPageFormat)m_printData.m_macPageFormat, &rPaper);
if ( err != noErr ) if ( err != noErr )
{ {
message.Printf( "Print Error %d", err ) ; message.Printf( "Print Error %d", err ) ;
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal(); dialog.ShowModal();
#if TARGET_CARBON && PM_USE_SESSION_APIS #if TARGET_CARBON && PM_USE_SESSION_APIS
UMAPrClose(&m_macPrintSession) ; UMAPrClose((PMPrintSession *)&m_macPrintSession) ;
#else #else
UMAPrClose() ; UMAPrClose() ;
#endif #endif
@@ -180,7 +180,7 @@ wxPrinterDC::~wxPrinterDC(void)
if ( m_ok ) if ( m_ok )
{ {
#if PM_USE_SESSION_APIS #if PM_USE_SESSION_APIS
err = PMSessionEndDocument(m_macPrintSession); err = PMSessionEndDocument((PMPrintSession)m_macPrintSession);
#else #else
err = PMEndDocument(m_macPrintPort); err = PMEndDocument(m_macPrintPort);
#endif #endif
@@ -191,7 +191,7 @@ wxPrinterDC::~wxPrinterDC(void)
dialog.ShowModal(); dialog.ShowModal();
} }
#if TARGET_CARBON && PM_USE_SESSION_APIS #if TARGET_CARBON && PM_USE_SESSION_APIS
UMAPrClose(&m_macPrintSession) ; UMAPrClose((PMPrintSession *)&m_macPrintSession) ;
#else #else
UMAPrClose() ; UMAPrClose() ;
#endif #endif
@@ -253,8 +253,8 @@ void wxPrinterDC::StartPage(void)
} }
#else #else
#if PM_USE_SESSION_APIS #if PM_USE_SESSION_APIS
err = PMSessionBeginPage(m_macPrintSession, err = PMSessionBeginPage((PMPrintSession)m_macPrintSession,
m_printData.m_macPageFormat, (PMPageFormat)m_printData.m_macPageFormat,
nil); nil);
#else #else
err = PMBeginPage(m_macPrintPort, nil); err = PMBeginPage(m_macPrintPort, nil);
@@ -265,9 +265,9 @@ void wxPrinterDC::StartPage(void)
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal(); dialog.ShowModal();
#if PM_USE_SESSION_APIS #if PM_USE_SESSION_APIS
PMSessionEndPage(m_macPrintSession); PMSessionEndPage((PMPrintSession)m_macPrintSession);
PMSessionEndDocument(m_macPrintSession); PMSessionEndDocument((PMPrintSession)m_macPrintSession);
UMAPrClose(&m_macPrintSession) ; UMAPrClose((PMPrintSession *)&m_macPrintSession) ;
#else #else
PMEndPage(m_macPrintPort); PMEndPage(m_macPrintPort);
PMEndDocument(m_macPrintPort); PMEndDocument(m_macPrintPort);
@@ -302,7 +302,7 @@ void wxPrinterDC::EndPage(void)
} }
#else #else
#if PM_USE_SESSION_APIS #if PM_USE_SESSION_APIS
err = PMSessionEndPage(m_macPrintSession); err = PMSessionEndPage((PMPrintSession)m_macPrintSession);
#else #else
err = PMEndPage(m_macPrintPort); err = PMEndPage(m_macPrintPort);
#endif #endif
@@ -312,8 +312,8 @@ void wxPrinterDC::EndPage(void)
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal(); dialog.ShowModal();
#if PM_USE_SESSION_APIS #if PM_USE_SESSION_APIS
PMSessionEndDocument(m_macPrintSession); PMSessionEndDocument((PMPrintSession)m_macPrintSession);
UMAPrClose(&m_macPrintSession) ; UMAPrClose((PMPrintSession *)&m_macPrintSession) ;
#else #else
PMEndDocument(m_macPrintPort); PMEndDocument(m_macPrintPort);
UMAPrClose() ; UMAPrClose() ;

View File

@@ -168,8 +168,8 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
Size asize; Size asize;
CreateListBoxControl( parent->MacGetRootWindow(), &bounds, false, 0, 1, false, true, CreateListBoxControl( MAC_WXHWND(parent->MacGetRootWindow()), &bounds, false, 0, 1, false, true,
kwxMacListItemHeight, kwxMacListItemHeight, false, &listDef, &m_macControl ); kwxMacListItemHeight, kwxMacListItemHeight, false, &listDef, (ControlRef *)&m_macControl );
GetControlData( (ControlHandle) m_macControl, kControlNoPart, kControlListBoxListHandleTag, GetControlData( (ControlHandle) m_macControl, kControlNoPart, kControlListBoxListHandleTag,
sizeof(ListHandle), (Ptr) &m_macList, &asize); sizeof(ListHandle), (Ptr) &m_macList, &asize);
@@ -273,7 +273,7 @@ void wxListBox::DoSetSize(int x, int y,
#if TARGET_CARBON #if TARGET_CARBON
Rect bounds ; Rect bounds ;
GetControlBounds( (ControlHandle) m_macControl , &bounds ) ; GetControlBounds( (ControlHandle) m_macControl , &bounds ) ;
ControlRef control = GetListVerticalScrollBar( m_macList ) ; ControlRef control = GetListVerticalScrollBar( (ListHandle)m_macList ) ;
if ( control ) if ( control )
{ {
Rect scrollbounds ; Rect scrollbounds ;
@@ -737,7 +737,7 @@ void wxListBox::OnSize( const wxSizeEvent &event)
Point pt; Point pt;
#if TARGET_CARBON #if TARGET_CARBON
GetListCellSize(m_macList, &pt); GetListCellSize((ListHandle)m_macList, &pt);
#else #else
pt = (**(ListHandle)m_macList).cellSize ; pt = (**(ListHandle)m_macList).cellSize ;
#endif #endif

View File

@@ -95,86 +95,86 @@ int wxPrintDialog::ShowModal()
PMPrintSession macPrintSession = kPMNoReference; PMPrintSession macPrintSession = kPMNoReference;
Boolean accepted; Boolean accepted;
err = ::UMAPrOpen(&macPrintSession) ; err = ::UMAPrOpen(&macPrintSession) ;
if ( err == noErr ) if ( err == noErr )
{ {
m_printDialogData.ConvertToNative() ; m_printDialogData.ConvertToNative() ;
// Set up a valid PageFormat object. // Set up a valid PageFormat object.
if (m_printDialogData.GetPrintData().m_macPageFormat == kPMNoPageFormat) if (m_printDialogData.GetPrintData().m_macPageFormat == kPMNoPageFormat)
{ {
err = PMCreatePageFormat(&m_printDialogData.GetPrintData().m_macPageFormat); err = PMCreatePageFormat((PMPageFormat *)&m_printDialogData.GetPrintData().m_macPageFormat);
// Note that PMPageFormat is not session-specific, but calling // Note that PMPageFormat is not session-specific, but calling
// PMSessionDefaultPageFormat assigns values specific to the printer // PMSessionDefaultPageFormat assigns values specific to the printer
// associated with the current printing session. // associated with the current printing session.
if ((err == noErr) && if ((err == noErr) &&
(m_printDialogData.GetPrintData().m_macPageFormat != kPMNoPageFormat)) (m_printDialogData.GetPrintData().m_macPageFormat != kPMNoPageFormat))
{ {
err = PMSessionDefaultPageFormat(macPrintSession, err = PMSessionDefaultPageFormat((PMPrintSession)macPrintSession,
m_printDialogData.GetPrintData().m_macPageFormat); (PMPageFormat)m_printDialogData.GetPrintData().m_macPageFormat);
} }
} }
else else
{ {
err = PMSessionValidatePageFormat(macPrintSession, err = PMSessionValidatePageFormat((PMPrintSession)macPrintSession,
m_printDialogData.GetPrintData().m_macPageFormat, (PMPageFormat)m_printDialogData.GetPrintData().m_macPageFormat,
kPMDontWantBoolean); kPMDontWantBoolean);
} }
// Set up a valid PrintSettings object. // Set up a valid PrintSettings object.
if (m_printDialogData.GetPrintData().m_macPrintSettings == kPMNoPrintSettings) if (m_printDialogData.GetPrintData().m_macPrintSettings == kPMNoPrintSettings)
{ {
err = PMCreatePrintSettings(&m_printDialogData.GetPrintData().m_macPrintSettings); err = PMCreatePrintSettings((PMPrintSettings *)&m_printDialogData.GetPrintData().m_macPrintSettings);
// Note that PMPrintSettings is not session-specific, but calling // Note that PMPrintSettings is not session-specific, but calling
// PMSessionDefaultPrintSettings assigns values specific to the printer // PMSessionDefaultPrintSettings assigns values specific to the printer
// associated with the current printing session. // associated with the current printing session.
if ((err == noErr) && if ((err == noErr) &&
(m_printDialogData.GetPrintData().m_macPrintSettings != kPMNoPrintSettings)) (m_printDialogData.GetPrintData().m_macPrintSettings != kPMNoPrintSettings))
{ {
err = PMSessionDefaultPrintSettings(macPrintSession, err = PMSessionDefaultPrintSettings((PMPrintSession)macPrintSession,
m_printDialogData.GetPrintData().m_macPrintSettings); (PMPrintSettings)m_printDialogData.GetPrintData().m_macPrintSettings);
} }
} }
else else
{ {
err = PMSessionValidatePrintSettings(macPrintSession, err = PMSessionValidatePrintSettings((PMPrintSession)macPrintSession,
m_printDialogData.GetPrintData().m_macPrintSettings, (PMPrintSettings)m_printDialogData.GetPrintData().m_macPrintSettings,
kPMDontWantBoolean); kPMDontWantBoolean);
} }
// Set a valid page range before displaying the Print dialog // Set a valid page range before displaying the Print dialog
if (err == noErr) if (err == noErr)
{ {
// err = PMSetPageRange(m_printDialogData.GetPrintData().m_macPrintSettings, // err = PMSetPageRange(m_printDialogData.GetPrintData().m_macPrintSettings,
// minPage, maxPage); // minPage, maxPage);
} }
// Display the Print dialog. // Display the Print dialog.
if (err == noErr) if (err == noErr)
{ {
err = PMSessionPrintDialog(macPrintSession, err = PMSessionPrintDialog((PMPrintSession)macPrintSession,
m_printDialogData.GetPrintData().m_macPrintSettings, (PMPrintSettings)m_printDialogData.GetPrintData().m_macPrintSettings,
m_printDialogData.GetPrintData().m_macPageFormat, (PMPageFormat)m_printDialogData.GetPrintData().m_macPageFormat,
&accepted); &accepted);
if ((err == noErr) && !accepted) if ((err == noErr) && !accepted)
{ {
err = kPMCancel; // user clicked Cancel button err = kPMCancel; // user clicked Cancel button
} }
} }
if ( err == noErr ) if ( err == noErr )
{ {
m_printDialogData.ConvertFromNative() ; m_printDialogData.ConvertFromNative() ;
result = wxID_OK ; result = wxID_OK ;
} }
} }
if ((err != noErr) && (err != kPMCancel)) if ((err != noErr) && (err != kPMCancel))
{ {
message.Printf( "Print Error %d", err ) ; message.Printf( "Print Error %d", err ) ;
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal(); dialog.ShowModal();
} }
::UMAPrClose(&macPrintSession) ; ::UMAPrClose(&macPrintSession) ;
#else #else
#pragma warning "TODO: Printing for carbon without session apis" #pragma warning "TODO: Printing for carbon without session apis"
#endif #endif
@@ -247,60 +247,60 @@ int wxPageSetupDialog::ShowModal()
PMPrintSession macPrintSession = kPMNoReference; PMPrintSession macPrintSession = kPMNoReference;
Boolean accepted; Boolean accepted;
err = ::UMAPrOpen(&macPrintSession) ; err = ::UMAPrOpen(&macPrintSession) ;
if ( err == noErr ) if ( err == noErr )
{ {
m_pageSetupData.ConvertToNative() ; m_pageSetupData.ConvertToNative() ;
// Set up a valid PageFormat object. // Set up a valid PageFormat object.
if (m_pageSetupData.GetPrintData().m_macPageFormat == kPMNoPageFormat) if (m_pageSetupData.GetPrintData().m_macPageFormat == kPMNoPageFormat)
{ {
err = PMCreatePageFormat(&m_pageSetupData.GetPrintData().m_macPageFormat); err = PMCreatePageFormat((PMPageFormat *)&m_pageSetupData.GetPrintData().m_macPageFormat);
// Note that PMPageFormat is not session-specific, but calling // Note that PMPageFormat is not session-specific, but calling
// PMSessionDefaultPageFormat assigns values specific to the printer // PMSessionDefaultPageFormat assigns values specific to the printer
// associated with the current printing session. // associated with the current printing session.
if ((err == noErr) && if ((err == noErr) &&
(m_pageSetupData.GetPrintData().m_macPageFormat != kPMNoPageFormat)) (m_pageSetupData.GetPrintData().m_macPageFormat != kPMNoPageFormat))
{ {
err = PMSessionDefaultPageFormat(macPrintSession, err = PMSessionDefaultPageFormat((PMPrintSession)macPrintSession,
m_pageSetupData.GetPrintData().m_macPageFormat); (PMPageFormat)m_pageSetupData.GetPrintData().m_macPageFormat);
} }
} }
else else
{ {
err = PMSessionValidatePageFormat(macPrintSession, err = PMSessionValidatePageFormat((PMPrintSession)macPrintSession,
m_pageSetupData.GetPrintData().m_macPageFormat, (PMPageFormat)m_pageSetupData.GetPrintData().m_macPageFormat,
kPMDontWantBoolean); kPMDontWantBoolean);
} }
// Display the Page Setup dialog. // Display the Page Setup dialog.
if (err == noErr) if (err == noErr)
{ {
err = PMSessionPageSetupDialog(macPrintSession, err = PMSessionPageSetupDialog((PMPrintSession)macPrintSession,
m_pageSetupData.GetPrintData().m_macPageFormat, (PMPageFormat)m_pageSetupData.GetPrintData().m_macPageFormat,
&accepted); &accepted);
if ((err == noErr) && !accepted) if ((err == noErr) && !accepted)
{ {
err = kPMCancel; // user clicked Cancel button err = kPMCancel; // user clicked Cancel button
} }
} }
// If the user did not cancel, flatten and save the PageFormat object // If the user did not cancel, flatten and save the PageFormat object
// with our document. // with our document.
if (err == noErr) { if (err == noErr) {
// err = FlattenAndSavePageFormat(m_pageSetupData.GetPrintData().m_macPageFormat); // err = FlattenAndSavePageFormat(m_pageSetupData.GetPrintData().m_macPageFormat);
m_pageSetupData.ConvertFromNative() ; m_pageSetupData.ConvertFromNative() ;
result = wxID_OK ; result = wxID_OK ;
} }
} }
if ((err != noErr) && (err != kPMCancel)) if ((err != noErr) && (err != kPMCancel))
{ {
message.Printf( "Print Error %d", err ) ; message.Printf( "Print Error %d", err ) ;
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal(); dialog.ShowModal();
} }
::UMAPrClose(&macPrintSession) ; ::UMAPrClose(&macPrintSession) ;
#else #else
#pragma warning "TODO: Printing for carbon without session apis" #pragma warning "TODO: Printing for carbon without session apis"
#endif #endif

View File

@@ -52,7 +52,6 @@ static pascal void wxMacCheckListDefinition( short message, Boolean isSelected,
Cell cell, short dataOffset, short dataLength, Cell cell, short dataOffset, short dataLength,
ListHandle listHandle ) ListHandle listHandle )
{ {
FontInfo fontInfo;
GrafPtr savePort; GrafPtr savePort;
GrafPtr grafPtr; GrafPtr grafPtr;
RgnHandle savedClipRegion; RgnHandle savedClipRegion;
@@ -180,8 +179,8 @@ bool wxCheckListBox::Create(wxWindow *parent,
Size asize; Size asize;
CreateListBoxControl( parent->MacGetRootWindow(), &bounds, false, 0, 1, false, true, CreateListBoxControl( MAC_WXHWND(parent->MacGetRootWindow()), &bounds, false, 0, 1, false, true,
14, 14, false, &listDef, &m_macControl ); 14, 14, false, &listDef, (ControlRef *)&m_macControl );
GetControlData( (ControlHandle) m_macControl, kControlNoPart, kControlListBoxListHandleTag, GetControlData( (ControlHandle) m_macControl, kControlNoPart, kControlListBoxListHandleTag,
sizeof(ListHandle), (Ptr) &m_macList, &asize); sizeof(ListHandle), (Ptr) &m_macList, &asize);
@@ -352,10 +351,10 @@ void wxCheckListBox::OnLeftClick(wxMouseEvent& event)
int topcell ; int topcell ;
#if TARGET_CARBON #if TARGET_CARBON
Point pt ; Point pt ;
GetListCellSize( m_macList , &pt ) ; GetListCellSize( (ListHandle)m_macList , &pt ) ;
lineheight = pt.v ; lineheight = pt.v ;
ListBounds visible ; ListBounds visible ;
GetListVisibleCells( m_macList , &visible ) ; GetListVisibleCells( (ListHandle)m_macList , &visible ) ;
topcell = visible.top ; topcell = visible.top ;
#else #else
lineheight = (**(ListHandle)m_macList).cellSize.v ; lineheight = (**(ListHandle)m_macList).cellSize.v ;

View File

@@ -43,7 +43,7 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
m_printData.ConvertToNative() ; m_printData.ConvertToNative() ;
#if TARGET_CARBON && PM_USE_SESSION_APIS #if TARGET_CARBON && PM_USE_SESSION_APIS
err = UMAPrOpen(&m_macPrintSession) ; err = UMAPrOpen((PMPrintSession *)&m_macPrintSession) ;
if ( err != noErr || m_macPrintSession == kPMNoData ) if ( err != noErr || m_macPrintSession == kPMNoData )
#else #else
err = UMAPrOpen() ; err = UMAPrOpen() ;
@@ -54,7 +54,7 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal(); dialog.ShowModal();
#if TARGET_CARBON && PM_USE_SESSION_APIS #if TARGET_CARBON && PM_USE_SESSION_APIS
UMAPrClose(&m_macPrintSession) ; UMAPrClose((PMPrintSession *)&m_macPrintSession) ;
#else #else
UMAPrClose() ; UMAPrClose() ;
#endif #endif
@@ -94,9 +94,9 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
m_macPort = (GrafPtr ) m_macPrintPort ; m_macPort = (GrafPtr ) m_macPrintPort ;
#else #else
#if PM_USE_SESSION_APIS #if PM_USE_SESSION_APIS
err = PMSessionBeginDocument(m_macPrintSession, err = PMSessionBeginDocument((PMPrintSession)m_macPrintSession,
m_printData.m_macPrintSettings, (PMPrintSettings)m_printData.m_macPrintSettings,
m_printData.m_macPageFormat); (PMPageFormat)m_printData.m_macPageFormat);
if ( err != noErr ) if ( err != noErr )
#else #else
m_macPrintPort = kPMNoReference ; m_macPrintPort = kPMNoReference ;
@@ -111,7 +111,7 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal(); dialog.ShowModal();
#if TARGET_CARBON && PM_USE_SESSION_APIS #if TARGET_CARBON && PM_USE_SESSION_APIS
UMAPrClose(&m_macPrintSession) ; UMAPrClose((PMPrintSession *)&m_macPrintSession) ;
#else #else
UMAPrClose() ; UMAPrClose() ;
#endif #endif
@@ -119,21 +119,21 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
return; return;
} }
// sets current port // sets current port
::GetPort( &m_macPort ) ; ::GetPort( (GrafPtr *)&m_macPort ) ;
#endif #endif
m_ok = TRUE ; m_ok = TRUE ;
m_minY = m_minX = 0 ; m_minY = m_minX = 0 ;
#if TARGET_CARBON #if TARGET_CARBON
PMRect rPaper; PMRect rPaper;
err = PMGetAdjustedPaperRect(m_printData.m_macPageFormat, &rPaper); err = PMGetAdjustedPaperRect((PMPageFormat)m_printData.m_macPageFormat, &rPaper);
if ( err != noErr ) if ( err != noErr )
{ {
message.Printf( "Print Error %d", err ) ; message.Printf( "Print Error %d", err ) ;
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal(); dialog.ShowModal();
#if TARGET_CARBON && PM_USE_SESSION_APIS #if TARGET_CARBON && PM_USE_SESSION_APIS
UMAPrClose(&m_macPrintSession) ; UMAPrClose((PMPrintSession *)&m_macPrintSession) ;
#else #else
UMAPrClose() ; UMAPrClose() ;
#endif #endif
@@ -180,7 +180,7 @@ wxPrinterDC::~wxPrinterDC(void)
if ( m_ok ) if ( m_ok )
{ {
#if PM_USE_SESSION_APIS #if PM_USE_SESSION_APIS
err = PMSessionEndDocument(m_macPrintSession); err = PMSessionEndDocument((PMPrintSession)m_macPrintSession);
#else #else
err = PMEndDocument(m_macPrintPort); err = PMEndDocument(m_macPrintPort);
#endif #endif
@@ -191,7 +191,7 @@ wxPrinterDC::~wxPrinterDC(void)
dialog.ShowModal(); dialog.ShowModal();
} }
#if TARGET_CARBON && PM_USE_SESSION_APIS #if TARGET_CARBON && PM_USE_SESSION_APIS
UMAPrClose(&m_macPrintSession) ; UMAPrClose((PMPrintSession *)&m_macPrintSession) ;
#else #else
UMAPrClose() ; UMAPrClose() ;
#endif #endif
@@ -253,8 +253,8 @@ void wxPrinterDC::StartPage(void)
} }
#else #else
#if PM_USE_SESSION_APIS #if PM_USE_SESSION_APIS
err = PMSessionBeginPage(m_macPrintSession, err = PMSessionBeginPage((PMPrintSession)m_macPrintSession,
m_printData.m_macPageFormat, (PMPageFormat)m_printData.m_macPageFormat,
nil); nil);
#else #else
err = PMBeginPage(m_macPrintPort, nil); err = PMBeginPage(m_macPrintPort, nil);
@@ -265,9 +265,9 @@ void wxPrinterDC::StartPage(void)
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal(); dialog.ShowModal();
#if PM_USE_SESSION_APIS #if PM_USE_SESSION_APIS
PMSessionEndPage(m_macPrintSession); PMSessionEndPage((PMPrintSession)m_macPrintSession);
PMSessionEndDocument(m_macPrintSession); PMSessionEndDocument((PMPrintSession)m_macPrintSession);
UMAPrClose(&m_macPrintSession) ; UMAPrClose((PMPrintSession *)&m_macPrintSession) ;
#else #else
PMEndPage(m_macPrintPort); PMEndPage(m_macPrintPort);
PMEndDocument(m_macPrintPort); PMEndDocument(m_macPrintPort);
@@ -302,7 +302,7 @@ void wxPrinterDC::EndPage(void)
} }
#else #else
#if PM_USE_SESSION_APIS #if PM_USE_SESSION_APIS
err = PMSessionEndPage(m_macPrintSession); err = PMSessionEndPage((PMPrintSession)m_macPrintSession);
#else #else
err = PMEndPage(m_macPrintPort); err = PMEndPage(m_macPrintPort);
#endif #endif
@@ -312,8 +312,8 @@ void wxPrinterDC::EndPage(void)
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal(); dialog.ShowModal();
#if PM_USE_SESSION_APIS #if PM_USE_SESSION_APIS
PMSessionEndDocument(m_macPrintSession); PMSessionEndDocument((PMPrintSession)m_macPrintSession);
UMAPrClose(&m_macPrintSession) ; UMAPrClose((PMPrintSession *)&m_macPrintSession) ;
#else #else
PMEndDocument(m_macPrintPort); PMEndDocument(m_macPrintPort);
UMAPrClose() ; UMAPrClose() ;

View File

@@ -168,8 +168,8 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
Size asize; Size asize;
CreateListBoxControl( parent->MacGetRootWindow(), &bounds, false, 0, 1, false, true, CreateListBoxControl( MAC_WXHWND(parent->MacGetRootWindow()), &bounds, false, 0, 1, false, true,
kwxMacListItemHeight, kwxMacListItemHeight, false, &listDef, &m_macControl ); kwxMacListItemHeight, kwxMacListItemHeight, false, &listDef, (ControlRef *)&m_macControl );
GetControlData( (ControlHandle) m_macControl, kControlNoPart, kControlListBoxListHandleTag, GetControlData( (ControlHandle) m_macControl, kControlNoPart, kControlListBoxListHandleTag,
sizeof(ListHandle), (Ptr) &m_macList, &asize); sizeof(ListHandle), (Ptr) &m_macList, &asize);
@@ -273,7 +273,7 @@ void wxListBox::DoSetSize(int x, int y,
#if TARGET_CARBON #if TARGET_CARBON
Rect bounds ; Rect bounds ;
GetControlBounds( (ControlHandle) m_macControl , &bounds ) ; GetControlBounds( (ControlHandle) m_macControl , &bounds ) ;
ControlRef control = GetListVerticalScrollBar( m_macList ) ; ControlRef control = GetListVerticalScrollBar( (ListHandle)m_macList ) ;
if ( control ) if ( control )
{ {
Rect scrollbounds ; Rect scrollbounds ;
@@ -737,7 +737,7 @@ void wxListBox::OnSize( const wxSizeEvent &event)
Point pt; Point pt;
#if TARGET_CARBON #if TARGET_CARBON
GetListCellSize(m_macList, &pt); GetListCellSize((ListHandle)m_macList, &pt);
#else #else
pt = (**(ListHandle)m_macList).cellSize ; pt = (**(ListHandle)m_macList).cellSize ;
#endif #endif

View File

@@ -95,86 +95,86 @@ int wxPrintDialog::ShowModal()
PMPrintSession macPrintSession = kPMNoReference; PMPrintSession macPrintSession = kPMNoReference;
Boolean accepted; Boolean accepted;
err = ::UMAPrOpen(&macPrintSession) ; err = ::UMAPrOpen(&macPrintSession) ;
if ( err == noErr ) if ( err == noErr )
{ {
m_printDialogData.ConvertToNative() ; m_printDialogData.ConvertToNative() ;
// Set up a valid PageFormat object. // Set up a valid PageFormat object.
if (m_printDialogData.GetPrintData().m_macPageFormat == kPMNoPageFormat) if (m_printDialogData.GetPrintData().m_macPageFormat == kPMNoPageFormat)
{ {
err = PMCreatePageFormat(&m_printDialogData.GetPrintData().m_macPageFormat); err = PMCreatePageFormat((PMPageFormat *)&m_printDialogData.GetPrintData().m_macPageFormat);
// Note that PMPageFormat is not session-specific, but calling // Note that PMPageFormat is not session-specific, but calling
// PMSessionDefaultPageFormat assigns values specific to the printer // PMSessionDefaultPageFormat assigns values specific to the printer
// associated with the current printing session. // associated with the current printing session.
if ((err == noErr) && if ((err == noErr) &&
(m_printDialogData.GetPrintData().m_macPageFormat != kPMNoPageFormat)) (m_printDialogData.GetPrintData().m_macPageFormat != kPMNoPageFormat))
{ {
err = PMSessionDefaultPageFormat(macPrintSession, err = PMSessionDefaultPageFormat((PMPrintSession)macPrintSession,
m_printDialogData.GetPrintData().m_macPageFormat); (PMPageFormat)m_printDialogData.GetPrintData().m_macPageFormat);
} }
} }
else else
{ {
err = PMSessionValidatePageFormat(macPrintSession, err = PMSessionValidatePageFormat((PMPrintSession)macPrintSession,
m_printDialogData.GetPrintData().m_macPageFormat, (PMPageFormat)m_printDialogData.GetPrintData().m_macPageFormat,
kPMDontWantBoolean); kPMDontWantBoolean);
} }
// Set up a valid PrintSettings object. // Set up a valid PrintSettings object.
if (m_printDialogData.GetPrintData().m_macPrintSettings == kPMNoPrintSettings) if (m_printDialogData.GetPrintData().m_macPrintSettings == kPMNoPrintSettings)
{ {
err = PMCreatePrintSettings(&m_printDialogData.GetPrintData().m_macPrintSettings); err = PMCreatePrintSettings((PMPrintSettings *)&m_printDialogData.GetPrintData().m_macPrintSettings);
// Note that PMPrintSettings is not session-specific, but calling // Note that PMPrintSettings is not session-specific, but calling
// PMSessionDefaultPrintSettings assigns values specific to the printer // PMSessionDefaultPrintSettings assigns values specific to the printer
// associated with the current printing session. // associated with the current printing session.
if ((err == noErr) && if ((err == noErr) &&
(m_printDialogData.GetPrintData().m_macPrintSettings != kPMNoPrintSettings)) (m_printDialogData.GetPrintData().m_macPrintSettings != kPMNoPrintSettings))
{ {
err = PMSessionDefaultPrintSettings(macPrintSession, err = PMSessionDefaultPrintSettings((PMPrintSession)macPrintSession,
m_printDialogData.GetPrintData().m_macPrintSettings); (PMPrintSettings)m_printDialogData.GetPrintData().m_macPrintSettings);
} }
} }
else else
{ {
err = PMSessionValidatePrintSettings(macPrintSession, err = PMSessionValidatePrintSettings((PMPrintSession)macPrintSession,
m_printDialogData.GetPrintData().m_macPrintSettings, (PMPrintSettings)m_printDialogData.GetPrintData().m_macPrintSettings,
kPMDontWantBoolean); kPMDontWantBoolean);
} }
// Set a valid page range before displaying the Print dialog // Set a valid page range before displaying the Print dialog
if (err == noErr) if (err == noErr)
{ {
// err = PMSetPageRange(m_printDialogData.GetPrintData().m_macPrintSettings, // err = PMSetPageRange(m_printDialogData.GetPrintData().m_macPrintSettings,
// minPage, maxPage); // minPage, maxPage);
} }
// Display the Print dialog. // Display the Print dialog.
if (err == noErr) if (err == noErr)
{ {
err = PMSessionPrintDialog(macPrintSession, err = PMSessionPrintDialog((PMPrintSession)macPrintSession,
m_printDialogData.GetPrintData().m_macPrintSettings, (PMPrintSettings)m_printDialogData.GetPrintData().m_macPrintSettings,
m_printDialogData.GetPrintData().m_macPageFormat, (PMPageFormat)m_printDialogData.GetPrintData().m_macPageFormat,
&accepted); &accepted);
if ((err == noErr) && !accepted) if ((err == noErr) && !accepted)
{ {
err = kPMCancel; // user clicked Cancel button err = kPMCancel; // user clicked Cancel button
} }
} }
if ( err == noErr ) if ( err == noErr )
{ {
m_printDialogData.ConvertFromNative() ; m_printDialogData.ConvertFromNative() ;
result = wxID_OK ; result = wxID_OK ;
} }
} }
if ((err != noErr) && (err != kPMCancel)) if ((err != noErr) && (err != kPMCancel))
{ {
message.Printf( "Print Error %d", err ) ; message.Printf( "Print Error %d", err ) ;
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal(); dialog.ShowModal();
} }
::UMAPrClose(&macPrintSession) ; ::UMAPrClose(&macPrintSession) ;
#else #else
#pragma warning "TODO: Printing for carbon without session apis" #pragma warning "TODO: Printing for carbon without session apis"
#endif #endif
@@ -247,60 +247,60 @@ int wxPageSetupDialog::ShowModal()
PMPrintSession macPrintSession = kPMNoReference; PMPrintSession macPrintSession = kPMNoReference;
Boolean accepted; Boolean accepted;
err = ::UMAPrOpen(&macPrintSession) ; err = ::UMAPrOpen(&macPrintSession) ;
if ( err == noErr ) if ( err == noErr )
{ {
m_pageSetupData.ConvertToNative() ; m_pageSetupData.ConvertToNative() ;
// Set up a valid PageFormat object. // Set up a valid PageFormat object.
if (m_pageSetupData.GetPrintData().m_macPageFormat == kPMNoPageFormat) if (m_pageSetupData.GetPrintData().m_macPageFormat == kPMNoPageFormat)
{ {
err = PMCreatePageFormat(&m_pageSetupData.GetPrintData().m_macPageFormat); err = PMCreatePageFormat((PMPageFormat *)&m_pageSetupData.GetPrintData().m_macPageFormat);
// Note that PMPageFormat is not session-specific, but calling // Note that PMPageFormat is not session-specific, but calling
// PMSessionDefaultPageFormat assigns values specific to the printer // PMSessionDefaultPageFormat assigns values specific to the printer
// associated with the current printing session. // associated with the current printing session.
if ((err == noErr) && if ((err == noErr) &&
(m_pageSetupData.GetPrintData().m_macPageFormat != kPMNoPageFormat)) (m_pageSetupData.GetPrintData().m_macPageFormat != kPMNoPageFormat))
{ {
err = PMSessionDefaultPageFormat(macPrintSession, err = PMSessionDefaultPageFormat((PMPrintSession)macPrintSession,
m_pageSetupData.GetPrintData().m_macPageFormat); (PMPageFormat)m_pageSetupData.GetPrintData().m_macPageFormat);
} }
} }
else else
{ {
err = PMSessionValidatePageFormat(macPrintSession, err = PMSessionValidatePageFormat((PMPrintSession)macPrintSession,
m_pageSetupData.GetPrintData().m_macPageFormat, (PMPageFormat)m_pageSetupData.GetPrintData().m_macPageFormat,
kPMDontWantBoolean); kPMDontWantBoolean);
} }
// Display the Page Setup dialog. // Display the Page Setup dialog.
if (err == noErr) if (err == noErr)
{ {
err = PMSessionPageSetupDialog(macPrintSession, err = PMSessionPageSetupDialog((PMPrintSession)macPrintSession,
m_pageSetupData.GetPrintData().m_macPageFormat, (PMPageFormat)m_pageSetupData.GetPrintData().m_macPageFormat,
&accepted); &accepted);
if ((err == noErr) && !accepted) if ((err == noErr) && !accepted)
{ {
err = kPMCancel; // user clicked Cancel button err = kPMCancel; // user clicked Cancel button
} }
} }
// If the user did not cancel, flatten and save the PageFormat object // If the user did not cancel, flatten and save the PageFormat object
// with our document. // with our document.
if (err == noErr) { if (err == noErr) {
// err = FlattenAndSavePageFormat(m_pageSetupData.GetPrintData().m_macPageFormat); // err = FlattenAndSavePageFormat(m_pageSetupData.GetPrintData().m_macPageFormat);
m_pageSetupData.ConvertFromNative() ; m_pageSetupData.ConvertFromNative() ;
result = wxID_OK ; result = wxID_OK ;
} }
} }
if ((err != noErr) && (err != kPMCancel)) if ((err != noErr) && (err != kPMCancel))
{ {
message.Printf( "Print Error %d", err ) ; message.Printf( "Print Error %d", err ) ;
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal(); dialog.ShowModal();
} }
::UMAPrClose(&macPrintSession) ; ::UMAPrClose(&macPrintSession) ;
#else #else
#pragma warning "TODO: Printing for carbon without session apis" #pragma warning "TODO: Printing for carbon without session apis"
#endif #endif