X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/52479aefae169d5c85cd0e07d159db0b8dd0a965..0db8bb5866f74a271e03fd0204f7560c710e6265:/include/wx/mac/classic/private.h diff --git a/include/wx/mac/classic/private.h b/include/wx/mac/classic/private.h index 97c0680bcf..d82bda0e17 100644 --- a/include/wx/mac/classic/private.h +++ b/include/wx/mac/classic/private.h @@ -1,7 +1,7 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: private.h +// Name: wx/mac/classic/private.h // Purpose: Private declarations: as this header is only included by -// wxWindows itself, it may contain identifiers which don't start +// wxWidgets itself, it may contain identifiers which don't start // with "wx". // Author: Stefan Csomor // Modified by: @@ -37,12 +37,12 @@ #include "wx/window.h" -class wxMacPortStateHelper +class wxMacPortStateHelper { DECLARE_NO_COPY_CLASS(wxMacPortStateHelper) - + public: - wxMacPortStateHelper( GrafPtr newport) ; + wxMacPortStateHelper( GrafPtr newport) ; wxMacPortStateHelper() ; ~wxMacPortStateHelper() ; @@ -65,7 +65,7 @@ private: class WXDLLEXPORT wxMacPortSetter { DECLARE_NO_COPY_CLASS(wxMacPortSetter) - + public: wxMacPortSetter( const wxDC* dc ) ; ~wxMacPortSetter() ; @@ -77,7 +77,7 @@ private: class WXDLLEXPORT wxMacWindowClipper { DECLARE_NO_COPY_CLASS(wxMacWindowClipper) - + public: wxMacWindowClipper( const wxWindow* win ) ; ~wxMacWindowClipper() ; @@ -89,11 +89,12 @@ private: class wxMacDrawingHelper { DECLARE_NO_COPY_CLASS(wxMacDrawingHelper) - + public: wxMacDrawingHelper( wxWindowMac * theWindow , bool clientArea = false ) ; ~wxMacDrawingHelper() ; - bool Ok() { return m_ok ; } + bool Ok() const { return IsOk(); } + bool IsOk() { return m_ok ; } void LocalToWindow( Rect *rect) { OffsetRect( rect , m_origin.h , m_origin.v ) ; } void LocalToWindow( Point *pt ) { AddPt( m_origin , pt ) ; } void LocalToWindow( RgnHandle rgn ) { OffsetRgn( rgn , m_origin.h , m_origin.v ) ; } @@ -118,12 +119,15 @@ WXDLLEXPORT void wxMacFilename2FSSpec( const wxChar *path , FSSpec *spec ) ; # ifndef __DARWIN__ // Mac file names are POSIX (Unix style) under Darwin, so these are not needed WXDLLEXPORT wxString wxMacFSSpec2UnixFilename( const FSSpec *spec ) ; -WXDLLEXPORT void wxUnixFilename2FSSpec( const char *path , FSSpec *spec ) ; -WXDLLEXPORT wxString wxMac2UnixFilename( const char *s) ; -WXDLLEXPORT wxString wxUnix2MacFilename( const char *s); +WXDLLEXPORT void wxUnixFilename2FSSpec( const wxChar *path , FSSpec *spec ) ; +WXDLLEXPORT wxString wxMac2UnixFilename( const wxChar *s) ; +WXDLLEXPORT wxString wxUnix2MacFilename( const wxChar *s); # endif // utils.h +WXDLLEXPORT wxString wxMacFindFolderNoSeparator(short vRefNum, + OSType folderType, + Boolean createFolder); WXDLLEXPORT wxString wxMacFindFolder(short vRefNum, OSType folderType, Boolean createFolder); @@ -173,57 +177,57 @@ void wxMacConvertNewlines10To13( wxChar * data ) ; #if TARGET_CARBON -class wxMacCFStringHolder -{ -public: - wxMacCFStringHolder() - { - m_cfs = NULL ; - m_release = false ; - } - - wxMacCFStringHolder(const wxString &str , wxFontEncoding encoding ) - { - m_cfs = NULL ; - m_release = false ; - Assign( str , encoding ) ; - } - - wxMacCFStringHolder(CFStringRef ref , bool release = true ) - { +class wxMacCFStringHolder +{ +public: + wxMacCFStringHolder() + { + m_cfs = NULL ; + m_release = false ; + } + + wxMacCFStringHolder(const wxString &str , wxFontEncoding encoding ) + { + m_cfs = NULL ; + m_release = false ; + Assign( str , encoding ) ; + } + + wxMacCFStringHolder(CFStringRef ref , bool release = true ) + { m_cfs = ref ; - m_release = release ; - } - - ~wxMacCFStringHolder() - { - Release() ; - } + m_release = release ; + } + + ~wxMacCFStringHolder() + { + Release() ; + } CFStringRef Detach() { - CFStringRef retval = m_cfs ; - m_release = false ; - m_cfs = NULL ; - return retval ; - } - + CFStringRef retval = m_cfs ; + m_release = false ; + m_cfs = NULL ; + return retval ; + } + void Release() { - if ( m_release && m_cfs) - CFRelease( m_cfs ) ; - m_cfs = NULL ; - } + if ( m_release && m_cfs) + CFRelease( m_cfs ) ; + m_cfs = NULL ; + } - void Assign( const wxString &str , wxFontEncoding encoding ) ; + void Assign( const wxString &str , wxFontEncoding encoding ) ; - operator CFStringRef () { return m_cfs; } + operator CFStringRef () { return m_cfs; } wxString AsString( wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ; - -private: - + +private: + CFStringRef m_cfs; - bool m_release ; + bool m_release ; } ; #endif