[wxGTK2] Runtime check for pango_font_family_is_monospace in wxFontEnumerator (gtk2.4 runtime check) to allow wxGTK2

applications compiled against gtk2.4 or newer to work with gtk2.2 or older runtime.
Removed HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE configure check in case of wxGTK2, as __WXGTK24__ is now used for that.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35361 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mart Raudsepp 2005-08-29 04:33:15 +00:00
parent 4979a56c78
commit 2696b11cd5
2 changed files with 15 additions and 9 deletions

View File

@ -2777,8 +2777,6 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
CFLAGS="$CFLAGS $wx_cv_cflags_gtk"
LIBS="$LIBS $wx_cv_libs_gtk"
AC_CHECK_FUNCS([pango_font_family_is_monospace])
dnl gtk_icon_size_lookup is not available in the GTK+ headers
dnl that have shipped with some versions of Sun's JDS. Not using
dnl AC_CHECK_FUNCS here since it only checks the function exists

View File

@ -60,9 +60,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 +85,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 +100,7 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding,
}
g_free(families);
}
return TRUE;
}