From de8d00f5097e2e476d76d305d63a4df505f008f0 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Tue, 27 Nov 2007 10:25:12 +0000 Subject: gtk+: upgrade 2.12 to 2.12.2 git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3242 311d38ba-8fff-0310-9ca6-ca027cbcb966 --- meta/conf/distro/poky-bleeding.conf | 2 +- .../gtk+/gtk+-2.12.1/cellrenderer-cairo.patch | 32 - .../gtk+/gtk+-2.12.1/combo-arrow-size.patch | 67 - meta/packages/gtk+/gtk+-2.12.1/disable-print.patch | 26 - meta/packages/gtk+/gtk+-2.12.1/entry-cairo.patch | 103 - .../gtk+/gtk+-2.12.1/gtklabel-resize-patch | 10 - .../gtk+/gtk+-2.12.1/hardcoded_libtool.patch | 29 - .../gtk+/gtk+-2.12.1/menu-deactivate.patch | 51 - meta/packages/gtk+/gtk+-2.12.1/no-demos.patch | 10 - meta/packages/gtk+/gtk+-2.12.1/pangoxft2.10.6.diff | 2456 -------------------- .../gtk+/gtk+-2.12.1/range-no-redraw.patch | 127 - meta/packages/gtk+/gtk+-2.12.1/run-iconcache.patch | 19 - .../gtk+/gtk+-2.12.1/scrolled-placement.patch | 22 - meta/packages/gtk+/gtk+-2.12.1/toggle-font.diff | 100 - meta/packages/gtk+/gtk+-2.12.1/xsettings.patch | 16 - .../gtk+/gtk+-2.12.2/cellrenderer-cairo.patch | 32 + .../gtk+/gtk+-2.12.2/combo-arrow-size.patch | 67 + meta/packages/gtk+/gtk+-2.12.2/disable-print.patch | 26 + meta/packages/gtk+/gtk+-2.12.2/entry-cairo.patch | 103 + .../gtk+/gtk+-2.12.2/gtklabel-resize-patch | 10 + .../gtk+/gtk+-2.12.2/hardcoded_libtool.patch | 29 + .../gtk+/gtk+-2.12.2/menu-deactivate.patch | 51 + meta/packages/gtk+/gtk+-2.12.2/no-demos.patch | 10 + meta/packages/gtk+/gtk+-2.12.2/pangoxft2.10.6.diff | 2456 ++++++++++++++++++++ .../gtk+/gtk+-2.12.2/range-no-redraw.patch | 127 + meta/packages/gtk+/gtk+-2.12.2/run-iconcache.patch | 19 + .../gtk+/gtk+-2.12.2/scrolled-placement.patch | 22 + meta/packages/gtk+/gtk+-2.12.2/toggle-font.diff | 100 + meta/packages/gtk+/gtk+-2.12.2/xsettings.patch | 16 + meta/packages/gtk+/gtk+_2.12.1.bb | 49 - meta/packages/gtk+/gtk+_2.12.2.bb | 49 + 31 files changed, 3118 insertions(+), 3118 deletions(-) delete mode 100644 meta/packages/gtk+/gtk+-2.12.1/cellrenderer-cairo.patch delete mode 100644 meta/packages/gtk+/gtk+-2.12.1/combo-arrow-size.patch delete mode 100644 meta/packages/gtk+/gtk+-2.12.1/disable-print.patch delete mode 100644 meta/packages/gtk+/gtk+-2.12.1/entry-cairo.patch delete mode 100644 meta/packages/gtk+/gtk+-2.12.1/gtklabel-resize-patch delete mode 100644 meta/packages/gtk+/gtk+-2.12.1/hardcoded_libtool.patch delete mode 100644 meta/packages/gtk+/gtk+-2.12.1/menu-deactivate.patch delete mode 100644 meta/packages/gtk+/gtk+-2.12.1/no-demos.patch delete mode 100644 meta/packages/gtk+/gtk+-2.12.1/pangoxft2.10.6.diff delete mode 100644 meta/packages/gtk+/gtk+-2.12.1/range-no-redraw.patch delete mode 100644 meta/packages/gtk+/gtk+-2.12.1/run-iconcache.patch delete mode 100644 meta/packages/gtk+/gtk+-2.12.1/scrolled-placement.patch delete mode 100644 meta/packages/gtk+/gtk+-2.12.1/toggle-font.diff delete mode 100644 meta/packages/gtk+/gtk+-2.12.1/xsettings.patch create mode 100644 meta/packages/gtk+/gtk+-2.12.2/cellrenderer-cairo.patch create mode 100644 meta/packages/gtk+/gtk+-2.12.2/combo-arrow-size.patch create mode 100644 meta/packages/gtk+/gtk+-2.12.2/disable-print.patch create mode 100644 meta/packages/gtk+/gtk+-2.12.2/entry-cairo.patch create mode 100644 meta/packages/gtk+/gtk+-2.12.2/gtklabel-resize-patch create mode 100644 meta/packages/gtk+/gtk+-2.12.2/hardcoded_libtool.patch create mode 100644 meta/packages/gtk+/gtk+-2.12.2/menu-deactivate.patch create mode 100644 meta/packages/gtk+/gtk+-2.12.2/no-demos.patch create mode 100644 meta/packages/gtk+/gtk+-2.12.2/pangoxft2.10.6.diff create mode 100644 meta/packages/gtk+/gtk+-2.12.2/range-no-redraw.patch create mode 100644 meta/packages/gtk+/gtk+-2.12.2/run-iconcache.patch create mode 100644 meta/packages/gtk+/gtk+-2.12.2/scrolled-placement.patch create mode 100644 meta/packages/gtk+/gtk+-2.12.2/toggle-font.diff create mode 100644 meta/packages/gtk+/gtk+-2.12.2/xsettings.patch delete mode 100644 meta/packages/gtk+/gtk+_2.12.1.bb create mode 100644 meta/packages/gtk+/gtk+_2.12.2.bb (limited to 'meta') diff --git a/meta/conf/distro/poky-bleeding.conf b/meta/conf/distro/poky-bleeding.conf index c63aaaa447..be4e37de1f 100644 --- a/meta/conf/distro/poky-bleeding.conf +++ b/meta/conf/distro/poky-bleeding.conf @@ -1,5 +1,5 @@ PREFERRED_VERSION_atk ?= "1.20.0" -PREFERRED_VERSION_gtk+ ?= "2.12.1" +PREFERRED_VERSION_gtk+ ?= "2.12.2" PREFERRED_VERSION_gnome-keyring ?= "2.20" PREFERRED_VERSION_gnome-vfs ?= "2.20.0" diff --git a/meta/packages/gtk+/gtk+-2.12.1/cellrenderer-cairo.patch b/meta/packages/gtk+/gtk+-2.12.1/cellrenderer-cairo.patch deleted file mode 100644 index 4439e69fb6..0000000000 --- a/meta/packages/gtk+/gtk+-2.12.1/cellrenderer-cairo.patch +++ /dev/null @@ -1,32 +0,0 @@ -Index: gtk/gtkcellrenderer.c -=================================================================== -RCS file: /cvs/gnome/gtk+/gtk/gtkcellrenderer.c,v -retrieving revision 1.55 -diff -u -r1.55 gtkcellrenderer.c ---- gtk/gtkcellrenderer.c 14 May 2006 04:25:28 -0000 1.55 -+++ gtk/gtkcellrenderer.c 30 Jun 2006 10:57:43 -0000 -@@ -551,6 +551,7 @@ - - if (cell->cell_background_set && !selected) - { -+#ifdef USE_CAIRO_INTERNALLY - cairo_t *cr = gdk_cairo_create (window); - - gdk_cairo_rectangle (cr, background_area); -@@ -558,6 +559,16 @@ - cairo_fill (cr); - - cairo_destroy (cr); -+#else -+ GdkGC *gc; -+ -+ gc = gdk_gc_new (window); -+ gdk_gc_set_rgb_fg_color (gc, &priv->cell_background); -+ gdk_draw_rectangle (window, gc, TRUE, -+ background_area->x, background_area->y, -+ background_area->width, background_area->height); -+ g_object_unref (gc); -+#endif - } - - GTK_CELL_RENDERER_GET_CLASS (cell)->render (cell, diff --git a/meta/packages/gtk+/gtk+-2.12.1/combo-arrow-size.patch b/meta/packages/gtk+/gtk+-2.12.1/combo-arrow-size.patch deleted file mode 100644 index d44c454ce3..0000000000 --- a/meta/packages/gtk+/gtk+-2.12.1/combo-arrow-size.patch +++ /dev/null @@ -1,67 +0,0 @@ -Index: gtk/gtkcombobox.c -=================================================================== -RCS file: /cvs/gnome/gtk+/gtk/gtkcombobox.c,v -retrieving revision 1.185 -diff -u -p -r1.185 gtkcombobox.c ---- gtk/gtkcombobox.c 12 Oct 2006 13:48:07 -0000 1.185 -+++ gtk/gtkcombobox.c 1 Nov 2006 19:01:09 -0000 -@@ -756,6 +756,25 @@ gtk_combo_box_class_init (GtkComboBoxCla - FALSE, - GTK_PARAM_READABLE)); - -+ /** -+ * GtkComboBox:arrow-size: -+ * -+ * Sets the minimum size of the arrow in the combo box. Note -+ * that the arrow size is coupled to the font size, so in case -+ * a larger font is used, the arrow will be larger than set -+ * by arrow size. -+ * -+ * Since: 2.12 -+ */ -+ gtk_widget_class_install_style_property (widget_class, -+ g_param_spec_int ("arrow-size", -+ P_("Arrow Size"), -+ P_("The minimum size of the arrow in the combo box"), -+ 0, -+ G_MAXINT, -+ 15, -+ GTK_PARAM_READABLE)); -+ - g_type_class_add_private (object_class, sizeof (GtkComboBoxPrivate)); - } - -@@ -1897,7 +1916,12 @@ gtk_combo_box_size_request (GtkWidget - { - gint width, height; - gint focus_width, focus_pad; -+ gint font_size; -+ gint arrow_size; - GtkRequisition bin_req; -+ PangoContext *context; -+ PangoFontMetrics *metrics; -+ PangoFontDescription *font_desc; - - GtkComboBox *combo_box = GTK_COMBO_BOX (widget); - -@@ -1910,7 +1934,20 @@ gtk_combo_box_size_request (GtkWidget - gtk_widget_style_get (GTK_WIDGET (widget), - "focus-line-width", &focus_width, - "focus-padding", &focus_pad, -+ "arrow-size", &arrow_size, - NULL); -+ -+ font_desc = GTK_BIN (widget)->child->style->font_desc; -+ context = gtk_widget_get_pango_context (widget); -+ metrics = pango_context_get_metrics (context, font_desc, -+ pango_context_get_language (context)); -+ font_size = PANGO_PIXELS (pango_font_metrics_get_ascent (metrics) + -+ pango_font_metrics_get_descent (metrics)); -+ pango_font_metrics_unref (metrics); -+ -+ arrow_size = MAX (arrow_size, font_size); -+ -+ gtk_widget_set_size_request (combo_box->priv->arrow, arrow_size, arrow_size); - - if (!combo_box->priv->tree_view) - { diff --git a/meta/packages/gtk+/gtk+-2.12.1/disable-print.patch b/meta/packages/gtk+/gtk+-2.12.1/disable-print.patch deleted file mode 100644 index 19292592d2..0000000000 --- a/meta/packages/gtk+/gtk+-2.12.1/disable-print.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- gtk+-2.12.0/configure.in~ 2006-07-05 18:11:44.000000000 +0200 -+++ gtk+-2.12.0/configure.in 2006-07-05 18:11:44.000000000 +0200 -@@ -1554,22 +1554 @@ --AC_PATH_PROG(CUPS_CONFIG, cups-config, no) --if test "x$CUPS_CONFIG" != "xno"; then -- CUPS_CFLAGS=`cups-config --cflags | sed 's/-O[0-9]*//' | sed 's/-m[^\t]*//g'` -- CUPS_LIBS=`cups-config --libs` -- -- CUPS_API_VERSION=`cups-config --api-version` -- CUPS_API_MAJOR=`echo $ECHO_N $CUPS_API_VERSION | awk -F. '{print $1}'` -- CUPS_API_MINOR=`echo $ECHO_N $CUPS_API_VERSION | awk -F. '{print $2}'` -- -- if test $CUPS_API_MAJOR -gt 1 -o \ -- $CUPS_API_MAJOR -eq 1 -a $CUPS_API_MINOR -ge 2; then -- AC_DEFINE(HAVE_CUPS_API_1_2) -- fi -- -- AC_SUBST(CUPS_API_MAJOR) -- AC_SUBST(CUPS_API_MINOR) -- AC_SUBST(CUPS_CFLAGS) -- AC_SUBST(CUPS_LIBS) -- -- AC_CHECK_HEADER(cups/cups.h,,AC_MSG_ERROR([[*** Sorry, cups-config present but cups/cups.h missing.]])) --fi --AM_CONDITIONAL(HAVE_CUPS, test "x$CUPS_CONFIG" != "xno") -+AM_CONDITIONAL(HAVE_CUPS, false) diff --git a/meta/packages/gtk+/gtk+-2.12.1/entry-cairo.patch b/meta/packages/gtk+/gtk+-2.12.1/entry-cairo.patch deleted file mode 100644 index 3313e7f132..0000000000 --- a/meta/packages/gtk+/gtk+-2.12.1/entry-cairo.patch +++ /dev/null @@ -1,103 +0,0 @@ -Index: gtk/gtkentry.c -=================================================================== -RCS file: /cvs/gnome/gtk+/gtk/gtkentry.c,v -retrieving revision 1.317 -diff -u -r1.317 gtkentry.c ---- gtk/gtkentry.c 29 Jun 2006 09:18:05 -0000 1.317 -+++ gtk/gtkentry.c 2 Jul 2006 14:14:24 -0000 -@@ -3337,7 +3337,9 @@ - if (GTK_WIDGET_DRAWABLE (entry)) - { - PangoLayout *layout = gtk_entry_ensure_layout (entry, TRUE); -+#ifdef USE_CAIRO_INTERNALLY - cairo_t *cr; -+#endif - gint x, y; - gint start_pos, end_pos; - -@@ -3345,23 +3347,35 @@ - - get_layout_position (entry, &x, &y); - -+#ifdef USE_CAIRO_INTERNALLY - cr = gdk_cairo_create (entry->text_area); - - cairo_move_to (cr, x, y); - gdk_cairo_set_source_color (cr, &widget->style->text [widget->state]); - pango_cairo_show_layout (cr, layout); -+#else -+ gdk_draw_layout (entry->text_area, widget->style->text_gc [widget->state], -+ x, y, -+ layout); -+#endif - - if (gtk_editable_get_selection_bounds (GTK_EDITABLE (entry), &start_pos, &end_pos)) - { - gint *ranges; - gint n_ranges, i; - PangoRectangle logical_rect; -- GdkColor *selection_color, *text_color; - GtkBorder inner_border; -+#ifdef USE_CAIRO_INTERNALLY -+ GdkColor *selection_color, *text_color; -+#else -+ GdkGC *selection_gc, *text_gc; -+ GdkRegion *clip_region; -+#endif - - pango_layout_get_pixel_extents (layout, NULL, &logical_rect); - gtk_entry_get_pixel_ranges (entry, &ranges, &n_ranges); - -+#ifdef USE_CAIRO_INTERNALLY - if (GTK_WIDGET_HAS_FOCUS (entry)) - { - selection_color = &widget->style->base [GTK_STATE_SELECTED]; -@@ -3390,11 +3404,46 @@ - cairo_move_to (cr, x, y); - gdk_cairo_set_source_color (cr, text_color); - pango_cairo_show_layout (cr, layout); -- -+#else -+ if (GTK_WIDGET_HAS_FOCUS (entry)) -+ { -+ selection_gc = widget->style->base_gc [GTK_STATE_SELECTED]; -+ text_gc = widget->style->text_gc [GTK_STATE_SELECTED]; -+ } -+ else -+ { -+ selection_gc = widget->style->base_gc [GTK_STATE_ACTIVE]; -+ text_gc = widget->style->text_gc [GTK_STATE_ACTIVE]; -+ } -+ -+ clip_region = gdk_region_new (); -+ for (i = 0; i < n_ranges; ++i) -+ { -+ GdkRectangle rect; -+ -+ rect.x = inner_border.left - entry->scroll_offset + ranges[2 * i]; -+ rect.y = y; -+ rect.width = ranges[2 * i + 1]; -+ rect.height = logical_rect.height; -+ -+ gdk_draw_rectangle (entry->text_area, selection_gc, TRUE, -+ rect.x, rect.y, rect.width, rect.height); -+ -+ gdk_region_union_with_rect (clip_region, &rect); -+ } -+ -+ gdk_gc_set_clip_region (text_gc, clip_region); -+ gdk_draw_layout (entry->text_area, text_gc, -+ x, y, -+ layout); -+ gdk_gc_set_clip_region (text_gc, NULL); -+ gdk_region_destroy (clip_region); -+#endif - g_free (ranges); - } -- -+#ifdef USE_CAIRO_INTERNALLY - cairo_destroy (cr); -+#endif - } - } - diff --git a/meta/packages/gtk+/gtk+-2.12.1/gtklabel-resize-patch b/meta/packages/gtk+/gtk+-2.12.1/gtklabel-resize-patch deleted file mode 100644 index df29656343..0000000000 --- a/meta/packages/gtk+/gtk+-2.12.1/gtklabel-resize-patch +++ /dev/null @@ -1,10 +0,0 @@ ---- gtk+-2.4.3/gtk/gtklabel.c~ 2004-06-11 13:50:34.000000000 +0100 -+++ gtk+-2.4.3/gtk/gtklabel.c 2004-07-05 13:33:57.000000000 +0100 -@@ -1623,6 +1623,7 @@ - - /* We have to clear the layout, fonts etc. may have changed */ - gtk_label_clear_layout (label); -+ gtk_widget_queue_resize (GTK_WIDGET (label)); - } - - static void diff --git a/meta/packages/gtk+/gtk+-2.12.1/hardcoded_libtool.patch b/meta/packages/gtk+/gtk+-2.12.1/hardcoded_libtool.patch deleted file mode 100644 index 6adb0cfef6..0000000000 --- a/meta/packages/gtk+/gtk+-2.12.1/hardcoded_libtool.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- /tmp/configure.in 2007-01-08 17:50:49.000000000 +0100 -+++ gtk+-2.10.7/configure.in 2007-01-08 17:52:33.495251000 +0100 -@@ -371,7 +371,7 @@ - case $enable_explicit_deps in - auto) - export SED -- deplibs_check_method=`(./libtool --config; echo 'eval echo $deplibs_check_method') | sh` -+ deplibs_check_method=`(./$host_alias-libtool --config; echo 'eval echo $deplibs_check_method') | sh` - if test "x$deplibs_check_method" '!=' xpass_all || test "x$enable_static" = xyes ; then - enable_explicit_deps=yes - else -@@ -773,7 +773,7 @@ - dnl Now we check to see if our libtool supports shared lib deps - dnl (in a rather ugly way even) - if $dynworks; then -- pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} ./libtool --config" -+ pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} ./$host_alias-libtool --config" - pixbuf_deplibs_check=`$pixbuf_libtool_config | \ - grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \ - sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'` -@@ -1611,7 +1611,7 @@ - # We are using gmodule-no-export now, but I'm leaving the stripping - # code in place for now, since pango and atk still require gmodule. - export SED --export_dynamic=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh` -+export_dynamic=`(./$host_alias-libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh` - if test -n "$export_dynamic"; then - GDK_PIXBUF_DEP_LIBS=`echo $GDK_PIXBUF_DEP_LIBS | sed -e "s/$export_dynamic//"` - GDK_PIXBUF_XLIB_DEP_LIBS=`echo $GDK_PIXBUF_XLIB_DEP_LIBS | sed -e "s/$export_dynamic//"` diff --git a/meta/packages/gtk+/gtk+-2.12.1/menu-deactivate.patch b/meta/packages/gtk+/gtk+-2.12.1/menu-deactivate.patch deleted file mode 100644 index cfb8849e9f..0000000000 --- a/meta/packages/gtk+/gtk+-2.12.1/menu-deactivate.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- gtk+-2.10.0/gtk/gtkmenushell.c.orig 2006-07-05 17:17:34.000000000 +0200 -+++ gtk+-2.10.0/gtk/gtkmenushell.c 2006-07-05 17:19:01.000000000 +0200 -@@ -42,7 +42,7 @@ - #include "gtkintl.h" - #include "gtkalias.h" - --#define MENU_SHELL_TIMEOUT 500 -+#define MENU_SHELL_TIMEOUT 2000 - - #define PACK_DIRECTION(m) \ - (GTK_IS_MENU_BAR (m) \ -@@ -203,6 +203,8 @@ - - G_DEFINE_TYPE (GtkMenuShell, gtk_menu_shell, GTK_TYPE_CONTAINER) - -+static int last_crossing_time; -+ - static void - gtk_menu_shell_class_init (GtkMenuShellClass *klass) - { -@@ -517,6 +519,7 @@ - gtk_grab_add (GTK_WIDGET (menu_shell)); - menu_shell->have_grab = TRUE; - menu_shell->active = TRUE; -+ last_crossing_time = 0; - } - } - -@@ -669,6 +672,13 @@ - menu_shell->activate_time = 0; - deactivate = FALSE; - } -+ -+ if (last_crossing_time != 0 -+ && ((event->time - last_crossing_time) < 500)) -+ { -+ last_crossing_time = 0; -+ deactivate = FALSE; -+ } - - if (deactivate) - { -@@ -716,6 +726,8 @@ - { - menu_item = gtk_get_event_widget ((GdkEvent*) event); - -+ last_crossing_time = event->time; -+ - if (!menu_item || - (GTK_IS_MENU_ITEM (menu_item) && - !_gtk_menu_item_is_selectable (menu_item))) diff --git a/meta/packages/gtk+/gtk+-2.12.1/no-demos.patch b/meta/packages/gtk+/gtk+-2.12.1/no-demos.patch deleted file mode 100644 index 0fc4c48d1a..0000000000 --- a/meta/packages/gtk+/gtk+-2.12.1/no-demos.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- gtk+-2.10.1/Makefile.am.orig 2006-08-08 12:37:30.000000000 +0100 -+++ gtk+-2.10.1/Makefile.am 2006-08-08 12:37:48.000000000 +0100 -@@ -1,6 +1,6 @@ - ## Makefile.am for GTK+ - --SRC_SUBDIRS = gdk-pixbuf gdk gtk modules demos tests perf contrib -+SRC_SUBDIRS = gdk-pixbuf gdk gtk modules tests perf contrib - SUBDIRS = po po-properties $(SRC_SUBDIRS) docs m4macros - - # require automake 1.4 diff --git a/meta/packages/gtk+/gtk+-2.12.1/pangoxft2.10.6.diff b/meta/packages/gtk+/gtk+-2.12.1/pangoxft2.10.6.diff deleted file mode 100644 index 63828cec63..0000000000 --- a/meta/packages/gtk+/gtk+-2.12.1/pangoxft2.10.6.diff +++ /dev/null @@ -1,2456 +0,0 @@ -http://mail.gnome.org/archives/performance-list/2006-October/msg00063.html - -From: Xan Lópe -To: ext Matt Hoosier -Cc: performance-list gnome org -Subject: Re: [patch] Remove pangocairo from Gtk+ 2.8.20 -Date: Mon, 30 Oct 2006 14:31:56 +0200 -Hi, - -I've upgraded your patch against GTK+ 2.10.6, and we are getting great -performance figures compared to GTK+ 2.10.6 with pangocairo too -(basically at the level of GTK+ 2.6.10 again). Right now I'm working on -a python/cairo script to get some nice graphics from a torture test -session with several GTK+s, hope to get it ready soon. - -Index: gtk+-2.10.6/configure.in -=================================================================== ---- gtk+-2.10.6.orig/configure.in 2006-10-30 12:59:28.000000000 +0000 -+++ gtk+-2.10.6/configure.in 2006-10-30 12:59:30.000000000 +0000 -@@ -1435,7 +1435,7 @@ - if test "x$gdktarget" = "xwin32"; then - PANGO_PACKAGES="pangowin32 pangocairo" - else -- PANGO_PACKAGES="pango pangocairo" -+ PANGO_PACKAGES="pango pangocairo pangoxft" - fi - - AC_MSG_CHECKING(Pango flags) -Index: gtk+-2.10.6/gdk/gdkaliasdef.c -=================================================================== ---- gtk+-2.10.6.orig/gdk/gdkaliasdef.c 2006-10-30 12:58:29.000000000 +0000 -+++ gtk+-2.10.6/gdk/gdkaliasdef.c 2006-10-30 12:59:30.000000000 +0000 -@@ -1799,9 +1799,6 @@ - #undef gdk_pango_context_get - extern __typeof (gdk_pango_context_get) gdk_pango_context_get __attribute((alias("IA__gdk_pango_context_get"), visibility("default"))); - --#undef gdk_pango_context_get_for_screen --extern __typeof (gdk_pango_context_get_for_screen) gdk_pango_context_get_for_screen __attribute((alias("IA__gdk_pango_context_get_for_screen"), visibility("default"))); -- - #ifndef GDK_DISABLE_DEPRECATED - #undef gdk_pango_context_set_colormap - extern __typeof (gdk_pango_context_set_colormap) gdk_pango_context_set_colormap __attribute((alias("IA__gdk_pango_context_set_colormap"), visibility("default"))); -@@ -1836,6 +1833,13 @@ - - #endif - #endif -+#if IN_HEADER(__GDK_PANGO_H__) -+#if IN_FILE(__GDK_PANGO_X11_C__) -+#undef gdk_pango_context_get_for_screen -+extern __typeof (gdk_pango_context_get_for_screen) gdk_pango_context_get_for_screen __attribute((alias("IA__gdk_pango_context_get_for_screen"), visibility("default"))); -+ -+#endif -+#endif - #if IN_HEADER(__GDK_PIXBUF_H__) - #if IN_FILE(__GDK_PIXBUF_DRAWABLE_C__) - #undef gdk_pixbuf_get_from_drawable -Index: gtk+-2.10.6/gdk/gdkalias.h -=================================================================== ---- gtk+-2.10.6.orig/gdk/gdkalias.h 2006-10-30 12:58:29.000000000 +0000 -+++ gtk+-2.10.6/gdk/gdkalias.h 2006-10-30 12:59:30.000000000 +0000 -@@ -1796,9 +1796,6 @@ - extern __typeof (gdk_pango_context_get) IA__gdk_pango_context_get __attribute((visibility("hidden"))); - #define gdk_pango_context_get IA__gdk_pango_context_get - --extern __typeof (gdk_pango_context_get_for_screen) IA__gdk_pango_context_get_for_screen __attribute((visibility("hidden"))); --#define gdk_pango_context_get_for_screen IA__gdk_pango_context_get_for_screen -- - #ifndef GDK_DISABLE_DEPRECATED - extern __typeof (gdk_pango_context_set_colormap) IA__gdk_pango_context_set_colormap __attribute((visibility("hidden"))); - #define gdk_pango_context_set_colormap IA__gdk_pango_context_set_colormap -@@ -1833,6 +1830,13 @@ - - #endif - #endif -+#if IN_HEADER(__GDK_PANGO_H__) -+#if IN_FILE(__GDK_PANGO_X11_C__) -+extern __typeof (gdk_pango_context_get_for_screen) IA__gdk_pango_context_get_for_screen __attribute((visibility("hidden"))); -+#define gdk_pango_context_get_for_screen IA__gdk_pango_context_get_for_screen -+ -+#endif -+#endif - #if IN_HEADER(__GDK_PIXBUF_H__) - #if IN_FILE(__GDK_PIXBUF_DRAWABLE_C__) - extern __typeof (gdk_pixbuf_get_from_drawable) IA__gdk_pixbuf_get_from_drawable __attribute((visibility("hidden"))); -Index: gtk+-2.10.6/gdk/gdkdraw.c -=================================================================== ---- gtk+-2.10.6.orig/gdk/gdkdraw.c 2006-10-30 12:58:29.000000000 +0000 -+++ gtk+-2.10.6/gdk/gdkdraw.c 2006-10-30 12:59:30.000000000 +0000 -@@ -909,9 +909,9 @@ - { - g_return_if_fail (GDK_IS_DRAWABLE (drawable)); - g_return_if_fail (GDK_IS_GC (gc)); -- -- real_draw_glyphs (drawable, gc, NULL, font, -- x, y, glyphs); -+ -+ -+ GDK_DRAWABLE_GET_CLASS (drawable)->draw_glyphs (drawable, gc, font, x, y, glyphs); - } - - /** -@@ -949,8 +949,9 @@ - g_return_if_fail (GDK_IS_DRAWABLE (drawable)); - g_return_if_fail (GDK_IS_GC (gc)); - -- real_draw_glyphs (drawable, gc, matrix, font, -- x / PANGO_SCALE, y / PANGO_SCALE, glyphs); -+ if (GDK_DRAWABLE_GET_CLASS (drawable)->draw_glyphs_transformed) -+ GDK_DRAWABLE_GET_CLASS (drawable)->draw_glyphs_transformed (drawable, gc, matrix, -+ font, x, y, glyphs); - } - - /** -@@ -974,28 +975,12 @@ - GdkTrapezoid *trapezoids, - gint n_trapezoids) - { -- cairo_t *cr; -- int i; -- - g_return_if_fail (GDK_IS_DRAWABLE (drawable)); - g_return_if_fail (GDK_IS_GC (gc)); - g_return_if_fail (n_trapezoids == 0 || trapezoids != NULL); - -- cr = gdk_cairo_create (drawable); -- _gdk_gc_update_context (gc, cr, NULL, NULL, TRUE); -- -- for (i = 0; i < n_trapezoids; i++) -- { -- cairo_move_to (cr, trapezoids[i].x11, trapezoids[i].y1); -- cairo_line_to (cr, trapezoids[i].x21, trapezoids[i].y1); -- cairo_line_to (cr, trapezoids[i].x22, trapezoids[i].y2); -- cairo_line_to (cr, trapezoids[i].x21, trapezoids[i].y2); -- cairo_close_path (cr); -- } -- -- cairo_fill (cr); -- -- cairo_destroy (cr); -+ GDK_DRAWABLE_GET_CLASS (drawable)->draw_trapezoids (drawable, gc, -+ trapezoids, n_trapezoids); - } - - /** -Index: gtk+-2.10.6/gdk/gdkpango.c -=================================================================== ---- gtk+-2.10.6.orig/gdk/gdkpango.c 2006-10-30 12:58:29.000000000 +0000 -+++ gtk+-2.10.6/gdk/gdkpango.c 2006-10-30 12:59:30.000000000 +0000 -@@ -50,19 +50,34 @@ - GdkBitmap *stipple[MAX_RENDER_PART + 1]; - gboolean embossed; - -- cairo_t *cr; -- PangoRenderPart last_part; -+ /* When switching between the normal and shadow copies when -+ * drawing shadows we can get unexpected recursion into the -+ * drawing functions; the 'in_emboss' flag guards against that. -+ */ -+ gboolean in_emboss; - - /* Current target */ - GdkDrawable *drawable; - GdkGC *base_gc; - - gboolean gc_changed; -+ -+ /* Cached GC, derived from base_gc */ -+ GdkGC *gc; -+ PangoColor gc_color; -+ gboolean gc_color_set; -+ GdkBitmap *gc_stipple; -+ -+ /* we accumulate trapezoids for the same PangoRenderPart */ -+ GArray *trapezoids; -+ PangoRenderPart trapezoid_part; - }; - - static PangoAttrType gdk_pango_attr_stipple_type; - static PangoAttrType gdk_pango_attr_embossed_type; - -+static void flush_trapezoids (GdkPangoRenderer *gdk_renderer); -+ - enum { - PROP_0, - PROP_SCREEN -@@ -77,6 +92,10 @@ - GdkPangoRendererPrivate *priv = gdk_renderer->priv; - int i; - -+ if (priv->gc) -+ g_object_unref (priv->gc); -+ if (priv->gc_stipple) -+ g_object_unref (priv->gc_stipple); - if (priv->base_gc) - g_object_unref (priv->base_gc); - if (priv->drawable) -@@ -86,6 +105,8 @@ - if (priv->stipple[i]) - g_object_unref (priv->stipple[i]); - -+ g_array_free (priv->trapezoids, TRUE); -+ - G_OBJECT_CLASS (gdk_pango_renderer_parent_class)->finalize (object); - } - -@@ -112,25 +133,6 @@ - return object; - } - --/* Adjusts matrix and color for the renderer to draw the secondary -- * "shadow" copy for embossed text */ --static void --emboss_context (cairo_t *cr) --{ -- cairo_matrix_t tmp_matrix; -- -- /* The gymnastics here to adjust the matrix are because we want -- * to offset by +1,+1 in device-space, not in user-space, -- * so we can't just draw the layout at x + 1, y + 1 -- */ -- cairo_get_matrix (cr, &tmp_matrix); -- tmp_matrix.x0 += 1.0; -- tmp_matrix.y0 += 1.0; -- cairo_set_matrix (cr, &tmp_matrix); -- -- cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); --} -- - static inline gboolean - color_equal (PangoColor *c1, PangoColor *c2) - { -@@ -146,74 +148,154 @@ - return FALSE; - } - --static cairo_t * --get_cairo_context (GdkPangoRenderer *gdk_renderer, -- PangoRenderPart part) -+/* Adjusts matrix and color for the renderer to draw the secondar -+ * "shadow" copy for embossed text */ -+static void -+emboss_renderer (PangoRenderer *renderer, -+ PangoRenderPart part, -+ PangoMatrix **save_matrix, -+ PangoColor **save_color) -+{ -+ GdkPangoRendererPrivate *priv = GDK_PANGO_RENDERER(renderer)->priv; -+ static const PangoColor white = { 0xffff, 0xffff, 0xffff }; -+ PangoMatrix tmp_matrix = PANGO_MATRIX_INIT; -+ -+ priv->in_emboss = TRUE; -+ -+ *save_color = pango_renderer_get_color (renderer, part); -+ if (*save_color) -+ *save_color = pango_color_copy (*save_color); -+ -+ *save_matrix = renderer->matrix; -+ if (*save_matrix) -+ { -+ *save_matrix = pango_matrix_copy (*save_matrix); -+ tmp_matrix = **save_matrix; -+ } -+ -+ /* The gymnastics here to adjust the matrix are because we want -+ * to offset by +1,+1 in device-space, not in user-space, -+ * so we can't just draw the layout at x + 1, y + 1 -+ */ -+ tmp_matrix.x0 += 1; -+ tmp_matrix.y0 += 1; -+ -+ pango_renderer_set_matrix (renderer, &tmp_matrix); -+ pango_renderer_set_color (renderer, part, &white); -+} -+ -+/* Restores from emboss_renderer() */ -+static void -+unemboss_renderer (PangoRenderer *renderer, -+ PangoRenderPart part, -+ PangoMatrix **save_matrix, -+ PangoColor **save_color) -+{ -+ GdkPangoRendererPrivate *priv = GDK_PANGO_RENDERER(renderer)->priv; -+ pango_renderer_set_matrix (renderer, *save_matrix); -+ pango_renderer_set_color (renderer, part, *save_color); -+ -+ if (*save_matrix) -+ pango_matrix_free (*save_matrix); -+ if (*save_color) -+ pango_color_free (*save_color); -+ -+ priv->in_emboss = FALSE; -+} -+ -+/* Gets the GC for drawing @part. This make involve copying the base GC -+ * for the renderer, in which case we keep a one-GC cache. */ -+static GdkGC * -+get_gc (GdkPangoRenderer *gdk_renderer, -+ PangoRenderPart part) - { - PangoRenderer *renderer = PANGO_RENDERER (gdk_renderer); -+ PangoColor *color; -+ GdkBitmap *stipple; - GdkPangoRendererPrivate *priv = gdk_renderer->priv; - -- if (!priv->cr) -+ color = pango_renderer_get_color (renderer, part); -+ -+ if (part <= MAX_RENDER_PART) -+ stipple = priv->stipple[part]; -+ else -+ stipple = NULL; -+ -+ if (!color && !stipple) /* nothing override, use base_gc */ -+ return priv->base_gc; -+ else - { -- const PangoMatrix *matrix; -+ gboolean new_stipple = FALSE; -+ gboolean new_color = FALSE; - -- priv->cr = gdk_cairo_create (priv->drawable); -+ if (stipple != priv->gc_stipple) -+ new_stipple = TRUE; - -- matrix = pango_renderer_get_matrix (renderer); -- if (matrix) -+ if ((priv->gc_color_set && !color) || -+ (!priv->gc_color_set && color) || -+ priv->gc_color.red != color->red || -+ priv->gc_color.green != color->green || -+ priv->gc_color.blue != color->blue) -+ new_color = TRUE; -+ -+ if (!priv->gc) - { -- cairo_matrix_t cairo_matrix; -- -- cairo_matrix_init (&cairo_matrix, -- matrix->xx, matrix->yx, -- matrix->xy, matrix->yy, -- matrix->x0, matrix->y0); -- cairo_set_matrix (priv->cr, &cairo_matrix); -+ priv->gc = gdk_gc_new (priv->drawable); -+ gdk_gc_copy (priv->gc, priv->base_gc); -+ } -+ else if (new_color && priv->gc_color_set && !color) -+ { -+ /* We have to recopy the original GC onto the cached GC -+ * to get the default color */ -+ new_stipple = TRUE; -+ gdk_gc_copy (priv->gc, priv->base_gc); -+ } -+ else if (new_stipple && priv->gc_stipple && !stipple) -+ { -+ /* Similarly, we need to make a new copy to restore to the -+ * default stipple state (the caller may have set a stipple -+ * on the GC, and even if not, gdk_gc_set_stipple (gc, NULL) -+ * doesn't work currently to restore to the default X stipple) */ -+ new_color = TRUE; -+ gdk_gc_copy (priv->gc, priv->base_gc); - } -- } -- -- if (part != priv->last_part) -- { -- PangoColor *pango_color; -- GdkColor *color; -- GdkColor tmp_color; -- gboolean changed; - -- pango_color = pango_renderer_get_color (renderer, part); -- -- if (priv->last_part != -1) -- changed = priv->gc_changed || -- priv->stipple[priv->last_part] != priv->stipple[part] || -- !color_equal (pango_color, -- pango_renderer_get_color (renderer, priv->last_part)); -- else -- changed = TRUE; -- -- if (changed) -+ if (new_color) - { -- if (pango_color) -+ if (color) - { -- tmp_color.red = pango_color->red; -- tmp_color.green = pango_color->green; -- tmp_color.blue = pango_color->blue; -+ GdkColor gdk_color; -+ -+ gdk_color.red = color->red; -+ gdk_color.green = color->green; -+ gdk_color.blue = color->blue; - -- color = &tmp_color; -+ gdk_gc_set_rgb_fg_color (priv->gc, &gdk_color); -+ -+ priv->gc_color = *color; -+ priv->gc_color_set = TRUE; - } - else -- color = NULL; -+ priv->gc_color_set = FALSE; -+ } - -- _gdk_gc_update_context (priv->base_gc, -- priv->cr, -- color, -- priv->stipple[part], -- priv->gc_changed); -+ if (new_stipple) -+ { -+ if (priv->gc_stipple) -+ g_object_unref (priv->gc_stipple); -+ -+ if (stipple) -+ { -+ gdk_gc_set_stipple (priv->gc, stipple); -+ gdk_gc_set_fill (priv->gc, GDK_STIPPLED); -+ priv->gc_stipple = g_object_ref (stipple); -+ } -+ else -+ priv->gc_stipple = NULL; - } - -- priv->last_part = part; -- priv->gc_changed = FALSE; -+ return priv->gc; - } -- -- return priv->cr; - } - - static void -@@ -225,133 +307,78 @@ - { - GdkPangoRenderer *gdk_renderer = GDK_PANGO_RENDERER (renderer); - GdkPangoRendererPrivate *priv = gdk_renderer->priv; -- cairo_t *cr; - -- cr = get_cairo_context (gdk_renderer, -- PANGO_RENDER_PART_FOREGROUND); -+ flush_trapezoids (gdk_renderer); - -- if (priv->embossed) -+ if (!priv->in_emboss && priv->embossed) - { -- cairo_save (cr); -- emboss_context (cr); -- cairo_move_to (cr, (double)x / PANGO_SCALE, (double)y / PANGO_SCALE); -- pango_cairo_show_glyph_string (cr, font, glyphs); -- cairo_restore (cr); -- } -- -- cairo_move_to (cr, (double)x / PANGO_SCALE, (double)y / PANGO_SCALE); -- pango_cairo_show_glyph_string (cr, font, glyphs); --} -- --/* Draws an error underline that looks like one of: -- * H E H -- * /\ /\ /\ /\ /\ - -- * A/ \ / \ / \ A/ \ / \ | -- * \ \ / \ / /D \ \ / \ | -- * \ \/ C \/ / \ \/ C \ | height = HEIGHT_SQUARES * square -- * \ /\ F / \ F /\ \ | -- * \ / \ / \ / \ \G | -- * \ / \ / \ / \ / | -- * \/ \/ \/ \/ - -- * B B -- * |----| -- * unit_width = (HEIGHT_SQUARES - 1) * square -- * -- * The x, y, width, height passed in give the desired bounding box; -- * x/width are adjusted to make the underline a integer number of units -- * wide. -- */ --#define HEIGHT_SQUARES 2.5 -+ PangoMatrix *save_matrix; -+ PangoColor *save_color; - --/* Cut-and-pasted between here and pango/pango/pangocairo-render.c */ -+ emboss_renderer (renderer, PANGO_RENDER_PART_FOREGROUND, &save_matrix, &save_color); -+ gdk_draw_glyphs_transformed (priv->drawable, -+ get_gc (gdk_renderer, PANGO_RENDER_PART_FOREGROUND), -+ renderer->matrix, font, x, y, glyphs); -+ unemboss_renderer (renderer, PANGO_RENDER_PART_FOREGROUND, &save_matrix, &save_color); -+ } -+ -+ gdk_draw_glyphs_transformed (priv->drawable, -+ get_gc (gdk_renderer, PANGO_RENDER_PART_FOREGROUND), -+ renderer->matrix, font, x, y, glyphs); -+} -+ -+/* Outputs any pending trapezoids, we do this when the part or -+ * part color changes, when we are about to draw text, etc. */ - static void --draw_error_underline (cairo_t *cr, -- double x, -- double y, -- double width, -- double height) --{ -- double square = height / HEIGHT_SQUARES; -- double unit_width = (HEIGHT_SQUARES - 1) * square; -- int width_units = (width + unit_width / 2) / unit_width; -- double y_top, y_bottom; -- int i; -+flush_trapezoids (GdkPangoRenderer *gdk_renderer) -+{ -+ GdkPangoRendererPrivate *priv = gdk_renderer->priv; - -- x += (width - width_units * unit_width) / 2; -- width = width_units * unit_width; -+ if (!priv->trapezoids || priv->trapezoids->len == 0) -+ return; - -- y_top = y; -- y_bottom = y + height; -- -- /* Bottom of squiggle */ -- cairo_move_to (cr, x - square / 2, y_top + square / 2); /* A */ -- for (i = 0; i < width_units; i += 2) -- { -- double x_middle = x + (i + 1) * unit_width; -- double x_right = x + (i + 2) * unit_width; -- -- cairo_line_to (cr, x_middle, y_bottom); /* B */ -- -- if (i + 1 == width_units) -- /* Nothing */; -- else if (i + 2 == width_units) -- cairo_line_to (cr, x_right + square / 2, y_top + square / 2); /* D */ -- else -- cairo_line_to (cr, x_right, y_top + square); /* C */ -- } -- -- /* Top of squiggle */ -- for (i -= 2; i >= 0; i -= 2) -- { -- double x_left = x + i * unit_width; -- double x_middle = x + (i + 1) * unit_width; -- double x_right = x + (i + 2) * unit_width; -- -- if (i + 1 == width_units) -- cairo_line_to (cr, x_middle + square / 2, y_bottom - square / 2); /* G */ -- else { -- if (i + 2 == width_units) -- cairo_line_to (cr, x_right, y_top); /* E */ -- cairo_line_to (cr, x_middle, y_bottom - square); /* F */ -- } -- -- cairo_line_to (cr, x_left, y_top); /* H */ -- } -+ gdk_draw_trapezoids (priv->drawable, -+ get_gc (gdk_renderer, priv->trapezoid_part), -+ (GdkTrapezoid *)priv->trapezoids->data, -+ priv->trapezoids->len); - -- cairo_close_path (cr); -- cairo_fill (cr); -+ g_array_set_size (priv->trapezoids, 0); - } - -+/* Draws a single trapezoid ... we don't draw it immediately, but rather -+ * cache it to join together with other trapezoids that form part of the -+ * same logical shape */ - static void --gdk_pango_renderer_draw_rectangle (PangoRenderer *renderer, -- PangoRenderPart part, -- int x, -- int y, -- int width, -- int height) -+gdk_pango_renderer_draw_trapezoid (PangoRenderer *renderer, -+ PangoRenderPart part, -+ double y1, -+ double x11, -+ double x21, -+ double y2, -+ double x12, -+ double x22) - { - GdkPangoRenderer *gdk_renderer = GDK_PANGO_RENDERER (renderer); -- GdkPangoRendererPrivate *priv = gdk_renderer->priv; -- cairo_t *cr; -- -- cr = get_cairo_context (gdk_renderer, part); -- -- if (priv->embossed && part != PANGO_RENDER_PART_BACKGROUND) -- { -- cairo_save (cr); -- emboss_context (cr); -- cairo_rectangle (cr, -- (double)x / PANGO_SCALE, (double)y / PANGO_SCALE, -- (double)width / PANGO_SCALE, (double)height / PANGO_SCALE); -+ GdkTrapezoid trap; - -- cairo_fill (cr); -- cairo_restore (cr); -- } -+ if (!gdk_renderer->priv->trapezoids) -+ gdk_renderer->priv->trapezoids = g_array_new (FALSE, FALSE, -+ sizeof (GdkTrapezoid)); -+ -+ if (gdk_renderer->priv->trapezoids->len > 0 && -+ gdk_renderer->priv->trapezoid_part != part) -+ flush_trapezoids (gdk_renderer); -+ -+ gdk_renderer->priv->trapezoid_part = part; -+ -+ trap.y1 = y1; -+ trap.x11 = x11 / 2; -+ trap.x21 = x21; -+ trap.y2 = y2; -+ trap.x12 = x12; -+ trap.x22 = x22; - -- cairo_rectangle (cr, -- (double)x / PANGO_SCALE, (double)y / PANGO_SCALE, -- (double)width / PANGO_SCALE, (double)height / PANGO_SCALE); -- cairo_fill (cr); -+ g_array_append_val (gdk_renderer->priv->trapezoids, trap); - } - - static void -@@ -363,23 +390,51 @@ - { - GdkPangoRenderer *gdk_renderer = GDK_PANGO_RENDERER (renderer); - GdkPangoRendererPrivate *priv = gdk_renderer->priv; -- cairo_t *cr; -- -- cr = get_cairo_context (gdk_renderer, PANGO_RENDER_PART_UNDERLINE); -- -- if (priv->embossed) -+ -+ if (!priv->in_emboss && priv->embossed) - { -- cairo_save (cr); -- emboss_context (cr); -- draw_error_underline (cr, -- (double)x / PANGO_SCALE, (double)y / PANGO_SCALE, -- (double)width / PANGO_SCALE, (double)height / PANGO_SCALE); -- cairo_restore (cr); -+ PangoMatrix *save_matrix; -+ PangoColor *save_color; -+ -+ emboss_renderer (renderer, PANGO_RENDER_PART_UNDERLINE, &save_matrix, &save_color); -+ PANGO_RENDERER_CLASS (gdk_pango_renderer_parent_class)->draw_error_underline (renderer, -+ x, y, width, height); -+ unemboss_renderer (renderer, PANGO_RENDER_PART_UNDERLINE, &save_matrix, &save_color); - } - -- draw_error_underline (cr, -- (double)x / PANGO_SCALE, (double)y / PANGO_SCALE, -- (double)width / PANGO_SCALE, (double)height / PANGO_SCALE); -+ PANGO_RENDERER_CLASS (gdk_pango_renderer_parent_class)->draw_error_underline (renderer, -+ x, y, width, height); -+} -+ -+/* We can't handle embossing at the level of trapezoids, because when an -+ * underline is split into multiple trapezoids, the normal and shadow -+ * trapezoids will be drawn mixed together. Instead, we have to emboss -+ * and entire rectangle or error underline -+ */ -+static void -+gdk_pango_renderer_draw_rectangle (PangoRenderer *renderer, -+ PangoRenderPart part, -+ int x, -+ int y, -+ int width, -+ int height) -+{ -+ GdkPangoRenderer *gdk_renderer = GDK_PANGO_RENDERER (renderer); -+ GdkPangoRendererPrivate *priv = gdk_renderer->priv; -+ -+ if (!priv->in_emboss && priv->embossed && part != PANGO_RENDER_PART_BACKGROUND) -+ { -+ PangoMatrix *save_matrix; -+ PangoColor *save_color; -+ -+ emboss_renderer (renderer, part, &save_matrix, &save_color); -+ PANGO_RENDERER_CLASS (gdk_pango_renderer_parent_class)->draw_rectangle (renderer, part, -+ x, y, width, height); -+ unemboss_renderer (renderer, part, &save_matrix, &save_color); -+ } -+ -+ PANGO_RENDERER_CLASS (gdk_pango_renderer_parent_class)->draw_rectangle (renderer, part, -+ x, y, width, height); - } - - static void -@@ -388,8 +443,8 @@ - { - GdkPangoRenderer *gdk_renderer = GDK_PANGO_RENDERER (renderer); - -- if (gdk_renderer->priv->last_part == part) -- gdk_renderer->priv->last_part = (PangoRenderPart)-1; -+ if (part == gdk_renderer->priv->trapezoid_part) -+ flush_trapezoids (gdk_renderer); - } - - static void -@@ -410,13 +465,8 @@ - { - GdkPangoRenderer *gdk_renderer = GDK_PANGO_RENDERER (renderer); - GdkPangoRendererPrivate *priv = gdk_renderer->priv; -- -- if (priv->cr) -- { -- cairo_destroy (priv->cr); -- priv->cr = NULL; -- } -- priv->last_part = (PangoRenderPart)-1; -+ -+ flush_trapezoids (gdk_renderer); - } - - static void -@@ -515,7 +565,6 @@ - GDK_TYPE_PANGO_RENDERER, - GdkPangoRendererPrivate); - -- renderer->priv->last_part = (PangoRenderPart)-1; - renderer->priv->gc_changed = TRUE; - } - -@@ -527,6 +576,7 @@ - PangoRendererClass *renderer_class = PANGO_RENDERER_CLASS (klass); - - renderer_class->draw_glyphs = gdk_pango_renderer_draw_glyphs; -+ renderer_class->draw_trapezoid = gdk_pango_renderer_draw_trapezoid; - renderer_class->draw_rectangle = gdk_pango_renderer_draw_rectangle; - renderer_class->draw_error_underline = gdk_pango_renderer_draw_error_underline; - renderer_class->part_changed = gdk_pango_renderer_part_changed; -@@ -647,6 +697,8 @@ - - priv = gdk_renderer->priv; - -+ flush_trapezoids (gdk_renderer); -+ - if (priv->drawable != drawable) - { - if (priv->drawable) -@@ -681,6 +733,8 @@ - - priv = gdk_renderer->priv; - -+ flush_trapezoids (gdk_renderer); -+ - if (priv->base_gc != gc) - { - if (priv->base_gc) -@@ -689,6 +743,20 @@ - if (priv->base_gc) - g_object_ref (priv->base_gc); - -+ if (priv->gc) -+ { -+ g_object_unref (priv->gc); -+ priv->gc = NULL; -+ } -+ -+ priv->gc_color_set = FALSE; -+ -+ if (priv->gc_stipple) -+ { -+ g_object_unref (priv->gc_stipple); -+ priv->gc_stipple = NULL; -+ } -+ - priv->gc_changed = TRUE; - } - } -@@ -1414,50 +1482,5 @@ - return gdk_pango_context_get_for_screen (gdk_screen_get_default ()); - } - --/** -- * gdk_pango_context_get_for_screen: -- * @screen: the #GdkScreen for which the context is to be created. -- * -- * Creates a #PangoContext for @screen. -- * -- * The context must be freed when you're finished with it. -- * -- * When using GTK+, normally you should use gtk_widget_get_pango_context() -- * instead of this function, to get the appropriate context for -- * the widget you intend to render text onto. -- * -- * The newly created context will have the default font options -- * (see #cairo_font_options_t) for the screen; if these options -- * change it will not be updated. Using gtk_widget_get_pango_context() -- * is more convenient if you want to keep a context around and track -- * changes to the screen's font rendering settings. -- * -- * Return value: a new #PangoContext for @screen -- * -- * Since: 2.2 -- **/ --PangoContext * --gdk_pango_context_get_for_screen (GdkScreen *screen) --{ -- PangoFontMap *fontmap; -- PangoContext *context; -- const cairo_font_options_t *options; -- double dpi; -- -- g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL); -- -- fontmap = pango_cairo_font_map_get_default (); -- -- context = pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap)); -- -- options = gdk_screen_get_font_options (screen); -- pango_cairo_context_set_font_options (context, options); -- -- dpi = gdk_screen_get_resolution (screen); -- pango_cairo_context_set_resolution (context, dpi); -- -- return context; --} -- - #define __GDK_PANGO_C__ - #include "gdkaliasdef.c" -Index: gtk+-2.10.6/gdk/gdk.symbols -=================================================================== ---- gtk+-2.10.6.orig/gdk/gdk.symbols 2006-10-30 12:58:29.000000000 +0000 -+++ gtk+-2.10.6/gdk/gdk.symbols 2006-10-30 12:59:30.000000000 +0000 -@@ -861,7 +861,6 @@ - gdk_pango_attr_embossed_new - gdk_pango_attr_stipple_new - gdk_pango_context_get --gdk_pango_context_get_for_screen - #ifndef GDK_DISABLE_DEPRECATED - gdk_pango_context_set_colormap - #endif -@@ -877,6 +876,12 @@ - #endif - #endif - -+#if IN_HEADER(__GDK_PANGO_H__) -+#if IN_FILE(__GDK_PANGO_X11_C__) -+gdk_pango_context_get_for_screen -+#endif -+#endif -+ - #if IN_HEADER(__GDK_PIXBUF_H__) - #if IN_FILE(__GDK_PIXBUF_DRAWABLE_C__) - gdk_pixbuf_get_from_drawable -Index: gtk+-2.10.6/gdk/gdkwindow.c -=================================================================== ---- gtk+-2.10.6.orig/gdk/gdkwindow.c 2006-10-30 12:58:29.000000000 +0000 -+++ gtk+-2.10.6/gdk/gdkwindow.c 2006-10-30 12:59:30.000000000 +0000 -@@ -1834,9 +1834,14 @@ - } - else - { -- method->cr = cairo_create (paint->surface); -+ /*method->cr = cairo_create (paint->surface); - -- gdk_cairo_set_source_color (method->cr, &private->bg_color); -+ gdk_cairo_set_source_color (method->cr, &private->bg_color);*/ -+ GdkGC *gc = _gdk_drawable_get_scratch_gc (paint->pixmap, FALSE); -+ -+ gdk_gc_set_foreground (gc, &(private->bg_color)); -+ -+ method->gc = g_object_ref (gc); - } - } - -Index: gtk+-2.10.6/gdk/x11/gdkdisplay-x11.c -=================================================================== ---- gtk+-2.10.6.orig/gdk/x11/gdkdisplay-x11.c 2006-10-30 12:58:29.000000000 +0000 -+++ gtk+-2.10.6/gdk/x11/gdkdisplay-x11.c 2006-10-30 12:59:30.000000000 +0000 -@@ -190,7 +190,8 @@ - display_x11->leader_window_title_set = FALSE; - - display_x11->have_render = GDK_UNKNOWN; -- -+ display_x11->have_render_with_trapezoids = GDK_UNKNOWN; -+ - #ifdef HAVE_XFIXES - if (XFixesQueryExtension (display_x11->xdisplay, - &display_x11->xfixes_event_base, -Index: gtk+-2.10.6/gdk/x11/gdkdisplay-x11.h -=================================================================== ---- gtk+-2.10.6.orig/gdk/x11/gdkdisplay-x11.h 2006-10-30 12:58:29.000000000 +0000 -+++ gtk+-2.10.6/gdk/x11/gdkdisplay-x11.h 2006-10-30 12:59:30.000000000 +0000 -@@ -78,6 +78,7 @@ - gboolean use_xshm; - gboolean have_shm_pixmaps; - GdkTristate have_render; -+ GdkTristate have_render_with_trapezoids; - gboolean have_xfixes; - gint xfixes_event_base; - -Index: gtk+-2.10.6/gdk/x11/gdkdrawable-x11.c -=================================================================== ---- gtk+-2.10.6.orig/gdk/x11/gdkdrawable-x11.c 2006-10-30 12:58:30.000000000 +0000 -+++ gtk+-2.10.6/gdk/x11/gdkdrawable-x11.c 2006-10-30 12:59:30.000000000 +0000 -@@ -26,6 +26,8 @@ - - #include - -+#include -+ - #include "gdkx.h" - #include "gdkregion-generic.h" - -@@ -106,7 +108,21 @@ - GdkGC *gc, - GdkPoint *points, - gint npoints); -- -+ -+static void gdk_x11_draw_glyphs (GdkDrawable *drawable, -+ GdkGC *gc, -+ PangoFont *font, -+ gint x, -+ gint y, -+ PangoGlyphString *glyphs); -+static void gdk_x11_draw_glyphs_transformed (GdkDrawable *drawable, -+ GdkGC *gc, -+ PangoMatrix *matrix, -+ PangoFont *font, -+ gint x, -+ gint y, -+ PangoGlyphString *glyphs); -+ - static void gdk_x11_draw_image (GdkDrawable *drawable, - GdkGC *gc, - GdkImage *image, -@@ -129,6 +145,11 @@ - gint x_dither, - gint y_dither); - -+static void gdk_x11_draw_trapezoids (GdkDrawable *drawable, -+ GdkGC *gc, -+ GdkTrapezoid *trapezoids, -+ gint n_trapezoids); -+ - static cairo_surface_t *gdk_x11_ref_cairo_surface (GdkDrawable *drawable); - - static void gdk_x11_set_colormap (GdkDrawable *drawable, -@@ -163,8 +184,11 @@ - drawable_class->draw_points = gdk_x11_draw_points; - drawable_class->draw_segments = gdk_x11_draw_segments; - drawable_class->draw_lines = gdk_x11_draw_lines; -+ drawable_class->draw_glyphs = gdk_x11_draw_glyphs; -+ drawable_class->draw_glyphs_transformed = gdk_x11_draw_glyphs_transformed; - drawable_class->draw_image = gdk_x11_draw_image; - drawable_class->draw_pixbuf = gdk_x11_draw_pixbuf; -+ drawable_class->draw_trapezoids = gdk_x11_draw_trapezoids; - - drawable_class->ref_cairo_surface = gdk_x11_ref_cairo_surface; - -@@ -327,6 +351,72 @@ - return x11display->have_render == GDK_YES; - } - -+gboolean -+_gdk_x11_have_render_with_trapezoids (GdkDisplay *display) -+{ -+ Display *xdisplay = GDK_DISPLAY_XDISPLAY (display); -+ GdkDisplayX11 *x11display = GDK_DISPLAY_X11 (display); -+ -+ if (x11display->have_render_with_trapezoids == GDK_UNKNOWN) -+ { -+ x11display->have_render_with_trapezoids = GDK_NO; -+ if (_gdk_x11_have_render (display)) -+ { -+ /* -+ * Require protocol >= 0.4 for CompositeTrapezoids support. -+ */ -+ int major_version, minor_version; -+ -+#define XRENDER_TETRAPEZOIDS_MAJOR 0 -+#define XRENDER_TETRAPEZOIDS_MINOR 4 -+ -+ if (XRenderQueryVersion (xdisplay, &major_version, -+ &minor_version)) -+ if ((major_version == XRENDER_TETRAPEZOIDS_MAJOR) && -+ (minor_version >= XRENDER_TETRAPEZOIDS_MINOR)) -+ x11display->have_render_with_trapezoids = GDK_YES; -+ } -+ } -+ -+ return x11display->have_render_with_trapezoids == GDK_YES; -+} -+ -+static XftDraw * -+gdk_x11_drawable_get_xft_draw (GdkDrawable *drawable) -+{ -+ GdkDrawableImplX11 *impl = GDK_DRAWABLE_IMPL_X11 (drawable); -+ -+ if (impl->xft_draw == NULL) -+ { -+ GdkColormap *colormap = gdk_drawable_get_colormap (drawable); -+ -+ if (colormap) -+ { -+ GdkVisual *visual; -+ -+ visual = gdk_colormap_get_visual (colormap); -+ -+ impl->xft_draw = XftDrawCreate (GDK_SCREEN_XDISPLAY (impl->screen), impl->xid, -+ GDK_VISUAL_XVISUAL (visual), GDK_COLORMAP_XCOLORMAP (colormap)); -+ } -+ else if (gdk_drawable_get_depth (drawable) == 1) -+ { -+ impl->xft_draw = XftDrawCreateBitmap (GDK_SCREEN_XDISPLAY (impl->screen), impl->xid); -+ } -+ else -+ { -+ g_warning ("Using Xft rendering requires the drawable argument to\n" -+ "have a specified colormap. All windows have a colormap,\n" -+ "however, pixmaps only have colormap by default if they\n" -+ "were created with a non-NULL window argument. Otherwise\n" -+ "a colormap must be set on them with gdk_drawable_set_colormap"); -+ return NULL; -+ } -+ } -+ -+ return impl->xft_draw; -+} -+ - static Picture - gdk_x11_drawable_get_picture (GdkDrawable *drawable) - { -@@ -393,6 +483,57 @@ - } - } - -+static void -+gdk_x11_drawable_update_xft_clip (GdkDrawable *drawable, -+ GdkGC *gc) -+{ -+ XftDraw *xft_draw = gdk_x11_drawable_get_xft_draw (drawable); -+ GdkRegion *clip_region = _gdk_gc_get_clip_region (gc); -+ -+ if (gc && clip_region) -+ { -+ GdkRegionBox *boxes = clip_region->rects; -+ gint n_boxes = clip_region->numRects; -+#if 0 /* Until XftDrawSetClipRectangles is there */ -+ XRectangle *rects = g_new (XRectangle, n_boxes); -+ int i; -+ -+ for (i=0; i < n_boxes; i++) -+ { -+ rects[i].x = CLAMP (boxes[i].x1 + gc->clip_x_origin, G_MINSHORT, G_MAXSHORT); -+ rects[i].y = CLAMP (boxes[i].y1 + gc->clip_y_origin, G_MINSHORT, G_MAXSHORT); -+ rects[i].width = CLAMP (boxes[i].x2 + gc->clip_x_origin, G_MINSHORT, G_MAXSHORT) - rects[i].x; -+ rects[i].height = CLAMP (boxes[i].y2 + gc->clip_y_origin, G_MINSHORT, G_MAXSHORT) - rects[i].y; -+ } -+ XftDrawSetClipRectangles (xft_draw, 0, 0, rects, n_boxes); -+ -+ g_free (rects); -+#else -+ Region xregion = XCreateRegion (); -+ int i; -+ -+ for (i=0; i < n_boxes; i++) -+ { -+ XRectangle rect; -+ -+ rect.x = CLAMP (boxes[i].x1 + gc->clip_x_origin, G_MINSHORT, G_MAXSHORT); -+ rect.y = CLAMP (boxes[i].y1 + gc->clip_y_origin, G_MINSHORT, G_MAXSHORT); -+ rect.width = CLAMP (boxes[i].x2 + gc->clip_x_origin, G_MINSHORT, G_MAXSHORT) - rect.x; -+ rect.height = CLAMP (boxes[i].y2 + gc->clip_y_origin, G_MINSHORT, G_MAXSHORT) - rect.y; -+ -+ XUnionRectWithRegion (&rect, xregion, xregion); -+ } -+ -+ XftDrawSetClip (xft_draw, xregion); -+ XDestroyRegion (xregion); -+#endif -+ } -+ else -+ { -+ XftDrawSetClip (xft_draw, NULL); -+ } -+} -+ - /***************************************************** - * X11 specific implementations of generic functions * - *****************************************************/ -@@ -780,6 +921,45 @@ - } - - static void -+gdk_x11_draw_glyphs (GdkDrawable *drawable, -+ GdkGC *gc, -+ PangoFont *font, -+ gint x, -+ gint y, -+ PangoGlyphString *glyphs) -+{ -+ gdk_x11_draw_glyphs_transformed (drawable, gc, NULL, -+ font, -+ x * PANGO_SCALE, -+ y * PANGO_SCALE, -+ glyphs); -+} -+ -+static void -+gdk_x11_draw_glyphs_transformed (GdkDrawable *drawable, -+ GdkGC *gc, -+ PangoMatrix *matrix, -+ PangoFont *font, -+ gint x, -+ gint y, -+ PangoGlyphString *glyphs) -+{ -+ GdkDrawableImplX11 *impl; -+ PangoRenderer *renderer; -+ -+ impl = GDK_DRAWABLE_IMPL_X11 (drawable); -+ -+ g_return_if_fail (PANGO_XFT_IS_FONT (font)); -+ -+ renderer = _gdk_x11_renderer_get (drawable, gc); -+ if (matrix) -+ pango_renderer_set_matrix (renderer, matrix); -+ pango_renderer_draw_glyphs (renderer, font, glyphs, x, y); -+ if (matrix) -+ pango_renderer_set_matrix (renderer, NULL); -+} -+ -+static void - gdk_x11_draw_image (GdkDrawable *drawable, - GdkGC *gc, - GdkImage *image, -@@ -1444,6 +1624,47 @@ - } - - static void -+gdk_x11_draw_trapezoids (GdkDrawable *drawable, -+ GdkGC *gc, -+ GdkTrapezoid *trapezoids, -+ gint n_trapezoids) -+{ -+ GdkScreen *screen = GDK_DRAWABLE_IMPL_X11 (drawable)->screen; -+ GdkDisplay *display = gdk_screen_get_display (screen); -+ XTrapezoid *xtrapezoids; -+ gint i; -+ -+ if (!_gdk_x11_have_render_with_trapezoids (display)) -+ { -+ GdkDrawable *wrapper = GDK_DRAWABLE_IMPL_X11 (drawable)->wrapper; -+ GDK_DRAWABLE_CLASS (_gdk_drawable_impl_x11_parent_class)->draw_trapezoids (wrapper, gc, -+ trapezoids, n_trapezoids); -+ return; -+ } -+ -+ xtrapezoids = g_new (XTrapezoid, n_trapezoids); -+ -+ for (i = 0; i < n_trapezoids; i++) -+ { -+ xtrapezoids[i].top = XDoubleToFixed (trapezoids[i].y1); -+ xtrapezoids[i].bottom = XDoubleToFixed (trapezoids[i].y2); -+ xtrapezoids[i].left.p1.x = XDoubleToFixed (trapezoids[i].x11); -+ xtrapezoids[i].left.p1.y = XDoubleToFixed (trapezoids[i].y1); -+ xtrapezoids[i].left.p2.x = XDoubleToFixed (trapezoids[i].x12); -+ xtrapezoids[i].left.p2.y = XDoubleToFixed (trapezoids[i].y2); -+ xtrapezoids[i].right.p1.x = XDoubleToFixed (trapezoids[i].x21); -+ xtrapezoids[i].right.p1.y = XDoubleToFixed (trapezoids[i].y1); -+ xtrapezoids[i].right.p2.x = XDoubleToFixed (trapezoids[i].x22); -+ xtrapezoids[i].right.p2.y = XDoubleToFixed (trapezoids[i].y2); -+ } -+ -+ _gdk_x11_drawable_draw_xtrapezoids (drawable, gc, -+ xtrapezoids, n_trapezoids); -+ -+ g_free (xtrapezoids); -+} -+ -+static void - gdk_x11_cairo_surface_destroy (void *data) - { - GdkDrawableImplX11 *impl = data; -@@ -1498,5 +1719,89 @@ - return impl->cairo_surface; - } - -+void -+_gdk_x11_drawable_draw_xtrapezoids (GdkDrawable *drawable, -+ GdkGC *gc, -+ XTrapezoid *xtrapezoids, -+ int n_trapezoids) -+{ -+ GdkScreen *screen = GDK_DRAWABLE_IMPL_X11 (drawable)->screen; -+ GdkDisplay *display = gdk_screen_get_display (screen); -+ GdkDisplayX11 *x11display = GDK_DISPLAY_X11 (display); -+ -+ XftDraw *draw; -+ -+ if (!_gdk_x11_have_render_with_trapezoids (display)) -+ { -+ /* This is the case of drawing the borders of the unknown glyph box -+ * without render on the display, we need to feed it back to -+ * fallback code. Not efficient, but doesn't matter. -+ */ -+ GdkTrapezoid *trapezoids = g_new (GdkTrapezoid, n_trapezoids); -+ int i; -+ -+ for (i = 0; i < n_trapezoids; i++) -+ { -+ trapezoids[i].y1 = XFixedToDouble (xtrapezoids[i].top); -+ trapezoids[i].y2 = XFixedToDouble (xtrapezoids[i].bottom); -+ trapezoids[i].x11 = XFixedToDouble (xtrapezoids[i].left.p1.x); -+ trapezoids[i].x12 = XFixedToDouble (xtrapezoids[i].left.p2.x); -+ trapezoids[i].x21 = XFixedToDouble (xtrapezoids[i].right.p1.x); -+ trapezoids[i].x22 = XFixedToDouble (xtrapezoids[i].right.p2.x); -+ } -+ -+ gdk_x11_draw_trapezoids (drawable, gc, trapezoids, n_trapezoids); -+ g_free (trapezoids); -+ -+ return; -+ } -+ -+ gdk_x11_drawable_update_xft_clip (drawable, gc); -+ draw = gdk_x11_drawable_get_xft_draw (drawable); -+ -+ if (!x11display->mask_format) -+ x11display->mask_format = XRenderFindStandardFormat (x11display->xdisplay, -+ PictStandardA8); -+ -+ XRenderCompositeTrapezoids (x11display->xdisplay, PictOpOver, -+ _gdk_x11_gc_get_fg_picture (gc), -+ XftDrawPicture (draw), -+ x11display->mask_format, -+ - gc->ts_x_origin, - gc->ts_y_origin, -+ xtrapezoids, n_trapezoids); -+} -+ -+void -+_gdk_x11_drawable_draw_xft_glyphs (GdkDrawable *drawable, -+ GdkGC *gc, -+ XftFont *xft_font, -+ XftGlyphSpec *glyphs, -+ gint n_glyphs) -+{ -+ GdkScreen *screen = GDK_DRAWABLE_IMPL_X11 (drawable)->screen; -+ GdkDisplay *display = gdk_screen_get_display (screen); -+ GdkDisplayX11 *x11display = GDK_DISPLAY_X11 (display); -+ XftDraw *draw; -+ -+ gdk_x11_drawable_update_xft_clip (drawable, gc); -+ draw = gdk_x11_drawable_get_xft_draw (drawable); -+ -+ if (_gdk_x11_have_render (display)) -+ { -+ XftGlyphSpecRender (x11display->xdisplay, PictOpOver, -+ _gdk_x11_gc_get_fg_picture (gc), -+ xft_font, -+ XftDrawPicture (draw), -+ - gc->ts_x_origin, - gc->ts_y_origin, -+ glyphs, n_glyphs); -+ } -+ else -+ { -+ XftColor color; -+ -+ _gdk_gc_x11_get_fg_xft_color (gc, &color); -+ XftDrawGlyphSpec (draw, &color, xft_font, glyphs, n_glyphs); -+ } -+} - #define __GDK_DRAWABLE_X11_C__ - #include "gdkaliasdef.c" -Index: gtk+-2.10.6/gdk/x11/gdkdrawable-x11.h -=================================================================== ---- gtk+-2.10.6.orig/gdk/x11/gdkdrawable-x11.h 2006-10-30 12:58:30.000000000 +0000 -+++ gtk+-2.10.6/gdk/x11/gdkdrawable-x11.h 2006-10-30 12:59:30.000000000 +0000 -@@ -33,6 +33,7 @@ - - #include - #include -+#include - - G_BEGIN_DECLS - -@@ -68,6 +69,8 @@ - Window xid; - GdkScreen *screen; - -+ XftDraw *xft_draw; -+ - Picture picture; - cairo_surface_t *cairo_surface; - }; -@@ -92,7 +95,15 @@ - /* Note that the following take GdkDrawableImplX11, not the wrapper drawable */ - void _gdk_x11_drawable_finish (GdkDrawable *drawable); - void _gdk_x11_drawable_update_size (GdkDrawable *drawable); -- -+void _gdk_x11_drawable_draw_xtrapezoids (GdkDrawable *drawable, -+ GdkGC *gc, -+ XTrapezoid *xtrapezoids, -+ int n_trapezoids); -+void _gdk_x11_drawable_draw_xft_glyphs (GdkDrawable *drawable, -+ GdkGC *gc, -+ XftFont *xft_font, -+ XftGlyphSpec *glyphs, -+ gint n_glyphs); - G_END_DECLS - - #endif /* __GDK_DRAWABLE_X11_H__ */ -Index: gtk+-2.10.6/gdk/x11/gdkgc-x11.c -=================================================================== ---- gtk+-2.10.6.orig/gdk/x11/gdkgc-x11.c 2006-10-30 12:58:30.000000000 +0000 -+++ gtk+-2.10.6/gdk/x11/gdkgc-x11.c 2006-10-30 12:59:30.000000000 +0000 -@@ -80,7 +80,10 @@ - gdk_gc_x11_finalize (GObject *object) - { - GdkGCX11 *x11_gc = GDK_GC_X11 (object); -- -+ -+ if (x11_gc->fg_picture != None) -+ XRenderFreePicture (GDK_GC_XDISPLAY (x11_gc), x11_gc->fg_picture); -+ - XFreeGC (GDK_GC_XDISPLAY (x11_gc), GDK_GC_XGC (x11_gc)); - - G_OBJECT_CLASS (_gdk_gc_x11_parent_class)->finalize (object); -@@ -110,7 +113,7 @@ - - private->dirty_mask = 0; - private->have_clip_mask = FALSE; -- -+ - private->screen = GDK_DRAWABLE_IMPL_X11 (drawable)->screen; - - private->depth = gdk_drawable_get_depth (drawable); -@@ -339,6 +342,18 @@ - } - - static void -+clear_fg_picture (GdkGC *gc) -+{ -+ GdkGCX11 *x11_gc = GDK_GC_X11 (gc); -+ -+ if (x11_gc->fg_picture != None) -+ { -+ XRenderFreePicture (GDK_GC_XDISPLAY (x11_gc), x11_gc->fg_picture); -+ x11_gc->fg_picture = None; -+ } -+} -+ -+static void - gdk_x11_gc_set_values (GdkGC *gc, - GdkGCValues *values, - GdkGCValuesMask values_mask) -@@ -367,6 +382,29 @@ - x11_gc->have_clip_mask = values->clip_mask != NULL; - } - -+ if (values_mask & GDK_GC_BACKGROUND) -+ { -+ if (_gdk_gc_get_fill (gc) == GDK_OPAQUE_STIPPLED) -+ clear_fg_picture (gc); -+ } -+ -+ if (values_mask & GDK_GC_FILL) -+ { -+ clear_fg_picture (gc); -+ } -+ -+ if (values_mask & GDK_GC_STIPPLE) -+ { -+ if (_gdk_gc_get_fill (gc) == GDK_STIPPLED || _gdk_gc_get_fill (gc) == GDK_OPAQUE_STIPPLED) -+ clear_fg_picture (gc); -+ } -+ -+ if (values_mask & GDK_GC_TILE) -+ { -+ if (_gdk_gc_get_fill (gc) == GDK_TILED) -+ clear_fg_picture (gc); -+ } -+ - gdk_x11_gc_values_to_xvalues (values, values_mask, &xvalues, &xvalues_mask); - - XChangeGC (GDK_GC_XDISPLAY (gc), -@@ -642,6 +680,8 @@ - x11_dst_gc->dirty_mask = x11_src_gc->dirty_mask; - x11_dst_gc->have_clip_region = x11_src_gc->have_clip_region; - x11_dst_gc->have_clip_mask = x11_src_gc->have_clip_mask; -+ -+ clear_fg_picture (dst_gc); - } - - /** -@@ -701,5 +741,359 @@ - return gc_x11->xgc; - } - -+/* Various bits of the below are roughly cribbed from XFree86 -+ * lib/Xft/xftdraw.c, Copyright 2000, Keith Packard -+ */ -+ -+static XRenderPictFormat * -+foreground_format (GdkGC *gc) -+{ -+ XRenderPictFormat pf; -+ -+ pf.type = PictTypeDirect; -+ pf.depth = 32; -+ pf.direct.redMask = 0xff; -+ pf.direct.greenMask = 0xff; -+ pf.direct.blueMask = 0xff; -+ pf.direct.alphaMask = 0xff; -+ -+ return XRenderFindFormat (GDK_GC_XDISPLAY (gc), -+ (PictFormatType | -+ PictFormatDepth | -+ PictFormatRedMask | -+ PictFormatGreenMask | -+ PictFormatBlueMask | -+ PictFormatAlphaMask), -+ &pf, -+ 0); -+} -+ -+static Picture -+make_fg_tile_picture (GdkGC *gc) -+{ -+ GdkGCX11 *x11_gc = GDK_GC_X11 (gc); -+ GdkVisual *visual = gdk_drawable_get_visual (_gdk_gc_get_tile (gc)); -+ XRenderPictFormat *format = NULL; -+ -+ if (visual) -+ { -+ format = XRenderFindVisualFormat (GDK_GC_XDISPLAY (gc), -+ GDK_VISUAL_XVISUAL (visual)); -+ } -+ else if (x11_gc->depth == 1) -+ { -+ format = XRenderFindStandardFormat (GDK_GC_XDISPLAY (gc), -+ PictStandardA1); -+ } -+ -+ if (format) -+ { -+ XRenderPictureAttributes pa; -+ pa.repeat = True; -+ -+ retur