X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14f355c2b5c71fc7c3d680aea366582d2ac60f7b..d2e66707deb10dea6f92e3e4092f8a43ef942a5d:/src/mgl/fontenum.cpp diff --git a/src/mgl/fontenum.cpp b/src/mgl/fontenum.cpp index fbba131e39..5659d4b643 100644 --- a/src/mgl/fontenum.cpp +++ b/src/mgl/fontenum.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: src/unix/fontenum.cpp +// Name: src/mgl/fontenum.cpp // Purpose: wxFontEnumerator class for MGL // Author: Vaclav Slavik // RCS-ID: $Id$ @@ -7,6 +7,13 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + // ============================================================================ // declarations // ============================================================================ @@ -15,24 +22,17 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "fontenum.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" +#include "wx/fontenum.h" -#ifdef __BORLANDC__ - #pragma hdrstop +#ifndef WX_PRECOMP + #include "wx/dynarray.h" + #include "wx/string.h" + #include "wx/utils.h" #endif -#include "wx/defs.h" -#include "wx/dynarray.h" -#include "wx/string.h" -#include "wx/utils.h" - -#include "wx/fontenum.h" +#include "wx/encinfo.h" #include "wx/fontutil.h" +#include "wx/private/fontmgr.h" #include @@ -48,25 +48,25 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, bool fixedWidthOnly) { - bool found = FALSE; - wxMGLFontFamilyList *list = wxTheFontsManager->GetFamilyList(); - wxMGLFontFamilyList::Node *node; - wxMGLFontFamily *f = NULL; + bool found = false; + const wxFontBundleList& list = wxFontsManager::Get()->GetBundles(); + wxFontBundleList::Node *node; + wxFontBundle *f = NULL; wxNativeEncodingInfo info; if ( encoding != wxFONTENCODING_SYSTEM ) wxGetNativeFontEncoding(encoding, &info); - - for (node = list->GetFirst(); node; node = node->GetNext()) + + for (node = list.GetFirst(); node; node = node->GetNext()) { f = node->GetData(); info.facename = f->GetName(); - if ( (!fixedWidthOnly || f->GetInfo()->isFixed) && + if ( (!fixedWidthOnly || f->IsFixed()) && (encoding == wxFONTENCODING_SYSTEM || wxTestFontEncoding(info)) ) { - found = TRUE; + found = true; if ( !OnFacename(f->GetName()) ) - return TRUE; + return true; } } @@ -75,7 +75,7 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, bool wxFontEnumerator::EnumerateEncodings(const wxString& family) { - static wxFontEncoding encodings[] = + static wxFontEncoding encodings[] = { wxFONTENCODING_ISO8859_1, wxFONTENCODING_ISO8859_2, @@ -101,11 +101,11 @@ bool wxFontEnumerator::EnumerateEncodings(const wxString& family) wxFONTENCODING_CP1256, wxFONTENCODING_CP1257, wxFONTENCODING_KOI8, - + wxFONTENCODING_SYSTEM }; - - static const char *encodingNames[] = + + static const char *encodingNames[] = { "iso88590-1", "iso88590-2", @@ -131,18 +131,18 @@ bool wxFontEnumerator::EnumerateEncodings(const wxString& family) "koi-8", NULL }; - + wxNativeEncodingInfo info; info.facename = family; - + for (size_t i = 0; encodings[i] != wxFONTENCODING_SYSTEM; i++) { if ( !wxGetNativeFontEncoding(encodings[i], &info) || - !wxTestFontEncoding(info) ) + !wxTestFontEncoding(info) ) continue; if ( !OnFontEncoding(family, encodingNames[i]) ) break; } - return TRUE; + return true; }