X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/03e11df5470fd64d9d9a669d0b50b84c2d714736..8fc754bf2bc32de45d85a519e7706fa122d42731:/src/mac/carbon/fontenum.cpp diff --git a/src/mac/carbon/fontenum.cpp b/src/mac/carbon/fontenum.cpp index 14491d79e9..ea743eee90 100644 --- a/src/mac/carbon/fontenum.cpp +++ b/src/mac/carbon/fontenum.cpp @@ -17,13 +17,15 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "fontenum.h" #endif // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#if wxUSE_FONTMAP + #ifdef __BORLANDC__ #pragma hdrstop #endif @@ -36,6 +38,9 @@ #include "wx/fontutil.h" #include "wx/fontmap.h" #include "wx/fontutil.h" +#include "wx/encinfo.h" + +#include "wx/mac/private.h" // ---------------------------------------------------------------------------- // private classes @@ -87,7 +92,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,50 +106,46 @@ bool wxFontEnumeratorHelper::SetEncoding(wxFontEncoding encoding) void wxFontEnumeratorHelper::DoEnumerate() { - MenuHandle menu ; - Str255 p_name ; - char c_name[256] ; - short lines ; - - menu = NewMenu( 32000 , "\pFont" ) ; - AppendResMenu( menu , 'FONT' ) ; - lines = CountMenuItems( menu ) ; - - for ( int i = 1 ; i < lines+1 ; i ++ ) - { - 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!) - if ( tm->tmPitchAndFamily & TMPF_FIXED_PITCH ) - { - // not a fixed pitch font - return TRUE; - } - } - - if ( m_charset != -1 ) - { - // check that we have the right encoding - if ( lf->lfCharSet != m_charset ) - { - return TRUE; - } - } - - */ - m_fontEnum->OnFacename( c_name ) ; - } - DisposeMenu( menu ) ; + MenuHandle menu ; + Str255 p_name ; + + short lines ; + + menu = NewMenu( 32000 , "\pFont" ) ; + AppendResMenu( menu , 'FONT' ) ; + lines = CountMenuItems( menu ) ; + + for ( int i = 1 ; i < lines+1 ; i ++ ) + { + GetMenuItemText( menu , i , p_name ) ; + wxString c_name = wxMacMakeStringFromPascal(p_name) ; + + /* + + if ( m_fixedOnly ) + { + // check that it's a fixed pitch font (there is *no* error here, the + // flag name is misleading!) + if ( tm->tmPitchAndFamily & TMPF_FIXED_PITCH ) + { + // not a fixed pitch font + return TRUE; + } + } + + if ( m_charset != -1 ) + { + // check that we have the right encoding + if ( lf->lfCharSet != m_charset ) + { + return TRUE; + } + } + + */ + m_fontEnum->OnFacename( c_name ) ; + } + DisposeMenu( menu ) ; } // ---------------------------------------------------------------------------- @@ -168,7 +169,9 @@ 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; } + +#endif