X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5185263fc5f0729ea1b926f9c2dcdc0153f6384e..c33edc08d6a5f6937624347f25934937164c13a1:/include/wx/mac/corefoundation/cfstring.h diff --git a/include/wx/mac/corefoundation/cfstring.h b/include/wx/mac/corefoundation/cfstring.h index 23e2f8d75b..16a95cf2ff 100644 --- a/include/wx/mac/corefoundation/cfstring.h +++ b/include/wx/mac/corefoundation/cfstring.h @@ -9,46 +9,48 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +#ifndef __WX_CFSTRINGHOLDER_H__ +#define __WX_CFSTRINGHOLDER_H__ + #ifdef __DARWIN__ #include #else #include #endif -void wxMacConvertNewlines13To10( char * data ) ; -void wxMacConvertNewlines10To13( char * data ) ; -void wxMacConvertNewlines13To10( wxString *data ) ; -void wxMacConvertNewlines10To13( wxString *data ) ; +#include "wx/dlimpexp.h" +#include "wx/fontenc.h" -#if wxUSE_UNICODE -void wxMacConvertNewlines13To10( wxChar * data ) ; -void wxMacConvertNewlines10To13( wxChar * data ) ; -#endif +class WXDLLIMPEXP_FWD_BASE wxString; + +WXDLLIMPEXP_BASE void wxMacConvertNewlines13To10( wxString *data ) ; +WXDLLIMPEXP_BASE void wxMacConvertNewlines10To13( wxString *data ) ; + +WXDLLIMPEXP_BASE void wxMacConvertNewlines13To10( char * data ) ; +WXDLLIMPEXP_BASE void wxMacConvertNewlines10To13( char * data ) ; -wxUint32 wxMacGetSystemEncFromFontEnc(wxFontEncoding encoding) ; -wxFontEncoding wxMacGetFontEncFromSystemEnc(wxUint32 encoding) ; -void wxMacWakeUp() ; +WXDLLIMPEXP_BASE wxUint32 wxMacGetSystemEncFromFontEnc(wxFontEncoding encoding) ; +WXDLLIMPEXP_BASE wxFontEncoding wxMacGetFontEncFromSystemEnc(wxUint32 encoding) ; +WXDLLIMPEXP_BASE void wxMacWakeUp() ; -class wxMacCFStringHolder +class WXDLLIMPEXP_BASE wxMacCFStringHolder { public: wxMacCFStringHolder() + : m_cfs(NULL) , m_release(false) { - m_cfs = NULL ; - m_release = false ; } - wxMacCFStringHolder(const wxString &str , wxFontEncoding encoding ) + wxMacCFStringHolder(const wxString &str, + wxFontEncoding encoding = wxFONTENCODING_DEFAULT) + : m_cfs(NULL) , m_release(false) { - m_cfs = NULL ; - m_release = false ; Assign( str , encoding ) ; } wxMacCFStringHolder(CFStringRef ref , bool release = true ) + : m_cfs(ref) , m_release(release) { - m_cfs = ref ; - m_release = release ; } ~wxMacCFStringHolder() @@ -71,14 +73,35 @@ public: m_cfs = NULL ; } - void Assign( const wxString &str , wxFontEncoding encoding ) ; + void Assign(const wxString &str, + wxFontEncoding encoding = wxFONTENCODING_DEFAULT); - operator CFStringRef () { return m_cfs; } + operator CFStringRef () const { return m_cfs; } wxString AsString( wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ; private: CFStringRef m_cfs; bool m_release ; + + DECLARE_NO_COPY_CLASS( wxMacCFStringHolder ) } ; +// corresponding class for holding UniChars (native unicode characters) + +class WXDLLIMPEXP_BASE wxMacUniCharBuffer +{ +public : + wxMacUniCharBuffer( const wxString &str ) ; + + ~wxMacUniCharBuffer() ; + + UniChar* GetBuffer() ; + + UniCharCount GetChars() ; + +private : + UniChar* m_ubuf ; + UniCharCount m_chars ; +}; +#endif //__WXCFSTRINGHOLDER_H__