X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3b7e6277be7c6dc21c62f3fa709bd0438df33175..7379599933e8db2dc319bd5240b4992687db4e46:/src/mac/carbon/fontenum.cpp diff --git a/src/mac/carbon/fontenum.cpp b/src/mac/carbon/fontenum.cpp index 99cd68441a..43aeb9a7a8 100644 --- a/src/mac/carbon/fontenum.cpp +++ b/src/mac/carbon/fontenum.cpp @@ -33,9 +33,12 @@ #endif #include "wx/fontenum.h" +#include "wx/fontutil.h" #include "wx/fontmap.h" #include "wx/fontutil.h" +#include "wx/mac/private.h" + // ---------------------------------------------------------------------------- // private classes // ---------------------------------------------------------------------------- @@ -86,7 +89,7 @@ bool wxFontEnumeratorHelper::SetEncoding(wxFontEncoding encoding) wxNativeEncodingInfo info; if ( !wxGetNativeFontEncoding(encoding, &info) ) { - if ( !wxTheFontMapper->GetAltForEncoding(encoding, &info) ) + if ( !wxFontMapper::Get()->GetAltForEncoding(encoding, &info) ) { // no such encodings at all return FALSE; @@ -101,7 +104,8 @@ bool wxFontEnumeratorHelper::SetEncoding(wxFontEncoding encoding) void wxFontEnumeratorHelper::DoEnumerate() { MenuHandle menu ; - Str255 name ; + Str255 p_name ; + char c_name[256] ; short lines ; menu = NewMenu( 32000 , "\pFont" ) ; @@ -110,11 +114,16 @@ void wxFontEnumeratorHelper::DoEnumerate() for ( int i = 1 ; i < lines+1 ; i ++ ) { - GetMenuItemText( menu , i , name ) ; - p2cstr( name ) ; - /* - - if ( m_fixedOnly ) + GetMenuItemText( menu , i , p_name ) ; +#if TARGET_CARBON + p2cstrcpy( c_name, p_name ) ; +#else + p2cstr( p_name ) ; + strcpy( c_name, (char *)p_name ) ; +#endif + /* + + if ( m_fixedOnly ) { // check that it's a fixed pitch font (there is *no* error here, the // flag name is misleading!) @@ -135,7 +144,7 @@ void wxFontEnumeratorHelper::DoEnumerate() } */ - m_fontEnum->OnFacename( name ) ; + m_fontEnum->OnFacename( c_name ) ; } DisposeMenu( menu ) ; } @@ -161,7 +170,7 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, bool wxFontEnumerator::EnumerateEncodings(const wxString& family) { - wxFAIL_MSG(wxT("TODO")); + wxFAIL_MSG(wxT("wxFontEnumerator::EnumerateEncodings() not yet implemented")); return TRUE; }