]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/fontenum.cpp
splitted wxApp docs in wxApp+wxAppConsole docs; fix the signature of the documented...
[wxWidgets.git] / src / mac / carbon / fontenum.cpp
index 3cbe7bad1bdb43a50d403f013973e6fb6bf26e75..233bdf3dd8251a86f420a8b7020e048f463e3b29 100644 (file)
@@ -12,7 +12,7 @@
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
-#if wxUSE_FONTMAP
+#if wxUSE_FONTENUM
 
 #include "wx/fontenum.h"
 
 bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding,
                                           bool fixedWidthOnly)
 {
+    if ( fixedWidthOnly )
+    {
+        wxFAIL_MSG( "enumerating only fixed width fonts not supported" );
+        return false;
+    }
+
     //
     // From Apple's QA 1471 http://developer.apple.com/qa/qa2006/qa1471.html
     //
-    
+
     ATSFontFamilyIterator theFontFamilyIterator = NULL;
     ATSFontFamilyRef theATSFontFamilyRef = 0;
     OSStatus status = noErr;
-    
+
     wxArrayString fontFamilies ;
-    
+
     // Create the iterator
     status = ATSFontFamilyIteratorCreate(kATSFontContextLocal, nil,nil,
                                          kATSOptionFlagsUnRestrictedScope,
                                          &theFontFamilyIterator );
-    
+
     wxUint32 macEncoding = wxMacGetSystemEncFromFontEnc(encoding) ;
-    
+
     while (status == noErr)
     {
         // Get the next font in the iteration.
@@ -76,12 +82,12 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding,
                 if ( fontFamiliyEncoding != macEncoding )
                     continue ;
             }
-            
+
             // TODO: determine fixed widths ...
 
             CFStringRef theName = NULL;
             ATSFontFamilyGetName(theATSFontFamilyRef, kATSOptionFlagsDefault, &theName);
-            wxMacCFStringHolder cfName(theName) ;
+            wxCFStringRef cfName(theName) ;
             fontFamilies.Add(cfName.AsString(wxLocale::GetSystemEncoding()));
         }
         else if (status == kATSIterationScopeModified) // Make sure the font database hasnÕt changed.
@@ -94,21 +100,21 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding,
         }
     }
     ATSFontFamilyIteratorRelease(&theFontFamilyIterator);
-    
+
     for ( size_t i = 0 ; i < fontFamilies.Count() ; ++i )
     {
         if ( OnFacename( fontFamilies[i] ) == false )
             break ;
     }
-    
+
     return true;
 }
 
-bool wxFontEnumerator::EnumerateEncodings(const wxString& family)
+bool wxFontEnumerator::EnumerateEncodings(const wxString& WXUNUSED(family))
 {
     wxFAIL_MSG(wxT("wxFontEnumerator::EnumerateEncodings() not yet implemented"));
 
     return true;
 }
 
-#endif // wxUSE_FONTMAP
+#endif // wxUSE_FONTENUM