diff --git a/configure b/configure index c922d7ee61..c1d57af4fd 100755 --- a/configure +++ b/configure @@ -985,12 +985,10 @@ Xxf86vm_LIBS Xxf86vm_CFLAGS Xinerama_LIBS Xinerama_CFLAGS -PANGOXFT_LIBS -PANGOXFT_CFLAGS PANGOFT2_LIBS PANGOFT2_CFLAGS -PANGOX_LIBS -PANGOX_CFLAGS +PANGOXFT_LIBS +PANGOXFT_CFLAGS X_EXTRA_LIBS X_LIBS X_PRE_LIBS @@ -1389,12 +1387,10 @@ PKG_CONFIG DIRECTFB_CFLAGS DIRECTFB_LIBS XMKMF -PANGOX_CFLAGS -PANGOX_LIBS -PANGOFT2_CFLAGS -PANGOFT2_LIBS PANGOXFT_CFLAGS PANGOXFT_LIBS +PANGOFT2_CFLAGS +PANGOFT2_LIBS Xinerama_CFLAGS Xinerama_LIBS Xxf86vm_CFLAGS @@ -2373,17 +2369,14 @@ Some influential environment variables: DIRECTFB_LIBS linker flags for DIRECTFB, overriding pkg-config XMKMF Path to xmkmf, Makefile generator for X Window System - PANGOX_CFLAGS - C compiler flags for PANGOX, overriding pkg-config - PANGOX_LIBS linker flags for PANGOX, overriding pkg-config - PANGOFT2_CFLAGS - C compiler flags for PANGOFT2, overriding pkg-config - PANGOFT2_LIBS - linker flags for PANGOFT2, overriding pkg-config PANGOXFT_CFLAGS C compiler flags for PANGOXFT, overriding pkg-config PANGOXFT_LIBS linker flags for PANGOXFT, overriding pkg-config + PANGOFT2_CFLAGS + C compiler flags for PANGOFT2, overriding pkg-config + PANGOFT2_LIBS + linker flags for PANGOFT2, overriding pkg-config Xinerama_CFLAGS C compiler flags for Xinerama, overriding pkg-config Xinerama_LIBS @@ -25648,20 +25641,20 @@ fi pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PANGOX" >&5 -$as_echo_n "checking for PANGOX... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PANGOXFT" >&5 +$as_echo_n "checking for PANGOXFT... " >&6; } if test -n "$PKG_CONFIG"; then - if test -n "$PANGOX_CFLAGS"; then - pkg_cv_PANGOX_CFLAGS="$PANGOX_CFLAGS" + if test -n "$PANGOXFT_CFLAGS"; then + pkg_cv_PANGOXFT_CFLAGS="$PANGOXFT_CFLAGS" else if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pangox\""; } >&5 - ($PKG_CONFIG --exists --print-errors "pangox") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pangoxft\""; } >&5 + ($PKG_CONFIG --exists --print-errors "pangoxft") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_PANGOX_CFLAGS=`$PKG_CONFIG --cflags "pangox" 2>/dev/null` + pkg_cv_PANGOXFT_CFLAGS=`$PKG_CONFIG --cflags "pangoxft" 2>/dev/null` else pkg_failed=yes fi @@ -25670,16 +25663,16 @@ else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then - if test -n "$PANGOX_LIBS"; then - pkg_cv_PANGOX_LIBS="$PANGOX_LIBS" + if test -n "$PANGOXFT_LIBS"; then + pkg_cv_PANGOXFT_LIBS="$PANGOXFT_LIBS" else if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pangox\""; } >&5 - ($PKG_CONFIG --exists --print-errors "pangox") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pangoxft\""; } >&5 + ($PKG_CONFIG --exists --print-errors "pangoxft") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_PANGOX_LIBS=`$PKG_CONFIG --libs "pangox" 2>/dev/null` + pkg_cv_PANGOXFT_LIBS=`$PKG_CONFIG --libs "pangoxft" 2>/dev/null` else pkg_failed=yes fi @@ -25698,31 +25691,33 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - PANGOX_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "pangox"` + PANGOXFT_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "pangoxft"` else - PANGOX_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "pangox"` + PANGOXFT_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "pangoxft"` fi # Put the nasty error message in config.log where it belongs - echo "$PANGOX_PKG_ERRORS" >&5 + echo "$PANGOXFT_PKG_ERRORS" >&5 - as_fn_error $? "pangox library not found, library cannot be compiled in Unicode mode" "$LINENO" 5 + as_fn_error $? "pangoxft library not found, library cannot be compiled in Unicode mode" "$LINENO" 5 elif test $pkg_failed = untried; then - as_fn_error $? "pangox library not found, library cannot be compiled in Unicode mode" "$LINENO" 5 + as_fn_error $? "pangoxft library not found, library cannot be compiled in Unicode mode" "$LINENO" 5 else - PANGOX_CFLAGS=$pkg_cv_PANGOX_CFLAGS - PANGOX_LIBS=$pkg_cv_PANGOX_LIBS + PANGOXFT_CFLAGS=$pkg_cv_PANGOXFT_CFLAGS + PANGOXFT_LIBS=$pkg_cv_PANGOXFT_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - CFLAGS="$PANGOX_CFLAGS $CFLAGS" - CXXFLAGS="$PANGOX_CFLAGS $CXXFLAGS" - GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOX_LIBS" + $as_echo "#define HAVE_PANGO_XFT 1" >>confdefs.h + + CFLAGS="$PANGOXFT_CFLAGS $CFLAGS" + CXXFLAGS="$PANGOXFT_CFLAGS $CXXFLAGS" + GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOXFT_LIBS" fi @@ -25809,90 +25804,6 @@ $as_echo "yes" >&6; } fi -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PANGOXFT" >&5 -$as_echo_n "checking for PANGOXFT... " >&6; } - -if test -n "$PKG_CONFIG"; then - if test -n "$PANGOXFT_CFLAGS"; then - pkg_cv_PANGOXFT_CFLAGS="$PANGOXFT_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pangoxft\""; } >&5 - ($PKG_CONFIG --exists --print-errors "pangoxft") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_PANGOXFT_CFLAGS=`$PKG_CONFIG --cflags "pangoxft" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi -if test -n "$PKG_CONFIG"; then - if test -n "$PANGOXFT_LIBS"; then - pkg_cv_PANGOXFT_LIBS="$PANGOXFT_LIBS" - else - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pangoxft\""; } >&5 - ($PKG_CONFIG --exists --print-errors "pangoxft") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_PANGOXFT_LIBS=`$PKG_CONFIG --libs "pangoxft" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - PANGOXFT_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "pangoxft"` - else - PANGOXFT_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "pangoxft"` - fi - # Put the nasty error message in config.log where it belongs - echo "$PANGOXFT_PKG_ERRORS" >&5 - - - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pangoxft library not found, library will be compiled without anti-aliasing support" >&5 -$as_echo "$as_me: WARNING: pangoxft library not found, library will be compiled without anti-aliasing support" >&2;} - - -elif test $pkg_failed = untried; then - - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pangoxft library not found, library will be compiled without anti-aliasing support" >&5 -$as_echo "$as_me: WARNING: pangoxft library not found, library will be compiled without anti-aliasing support" >&2;} - - -else - PANGOXFT_CFLAGS=$pkg_cv_PANGOXFT_CFLAGS - PANGOXFT_LIBS=$pkg_cv_PANGOXFT_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - $as_echo "#define HAVE_PANGO_XFT 1" >>confdefs.h - - CFLAGS="$PANGOXFT_CFLAGS $CFLAGS" - CXXFLAGS="$PANGOXFT_CFLAGS $CXXFLAGS" - GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOXFT_LIBS" - -fi - save_LIBS="$LIBS" - LIBS="$LIBS $PANGOX_LIBS" for ac_func in pango_font_family_is_monospace do : ac_fn_c_check_func "$LINENO" "pango_font_family_is_monospace" "ac_cv_func_pango_font_family_is_monospace" @@ -25904,7 +25815,6 @@ _ACEOF fi done - LIBS="$save_LIBS" fi wxUSE_UNIVERSAL="yes" diff --git a/configure.in b/configure.in index 1c30b387e0..7d28dd00ec 100644 --- a/configure.in +++ b/configure.in @@ -3102,14 +3102,15 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config if test "$wxUSE_UNICODE" = "yes"; then PKG_PROG_PKG_CONFIG() - PKG_CHECK_MODULES(PANGOX, pangox, + PKG_CHECK_MODULES(PANGOXFT, pangoxft, [ - CFLAGS="$PANGOX_CFLAGS $CFLAGS" - CXXFLAGS="$PANGOX_CFLAGS $CXXFLAGS" - GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOX_LIBS" + AC_DEFINE(HAVE_PANGO_XFT) + CFLAGS="$PANGOXFT_CFLAGS $CFLAGS" + CXXFLAGS="$PANGOXFT_CFLAGS $CXXFLAGS" + GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOXFT_LIBS" ], [ - AC_MSG_ERROR([pangox library not found, library cannot be compiled in Unicode mode]) + AC_MSG_ERROR([pangoxft library not found, library cannot be compiled in Unicode mode]) ] ) PKG_CHECK_MODULES(PANGOFT2, pangoft2, @@ -3123,21 +3124,8 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config wxUSE_PRINTING_ARCHITECTURE="no" ] ) - PKG_CHECK_MODULES(PANGOXFT, pangoxft, - [ - AC_DEFINE(HAVE_PANGO_XFT) - CFLAGS="$PANGOXFT_CFLAGS $CFLAGS" - CXXFLAGS="$PANGOXFT_CFLAGS $CXXFLAGS" - GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOXFT_LIBS" - ], - [ - AC_MSG_WARN([pangoxft library not found, library will be compiled without anti-aliasing support]) - ] - ) - save_LIBS="$LIBS" - LIBS="$LIBS $PANGOX_LIBS" + AC_CHECK_FUNCS([pango_font_family_is_monospace]) - LIBS="$save_LIBS" fi wxUSE_UNIVERSAL="yes" diff --git a/src/x11/app.cpp b/src/x11/app.cpp index 2bfd972742..3508c41d0f 100644 --- a/src/x11/app.cpp +++ b/src/x11/app.cpp @@ -659,10 +659,7 @@ bool wxApp::OnInitGui() #if wxUSE_UNICODE #include -#include -#ifdef HAVE_PANGO_XFT - #include -#endif +#include PangoContext* wxApp::GetPangoContext() { @@ -670,21 +667,9 @@ PangoContext* wxApp::GetPangoContext() if ( !s_pangoContext ) { Display *dpy = wxGlobalDisplay(); - -#ifdef HAVE_PANGO_XFT int xscreen = DefaultScreen(dpy); - static int use_xft = -1; - if (use_xft == -1) - { - wxString val = wxGetenv( L"GDK_USE_XFT" ); - use_xft = val == L"1"; - } - if (use_xft) - s_pangoContext = pango_xft_get_context(dpy, xscreen); - else -#endif // HAVE_PANGO_XFT - s_pangoContext = pango_x_get_context(dpy); + s_pangoContext = pango_xft_get_context(dpy, xscreen); if (!PANGO_IS_CONTEXT(s_pangoContext)) { diff --git a/src/x11/dcclient.cpp b/src/x11/dcclient.cpp index 1b4f0c303b..3883422711 100644 --- a/src/x11/dcclient.cpp +++ b/src/x11/dcclient.cpp @@ -30,10 +30,7 @@ #if wxUSE_UNICODE #include "glib.h" -#include "pango/pangox.h" -#ifdef HAVE_PANGO_XFT - #include "pango/pangoxft.h" -#endif +#include "pango/pangoxft.h" #include "pango_x.cpp" #endif diff --git a/src/x11/pango_x.cpp b/src/x11/pango_x.cpp index 0e82c04f96..f7b7903558 100644 --- a/src/x11/pango_x.cpp +++ b/src/x11/pango_x.cpp @@ -64,7 +64,6 @@ x11_draw_glyphs( Drawable drawable, PangoGlyphString *glyphs, wxColour &colour ) { -#ifdef HAVE_PANGO_XFT if (PANGO_XFT_IS_FONT (font)) { Display* xdisplay = wxGlobalDisplay(); @@ -84,12 +83,6 @@ x11_draw_glyphs( Drawable drawable, XftDrawDestroy( draw ); } - else -#endif - { - wxUnusedVar(colour); - pango_x_render( wxGlobalDisplay(), drawable, gc, font, glyphs, x, y ); - } } void diff --git a/src/x11/pangox11.cpp b/src/x11/pangox11.cpp deleted file mode 100644 index 9b37a00c23..0000000000 --- a/src/x11/pangox11.cpp +++ /dev/null @@ -1,277 +0,0 @@ -/** - * This file gets included from dcclient.cpp and implements - * the X11 interface to Pango. - * Copyright (C) Owen Taylor and Robert Roebling. - * Licence: The wxWindows licence - */ - -/* Declaration */ - -void -x11_draw_glyphs( Drawable drawable, - GC gc, - PangoFont *font, - int x, - int y, - PangoGlyphString *glyphs); - -void -x11_draw_layout_line_with_colors( Drawable drawable, - GC gc, - int x, - int y, - PangoLayoutLine *line, - XColor *foreground, - XColor *background); - -void -x11_draw_layout_with_colors( Drawable drawable, - GC gc, - int x, - int y, - PangoLayout *layout, - XColor *foreground, - XColor *background); - -void -x11_draw_layout( Drawable drawable, - GC gc, - int x, - int y, - PangoLayout *layout); - -void -x11_pango_get_item_properties( PangoItem *item, - PangoUnderline *uline, - gboolean *strikethrough, - gint *rise, - PangoColor *fg_color, - gboolean *fg_set, - PangoColor *bg_color, - gboolean *bg_set, - gboolean *shape_set, - PangoRectangle *ink_rect, - PangoRectangle *logical_rect); - -/* Implementation */ - -void -x11_draw_glyphs( Drawable drawable, - GC gc, - PangoFont *font, - int x, - int y, - PangoGlyphString *glyphs) -{ - if (PANGO_XFT_IS_FONT (font)) - { - pango_xft_picture_render( wxGlobalDisplay(), drawable, drawable, font, glyphs, x, y ); - } - else - { - pango_x_render( wxGlobalDisplay(), drawable, gc, font, glyphs, x, y ); - } -} - -void -x11_draw_layout_line_with_colors( Drawable drawable, - GC gc, - int x, - int y, - PangoLayoutLine *line, - XColor *foreground, - XColor *background) -{ - PangoRectangle overall_rect; - PangoRectangle logical_rect; - PangoRectangle ink_rect; - PangoContext *context; - gint x_off = 0; - gint rise = 0; - - context = pango_layout_get_context (line->layout); - - pango_layout_line_get_extents (line,NULL, &overall_rect); - - GSList *tmp_list = line->runs; - while (tmp_list) - { - PangoUnderline uline = PANGO_UNDERLINE_NONE; - PangoLayoutRun *run = (PangoLayoutRun *) tmp_list->data; - PangoColor fg_color, bg_color; - gboolean strike, fg_set, bg_set, shape_set; - gint risen_y; - - tmp_list = tmp_list->next; - - x11_pango_get_item_properties (run->item, &uline, - &strike, &rise, &fg_color, &fg_set, &bg_color, &bg_set, - &shape_set, &ink_rect, &logical_rect); - - /* we subtract the rise because X coordinates are upside down */ - risen_y = y - rise / PANGO_SCALE; - - if (!shape_set) - { - if (uline == PANGO_UNDERLINE_NONE) - pango_glyph_string_extents (run->glyphs, run->item->analysis.font, NULL, &logical_rect); - else - pango_glyph_string_extents (run->glyphs, run->item->analysis.font, &ink_rect, &logical_rect); - } - -#if 0 - XDrawRectangle( drawable, gc, TRUE, - x + (x_off + logical_rect.x) / PANGO_SCALE, - risen_y + overall_rect.y / PANGO_SCALE, - logical_rect.width / PANGO_SCALE, - overall_rect.height / PANGO_SCALE); -#endif - - if (!shape_set) - { - int gx = x + x_off / PANGO_SCALE; - int gy = risen_y; - - x11_draw_glyphs( drawable, gc, run->item->analysis.font, gx, gy, run->glyphs); - } - - if (uline == PANGO_UNDERLINE_SINGLE) - { - XDrawLine( wxGlobalDisplay(), drawable, gc, - x + (x_off + ink_rect.x) / PANGO_SCALE - 1, - risen_y + 1, - x + (x_off + ink_rect.x + ink_rect.width) / PANGO_SCALE, - risen_y + 1); - } - - x_off += logical_rect.width; - } -} - -void -x11_draw_layout_with_colors( Drawable drawable, - GC gc, - int x, - int y, - PangoLayout *layout, - XColor *foreground, - XColor *background) -{ - PangoLayoutIter *iter = pango_layout_get_iter (layout); - - do - { - PangoLayoutLine *line = pango_layout_iter_get_line (iter); - - PangoRectangle logical_rect; - pango_layout_iter_get_line_extents (iter, NULL, &logical_rect); - - int baseline = pango_layout_iter_get_baseline (iter); - - x11_draw_layout_line_with_colors( drawable, gc, - x + logical_rect.x / PANGO_SCALE, - y + baseline / PANGO_SCALE, - line, - foreground, - background); - - } while (pango_layout_iter_next_line (iter)); - - pango_layout_iter_free (iter); -} - -void -x11_draw_layout( Drawable drawable, - GC gc, - int x, - int y, - PangoLayout *layout) -{ - wxCHECK_RET( layout, wxT("No layout") ); - - x11_draw_layout_with_colors (drawable, gc, x, y, layout, NULL, NULL); -} - -void -x11_pango_get_item_properties( PangoItem *item, - PangoUnderline *uline, - gboolean *strikethrough, - gint *rise, - PangoColor *fg_color, - gboolean *fg_set, - PangoColor *bg_color, - gboolean *bg_set, - gboolean *shape_set, - PangoRectangle *ink_rect, - PangoRectangle *logical_rect) -{ - GSList *tmp_list = item->analysis.extra_attrs; - - if (strikethrough) - *strikethrough = FALSE; - - if (fg_set) - *fg_set = FALSE; - - if (bg_set) - *bg_set = FALSE; - - if (shape_set) - *shape_set = FALSE; - - if (rise) - *rise = 0; - - while (tmp_list) - { - PangoAttribute *attr = (PangoAttribute *) tmp_list->data; - - switch (attr->klass->type) - { - case PANGO_ATTR_UNDERLINE: - if (uline) - *uline = (PangoUnderline) ((PangoAttrInt *)attr)->value; - break; - - case PANGO_ATTR_STRIKETHROUGH: - if (strikethrough) - *strikethrough = ((PangoAttrInt *)attr)->value; - break; - - case PANGO_ATTR_FOREGROUND: - if (fg_color) - *fg_color = ((PangoAttrColor *)attr)->color; - if (fg_set) - *fg_set = TRUE; - - break; - - case PANGO_ATTR_BACKGROUND: - if (bg_color) - *bg_color = ((PangoAttrColor *)attr)->color; - if (bg_set) - *bg_set = TRUE; - - break; - - case PANGO_ATTR_SHAPE: - if (shape_set) - *shape_set = TRUE; - if (logical_rect) - *logical_rect = ((PangoAttrShape *)attr)->logical_rect; - if (ink_rect) - *ink_rect = ((PangoAttrShape *)attr)->ink_rect; - break; - - case PANGO_ATTR_RISE: - if (rise) - *rise = ((PangoAttrInt *)attr)->value; - break; - - default: - break; - } - tmp_list = tmp_list->next; - } -} -