From 4913272f9cdead94a6d1470e51d6fb14946b50e0 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sat, 14 Oct 2006 16:02:39 +0000 Subject: [PATCH] cleanup for 10.5 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42011 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/dirmac.cpp | 2 +- src/mac/carbon/dnd.cpp | 21 ++++++++++++++++----- src/mac/carbon/font.cpp | 17 +++++++++++++++-- src/mac/carbon/fontenum.cpp | 4 +++- 4 files changed, 35 insertions(+), 9 deletions(-) diff --git a/src/mac/carbon/dirmac.cpp b/src/mac/carbon/dirmac.cpp index 3dd53627a6..979f68a40e 100644 --- a/src/mac/carbon/dirmac.cpp +++ b/src/mac/carbon/dirmac.cpp @@ -131,7 +131,7 @@ bool wxDirData::Read(wxString *filename) HFSUniStr255 uniname ; FSRef fileRef; FSCatalogInfo catalogInfo; - UInt32 fetched = 0; + ItemCount fetched = 0; err = FSGetCatalogInfoBulk( m_iterator, 1, &fetched, NULL, kFSCatInfoNodeFlags | kFSCatInfoFinderInfo , &catalogInfo , &fileRef, NULL, &uniname ); diff --git a/src/mac/carbon/dnd.cpp b/src/mac/carbon/dnd.cpp index 0a42702a8f..29c7ff768b 100644 --- a/src/mac/carbon/dnd.cpp +++ b/src/mac/carbon/dnd.cpp @@ -264,10 +264,12 @@ bool wxDropTarget::GetData() if (theData != NULL) { HFSFlavor* theFile = (HFSFlavor*)theData; +#ifndef __LP64__ wxString name = wxMacFSSpec2MacFilename( &theFile->fileSpec ); if (!name.empty()) filenamesPassed += name + wxT("\n"); +#endif } break; @@ -345,7 +347,7 @@ wxDragResult wxDropSource::DoDragDrop(int flags) size_t formatCount = m_data->GetFormatCount(); wxDataFormat *formats = new wxDataFormat[formatCount]; m_data->GetAllFormats( formats ); - ItemReference theItem = 1; + ItemReference theItem = (ItemReference) 1; for ( size_t i = 0; i < formatCount; ++i ) { @@ -371,6 +373,7 @@ wxDragResult wxDropSource::DoDragDrop(int flags) { HFSFlavor theFlavor; OSErr err = noErr; +#ifndef __LP64__ CInfoPBRec cat; wxMacFilename2FSSpec( wxString( dataPtr, *wxConvCurrent ), &theFlavor.fileSpec ); @@ -381,8 +384,10 @@ wxDragResult wxDropSource::DoDragDrop(int flags) cat.hFileInfo.ioDirID = theFlavor.fileSpec.parID; cat.hFileInfo.ioFDirIndex = 0; err = PBGetCatInfoSync( &cat ); - if (err == noErr) +#endif + if (err == noErr) { +#ifndef __LP64__ theFlavor.fdFlags = cat.hFileInfo.ioFlFndrInfo.fdFlags; if (theFlavor.fileSpec.parID == fsRtParID) { @@ -399,7 +404,7 @@ wxDragResult wxDropSource::DoDragDrop(int flags) theFlavor.fileCreator = cat.hFileInfo.ioFlFndrInfo.fdCreator; theFlavor.fileType = cat.hFileInfo.ioFlFndrInfo.fdType; } - +#endif AddDragItemFlavor( theDrag, theItem, type, &theFlavor, sizeof(theFlavor), 0 ); } } @@ -541,7 +546,7 @@ pascal OSErr wxMacWindowDragTrackingHandler( GetDragMouse( theDrag, &mouse, 0L ); localMouse = mouse; - GlobalToLocal( &localMouse ); + wxMacGlobalToLocal( theWindow, &localMouse ); { wxWindow *win = NULL; @@ -566,7 +571,9 @@ pascal OSErr wxMacWindowDragTrackingHandler( // this window is left if ( trackingGlobals->m_currentTarget ) { +#ifndef __LP64__ HideDragHilite( theDrag ); +#endif trackingGlobals->m_currentTarget->SetCurrentDrag( theDrag ); trackingGlobals->m_currentTarget->OnLeave(); trackingGlobals->m_currentTarget = NULL; @@ -595,7 +602,9 @@ pascal OSErr wxMacWindowDragTrackingHandler( RgnHandle hiliteRgn = NewRgn(); Rect r = { y, x, y + win->GetSize().y, x + win->GetSize().x }; RectRgn( hiliteRgn, &r ); +#ifndef __LP64__ ShowDragHilite( theDrag, hiliteRgn, true ); +#endif DisposeRgn( hiliteRgn ); } } @@ -657,7 +666,9 @@ pascal OSErr wxMacWindowDragTrackingHandler( { trackingGlobals->m_currentTarget->SetCurrentDrag( theDrag ); trackingGlobals->m_currentTarget->OnLeave(); +#ifndef __LP64__ HideDragHilite( theDrag ); +#endif trackingGlobals->m_currentTarget = NULL; } trackingGlobals->m_currentTargetWindow = NULL; @@ -684,7 +695,7 @@ pascal OSErr wxMacWindowDragReceiveHandler( trackingGlobals->m_currentTarget->SetCurrentDrag( theDrag ); GetDragMouse( theDrag, &mouse, 0L ); localMouse = mouse; - GlobalToLocal( &localMouse ); + wxMacGlobalToLocal( theWindow, &localMouse ); localx = localMouse.h; localy = localMouse.v; diff --git a/src/mac/carbon/font.cpp b/src/mac/carbon/font.cpp index ff9671bd6c..e2c9d4f9a0 100644 --- a/src/mac/carbon/font.cpp +++ b/src/mac/carbon/font.cpp @@ -220,8 +220,9 @@ void wxFontRefData::MacFindFont() if ( m_macFontStyle & underline ) m_underlined = true ; m_pointSize = m_macFontSize ; - +#ifndef __LP64__ m_macFontFamily = FMGetFontFamilyFromName( qdFontName ); +#endif } else { @@ -229,9 +230,11 @@ void wxFontRefData::MacFindFont() { if ( m_family == wxDEFAULT ) { +#ifndef __LP64__ m_macFontFamily = GetAppFont(); FMGetFontFamilyName(m_macFontFamily,qdFontName); m_faceName = wxMacMakeStringFromPascal( qdFontName ); +#endif } else { @@ -255,17 +258,26 @@ void wxFontRefData::MacFindFont() m_faceName = wxT("Times"); break ; } +#ifndef __LP64__ wxMacStringToPascal( m_faceName , qdFontName ); m_macFontFamily = FMGetFontFamilyFromName( qdFontName ); +#endif } } else { +#ifndef __LP64__ if ( m_faceName == wxT("systemfont") ) m_macFontFamily = GetSysFont(); else if ( m_faceName == wxT("applicationfont") ) m_macFontFamily = GetAppFont(); else +#else + if ( m_faceName == wxT("systemfont") ) + m_faceName = wxT("Lucida Grande"); + else if ( m_faceName == wxT("applicationfont") ) + m_faceName = wxT("Lucida Grande"); +#endif { wxMacCFStringHolder cf( m_faceName, wxLocale::GetSystemEncoding() ); ATSFontFamilyRef atsfamily = ATSFontFamilyFindFromName( cf , kATSOptionFlagsDefault ); @@ -289,9 +301,10 @@ void wxFontRefData::MacFindFont() // ATSUFontID and FMFont are equivalent FMFontStyle intrinsicStyle = 0 ; +#ifndef __LP64__ status = FMGetFontFromFontFamilyInstance( m_macFontFamily , m_macFontStyle , &m_macATSUFontID , &intrinsicStyle); wxASSERT_MSG( status == noErr , wxT("couldn't get an ATSUFont from font family") ); - +#endif m_macATSUAdditionalQDStyles = m_macFontStyle & (~intrinsicStyle ); if ( m_macATSUStyle ) diff --git a/src/mac/carbon/fontenum.cpp b/src/mac/carbon/fontenum.cpp index f99cc1fd02..3cbe7bad1b 100644 --- a/src/mac/carbon/fontenum.cpp +++ b/src/mac/carbon/fontenum.cpp @@ -57,6 +57,8 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, status = ATSFontFamilyIteratorNext( theFontFamilyIterator, &theATSFontFamilyRef ); if(status == noErr) { + #ifndef __LP64__ + // TODO CS : Find replacement // added CS : avoid showing fonts that won't be displayable FMFontStyle intrinsicStyle = 0 ; FMFont fontInstance ; @@ -67,7 +69,7 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, status = noErr; continue ; } - +#endif if ( encoding != wxFONTENCODING_SYSTEM ) { TextEncoding fontFamiliyEncoding = ATSFontFamilyGetEncoding(theATSFontFamilyRef) ;