X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9f67b77690c1d993bd70e3fd301c2ebfe7215034..d894c201132341a31790bba39a0c33d03d71aeb8:/include/wx/mac/private.h diff --git a/include/wx/mac/private.h b/include/wx/mac/private.h index 514db92eae..379042ecbe 100644 --- a/include/wx/mac/private.h +++ b/include/wx/mac/private.h @@ -17,9 +17,8 @@ #include "wx/defs.h" #include "wx/app.h" -#if defined(__POWERPC__) && defined(__DARWIN__) +#ifdef __DARWIN__ # include -# define TARGET_CARBON 1 #else # include # include @@ -143,6 +142,53 @@ void wxMacCreateBitmapButton( ControlButtonContentInfo*info , const wxBitmap& bi #define MAC_WXPOINTPTR(a) ((Point*)a) #define MAC_WXHMENU(a) ((MenuHandle)a) +//--------------------------------------------------------------------------- +// wxMac string conversions +//--------------------------------------------------------------------------- + +void wxMacConvertToPC( const char *from , char *to , int len ) ; +void wxMacConvertFromPC( const char *from , char *to , int len ) ; +void wxMacConvertToPC( const char *from , char *to , int len ) ; + +wxString wxMacMakeMacStringFromPC( const char * p ) ; + +wxString wxMacMakePCStringFromMac( const char * p ) ; + + +// converts this c string into a wxString with optional mac 2 pc encoding +wxString wxMacMakeStringFromMacString( const char* from , bool mac2pcEncoding ) ; + +// converts this c string into a wxString with pc 2 mac encoding if s_macDefaultEncodingIsPC +inline wxString wxMacMakeStringFromMacString( const char* from ) + { return wxMacMakeStringFromMacString( from , wxApp::s_macDefaultEncodingIsPC ) ; } + +// converts this c string into a wxString with pc 2 mac encoding if s_macDefaultEncodingIsPC +inline wxString wxMacMakeStringFromMacString( const wxString& from ) + { return wxApp::s_macDefaultEncodingIsPC ? + wxMacMakeStringFromMacString( from.c_str() , true ) : from ; } + +// +// Pascal Strings +// + +// converts this string into a pascal with optional pc 2 mac encoding +void wxMacStringToPascal( const char * from , StringPtr to , bool pc2macEncoding ) ; + +// converts this string into a pascal with pc 2 mac encoding if s_macDefaultEncodingIsPC +inline void wxMacStringToPascal( const char * from , StringPtr to ) + { wxMacStringToPascal( from , to , wxApp::s_macDefaultEncodingIsPC ) ; } + +// converts this string into a pascal with optional mac 2 pc encoding +wxString wxMacMakeStringFromPascal( ConstStringPtr from , bool mac2pcEncoding ) ; + +// converts this pascal string into a wxString with pc 2 mac encoding if s_macDefaultEncodingIsPC +inline wxString wxMacMakeStringFromPascal( ConstStringPtr from ) + { return wxMacMakeStringFromPascal( from , wxApp::s_macDefaultEncodingIsPC ) ; } + +// +// CFStringRefs (Carbon only) +// + #if TARGET_CARBON // converts this string into a carbon foundation string with optional pc 2 mac encoding CFStringRef wxMacCreateCFString( const wxString &str , bool pc2macEncoding ) ; @@ -153,5 +199,6 @@ inline CFStringRef wxMacCreateCFString( const wxString &str ) #endif //TARGET_CARBON + #endif // _WX_PRIVATE_H_