X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..ccb5db57cdb1766eefb7023dda50ede9f0d01f78:/src/mgl/fontenum.cpp diff --git a/src/mgl/fontenum.cpp b/src/mgl/fontenum.cpp index f00e22fd38..c3a523e17b 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,19 +22,14 @@ // headers // ---------------------------------------------------------------------------- -// 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" @@ -45,7 +47,7 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, bool fixedWidthOnly) { - bool found = FALSE; + bool found = false; wxMGLFontFamilyList *list = wxTheFontsManager->GetFamilyList(); wxMGLFontFamilyList::Node *node; wxMGLFontFamily *f = NULL; @@ -53,7 +55,7 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, if ( encoding != wxFONTENCODING_SYSTEM ) wxGetNativeFontEncoding(encoding, &info); - + for (node = list->GetFirst(); node; node = node->GetNext()) { f = node->GetData(); @@ -61,9 +63,9 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, if ( (!fixedWidthOnly || f->GetInfo()->isFixed) && (encoding == wxFONTENCODING_SYSTEM || wxTestFontEncoding(info)) ) { - found = TRUE; + found = true; if ( !OnFacename(f->GetName()) ) - return TRUE; + return true; } } @@ -72,7 +74,7 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, bool wxFontEnumerator::EnumerateEncodings(const wxString& family) { - static wxFontEncoding encodings[] = + static wxFontEncoding encodings[] = { wxFONTENCODING_ISO8859_1, wxFONTENCODING_ISO8859_2, @@ -98,11 +100,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", @@ -128,18 +130,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; }