/////////////////////////////////////////////////////////////////////////////
-// Name: src/unix/fontenum.cpp
+// Name: src/mgl/fontenum.cpp
// Purpose: wxFontEnumerator class for MGL
// Author: Vaclav Slavik
// RCS-ID: $Id$
-// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
+// Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+
// ============================================================================
// declarations
// ============================================================================
// headers
// ----------------------------------------------------------------------------
-#ifdef __GNUG__
- #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 <mgraph.h>
bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding,
bool fixedWidthOnly)
{
- bool found = FALSE;
+ bool found = false;
wxMGLFontFamilyList *list = wxTheFontsManager->GetFamilyList();
wxMGLFontFamilyList::Node *node;
wxMGLFontFamily *f = NULL;
if ( encoding != wxFONTENCODING_SYSTEM )
wxGetNativeFontEncoding(encoding, &info);
-
+
for (node = list->GetFirst(); node; node = node->GetNext())
{
f = node->GetData();
if ( (!fixedWidthOnly || f->GetInfo()->isFixed) &&
(encoding == wxFONTENCODING_SYSTEM || wxTestFontEncoding(info)) )
{
- found = TRUE;
+ found = true;
if ( !OnFacename(f->GetName()) )
- return TRUE;
+ return true;
}
}
bool wxFontEnumerator::EnumerateEncodings(const wxString& family)
{
- static wxFontEncoding encodings[] =
+ static wxFontEncoding encodings[] =
{
wxFONTENCODING_ISO8859_1,
wxFONTENCODING_ISO8859_2,
wxFONTENCODING_CP1256,
wxFONTENCODING_CP1257,
wxFONTENCODING_KOI8,
-
+
wxFONTENCODING_SYSTEM
};
-
- static const char *encodingNames[] =
+
+ static const char *encodingNames[] =
{
"iso88590-1",
"iso88590-2",
"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;
}