]> git.saurik.com Git - wxWidgets.git/blame - src/dfb/fontenum.cpp
fixing focus, fixes #9985
[wxWidgets.git] / src / dfb / fontenum.cpp
CommitLineData
b3c86150
VS
1/////////////////////////////////////////////////////////////////////////////
2// Name: src/dfb/fontenum.cpp
3// Purpose: wxFontEnumerator class
4// Author: Vaclav Slavik
5// Created: 2006-08-10
6// RCS-ID: $Id$
7// Copyright: (c) 2006 REA Elektronik GmbH
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
10
11// For compilers that support precompilation, includes "wx.h".
12#include "wx/wxprec.h"
13
14#ifdef __BORLANDC__
15 #pragma hdrstop
16#endif
17
18#include "wx/fontenum.h"
4e1d79d3 19#include "wx/private/fontmgr.h"
b3c86150 20
63feebce
VS
21#if wxUSE_FONTENUM
22
b3c86150
VS
23// ----------------------------------------------------------------------------
24// wxFontEnumerator
25// ----------------------------------------------------------------------------
26
4e1d79d3
VS
27bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding,
28 bool fixedWidthOnly)
b3c86150 29{
4e1d79d3
VS
30 // we only support UTF-8 and system (which means "use any"):
31 if ( encoding != wxFONTENCODING_SYSTEM && encoding != wxFONTENCODING_UTF8 )
32 return false;
33
34 bool found = false;
35 const wxFontBundleList& list = wxFontsManager::Get()->GetBundles();
36
37 for ( wxFontBundleList::const_iterator f = list.begin(); f != list.end(); ++f )
38 {
39 if ( fixedWidthOnly && !(*f)->IsFixed() )
40 continue;
41
42 found = true;
43 if ( !OnFacename((*f)->GetName()) )
44 break; // OnFacename() requests us to stop enumeration
45 }
46
47 return found;
b3c86150
VS
48}
49
4e1d79d3 50bool wxFontEnumerator::EnumerateEncodings(const wxString& facename)
b3c86150 51{
4e1d79d3 52 return EnumerateEncodingsUTF8(facename);
b3c86150 53}
63feebce
VS
54
55#endif // wxUSE_FONTENUM