]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/fontenum.cpp
Compile fixes for the const patch
[wxWidgets.git] / src / unix / fontenum.cpp
index 3b9be3e2cb62c030f41c4372b8373ebc6467b954..d01014ad640647b7ee6c3bbe1f47b67e99a23dc6 100644 (file)
 // headers
 // ----------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "fontenum.h"
-#endif
-
 // for compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
@@ -60,9 +56,13 @@ cmp_families (const void *a, const void *b)
 bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding,
                                           bool fixedWidthOnly)
 {
-#ifndef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE
-    if ( fixedWidthOnly )
-    {
+#if defined(__WXGTK20__) || !defined(HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE)
+    if ( fixedWidthOnly
+#if defined(__WXGTK24__)
+        && (gtk_check_version(2,4,0) != NULL)
+#endif
+       )
+{
         OnFacename( wxT("monospace") );
     }
     else
@@ -81,9 +81,13 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding,
 
         for (int i=0; i<n_families; i++)
         {
-#ifdef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE
-            if (!fixedWidthOnly ||
-                pango_font_family_is_monospace(families[i]))
+#if defined(__WXGTK24__) || defined(HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE)
+            if (!fixedWidthOnly || (
+#ifdef __WXGTK24__
+                !gtk_check_version(2,4,0) &&
+#endif
+                pango_font_family_is_monospace(families[i])
+                                   ) )
 #endif
             {
                 const gchar *name = pango_font_family_get_name(families[i]);
@@ -92,7 +96,7 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding,
         }
         g_free(families);
     }
-    
+
     return TRUE;
 }