Changing datatransfer implementation from CFPasteboard to NSPasteboard API (#1264)
* changing datatransfer from CFPasteboard to NSPasteboard API * factoring and cleaning up * Switching back naming * missed file * getting wxCFStringRef to be independent of system headers * add unichar include * using wxCFStringRef in header * moving to private headers, change method name * adapting to lesser content in cfstring.h * Removing malloc/free usage * use wxScopedArray throughout * using wxMemoryBuffer instead of char[] * fixing nonprecomp headers * missing forward decl in non-precomp builds
This commit is contained in:
@@ -798,8 +798,6 @@ wxString wxPathOnly (const wxString& path)
|
||||
|
||||
#if defined(__WXMAC__) && !defined(__WXOSX_IPHONE__)
|
||||
|
||||
#define kDefaultPathStyle kCFURLPOSIXPathStyle
|
||||
|
||||
wxString wxMacFSRefToPath( const FSRef *fsRef , CFStringRef additionalPathComponent )
|
||||
{
|
||||
CFURLRef fullURLRef;
|
||||
@@ -814,7 +812,7 @@ wxString wxMacFSRefToPath( const FSRef *fsRef , CFStringRef additionalPathCompon
|
||||
additionalPathComponent,false);
|
||||
CFRelease( parentURLRef ) ;
|
||||
}
|
||||
wxCFStringRef cfString( CFURLCopyFileSystemPath(fullURLRef, kDefaultPathStyle ));
|
||||
wxCFStringRef cfString( CFURLCopyFileSystemPath(fullURLRef, kCFURLPOSIXPathStyle ));
|
||||
CFRelease( fullURLRef ) ;
|
||||
|
||||
return wxCFStringRef::AsStringWithNormalizationFormC(cfString);
|
||||
@@ -823,15 +821,11 @@ wxString wxMacFSRefToPath( const FSRef *fsRef , CFStringRef additionalPathCompon
|
||||
OSStatus wxMacPathToFSRef( const wxString&path , FSRef *fsRef )
|
||||
{
|
||||
OSStatus err = noErr ;
|
||||
CFMutableStringRef cfMutableString = CFStringCreateMutableCopy(NULL, 0, wxCFStringRef(path));
|
||||
CFStringNormalize(cfMutableString,kCFStringNormalizationFormD);
|
||||
CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, cfMutableString , kDefaultPathStyle, false);
|
||||
CFRelease( cfMutableString );
|
||||
wxCFRef<CFURLRef> url(wxOSXCreateURLFromFileSystemPath(path));
|
||||
if ( NULL != url )
|
||||
{
|
||||
if ( CFURLGetFSRef(url, fsRef) == false )
|
||||
err = fnfErr ;
|
||||
CFRelease( url ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -848,6 +842,13 @@ wxString wxMacHFSUniStrToString( ConstHFSUniStr255Param uniname )
|
||||
return wxCFStringRef::AsStringWithNormalizationFormC(cfname);
|
||||
}
|
||||
|
||||
CFURLRef wxOSXCreateURLFromFileSystemPath( const wxString& path)
|
||||
{
|
||||
wxCFRef<CFMutableStringRef> cfMutableString(CFStringCreateMutableCopy(NULL, 0, wxCFStringRef(path)));
|
||||
CFStringNormalize(cfMutableString,kCFStringNormalizationFormD);
|
||||
return CFURLCreateWithFileSystemPath(kCFAllocatorDefault, cfMutableString , kCFURLPOSIXPathStyle, false);
|
||||
}
|
||||
|
||||
#ifndef __LP64__
|
||||
|
||||
wxString wxMacFSSpec2MacFilename( const FSSpec *spec )
|
||||
|
||||
Reference in New Issue
Block a user