]> git.saurik.com Git - wxWidgets.git/commitdiff
added conversion function to CFStringRefs
authorStefan Csomor <csomor@advancedconcepts.ch>
Sat, 11 Jan 2003 11:56:48 +0000 (11:56 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sat, 11 Jan 2003 11:56:48 +0000 (11:56 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18679 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/mac/private.h
src/mac/carbon/utils.cpp
src/mac/utils.cpp

index 341d5307c7554ebb51f3c627ce935f6c658d0d59..8efe019a0af37c87442bfa0658d8fa65bbda3d22 100644 (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_
index d651da7ca985db19dee49cc9c370f085d457ebd1..7e68c37b03b670068dad02e4a2ed224fd244fb03 100644 (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
+
index d651da7ca985db19dee49cc9c370f085d457ebd1..7e68c37b03b670068dad02e4a2ed224fd244fb03 100644 (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
+