X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ad9835c97c10c0d7de345e3a7a7c0fc2776eb2cb..80a779275ae04443c568dca919adb26cf6f5002c:/src/mac/carbon/mimetmac.cpp?ds=sidebyside diff --git a/src/mac/carbon/mimetmac.cpp b/src/mac/carbon/mimetmac.cpp index f0bc491790..9265887d3c 100644 --- a/src/mac/carbon/mimetmac.cpp +++ b/src/mac/carbon/mimetmac.cpp @@ -32,21 +32,22 @@ #if wxUSE_MIMETYPE +#include "wx/mac/mimetype.h" + #ifndef WX_PRECOMP #include "wx/dynarray.h" #include "wx/string.h" + #include "wx/intl.h" + #include "wx/log.h" #if wxUSE_GUI #include "wx/icon.h" #endif #endif -#include "wx/log.h" #include "wx/file.h" -#include "wx/intl.h" #include "wx/confbase.h" -#include "wx/mac/mimetype.h" #include "wx/mac/private.h" // other standard headers @@ -57,7 +58,7 @@ #include #endif - +#ifndef __LP64__ // START CODE SAMPLE FROM TECHNOTE 1002 (http://developer.apple.com/technotes/tn/tn1002.html) // IsRemoteVolume can be used to find out if the @@ -319,7 +320,7 @@ pascal OSErr FSpGetFullPath( const FSSpec *spec, return result; } - +#endif // // On the mac there are two ways to open a file - one is through apple events and the // finder, another is through mime types. @@ -458,6 +459,7 @@ wxString wxFileTypeImpl::GetCommand(const wxString& verb) const #else //carbon/classic implementation + wxString wxFileTypeImpl::GetCommand(const wxString& verb) const { wxASSERT_MSG( m_manager != NULL , wxT("Bad wxFileType") ); @@ -629,7 +631,7 @@ void wxMimeTypesManagerImpl::Initialize(int mailcapStyles, const wxString& extra if (status != noErr) { wxLogDebug(wxT("Could not initialize wxMimeTypesManager!")); - wxASSERT( false ); + wxFAIL; m_hIC = NULL; return; @@ -788,7 +790,9 @@ pascal OSStatus MoreProcGetProcessTypeSignature( infoRec.processInfoLength = sizeof(ProcessInfoRec); infoRec.processName = NULL; +#ifndef __LP64__ infoRec.processAppSpec = NULL; +#endif if ( pPSN == NULL ) { @@ -818,7 +822,6 @@ pascal OSStatus MoreProcGetProcessTypeSignature( // #include "wx/mac/corefoundation/cfstring.h" -#include "wx/intl.h" //wxLocale for wxCFString #define wxCF_RELEASE true #define wxCF_RETAIN false @@ -1311,7 +1314,6 @@ private: // ---------------------------------------------------------------------------- #define wxCFDATA_RELEASEBUFFER 1 -#define wxCFDATA_RETAINBUFFER 0 class wxCFData { @@ -1694,8 +1696,18 @@ wxFileType* wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) if (status == noErr) { Str255 psCreatorName; +#ifndef __LP64__ FSSpec dummySpec; status = FindApplication(creator, false, psCreatorName, &dummySpec); +#else + FSRef fsref; + status = LSFindApplicationForInfo( creator, NULL, NULL, &fsref ,NULL); + HFSUniStr255 name; + status = FSGetCatalogInfo(&fsref, kFSCatInfoNone, NULL, &name, NULL, NULL); + CFStringRef str = FSCreateStringFromHFSUniStr( 0 , &name ); + CFStringGetPascalString(str, psCreatorName, 256, CFStringGetSystemEncoding()); + CFRelease( str ); +#endif if (status == noErr) {