Don't use long deprecated and now removed pangox library in wxX11 any more.

Use pangoxft only now.

Also remove the apparently unused src/x11/pangox11.cpp file, only
src/x11/pango_x.cpp seems to be used (and this one only by being included in
src/x11/dcclient.cpp).

Closes #15482.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74981 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-10-10 20:55:15 +00:00
parent 16fc5c6a61
commit dc1f61892b
6 changed files with 42 additions and 446 deletions

154
configure vendored
View File

@@ -985,12 +985,10 @@ Xxf86vm_LIBS
Xxf86vm_CFLAGS Xxf86vm_CFLAGS
Xinerama_LIBS Xinerama_LIBS
Xinerama_CFLAGS Xinerama_CFLAGS
PANGOXFT_LIBS
PANGOXFT_CFLAGS
PANGOFT2_LIBS PANGOFT2_LIBS
PANGOFT2_CFLAGS PANGOFT2_CFLAGS
PANGOX_LIBS PANGOXFT_LIBS
PANGOX_CFLAGS PANGOXFT_CFLAGS
X_EXTRA_LIBS X_EXTRA_LIBS
X_LIBS X_LIBS
X_PRE_LIBS X_PRE_LIBS
@@ -1389,12 +1387,10 @@ PKG_CONFIG
DIRECTFB_CFLAGS DIRECTFB_CFLAGS
DIRECTFB_LIBS DIRECTFB_LIBS
XMKMF XMKMF
PANGOX_CFLAGS
PANGOX_LIBS
PANGOFT2_CFLAGS
PANGOFT2_LIBS
PANGOXFT_CFLAGS PANGOXFT_CFLAGS
PANGOXFT_LIBS PANGOXFT_LIBS
PANGOFT2_CFLAGS
PANGOFT2_LIBS
Xinerama_CFLAGS Xinerama_CFLAGS
Xinerama_LIBS Xinerama_LIBS
Xxf86vm_CFLAGS Xxf86vm_CFLAGS
@@ -2373,17 +2369,14 @@ Some influential environment variables:
DIRECTFB_LIBS DIRECTFB_LIBS
linker flags for DIRECTFB, overriding pkg-config linker flags for DIRECTFB, overriding pkg-config
XMKMF Path to xmkmf, Makefile generator for X Window System 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 PANGOXFT_CFLAGS
C compiler flags for PANGOXFT, overriding pkg-config C compiler flags for PANGOXFT, overriding pkg-config
PANGOXFT_LIBS PANGOXFT_LIBS
linker flags for PANGOXFT, overriding pkg-config 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 Xinerama_CFLAGS
C compiler flags for Xinerama, overriding pkg-config C compiler flags for Xinerama, overriding pkg-config
Xinerama_LIBS Xinerama_LIBS
@@ -25648,20 +25641,20 @@ fi
pkg_failed=no pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PANGOX" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PANGOXFT" >&5
$as_echo_n "checking for PANGOX... " >&6; } $as_echo_n "checking for PANGOXFT... " >&6; }
if test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG"; then
if test -n "$PANGOX_CFLAGS"; then if test -n "$PANGOXFT_CFLAGS"; then
pkg_cv_PANGOX_CFLAGS="$PANGOX_CFLAGS" pkg_cv_PANGOXFT_CFLAGS="$PANGOXFT_CFLAGS"
else else
if test -n "$PKG_CONFIG" && \ if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pangox\""; } >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pangoxft\""; } >&5
($PKG_CONFIG --exists --print-errors "pangox") 2>&5 ($PKG_CONFIG --exists --print-errors "pangoxft") 2>&5
ac_status=$? ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then 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 else
pkg_failed=yes pkg_failed=yes
fi fi
@@ -25670,16 +25663,16 @@ else
pkg_failed=untried pkg_failed=untried
fi fi
if test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG"; then
if test -n "$PANGOX_LIBS"; then if test -n "$PANGOXFT_LIBS"; then
pkg_cv_PANGOX_LIBS="$PANGOX_LIBS" pkg_cv_PANGOXFT_LIBS="$PANGOXFT_LIBS"
else else
if test -n "$PKG_CONFIG" && \ if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pangox\""; } >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pangoxft\""; } >&5
($PKG_CONFIG --exists --print-errors "pangox") 2>&5 ($PKG_CONFIG --exists --print-errors "pangoxft") 2>&5
ac_status=$? ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then 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 else
pkg_failed=yes pkg_failed=yes
fi fi
@@ -25698,31 +25691,33 @@ else
_pkg_short_errors_supported=no _pkg_short_errors_supported=no
fi fi
if test $_pkg_short_errors_supported = yes; then 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 else
PANGOX_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "pangox"` PANGOXFT_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "pangoxft"`
fi fi
# Put the nasty error message in config.log where it belongs # 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 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 else
PANGOX_CFLAGS=$pkg_cv_PANGOX_CFLAGS PANGOXFT_CFLAGS=$pkg_cv_PANGOXFT_CFLAGS
PANGOX_LIBS=$pkg_cv_PANGOX_LIBS PANGOXFT_LIBS=$pkg_cv_PANGOXFT_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; } $as_echo "yes" >&6; }
CFLAGS="$PANGOX_CFLAGS $CFLAGS" $as_echo "#define HAVE_PANGO_XFT 1" >>confdefs.h
CXXFLAGS="$PANGOX_CFLAGS $CXXFLAGS"
GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOX_LIBS" CFLAGS="$PANGOXFT_CFLAGS $CFLAGS"
CXXFLAGS="$PANGOXFT_CFLAGS $CXXFLAGS"
GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOXFT_LIBS"
fi fi
@@ -25809,90 +25804,6 @@ $as_echo "yes" >&6; }
fi 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 for ac_func in pango_font_family_is_monospace
do : do :
ac_fn_c_check_func "$LINENO" "pango_font_family_is_monospace" "ac_cv_func_pango_font_family_is_monospace" 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 fi
done done
LIBS="$save_LIBS"
fi fi
wxUSE_UNIVERSAL="yes" wxUSE_UNIVERSAL="yes"

