added conversion function to CFStringRefs

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18679 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2003-01-11 11:56:48 +00:00
parent 67e3d9d399
commit 3d963f8137
3 changed files with 41 additions and 0 deletions

View File

@@ -141,5 +141,16 @@ void wxMacCreateBitmapButton( ControlButtonContentInfo*info , const wxBitmap& bi
#define MAC_WXRECPTR(a) ((Rect*)a)
#define MAC_WXPOINTPTR(a) ((Point*)a)
#define MAC_WXHMENU(a) ((MenuHandle)a)
#if TARGET_CARBON
// converts this string into a carbon foundation string with optional pc 2 mac encoding
CFStringRef wxMacCreateCFString( const wxString &str , bool pc2macEncoding ) ;
// converts this string into a carbon foundation string with optional pc 2 mac encoding
inline CFStringRef wxMacCreateCFString( const wxString &str )
{ return wxMacCreateCFString( str , wxApp::s_macDefaultEncodingIsPC ) ; }
#endif //TARGET_CARBON
#endif
// _WX_PRIVATE_H_

View File

@@ -518,3 +518,18 @@ wxString wxGetOsDescription()
#endif
}
//---------------------------------------------------------------------------
// wxMac Specific utility functions
//---------------------------------------------------------------------------
#if TARGET_CARBON
// converts this string into a carbon foundation string with optional pc 2 mac encoding
CFStringRef wxMacCreateCFString( const wxString &str , bool pc2macEncoding )
{
return CFStringCreateWithCString( kCFAllocatorSystemDefault , str.c_str() ,
pc2macEncoding ?
kCFStringEncodingWindowsLatin1 : CFStringGetSystemEncoding() ) ;
}
#endif //TARGET_CARBON

View File

@@ -518,3 +518,18 @@ wxString wxGetOsDescription()
#endif
}
//---------------------------------------------------------------------------
// wxMac Specific utility functions
//---------------------------------------------------------------------------
#if TARGET_CARBON
// converts this string into a carbon foundation string with optional pc 2 mac encoding
CFStringRef wxMacCreateCFString( const wxString &str , bool pc2macEncoding )
{
return CFStringCreateWithCString( kCFAllocatorSystemDefault , str.c_str() ,
pc2macEncoding ?
kCFStringEncodingWindowsLatin1 : CFStringGetSystemEncoding() ) ;
}
#endif //TARGET_CARBON