support icns in bundle

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66719 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2011-01-19 18:32:53 +00:00
parent d326d52cd9
commit d2ec5847d6

View File

@@ -321,6 +321,25 @@ bool wxIcon::LoadIconFromBundleResource(const wxString& resourceName, int desire
ReleaseResource( resHandle ) ;
}
}
if ( iconRef == NULL )
{
wxCFStringRef name(resourceName);
FSRef iconFSRef;
wxCFRef<CFURLRef> iconURL(CFBundleCopyResourceURL(CFBundleGetMainBundle(), name, CFSTR("icns"), NULL));
if (CFURLGetFSRef(iconURL, &iconFSRef))
{
// Get a handle on the icon family
IconFamilyHandle iconFamily;
OSStatus err = ReadIconFromFSRef( &iconFSRef, &iconFamily );
if ( err == noErr )
{
err = GetIconRefFromIconFamilyPtr( *iconFamily, GetHandleSize((Handle) iconFamily), &iconRef );
}
}
}
if ( iconRef )
{