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:
Stefan Csomor
2019-10-08 06:32:44 +02:00
committed by GitHub
parent 9102da27ec
commit f83577df45
24 changed files with 733 additions and 624 deletions

View File

@@ -12,8 +12,6 @@
#ifndef __WX_CFSTRINGHOLDER_H__
#define __WX_CFSTRINGHOLDER_H__
#include <CoreFoundation/CFString.h>
#include "wx/dlimpexp.h"
#include "wx/fontenc.h"
#include "wx/osx/core/cfref.h"
@@ -44,7 +42,7 @@ public:
wxFontEncoding encoding = wxFONTENCODING_DEFAULT) ;
#ifdef __WXMAC__
wxCFStringRef(NSString* ref)
wxCFStringRef(WX_NSString ref)
: wxCFRef< CFStringRef >((CFStringRef) ref)
{
}
@@ -69,29 +67,12 @@ public:
static wxString AsString( CFStringRef ref, wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ;
static wxString AsStringWithNormalizationFormC( CFStringRef ref, wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ;
#ifdef __WXMAC__
static wxString AsString( NSString* ref, wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ;
static wxString AsStringWithNormalizationFormC( NSString* ref, wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ;
static wxString AsString( WX_NSString ref, wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ;
static wxString AsStringWithNormalizationFormC( WX_NSString ref, wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ;
NSString* AsNSString() const { return (NSString*)(CFStringRef) *this; }
WX_NSString AsNSString() const { return (WX_NSString)(CFStringRef) *this; }
#endif
private:
} ;
// corresponding class for holding UniChars (native unicode characters)
class WXDLLIMPEXP_BASE wxMacUniCharBuffer
{
public :
wxMacUniCharBuffer( const wxString &str ) ;
~wxMacUniCharBuffer() ;
UniCharPtr GetBuffer() ;
UniCharCount GetChars() ;
private :
UniCharPtr m_ubuf ;
UniCharCount m_chars ;
};
#endif //__WXCFSTRINGHOLDER_H__