cleanup mac
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50005 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -32,19 +32,10 @@
|
|||||||
#endif
|
#endif
|
||||||
#include "wx/mac/corefoundation/cfstring.h"
|
#include "wx/mac/corefoundation/cfstring.h"
|
||||||
|
|
||||||
#if defined(__DARWIN__)
|
|
||||||
#include <CoreFoundation/CFBundle.h>
|
#include <CoreFoundation/CFBundle.h>
|
||||||
#include <CoreFoundation/CFURL.h>
|
#include <CoreFoundation/CFURL.h>
|
||||||
#else
|
|
||||||
#include <CFBundle.h>
|
|
||||||
#include <CFURL.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__WXCOCOA__) || defined(__WXMAC_OSX__)
|
|
||||||
#define kDefaultPathStyle kCFURLPOSIXPathStyle
|
#define kDefaultPathStyle kCFURLPOSIXPathStyle
|
||||||
#else
|
|
||||||
#define kDefaultPathStyle kCFURLHFSPathStyle
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// implementation
|
// implementation
|
||||||
|
@@ -57,7 +57,6 @@ WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_cf(wxFontEncoding encoding)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
|
|
||||||
// Provide a constant for the wchat_t encoding used by the host platform.
|
// Provide a constant for the wchat_t encoding used by the host platform.
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef WORDS_BIGENDIAN
|
||||||
static const CFStringEncoding wxCFStringEncodingWcharT = kCFStringEncodingUTF32BE;
|
static const CFStringEncoding wxCFStringEncodingWcharT = kCFStringEncodingUTF32BE;
|
||||||
@@ -65,8 +64,6 @@ WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_cf(wxFontEncoding encoding)
|
|||||||
static const CFStringEncoding wxCFStringEncodingWcharT = kCFStringEncodingUTF32LE;
|
static const CFStringEncoding wxCFStringEncodingWcharT = kCFStringEncodingUTF32LE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 */
|
|
||||||
|
|
||||||
size_t wxMBConv_cf::ToWChar(wchar_t * dst, size_t dstSize, const char * src, size_t srcSize) const
|
size_t wxMBConv_cf::ToWChar(wchar_t * dst, size_t dstSize, const char * src, size_t srcSize) const
|
||||||
{
|
{
|
||||||
wxCHECK(src, wxCONV_FAILED);
|
wxCHECK(src, wxCONV_FAILED);
|
||||||
@@ -101,7 +98,6 @@ WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_cf(wxFontEncoding encoding)
|
|||||||
* to UTF32. If we are then run against a pre-Tiger system, the encoding
|
* to UTF32. If we are then run against a pre-Tiger system, the encoding
|
||||||
* won't be available so we'll defer to the string->UTF-16->UTF-32 conversion.
|
* won't be available so we'll defer to the string->UTF-16->UTF-32 conversion.
|
||||||
*/
|
*/
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
|
|
||||||
if(CFStringIsEncodingAvailable(wxCFStringEncodingWcharT))
|
if(CFStringIsEncodingAvailable(wxCFStringEncodingWcharT))
|
||||||
{
|
{
|
||||||
CFRange fullStringRange = CFRangeMake(0, CFStringGetLength(theString));
|
CFRange fullStringRange = CFRangeMake(0, CFStringGetLength(theString));
|
||||||
@@ -132,7 +128,6 @@ WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_cf(wxFontEncoding encoding)
|
|||||||
return usedBufLen / sizeof(wchar_t);
|
return usedBufLen / sizeof(wchar_t);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 */
|
|
||||||
{
|
{
|
||||||
// NOTE: Includes NULL iff source did
|
// NOTE: Includes NULL iff source did
|
||||||
/* NOTE: This is an approximation. The eventual UTF-32 will
|
/* NOTE: This is an approximation. The eventual UTF-32 will
|
||||||
@@ -175,7 +170,6 @@ WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_cf(wxFontEncoding encoding)
|
|||||||
* from UTF32. If we are then run against a pre-Tiger system, the encoding
|
* from UTF32. If we are then run against a pre-Tiger system, the encoding
|
||||||
* won't be available so we'll defer to the UTF-32->UTF-16->string conversion.
|
* won't be available so we'll defer to the UTF-32->UTF-16->string conversion.
|
||||||
*/
|
*/
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
|
|
||||||
if(CFStringIsEncodingAvailable(wxCFStringEncodingWcharT))
|
if(CFStringIsEncodingAvailable(wxCFStringEncodingWcharT))
|
||||||
{
|
{
|
||||||
theString = wxCFRef<CFStringRef>(CFStringCreateWithBytes(
|
theString = wxCFRef<CFStringRef>(CFStringCreateWithBytes(
|
||||||
@@ -186,7 +180,6 @@ WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_cf(wxFontEncoding encoding)
|
|||||||
false));
|
false));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 */
|
|
||||||
{
|
{
|
||||||
wxMBConvUTF16 converter;
|
wxMBConvUTF16 converter;
|
||||||
size_t cbUniBuffer = converter.FromWChar( NULL, 0, src, srcSize );
|
size_t cbUniBuffer = converter.FromWChar( NULL, 0, src, srcSize );
|
||||||
|
@@ -40,11 +40,7 @@
|
|||||||
#include "wx/mac/corefoundation/cfstring.h"
|
#include "wx/mac/corefoundation/cfstring.h"
|
||||||
|
|
||||||
// Default path style
|
// Default path style
|
||||||
#ifdef __WXMAC_OSX__
|
|
||||||
#define kDefaultPathStyle kCFURLPOSIXPathStyle
|
#define kDefaultPathStyle kCFURLPOSIXPathStyle
|
||||||
#else
|
|
||||||
#define kDefaultPathStyle kCFURLHFSPathStyle
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
// IMPLEMENTATION
|
// IMPLEMENTATION
|
||||||
|
Reference in New Issue
Block a user