removed all compile- and run-time checks for GTK+ < 2.4; don't include the generic files which are now never used in wxGTK in the build

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49660 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-11-05 22:31:24 +00:00
parent 899544330f
commit ff654490b7
41 changed files with 483 additions and 1234 deletions

View File

@@ -68,46 +68,29 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding,
return false;
}
#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 // !fixedWidthOnly
#endif // __WXGTK20__ || !HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE
{
PangoFontFamily **families = NULL;
gint n_families = 0;
pango_context_list_families (
PangoFontFamily **families = NULL;
gint n_families = 0;
pango_context_list_families (
#ifdef __WXGTK20__
gtk_widget_get_pango_context( wxGetRootWindow() ),
gtk_widget_get_pango_context( wxGetRootWindow() ),
#else
wxTheApp->GetPangoContext(),
wxTheApp->GetPangoContext(),
#endif
&families, &n_families );
qsort (families, n_families, sizeof (PangoFontFamily *), wxCompareFamilies);
&families, &n_families );
qsort (families, n_families, sizeof (PangoFontFamily *), wxCompareFamilies);
for (int i=0; i<n_families; i++)
for ( int i = 0; i < n_families; i++ )
{
#if defined(__WXGTK20__) || defined(HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE)
if ( !fixedWidthOnly ||
pango_font_family_is_monospace(families[i]) )
#endif
{
#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]);
OnFacename(wxString(name, wxConvUTF8));
}
const gchar *name = pango_font_family_get_name(families[i]);
OnFacename(wxString(name, wxConvUTF8));
}
g_free(families);
}
g_free(families);
return true;
}

View File

@@ -158,9 +158,9 @@ wxFontFamily wxNativeFontInfo::GetFamily() const
ret = wxFONTFAMILY_TELETYPE; // begins with "Monospace"
else if (strncmp( family_text, "courier", 7 ) == 0)
ret = wxFONTFAMILY_TELETYPE; // begins with "Courier"
#if defined(__WXGTK24__) || defined(HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE)
#if defined(__WXGTK20__) || defined(HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE)
else
#ifdef __WXGTK24__
#ifdef __WXGTK20__
if (!gtk_check_version(2,4,0))
#endif
{
@@ -196,7 +196,7 @@ wxFontFamily wxNativeFontInfo::GetFamily() const
if (family != NULL && pango_font_family_is_monospace( family ))
ret = wxFONTFAMILY_TELETYPE; // is deemed a monospace font by pango
}
#endif // gtk24 || HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE
#endif // GTK+ 2 || HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE
if (ret == wxFONTFAMILY_DEFAULT)
{