]> git.saurik.com Git - wxWidgets.git/blobdiff - src/dfb/fontenum.cpp
Add wxActivateEvent::GetActivationReason().
[wxWidgets.git] / src / dfb / fontenum.cpp
index 4e1f9050cc46dc2021aabad6ff1200b190fb2aa6..79ec128ded4702d8132ae5b8e8e51ed1ce551e29 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     wxFontEnumerator class
 // Author:      Vaclav Slavik
 // Created:     2006-08-10
-// RCS-ID:      $Id$
 // Copyright:   (c) 2006 REA Elektronik GmbH
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 #endif
 
 #include "wx/fontenum.h"
+#include "wx/private/fontmgr.h"
+
+#if wxUSE_FONTENUM
 
 // ----------------------------------------------------------------------------
 // wxFontEnumerator
 // ----------------------------------------------------------------------------
 
-bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding WXUNUSED(encoding),
-                                          bool WXUNUSED(fixedWidthOnly))
+bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding,
+                                          bool fixedWidthOnly)
 {
-    // FIXME_DFB
-    OnFacename(_T("Default"));
-    return true;
+    // we only support UTF-8 and system (which means "use any"):
+    if ( encoding != wxFONTENCODING_SYSTEM && encoding != wxFONTENCODING_UTF8 )
+        return false;
+
+    bool found = false;
+    const wxFontBundleList& list = wxFontsManager::Get()->GetBundles();
+
+    for ( wxFontBundleList::const_iterator f = list.begin(); f != list.end(); ++f )
+    {
+        if ( fixedWidthOnly && !(*f)->IsFixed() )
+            continue;
+
+        found = true;
+        if ( !OnFacename((*f)->GetName()) )
+            break; // OnFacename() requests us to stop enumeration
+    }
+
+    return found;
 }
 
-bool wxFontEnumerator::EnumerateEncodings(const wxString& WXUNUSED(family))
+bool wxFontEnumerator::EnumerateEncodings(const wxString& facename)
 {
-    // FIXME_DFB
-    return false;
+    return EnumerateEncodingsUTF8(facename);
 }
+
+#endif // wxUSE_FONTENUM