View File

@@ -3102,14 +3102,15 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
if test "$wxUSE_UNICODE" = "yes"; then if test "$wxUSE_UNICODE" = "yes"; then
PKG_PROG_PKG_CONFIG() PKG_PROG_PKG_CONFIG()
PKG_CHECK_MODULES(PANGOX, pangox, PKG_CHECK_MODULES(PANGOXFT, pangoxft,
[ [
CFLAGS="$PANGOX_CFLAGS $CFLAGS" AC_DEFINE(HAVE_PANGO_XFT)
CXXFLAGS="$PANGOX_CFLAGS $CXXFLAGS" CFLAGS="$PANGOXFT_CFLAGS $CFLAGS"
GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOX_LIBS" 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, 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" 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]) AC_CHECK_FUNCS([pango_font_family_is_monospace])
LIBS="$save_LIBS"
fi fi
wxUSE_UNIVERSAL="yes" wxUSE_UNIVERSAL="yes"

View File

@@ -659,10 +659,7 @@ bool wxApp::OnInitGui()
#if wxUSE_UNICODE #if wxUSE_UNICODE
#include <pango/pango.h> #include <pango/pango.h>
#include <pango/pangox.h> #include <pango/pangoxft.h>
#ifdef HAVE_PANGO_XFT
#include <pango/pangoxft.h>
#endif
PangoContext* wxApp::GetPangoContext() PangoContext* wxApp::GetPangoContext()
{ {
@@ -670,21 +667,9 @@ PangoContext* wxApp::GetPangoContext()
if ( !s_pangoContext ) if ( !s_pangoContext )
{ {
Display *dpy = wxGlobalDisplay(); Display *dpy = wxGlobalDisplay();
#ifdef HAVE_PANGO_XFT
int xscreen = DefaultScreen(dpy); 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);
s_pangoContext = pango_xft_get_context(dpy, xscreen);
else
#endif // HAVE_PANGO_XFT
s_pangoContext = pango_x_get_context(dpy);
if (!PANGO_IS_CONTEXT(s_pangoContext)) if (!PANGO_IS_CONTEXT(s_pangoContext))
{ {

View File

@@ -30,10 +30,7 @@
#if wxUSE_UNICODE #if wxUSE_UNICODE
#include "glib.h" #include "glib.h"
#include "pango/pangox.h" #include "pango/pangoxft.h"
#ifdef HAVE_PANGO_XFT
#include "pango/pangoxft.h"
#endif
#include "pango_x.cpp" #include "pango_x.cpp"
#endif #endif

View File

@@ -64,7 +64,6 @@ x11_draw_glyphs( Drawable drawable,
PangoGlyphString *glyphs, PangoGlyphString *glyphs,
wxColour &colour ) wxColour &colour )
{ {
#ifdef HAVE_PANGO_XFT
if (PANGO_XFT_IS_FONT (font)) if (PANGO_XFT_IS_FONT (font))
{ {
Display* xdisplay = wxGlobalDisplay(); Display* xdisplay = wxGlobalDisplay();
@@ -84,12 +83,6 @@ x11_draw_glyphs( Drawable drawable,
XftDrawDestroy( draw ); XftDrawDestroy( draw );
} }
else
#endif
{
wxUnusedVar(colour);
pango_x_render( wxGlobalDisplay(), drawable, gc, font, glyphs, x, y );
}
} }
void void

View File

@@ -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;
}
}