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