aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/gtk+
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/gtk+
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
downloadopenembedded-709c4d66e0b107ca606941b988bad717c0b45d9b.tar.gz
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/gtk+')
-rw-r--r--recipes/gtk+/composite-pixbuf_0.0.bb18
-rw-r--r--recipes/gtk+/files/directfb-pixbuf-deprecated-fix.patch34
-rw-r--r--recipes/gtk+/files/filesel-fix-segfault.patch19
-rw-r--r--recipes/gtk+/files/gtklabel-resize-patch10
-rw-r--r--recipes/gtk+/files/lower-quality-scaling-in-pixbuf-engine.patch13
-rw-r--r--recipes/gtk+/files/migration.patch619
-rw-r--r--recipes/gtk+/files/xsettings.patch16
-rw-r--r--recipes/gtk+/gdk-pixbuf-csource-native_2.12.11.bb33
-rw-r--r--recipes/gtk+/gdk-pixbuf-csource/reduce-dependencies.patch221
-rw-r--r--recipes/gtk+/gdk-pixbuf_2.10.14.bb66
-rw-r--r--recipes/gtk+/gtk+-1.2-1.2.10/gtk+1.2-reconf-fix689
-rw-r--r--recipes/gtk+/gtk+-1.2-1.2.10/no-xwc267
-rw-r--r--recipes/gtk+/gtk+-1.2-1.2.10/timezone-fix.patch15
-rw-r--r--recipes/gtk+/gtk+-1.2_1.2.10.bb58
-rw-r--r--recipes/gtk+/gtk+-2.10.14/automake-lossage.patch24
-rw-r--r--recipes/gtk+/gtk+-2.10.14/cell-renderer-edit-focus.patch30
-rw-r--r--recipes/gtk+/gtk+-2.10.14/combo-arrow-size.patch66
-rw-r--r--recipes/gtk+/gtk+-2.10.14/disable-print.patch50
-rw-r--r--recipes/gtk+/gtk+-2.10.14/disable-tooltips.patch11
-rw-r--r--recipes/gtk+/gtk+-2.10.14/gnome-bug-341177.patch217
-rw-r--r--recipes/gtk+/gtk+-2.10.14/gtk+-handhelds.patch149
-rw-r--r--recipes/gtk+/gtk+-2.10.14/hardcoded_libtool.patch29
-rw-r--r--recipes/gtk+/gtk+-2.10.14/integer-pixops.patch348
-rw-r--r--recipes/gtk+/gtk+-2.10.14/menu-deactivate.patch51
-rw-r--r--recipes/gtk+/gtk+-2.10.14/migration.patch611
-rw-r--r--recipes/gtk+/gtk+-2.10.14/no-demos.patch10
-rw-r--r--recipes/gtk+/gtk+-2.10.14/no-xwc.patch151
-rw-r--r--recipes/gtk+/gtk+-2.10.14/plana-pixops.patch569
-rw-r--r--recipes/gtk+/gtk+-2.10.14/range-no-redraw.patch41
-rw-r--r--recipes/gtk+/gtk+-2.10.14/run-iconcache.patch19
-rw-r--r--recipes/gtk+/gtk+-2.10.14/scroll-timings.patch11
-rw-r--r--recipes/gtk+/gtk+-2.10.14/scrolled-placement.patch35
-rw-r--r--recipes/gtk+/gtk+-2.10.14/single-click.patch56
-rw-r--r--recipes/gtk+/gtk+-2.10.14/small-gtkfilechooser.patch222
-rw-r--r--recipes/gtk+/gtk+-2.10.14/small-gtkfilesel.patch267
-rw-r--r--recipes/gtk+/gtk+-2.10.14/spinbutton.patch130
-rw-r--r--recipes/gtk+/gtk+-2.10.14/toggle-font.diff100
-rw-r--r--recipes/gtk+/gtk+-2.10.14/treeview-checkbox-size.patch100
-rw-r--r--recipes/gtk+/gtk+-2.12.0/cellrenderer-cairo.patch32
-rw-r--r--recipes/gtk+/gtk+-2.12.0/combo-arrow-size.patch67
-rw-r--r--recipes/gtk+/gtk+-2.12.0/disable-print.patch26
-rw-r--r--recipes/gtk+/gtk+-2.12.0/entry-cairo.patch103
-rw-r--r--recipes/gtk+/gtk+-2.12.0/hardcoded_libtool.patch29
-rw-r--r--recipes/gtk+/gtk+-2.12.0/menu-deactivate.patch51
-rw-r--r--recipes/gtk+/gtk+-2.12.0/no-demos.patch10
-rw-r--r--recipes/gtk+/gtk+-2.12.0/pangoxft2.10.6.diff2456
-rw-r--r--recipes/gtk+/gtk+-2.12.0/range-no-redraw.patch127
-rw-r--r--recipes/gtk+/gtk+-2.12.0/run-iconcache.patch19
-rw-r--r--recipes/gtk+/gtk+-2.12.0/scrolled-placement.patch22
-rw-r--r--recipes/gtk+/gtk+-2.12.0/toggle-font.diff100
-rw-r--r--recipes/gtk+/gtk+-2.12.11/cellrenderer-cairo.patch32
-rw-r--r--recipes/gtk+/gtk+-2.12.11/combo-arrow-size.patch67
-rw-r--r--recipes/gtk+/gtk+-2.12.11/disable-print.patch26
-rw-r--r--recipes/gtk+/gtk+-2.12.11/entry-cairo.patch103
-rw-r--r--recipes/gtk+/gtk+-2.12.11/hardcoded_libtool.patch29
-rw-r--r--recipes/gtk+/gtk+-2.12.11/menu-deactivate.patch51
-rw-r--r--recipes/gtk+/gtk+-2.12.11/no-demos.patch10
-rw-r--r--recipes/gtk+/gtk+-2.12.11/pangoxft2.10.6.diff2456
-rw-r--r--recipes/gtk+/gtk+-2.12.11/range-no-redraw.patch127
-rw-r--r--recipes/gtk+/gtk+-2.12.11/run-iconcache.patch19
-rw-r--r--recipes/gtk+/gtk+-2.12.11/scrolled-placement.patch22
-rw-r--r--recipes/gtk+/gtk+-2.12.11/toggle-font.diff100
-rw-r--r--recipes/gtk+/gtk+-2.12.3/cellrenderer-cairo.patch32
-rw-r--r--recipes/gtk+/gtk+-2.12.3/combo-arrow-size.patch67
-rw-r--r--recipes/gtk+/gtk+-2.12.3/disable-print.patch26
-rw-r--r--recipes/gtk+/gtk+-2.12.3/entry-cairo.patch103
-rw-r--r--recipes/gtk+/gtk+-2.12.3/hardcoded_libtool.patch29
-rw-r--r--recipes/gtk+/gtk+-2.12.3/menu-deactivate.patch51
-rw-r--r--recipes/gtk+/gtk+-2.12.3/no-demos.patch10
-rw-r--r--recipes/gtk+/gtk+-2.12.3/pangoxft2.10.6.diff2456
-rw-r--r--recipes/gtk+/gtk+-2.12.3/range-no-redraw.patch127
-rw-r--r--recipes/gtk+/gtk+-2.12.3/run-iconcache.patch19
-rw-r--r--recipes/gtk+/gtk+-2.12.3/scrolled-placement.patch22
-rw-r--r--recipes/gtk+/gtk+-2.12.3/toggle-font.diff100
-rw-r--r--recipes/gtk+/gtk+-2.14.1/hardcoded_libtool.patch29
-rw-r--r--recipes/gtk+/gtk+-2.14.1/no-demos.patch10
-rw-r--r--recipes/gtk+/gtk+-2.14.1/run-iconcache.patch19
-rw-r--r--recipes/gtk+/gtk+-2.14.1/toggle-font.diff100
-rw-r--r--recipes/gtk+/gtk+-2.14.2/hardcoded_libtool.patch31
-rw-r--r--recipes/gtk+/gtk+-2.14.2/no-demos.patch10
-rw-r--r--recipes/gtk+/gtk+-2.14.2/run-iconcache.patch19
-rw-r--r--recipes/gtk+/gtk+-2.14.2/smallscreen_filechooser.patch235
-rw-r--r--recipes/gtk+/gtk+-2.14.2/toggle-font.diff100
-rw-r--r--recipes/gtk+/gtk+-2.6.10/automake-lossage.patch24
-rw-r--r--recipes/gtk+/gtk+-2.6.10/compile-against-newer-glib.patch49
-rw-r--r--recipes/gtk+/gtk+-2.6.10/disable-tooltips.patch11
-rw-r--r--recipes/gtk+/gtk+-2.6.10/gtk+-2.6.10-bg.patch20
-rw-r--r--recipes/gtk+/gtk+-2.6.10/gtk+-handhelds.patch236
-rwxr-xr-xrecipes/gtk+/gtk+-2.6.10/gtk.keynav.gtkcombobox.patch238
-rwxr-xr-xrecipes/gtk+/gtk+-2.6.10/gtk.keynav.gtkentry.patch16
-rwxr-xr-xrecipes/gtk+/gtk+-2.6.10/gtk.keynav.gtkiconview.patch91
-rwxr-xr-xrecipes/gtk+/gtk+-2.6.10/gtk.keynav.gtkradiobutton.patch32
-rwxr-xr-xrecipes/gtk+/gtk+-2.6.10/gtk.keynav.gtksettings.patch38
-rwxr-xr-xrecipes/gtk+/gtk+-2.6.10/gtk.keynav.gtktextview.patch25
-rwxr-xr-xrecipes/gtk+/gtk+-2.6.10/gtk.keynav.gtktreeview.patch121
-rwxr-xr-xrecipes/gtk+/gtk+-2.6.10/gtk.keynav.gtkwidget.patch127
-rw-r--r--recipes/gtk+/gtk+-2.6.10/hardcoded_libtool.patch29
-rw-r--r--recipes/gtk+/gtk+-2.6.10/help.patch158
-rw-r--r--recipes/gtk+/gtk+-2.6.10/menu-deactivate.patch50
-rw-r--r--recipes/gtk+/gtk+-2.6.10/menu-styling.patch22
-rw-r--r--recipes/gtk+/gtk+-2.6.10/no-demos.patch10
-rw-r--r--recipes/gtk+/gtk+-2.6.10/no-xwc.patch151
-rw-r--r--recipes/gtk+/gtk+-2.6.10/scroll-timings.patch15
-rw-r--r--recipes/gtk+/gtk+-2.6.10/single-click.patch54
-rw-r--r--recipes/gtk+/gtk+-2.6.10/small-gtkfilesel.patch267
-rw-r--r--recipes/gtk+/gtk+-2.6.10/spinbutton.patch128
-rw-r--r--recipes/gtk+/gtk+-2.8.16/automake-lossage.patch24
-rw-r--r--recipes/gtk+/gtk+-2.8.16/disable-tooltips.patch11
-rw-r--r--recipes/gtk+/gtk+-2.8.16/gtk+-handhelds.patch264
-rw-r--r--recipes/gtk+/gtk+-2.8.16/gtktreeview-316689.patch25
-rw-r--r--recipes/gtk+/gtk+-2.8.16/hardcoded_libtool.patch29
-rw-r--r--recipes/gtk+/gtk+-2.8.16/menu-deactivate.patch50
-rw-r--r--recipes/gtk+/gtk+-2.8.16/no-demos.patch10
-rw-r--r--recipes/gtk+/gtk+-2.8.16/no-xwc.patch179
-rw-r--r--recipes/gtk+/gtk+-2.8.16/scroll-timings.patch15
-rw-r--r--recipes/gtk+/gtk+-2.8.16/single-click.patch36
-rw-r--r--recipes/gtk+/gtk+-2.8.16/small-gtkfilesel.patch267
-rw-r--r--recipes/gtk+/gtk+-2.8.16/spinbutton.patch128
-rw-r--r--recipes/gtk+/gtk+-2.8.9/automake-lossage.patch24
-rw-r--r--recipes/gtk+/gtk+-2.8.9/disable-tooltips.patch11
-rw-r--r--recipes/gtk+/gtk+-2.8.9/gtk+-handhelds.patch264
-rw-r--r--recipes/gtk+/gtk+-2.8.9/hardcoded_libtool.patch29
-rw-r--r--recipes/gtk+/gtk+-2.8.9/menu-deactivate.patch50
-rw-r--r--recipes/gtk+/gtk+-2.8.9/no-demos.patch10
-rw-r--r--recipes/gtk+/gtk+-2.8.9/no-xwc.patch151
-rw-r--r--recipes/gtk+/gtk+-2.8.9/scroll-timings.patch15
-rw-r--r--recipes/gtk+/gtk+-2.8.9/single-click.patch36
-rw-r--r--recipes/gtk+/gtk+-2.8.9/small-gtkfilesel.patch267
-rw-r--r--recipes/gtk+/gtk+-2.8.9/spinbutton.patch128
-rw-r--r--recipes/gtk+/gtk+-fastscaling_2.10.14.bb14
-rw-r--r--recipes/gtk+/gtk+-native-1.2_1.2.10.bb58
-rw-r--r--recipes/gtk+/gtk+.inc70
-rw-r--r--recipes/gtk+/gtk+_2.10.14.bb33
-rw-r--r--recipes/gtk+/gtk+_2.12.0.bb49
-rw-r--r--recipes/gtk+/gtk+_2.12.11.bb48
-rw-r--r--recipes/gtk+/gtk+_2.12.3.bb48
-rw-r--r--recipes/gtk+/gtk+_2.14.1.bb42
-rw-r--r--recipes/gtk+/gtk+_2.14.2.bb48
-rw-r--r--recipes/gtk+/gtk+_2.6.10.bb115
-rw-r--r--recipes/gtk+/gtk+_2.8.16.bb99
-rw-r--r--recipes/gtk+/gtk+_2.8.9.bb96
-rw-r--r--recipes/gtk+/gtk-2.10.inc89
-rw-r--r--recipes/gtk+/gtk-fpu.inc6
-rw-r--r--recipes/gtk+/pixops-test.bb25
-rw-r--r--recipes/gtk+/pixops-test/gtk-logo-rgb.gifbin0 -> 6459 bytes
-rw-r--r--recipes/gtk+/pixops-test/pixops-test.c69
146 files changed, 19898 insertions, 0 deletions
diff --git a/recipes/gtk+/composite-pixbuf_0.0.bb b/recipes/gtk+/composite-pixbuf_0.0.bb
new file mode 100644
index 0000000000..729343fb44
--- /dev/null
+++ b/recipes/gtk+/composite-pixbuf_0.0.bb
@@ -0,0 +1,18 @@
+DESCRIPTION = "Pixbuf performance test"
+LICENSE = "Public domain"
+DEPENDS = "gtk+"
+
+SRC_URI = "http://amelang.net/composite_pixbuf.c"
+
+S = "${WORKDIR}"
+
+do_compile() {
+ ${CC} ${CFLAGS} composite_pixbuf.c -o composite_pixbuf \
+ `pkg-config --cflags gdk-2.0` `pkg-config --libs gdk-2.0` `pkg-config --libs x11` `pkg-config --libs pango` \
+ -lxcb -lXext -lXinerama -lXrandr -lXcursor -lXfixes -lpangoft2-1.0 -lz -lexpat -lxcb-xlib -lXau -lXdmcp
+}
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 755 composite_pixbuf ${D}${bindir}
+}
diff --git a/recipes/gtk+/files/directfb-pixbuf-deprecated-fix.patch b/recipes/gtk+/files/directfb-pixbuf-deprecated-fix.patch
new file mode 100644
index 0000000000..2def90f7e4
--- /dev/null
+++ b/recipes/gtk+/files/directfb-pixbuf-deprecated-fix.patch
@@ -0,0 +1,34 @@
+--- gtk+-2.10.14/gdk/directfb/Makefile.am.orig 2007-07-16 15:46:15.000000000 -0400
++++ gtk+-2.10.14/gdk/directfb/Makefile.am 2007-09-24 15:12:14.000000000 -0400
+@@ -8,7 +8,6 @@
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/gdk \
+ -I$(top_builddir)/gdk \
+- -DG_DISABLE_DEPRECATED \
+ @GTK_DEBUG_FLAGS@ \
+ @GDK_DEP_CFLAGS@
+
+--- gtk+-2.10.14/gdk/quartz/Makefile.am.orig 2007-07-16 15:46:18.000000000 -0400
++++ gtk+-2.10.14/gdk/quartz/Makefile.am 2007-09-24 15:12:28.000000000 -0400
+@@ -7,7 +7,6 @@
+ -I$(top_srcdir)/gdk \
+ -I$(top_builddir)/gdk \
+ -DGDK_PIXBUF_DISABLE_DEPRECATED \
+- -DGDK_DISABLE_DEPRECATED \
+ $(GTK_DEBUG_FLAGS) \
+ $(GDK_DEP_CFLAGS) \
+ "-xobjective-c"
+
+diff -ur gtk+-2.10.9~org/gdk-pixbuf/pixops/Makefile.am gtk+-2.10.9/gdk-pixbuf/pixops/Makefile.am
+--- gtk+-2.10.9~org/gdk-pixbuf/pixops/Makefile.am 2007-03-18 00:02:40.000000000 -0400
++++ gtk+-2.10.9/gdk-pixbuf/pixops/Makefile.am 2007-03-18 10:25:06.000000000 -0400
+@@@ -3,8 +3,7 @@
+ INCLUDES = \
+ -I$(top_srcdir) -I$(top_builddir) \
+ $(GTK_DEBUG_FLAGS) \
+- $(GDK_PIXBUF_DEP_CFLAGS) \
+- -DGDK_PIXBUF_DISABLE_DEPRECATED
++ $(GDK_PIXBUF_DEP_CFLAGS)
+
+ noinst_PROGRAMS = timescale
+
diff --git a/recipes/gtk+/files/filesel-fix-segfault.patch b/recipes/gtk+/files/filesel-fix-segfault.patch
new file mode 100644
index 0000000000..7b37d4bb2e
--- /dev/null
+++ b/recipes/gtk+/files/filesel-fix-segfault.patch
@@ -0,0 +1,19 @@
+--- gtk+-2.10.12_/gtk/gtkfilesel.c 2007-06-12 14:00:38.000000000 +0200
++++ gtk+-2.10.12/gtk/gtkfilesel.c 2007-06-12 14:40:32.000000000 +0200
+@@ -2444,9 +2444,13 @@
+
+ if (!is_file)
+ {
+- gtk_file_selection_dir_activate (tree_view, path,
+- gtk_tree_view_get_column (tree_view, DIR_COLUMN),
+- user_data);
++ fs->last_selected = g_strdup (g_ptr_array_index (new_names, index));
++ gtk_file_selection_dir_activate (tree_view, path,
++ gtk_tree_view_get_column (tree_view, DIR_COLUMN),
++ user_data);
++ gtk_tree_path_free (path);
++ return;
++
+ }
+
+ gtk_tree_path_free (path);
diff --git a/recipes/gtk+/files/gtklabel-resize-patch b/recipes/gtk+/files/gtklabel-resize-patch
new file mode 100644
index 0000000000..df29656343
--- /dev/null
+++ b/recipes/gtk+/files/gtklabel-resize-patch
@@ -0,0 +1,10 @@
+--- 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/recipes/gtk+/files/lower-quality-scaling-in-pixbuf-engine.patch b/recipes/gtk+/files/lower-quality-scaling-in-pixbuf-engine.patch
new file mode 100644
index 0000000000..6cf1c14991
--- /dev/null
+++ b/recipes/gtk+/files/lower-quality-scaling-in-pixbuf-engine.patch
@@ -0,0 +1,13 @@
+Index: gtk+-2.6.10/modules/engines/pixbuf/pixbuf-render.c
+===================================================================
+--- gtk+-2.6.10.orig/modules/engines/pixbuf/pixbuf-render.c 2005-08-18 14:11:00.000000000 +0000
++++ gtk+-2.6.10/modules/engines/pixbuf/pixbuf-render.c 2007-05-24 11:16:50.000000000 +0000
+@@ -407,7 +407,7 @@
+ 0, 0, rect.width, rect.height,
+ dest_x - rect.x, dest_y - rect.y,
+ x_scale, y_scale,
+- GDK_INTERP_BILINEAR);
++ GDK_INTERP_NEAREST);
+
+ g_object_unref (partial_src);
+
diff --git a/recipes/gtk+/files/migration.patch b/recipes/gtk+/files/migration.patch
new file mode 100644
index 0000000000..f4c7f853ad
--- /dev/null
+++ b/recipes/gtk+/files/migration.patch
@@ -0,0 +1,619 @@
+Index: configure.in
+===================================================================
+RCS file: /cvs/gnome/gtk+/configure.in,v
+retrieving revision 1.419.2.4
+diff -u -r1.419.2.4 configure.in
+--- configure.in 8 Feb 2005 21:39:42 -0000 1.419.2.4
++++ configure.in 27 Feb 2005 13:10:16 -0000
+@@ -1495,6 +1495,16 @@
+ GTK_DEP_LIBS="$GDK_EXTRA_LIBS $GTK_DEP_LIBS_FOR_X `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GTK_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
+ GTK_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS"
+
++AC_ARG_ENABLE(display-migration,
++ [AC_HELP_STRING([--enable-display-migration],
++ [include support for GPE_CHANGE_DISPLAY protocol])],
++ enable_migration=yes, enable_migration=no)
++if test "$enable_migration" = "yes"; then
++ AC_DEFINE([ENABLE_MIGRATION], 1, [Define if display migration is enabled])
++ GTK_DEP_LIBS="$GTK_DEP_LIBS -lgcrypt"
++fi
++AM_CONDITIONAL(ENABLE_MIGRATION, test $enable_migration = "yes")
++
+ AC_SUBST(GTK_PACKAGES)
+ AC_SUBST(GTK_EXTRA_LIBS)
+ AC_SUBST(GTK_EXTRA_CFLAGS)
+Index: gtk/Makefile.am
+===================================================================
+RCS file: /cvs/gnome/gtk+/gtk/Makefile.am,v
+retrieving revision 1.266.2.1
+diff -u -r1.266.2.1 Makefile.am
+--- gtk/Makefile.am 13 Jan 2005 15:18:21 -0000 1.266.2.1
++++ gtk/Makefile.am 27 Feb 2005 13:10:17 -0000
+@@ -520,6 +520,10 @@
+ gtkwindow.c \
+ xembed.h
+
++if ENABLE_MIGRATION
++gtk_c_sources += gtkmigration.c
++endif
++
+ if OS_UNIX
+ gtk_private_h_sources += gtkfilesystemunix.h
+ gtk_c_sources += gtkfilesystemunix.c
+Index: gtk/gtkmain.c
+===================================================================
+RCS file: /cvs/gnome/gtk+/gtk/gtkmain.c,v
+retrieving revision 1.255
+diff -u -r1.255 gtkmain.c
+--- gtk/gtkmain.c 27 Dec 2004 05:25:15 -0000 1.255
++++ gtk/gtkmain.c 27 Feb 2005 13:10:19 -0000
+@@ -491,6 +491,10 @@
+ _gtk_accel_map_init ();
+ _gtk_rc_init ();
+
++#ifdef ENABLE_MIGRATION
++ gtk_migration_init ();
++#endif
++
+ /* Set the 'initialized' flag.
+ */
+ gtk_initialized = TRUE;
+Index: gtk/gtkwindow.c
+===================================================================
+RCS file: /cvs/gnome/gtk+/gtk/gtkwindow.c,v
+retrieving revision 1.281.2.4
+diff -u -r1.281.2.4 gtkwindow.c
+--- gtk/gtkwindow.c 21 Feb 2005 04:21:49 -0000 1.281.2.4
++++ gtk/gtkwindow.c 27 Feb 2005 13:10:56 -0000
+@@ -731,6 +731,8 @@
+ add_tab_bindings (binding_set, GDK_CONTROL_MASK | GDK_SHIFT_MASK, GTK_DIR_TAB_BACKWARD);
+ }
+
++extern void gtk_migration_mark_window (GtkWidget *w);
++
+ static void
+ gtk_window_init (GtkWindow *window)
+ {
+@@ -790,6 +792,10 @@
+ "event",
+ G_CALLBACK (gtk_window_event),
+ NULL);
++
++#ifdef ENABLE_MIGRATION
++ gtk_migration_mark_window (window);
++#endif
+ }
+
+ static void
+--- /dev/null 2005-02-20 01:07:50.714416160 +0000
++++ gtk/gtkmigration.c 2005-02-27 15:05:04.052757352 +0000
+@@ -0,0 +1,529 @@
++/*
++ * Copyright (C) 2003, 2005 Philip Blundell <philb@gnu.org>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version
++ * 2 of the License, or (at your option) any later version.
++ */
++
++#include <stdlib.h>
++#include <ctype.h>
++#include <libintl.h>
++#include <string.h>
++#include <assert.h>
++
++#include <X11/X.h>
++#include <X11/Xlib.h>
++#include <X11/Xatom.h>
++
++#include <gcrypt.h>
++
++#include "gtk.h"
++#include "gdk.h"
++#include "x11/gdkx.h"
++
++#define _(x) gettext(x)
++
++static GdkAtom string_gdkatom, display_change_gdkatom;
++static GdkAtom rsa_challenge_gdkatom;
++
++#define DISPLAY_CHANGE_SUCCESS 0
++#define DISPLAY_CHANGE_UNABLE_TO_CONNECT 1
++#define DISPLAY_CHANGE_NO_SUCH_SCREEN 2
++#define DISPLAY_CHANGE_AUTHENTICATION_BAD 3
++#define DISPLAY_CHANGE_INDETERMINATE_ERROR 4
++
++static gboolean no_auth;
++
++static GSList *all_widgets;
++
++static gboolean gtk_migration_initialised;
++
++#define CHALLENGE_LEN 64
++
++gchar *gtk_migration_auth_challenge_string;
++
++static unsigned char challenge_bytes[CHALLENGE_LEN];
++static unsigned long challenge_seq;
++
++#define hexbyte(x) ((x) >= 10 ? (x) + 'a' - 10 : (x) + '0')
++
++struct rsa_key
++{
++ gcry_mpi_t n, e, d, p, q, u;
++};
++
++static gcry_mpi_t
++mpi_from_sexp (gcry_sexp_t r, char *tag)
++{
++ gcry_sexp_t s = gcry_sexp_find_token (r, tag, 0);
++ return gcry_sexp_nth_mpi (s, 1, GCRYMPI_FMT_USG);
++}
++
++static char *
++hex_from_mpi (gcry_mpi_t m)
++{
++ char *buf;
++ gcry_mpi_aprint (GCRYMPI_FMT_HEX, (void *)&buf, NULL, m);
++ return buf;
++}
++
++static void
++gtk_migration_crypt_create_hash (char *display, char *challenge, size_t len, char *result)
++{
++ size_t dlen = strlen (display);
++ gchar *buf = g_malloc (dlen + 1 + len);
++ strcpy (buf, display);
++ memcpy (buf + dlen + 1, challenge, len);
++ gcry_md_hash_buffer (GCRY_MD_SHA1, result, buf, len + dlen + 1);
++ g_free (buf);
++}
++
++static int
++do_encode_md (const unsigned char *digest, size_t digestlen, int algo,
++ unsigned int nbits, gcry_mpi_t *r_val)
++{
++ int nframe = (nbits+7) / 8;
++ unsigned char *frame;
++ int i, n;
++ unsigned char asn[100];
++ size_t asnlen;
++
++ asnlen = sizeof(asn);
++ if (gcry_md_algo_info (algo, GCRYCTL_GET_ASNOID, asn, &asnlen))
++ return -1;
++
++ if (digestlen + asnlen + 4 > nframe )
++ return -1;
++
++ /* We encode the MD in this way:
++ *
++ * 0 1 PAD(n bytes) 0 ASN(asnlen bytes) MD(len bytes)
++ *
++ * PAD consists of FF bytes.
++ */
++ frame = g_malloc (nframe);
++ n = 0;
++ frame[n++] = 0;
++ frame[n++] = 1; /* block type */
++ i = nframe - digestlen - asnlen -3 ;
++ assert ( i > 1 );
++ memset ( frame+n, 0xff, i ); n += i;
++ frame[n++] = 0;
++ memcpy ( frame+n, asn, asnlen ); n += asnlen;
++ memcpy ( frame+n, digest, digestlen ); n += digestlen;
++ assert ( n == nframe );
++
++ gcry_mpi_scan (r_val, GCRYMPI_FMT_USG, frame, nframe, &nframe);
++ g_free (frame);
++ return 0;
++}
++
++static gboolean
++gtk_migration_crypt_check_signature (struct rsa_key *k, char *hash, char *sigbuf)
++{
++ gcry_mpi_t mpi, mpi2;
++ gcry_sexp_t data, sig, key;
++ int rc;
++
++ do_encode_md (hash, 20, GCRY_MD_SHA1, 1024, &mpi);
++
++ gcry_sexp_build (&data, NULL, "(data (value %m))", mpi);
++
++ gcry_mpi_release (mpi);
++
++ gcry_sexp_build (&key, NULL, "(public-key (rsa (n %m) (e %m)))", k->n, k->e);
++
++ if (gcry_mpi_scan (&mpi2, GCRYMPI_FMT_HEX, sigbuf, 0, NULL))
++ {
++ gcry_sexp_release (data);
++ return FALSE;
++ }
++
++ gcry_sexp_build (&sig, NULL, "(sig-val (rsa (s %m)))", mpi2);
++
++ rc = gcry_pk_verify (sig, data, key);
++
++ gcry_sexp_release (data);
++ gcry_sexp_release (key);
++ gcry_sexp_release (sig);
++ gcry_mpi_release (mpi2);
++
++ if (rc)
++ return FALSE;
++
++ return TRUE;
++}
++
++static void
++gtk_migration_auth_update_challenge (void)
++{
++ int i;
++ unsigned char *p;
++
++ if (gtk_migration_auth_challenge_string == NULL)
++ gtk_migration_auth_challenge_string = g_malloc ((CHALLENGE_LEN * 2) + 9);
++
++ p = gtk_migration_auth_challenge_string;
++
++ for (i = 0; i < CHALLENGE_LEN; i++)
++ {
++ *p++ = hexbyte (challenge_bytes[i] >> 4);
++ *p++ = hexbyte (challenge_bytes[i] & 15);
++ }
++
++ sprintf (p, "%08lx", challenge_seq++);
++}
++
++static void
++gtk_migration_auth_generate_challenge (void)
++{
++ gcry_randomize (challenge_bytes, sizeof (challenge_bytes), GCRY_STRONG_RANDOM);
++ gtk_migration_auth_update_challenge ();
++}
++
++static struct rsa_key *
++parse_pubkey (char *s)
++{
++ struct rsa_key *r;
++ gcry_mpi_t n, e;
++ gchar *sp;
++
++ sp = strtok (s, " \n");
++ gcry_mpi_scan (&e, GCRYMPI_FMT_HEX, sp, 0, NULL);
++ sp = strtok (NULL, " \n");
++ gcry_mpi_scan (&n, GCRYMPI_FMT_HEX, sp, 0, NULL);
++
++ r = g_malloc0 (sizeof (struct rsa_key));
++ r->e = e;
++ r->n = n;
++ return r;
++}
++
++static struct rsa_key *
++lookup_pubkey (u_int32_t id)
++{
++ const gchar *home_dir = g_get_home_dir ();
++ gchar *filename = g_strdup_printf ("%s/.gpe/migrate/public", home_dir);
++ FILE *fp = fopen (filename, "r");
++ struct rsa_key *r = NULL;
++
++ if (fp)
++ {
++ while (!feof (fp))
++ {
++ char buffer[4096];
++ if (fgets (buffer, 4096, fp))
++ {
++ char *p;
++ u_int32_t this_id = strtoul (buffer, &p, 16);
++ if (p != buffer && *p == ' ')
++ {
++#ifdef DEBUG
++ fprintf (stderr, "found id %x\n", this_id);
++#endif
++ if (this_id == id)
++ {
++ r = parse_pubkey (++p);
++ break;
++ }
++ }
++ }
++ }
++ fclose (fp);
++ }
++
++ g_free (filename);
++ return r;
++}
++
++static void
++free_pubkey (struct rsa_key *k)
++{
++ gcry_mpi_release (k->n);
++ gcry_mpi_release (k->e);
++
++ g_free (k);
++}
++
++static gboolean
++gtk_migration_auth_validate_request (char *display, char *data)
++{
++ u_int32_t key_id;
++ char *ep;
++ char *p;
++ struct rsa_key *k;
++ char hash[20];
++ gboolean rc;
++
++ p = strchr (data, ' ');
++ if (p == NULL)
++ return FALSE;
++ *p++ = 0;
++
++ key_id = strtoul (data, &ep, 16);
++ if (*ep)
++ return FALSE;
++
++ k = lookup_pubkey (key_id);
++ if (k == NULL)
++ return FALSE;
++
++ gtk_migration_crypt_create_hash (display, gtk_migration_auth_challenge_string,
++ strlen (gtk_migration_auth_challenge_string), hash);
++
++ rc = gtk_migration_crypt_check_signature (k, hash, p);
++
++ free_pubkey (k);
++
++ return rc;
++}
++
++static int
++do_change_display (GtkWidget *w, char *display_name)
++{
++ GdkDisplay *newdisplay;
++ guint screen_nr = 1;
++ guint i;
++
++ if (display_name[0] == 0)
++ return DISPLAY_CHANGE_INDETERMINATE_ERROR;
++
++ i = strlen (display_name) - 1;
++ while (i > 0 && isdigit (display_name[i]))
++ i--;
++
++ if (display_name[i] == '.')
++ {
++ screen_nr = atoi (display_name + i + 1);
++ display_name[i] = 0;
++ }
++
++ newdisplay = gdk_display_open (display_name);
++ if (newdisplay)
++ {
++ GdkScreen *screen = gdk_display_get_screen (newdisplay, screen_nr);
++ if (screen)
++ {
++ gtk_window_set_screen (GTK_WINDOW (w), screen);
++ gdk_display_manager_set_default_display (gdk_display_manager_get (),
++ newdisplay);
++ return DISPLAY_CHANGE_SUCCESS;
++ }
++ else
++ return DISPLAY_CHANGE_NO_SUCH_SCREEN;
++ }
++
++ return DISPLAY_CHANGE_UNABLE_TO_CONNECT;
++}
++
++static void
++set_challenge_on_window (GdkWindow *window)
++{
++ gdk_property_change (window, rsa_challenge_gdkatom, string_gdkatom,
++ 8, GDK_PROP_MODE_REPLACE, gtk_migration_auth_challenge_string,
++ strlen (gtk_migration_auth_challenge_string));
++}
++
++static void
++update_challenge_on_windows (void)
++{
++ GSList *i;
++
++ gtk_migration_auth_update_challenge ();
++
++ for (i = all_widgets; i; i = i->next)
++ {
++ GtkWidget *w = GTK_WIDGET (i->data);
++ if (w->window)
++ set_challenge_on_window (w->window);
++ }
++}
++
++static void
++reset_state (GdkWindow *window)
++{
++ gdk_property_change (window, display_change_gdkatom, string_gdkatom,
++ 8, GDK_PROP_MODE_REPLACE, NULL, 0);
++}
++
++static void
++generate_response (GdkDisplay *gdisplay, Display *dpy, Window window, int code)
++{
++ XClientMessageEvent ev;
++ Atom atom = gdk_x11_atom_to_xatom_for_display (gdisplay,
++ display_change_gdkatom);
++
++ memset (&ev, 0, sizeof (ev));
++
++ ev.type = ClientMessage;
++ ev.window = window;
++ ev.message_type = atom;
++ ev.format = 32;
++
++ ev.data.l[0] = window;
++ ev.data.l[1] = code;
++
++ XSendEvent (dpy, DefaultRootWindow (dpy), False, SubstructureNotifyMask, (XEvent *)&ev);
++}
++
++static int
++handle_request (GdkWindow *gwindow, char *prop)
++{
++ GtkWidget *widget;
++ char *target, *auth_method, *auth_data;
++ char *p;
++
++ target = prop;
++ auth_method = "NULL";
++ auth_data = NULL;
++
++ p = strchr (prop, ' ');
++ if (p)
++ {
++ *p = 0;
++ auth_method = ++p;
++
++ p = strchr (p, ' ');
++ if (p)
++ {
++ *p = 0;
++ auth_data = ++p;
++ }
++ }
++
++ if (no_auth == FALSE)
++ {
++ if (!strcasecmp (auth_method, "null"))
++ return DISPLAY_CHANGE_AUTHENTICATION_BAD;
++ else if (!strcasecmp (auth_method, "rsa-sig"))
++ {
++ if (gtk_migration_auth_validate_request (target, auth_data) == FALSE)
++ return DISPLAY_CHANGE_AUTHENTICATION_BAD;
++ }
++ else
++ return DISPLAY_CHANGE_AUTHENTICATION_BAD;
++ }
++
++ gdk_window_get_user_data (gwindow, (gpointer*) &widget);
++
++ if (widget)
++ return do_change_display (widget, target);
++
++ return DISPLAY_CHANGE_INDETERMINATE_ERROR;
++}
++
++static GdkFilterReturn
++filter_func (GdkXEvent *xevp, GdkEvent *ev, gpointer p)
++{
++ XPropertyEvent *xev = (XPropertyEvent *)xevp;
++
++ if (xev->type == PropertyNotify)
++ {
++ GdkDisplay *gdisplay;
++ Atom atom;
++
++ gdisplay = gdk_x11_lookup_xdisplay (xev->display);
++ if (gdisplay)
++ {
++ atom = gdk_x11_atom_to_xatom_for_display (gdisplay, display_change_gdkatom);
++
++ if (xev->atom == atom)
++ {
++ GdkWindow *gwindow;
++
++ gwindow = gdk_window_lookup_for_display (gdisplay, xev->window);
++
++ if (gwindow)
++ {
++ GdkAtom actual_type;
++ gint actual_format;
++ gint actual_length;
++ unsigned char *prop = NULL;
++
++ if (gdk_property_get (gwindow, display_change_gdkatom, string_gdkatom,
++ 0, G_MAXLONG, FALSE, &actual_type, &actual_format,
++ &actual_length, &prop))
++ {
++ if (actual_length != 0)
++ {
++ if (actual_type == string_gdkatom && actual_length > 8)
++ {
++ gchar *buf = g_malloc (actual_length + 1);
++ int rc;
++
++ memcpy (buf, prop, actual_length);
++ buf[actual_length] = 0;
++
++ rc = handle_request (gwindow, buf);
++
++ g_free (buf);
++ generate_response (gdisplay, xev->display, xev->window, rc);
++
++ if (rc == DISPLAY_CHANGE_SUCCESS)
++ update_challenge_on_windows ();
++ }
++
++ reset_state (gwindow);
++ }
++ }
++
++ if (prop)
++ g_free (prop);
++ }
++ }
++
++ return GDK_FILTER_REMOVE;
++ }
++ }
++
++ return GDK_FILTER_CONTINUE;
++}
++
++static void
++unrealize_window (GtkWidget *w)
++{
++ all_widgets = g_slist_remove (all_widgets, w);
++}
++
++void
++gtk_migration_mark_window (GtkWidget *w)
++{
++ if (! gtk_migration_initialised)
++ {
++ g_warning ("gtk_migration not initialised yet");
++ return;
++ }
++
++ if (GTK_WIDGET_REALIZED (w))
++ {
++ GdkWindow *window = w->window;
++
++ gdk_window_add_filter (window, filter_func, NULL);
++
++ reset_state (window);
++ set_challenge_on_window (window);
++
++ all_widgets = g_slist_append (all_widgets, w);
++
++ g_signal_connect (G_OBJECT (w), "unrealize", G_CALLBACK (unrealize_window), NULL);
++ }
++ else
++ g_signal_connect (G_OBJECT (w), "realize", G_CALLBACK (gtk_migration_mark_window), NULL);
++}
++
++void
++gtk_migration_init (void)
++{
++ if (getenv ("GPE_DISPLAY_MIGRATION_NO_AUTH") != NULL)
++ no_auth = TRUE;
++
++ string_gdkatom = gdk_atom_intern ("STRING", FALSE);
++ display_change_gdkatom = gdk_atom_intern ("_GPE_DISPLAY_CHANGE", FALSE);
++ rsa_challenge_gdkatom = gdk_atom_intern ("_GPE_DISPLAY_CHANGE_RSA_CHALLENGE", FALSE);
++
++ gtk_migration_auth_generate_challenge ();
++
++ gtk_migration_initialised = TRUE;
++}
diff --git a/recipes/gtk+/files/xsettings.patch b/recipes/gtk+/files/xsettings.patch
new file mode 100644
index 0000000000..b63e262d34
--- /dev/null
+++ b/recipes/gtk+/files/xsettings.patch
@@ -0,0 +1,16 @@
+--- gtk+-2.4.4/gdk/x11/gdkevents-x11.c.old Sun Aug 22 17:14:00 2004
++++ gtk+-2.4.4/gdk/x11/gdkevents-x11.c Sun Aug 22 17:14:00 2004
+@@ -2827,10 +2827,9 @@
+ {
+ GdkScreenX11 *screen = data;
+
+- if (xsettings_client_process_event (screen->xsettings_client, (XEvent *)xevent))
+- return GDK_FILTER_REMOVE;
+- else
+- return GDK_FILTER_CONTINUE;
++ xsettings_client_process_event (screen->xsettings_client, (XEvent *)xevent);
++
++ return GDK_FILTER_CONTINUE;
+ }
+
+ static void
diff --git a/recipes/gtk+/gdk-pixbuf-csource-native_2.12.11.bb b/recipes/gtk+/gdk-pixbuf-csource-native_2.12.11.bb
new file mode 100644
index 0000000000..22d30bfd01
--- /dev/null
+++ b/recipes/gtk+/gdk-pixbuf-csource-native_2.12.11.bb
@@ -0,0 +1,33 @@
+require gtk+_${PV}.bb
+inherit native
+DEPENDS = "jpeg-native libpng-native gettext-native glib-2.0-native libx11-native"
+S = "${WORKDIR}/gtk+-${PV}"
+FILESPATH = "${FILE_DIRNAME}/gdk-pixbuf-csource:${FILE_DIRNAME}/gtk+-${PV}:${FILE_DIRNAME}/files"
+SRC_URI += "file://reduce-dependencies.patch;patch=1"
+
+#clear recommends for uclibc builds
+RRECOMMENDS = " "
+RRECOMMENDS_${PN}_linux = " "
+RRECOMMENDS_${PN}_linux-gnueabi = " "
+
+EXTRA_OECONF = "\
+ --with-gdktarget=x11 \
+ --without-libtiff \
+ --with-libjpeg \
+ --with-libpng \
+ --disable-cups \
+"
+
+do_compile() {
+ cd gdk-pixbuf && oe_runmake
+}
+
+do_stage() {
+ cd gdk-pixbuf && oe_runmake install
+ find ${libdir} -name "libpixbufloader-*.la" -exec rm \{\} \;
+}
+
+do_install() {
+ :
+}
+
diff --git a/recipes/gtk+/gdk-pixbuf-csource/reduce-dependencies.patch b/recipes/gtk+/gdk-pixbuf-csource/reduce-dependencies.patch
new file mode 100644
index 0000000000..6b030e8f16
--- /dev/null
+++ b/recipes/gtk+/gdk-pixbuf-csource/reduce-dependencies.patch
@@ -0,0 +1,221 @@
+#
+# strip unnecessary stuff out of configure, we just want
+# to build gdk-pixbuf-csource.
+# -- Michael 'Mickey' Lauer <mlauer@vanille-media.de>
+#
+---
+# configure.in | 116 ++---------------------------------------------------------
+# 1 file changed, 5 insertions(+), 111 deletions(-)
+#
+--- gtk+-2.12.7.orig/configure.in
++++ gtk+-2.12.7/configure.in
+@@ -30,13 +30,10 @@ m4_define([gtk_api_version], [2.0])
+ #GTK_BINARY_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$LT_CURRENT
+ m4_define([gtk_binary_version], [2.10.0])
+
+ # required versions of other packages
+ m4_define([glib_required_version], [2.13.5])
+-m4_define([pango_required_version], [1.17.3])
+-m4_define([atk_required_version], [1.9.0])
+-m4_define([cairo_required_version], [1.2.0])
+
+
+ AC_INIT([gtk+], [gtk_version],
+ [http://bugzilla.gnome.org/enter_bug.cgi?product=gtk%2B],
+ [gtk+])
+@@ -347,14 +344,11 @@ ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
+ ## Later on we actually use the cflags/libs from separate pkg-config
+ ## calls. Oh, also the later pkg-config calls don't include
+ ## the version requirements since those make the module lists
+ ## annoying to construct
+ PKG_CHECK_MODULES(BASE_DEPENDENCIES,
+- [glib-2.0 >= glib_required_version dnl
+- atk >= atk_required_version dnl
+- pango >= pango_required_version dnl
+- cairo >= cairo_required_version])
++ [glib-2.0 >= glib_required_version])
+
+ if test "$os_win32" != yes; then
+ # libtool option to control which symbols are exported
+ # right now, symbols starting with _ are not exported
+ LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
+@@ -1059,27 +1053,19 @@ GDK_PIXBUF_DEP_CFLAGS="`$PKG_CONFIG --cf
+
+ GDK_PIXBUF_XLIB_PACKAGES=
+ GDK_PIXBUF_XLIB_EXTRA_CFLAGS=
+ GDK_PIXBUF_XLIB_EXTRA_LIBS=
+
+-X_PACKAGES=fontconfig
++X_PACKAGES=
+ GDK_EXTRA_LIBS="$GDK_WLIBS"
+ GDK_EXTRA_CFLAGS=
+
+ # GTK+ uses some X calls, so needs to link against X directly
+ GTK_DEP_PACKAGES_FOR_X=
+ GTK_DEP_LIBS_FOR_X=
+
+ if test "x$gdktarget" = "xx11"; then
+- #
+- # We use fontconfig very peripherally when decoding the default
+- # settings.
+- #
+- if $PKG_CONFIG --exists fontconfig; then : ; else
+- AC_MSG_ERROR([
+-*** fontconfig (http://www.fontconfig.org) is required by the X11 backend.])
+- fi
+
+ #
+ # Check for basic X packages; we use pkg-config if available
+ #
+ if $PKG_CONFIG --exists x11 xext xrender; then
+@@ -1122,20 +1108,10 @@ if test "x$gdktarget" = "xx11"; then
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+
+ gtk_save_LIBS=$LIBS
+ LIBS="$x_libs_for_checks $LIBS"
+
+- # Sanity check for the X11 and Xext libraries. While everything we need from
+- # Xext is optional, the chances a system has *none* of these things is so
+- # small that we just unconditionally require it.
+- AC_CHECK_FUNC(XOpenDisplay, :,
+- AC_MSG_ERROR([*** libX11 not found. Check 'config.log' for more details.]))
+- AC_CHECK_FUNC(XextFindDisplay, :,
+- AC_MSG_ERROR([*** libXext not found. Check 'config.log' for more details.]))
+- AC_CHECK_FUNC(XRenderQueryExtension, :,
+- AC_MSG_ERROR([*** libXrender not found. Check 'config.log' for more details.]))
+-
+ # Check for xReply
+
+ AC_MSG_CHECKING([if <X11/extensions/XIproto.h> is needed for xReply])
+ AC_TRY_COMPILE([#include <X11/Xlibint.h>],
+ [xReply *rep;],
+@@ -1416,104 +1392,33 @@ if test "x$gdktarget" = "xdirectfb"; the
+ AM_CONDITIONAL(USE_DIRECTFB, true)
+ else
+ AM_CONDITIONAL(USE_DIRECTFB, false)
+ fi
+
+-
+-# Check for Pango flags
+-
+-if test "x$gdktarget" = "xwin32"; then
+- PANGO_PACKAGES="pangowin32 pangocairo"
+-else
+- PANGO_PACKAGES="pango pangocairo"
+-fi
+-
+-AC_MSG_CHECKING(Pango flags)
+-if $PKG_CONFIG --exists $PANGO_PACKAGES ; then
+- PANGO_CFLAGS=`$PKG_CONFIG --cflags $PANGO_PACKAGES`
+- PANGO_LIBS=`$PKG_CONFIG --libs $PANGO_PACKAGES`
+-
+- AC_MSG_RESULT($PANGO_CFLAGS $PANGO_LIBS)
+-else
+- AC_MSG_ERROR([
+-*** Pango not found. Pango built with Cairo support is required
+-*** to build GTK+. See http://www.pango.org for Pango information.
+-])
+-fi
+-
+-CFLAGS="$CFLAGS $PANGO_CFLAGS"
+-
+-if $PKG_CONFIG --uninstalled $PANGO_PACKAGES; then
+- :
+-else
+- gtk_save_LIBS="$LIBS"
+- LIBS="$PANGO_LIBS $LIBS"
+- AC_TRY_LINK_FUNC(pango_context_new, :, AC_MSG_ERROR([
+-*** Can't link to Pango. Pango is required to build
+-*** GTK+. For more information see http://www.pango.org]))
+- LIBS="$gtk_save_LIBS"
+-fi
+-
+-CFLAGS="$saved_cflags"
+-LDFLAGS="$saved_ldflags"
+-
+-GDK_PACKAGES="$PANGO_PACKAGES"
+-if test "x$gdktarget" = "xx11"; then
+- GDK_PACKAGES="$GDK_PACKAGES $X_PACKAGES"
+-fi
+ GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
+ GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS"
+
+ #
+ # If we aren't writing explicit dependencies, then don't put the extra libraries we need
+ # into the pkg-config files
+ #
+ if test $enable_explicit_deps != yes ; then
+- GDK_PACKAGES="$PANGO_PACKAGES"
++ GDK_PACKAGES=
+ GDK_EXTRA_LIBS=
+ fi
+
+ AC_SUBST(GDK_PACKAGES)
+ AC_SUBST(GDK_EXTRA_LIBS)
+ AC_SUBST(GDK_EXTRA_CFLAGS)
+ AC_SUBST(GDK_DEP_LIBS)
+ AC_SUBST(GDK_DEP_CFLAGS)
+
+
+-########################################
+-# Check for Accessibility Toolkit flags
+-########################################
+-
+-ATK_PACKAGES=atk
+-AC_MSG_CHECKING(ATK flags)
+-if $PKG_CONFIG --exists $ATK_PACKAGES ; then
+- ATK_CFLAGS=`$PKG_CONFIG --cflags $ATK_PACKAGES`
+- ATK_LIBS=`$PKG_CONFIG --libs $ATK_PACKAGES`
+-
+- AC_MSG_RESULT($ATK_CFLAGS $ATK_LIBS)
+-else
+- AC_MSG_ERROR([
+-*** Accessibility Toolkit not found. Accessibility Toolkit is required
+-*** to build GTK+.
+-])
+-fi
+-
+-if $PKG_CONFIG --uninstalled $ATK_PACKAGES; then
+- :
+-else
+- gtk_save_LIBS="$LIBS"
+- LIBS="$ATK_LIBS $LIBS"
+- AC_TRY_LINK_FUNC(atk_object_get_type, : , AC_MSG_ERROR([
+- *** Cannot link to Accessibility Toolkit. Accessibility Toolkit is required
+- *** to build GTK+]))
+- LIBS="$gtk_save_LIBS"
+-fi
+-
+-GTK_PACKAGES="atk cairo"
++GTK_PACKAGES=
+ GTK_EXTRA_LIBS=
+ GTK_EXTRA_CFLAGS=
+-GTK_DEP_LIBS="$GDK_EXTRA_LIBS $GTK_DEP_LIBS_FOR_X `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $PANGO_PACKAGES $GTK_PACKAGES_FOR_X $GTK_PACKAGES` $GTK_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
++GTK_DEP_LIBS="$GDK_EXTRA_LIBS $GTK_DEP_LIBS_FOR_X `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GTK_PACKAGES_FOR_X $GTK_PACKAGES` $GTK_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
+ GTK_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS"
+
+ if test x"$os_win32" = xyes; then
+ GTK_EXTRA_CFLAGS="$msnative_struct"
+ fi
+@@ -1567,21 +1472,10 @@ LIBS="$CUPS_LIBS"
+ AC_CHECK_FUNCS(httpGetAuthString)
+ LIBS="$gtk_save_libs"
+
+ gtk_save_cppflags="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS"
+-
+-AC_CHECK_HEADER(cairo-pdf.h,,AC_MSG_ERROR([
+-*** Can't find cairo-pdf.h. You must build Cairo with the pdf
+-*** backend enabled.]))
+-
+-if test "$os_win32" != "yes"; then
+- AC_CHECK_HEADER(cairo-ps.h,,AC_MSG_ERROR([
+-*** Can't find cairo-ps.h. You must build Cairo with the
+-*** postscript backend enabled.]))
+-fi
+-
+ CPPFLAGS="$gtk_save_cppflags"
+
+
+ AC_ARG_ENABLE(test-print-backend,
+ [AC_HELP_STRING([--enable-test-print-backend],
diff --git a/recipes/gtk+/gdk-pixbuf_2.10.14.bb b/recipes/gtk+/gdk-pixbuf_2.10.14.bb
new file mode 100644
index 0000000000..0aa53b856a
--- /dev/null
+++ b/recipes/gtk+/gdk-pixbuf_2.10.14.bb
@@ -0,0 +1,66 @@
+DESCRIPTION = "Stand-alone libpixbuf, a pixelmap image i/o library from the \
+GTK+ multi-platform toolkit for creating graphical user interfaces."
+HOMEPAGE = "http://www.gtk.org/"
+SECTION = "libs"
+LICENSE = "LGPL"
+PRIORITY = "optional"
+DEPENDS = "libpng gettext glib-2.0"
+PR = "r2"
+
+S = "${WORKDIR}/gtk+-${PV}"
+FILESPATH = "${FILE_DIRNAME}/gdk-pixbuf-csource:${FILE_DIRNAME}/gtk+-${PV}:${FILE_DIRNAME}/files"
+
+SRC_URI = "\
+ ftp://ftp.gtk.org/pub/gtk/v2.10/gtk+-${PV}.tar.bz2 \
+ file://automake-lossage.patch;patch=1 \
+"
+
+inherit autotools pkgconfig
+
+LIBV = "2.10.0"
+
+FILES_${PN} = "${bindir}/gdk-pixbuf-query-loaders \
+ ${bindir}/gtk-update-icon-cache \
+ ${libdir}/lib*.so.*"
+
+FILES_${PN}-dev += " \
+ ${datadir}/gtk-2.0/include \
+ ${libdir}/gtk-2.0/include \
+ ${libdir}/gtk-2.0/${LIBV}/loaders/*.la \
+ ${bindir}/gdk-pixbuf-csource \
+ ${bindir}/gtk-builder-convert"
+
+FILES_${PN}-dbg += " \
+ ${libdir}/gtk-2.0/${LIBV}/loaders/.debug/*"
+
+EXTRA_OECONF = "\
+ --without-x \
+ --with-gdktarget=linux-fb \
+ --without-libtiff \
+ --without-libjpeg \
+ --with-libpng \
+"
+
+EXTRA_OECONF += "--disable-modules --with-included-loaders=png,tga"
+
+# check for TARGET_FPU=soft and inform configure of the result so it can disable some floating points
+require gtk-fpu.inc
+EXTRA_OECONF += "${@get_gtk_fpu_setting(bb, d)}"
+
+do_compile() {
+ cd gdk-pixbuf && oe_runmake
+}
+
+do_stage() {
+ oe_libinstall -C gdk-pixbuf -so libgdk_pixbuf-2.0 ${STAGING_LIBDIR}
+ cd gdk-pixbuf && oe_runmake install DESTDIR=${STAGING_DIR_HOST}${layout_exec_prefix}
+ autotools_stage_includes
+# install -d -m 0755 ${STAGING_LIBDIR}/gtk-2.0/include
+# install -m 0644 gdk/gdkconfig.h ${STAGING_LIBDIR}/gtk-2.0/include/gdkconfig.h
+}
+
+do_install() {
+ oe_libinstall -C gdk-pixbuf -so libgdk_pixbuf-2.0 ${D}/${libdir}
+ cd gdk-pixbuf && oe_runmake install DESTDIR=${D}
+}
+
diff --git a/recipes/gtk+/gtk+-1.2-1.2.10/gtk+1.2-reconf-fix b/recipes/gtk+/gtk+-1.2-1.2.10/gtk+1.2-reconf-fix
new file mode 100644
index 0000000000..a406235bae
--- /dev/null
+++ b/recipes/gtk+/gtk+-1.2-1.2.10/gtk+1.2-reconf-fix
@@ -0,0 +1,689 @@
+fixup configure.in, acinclude.m4 and Makefile.am's for reconfigurability. make
+gtk-config use pkg-config
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+--- gtk+-1.2.10/configure.in~gtk+1.2-reconf-fix
++++ gtk+-1.2.10/configure.in
+@@ -17,7 +17,9 @@
+
+ dnl we need to AC_DIVERT_PUSH/AC_DIVERT_POP these variable definitions so they
+ dnl are available for $ac_help expansion (don't we all *love* autoconf?)
+-AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
++ifdef([AC_DIVERSION_NOTICE],
++ [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
++ [AC_DIVERT_PUSH(NOTICE)])dnl
+ #
+ # Making releases:
+ # GTK_MICRO_VERSION += 1;
+@@ -76,7 +78,10 @@
+
+ dnl figure debugging default, prior to $ac_help setup
+ dnl
+-AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
++ifdef([AC_DIVERSION_NOTICE],
++ [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
++ [AC_DIVERT_PUSH(NOTICE)])dnl
++
+ if test `expr $GTK_MINOR_VERSION \% 2` = 1 ; then
+ debug_default=yes
+ else
+@@ -292,12 +297,9 @@
+ AC_SUBST(GLIB_DEPLIBS)
+
+ # Find the X11 include and library directories
+-AC_PATH_X
+ AC_PATH_XTRA
+
+-if test "x$x_includes" = "x"; then
+- x_includes="/usr/include"
+-fi
++PKG_CHECK_MODULES(X,x11 xau)
+
+ saved_cflags="$CFLAGS"
+ saved_ldflags="$LDFLAGS"
+--- gtk+-1.2.10/gdk/Makefile.am~gtk+1.2-reconf-fix
++++ gtk+-1.2.10/gdk/Makefile.am
+@@ -31,7 +31,7 @@
+ # setup source file variables
+ #
+ # GDK header files for public installation (non-generated)
+-gdk_public_h_sources = @STRIP_BEGIN@ \
++gdk_public_h_sources = \
+ gdk.h \
+ gdkcursors.h \
+ gdkrgb.h \
+@@ -39,9 +39,9 @@
+ gdkkeysyms.h \
+ gdkprivate.h \
+ gdktypes.h \
+- gdkx.h \
+-@STRIP_END@
+-gdk_c_sources = @STRIP_BEGIN@ \
++ gdkx.h
++
++gdk_c_sources = \
+ gdk.c \
+ gdkcc.c \
+ gdkcolor.c \
+@@ -72,18 +72,16 @@
+ MwmUtil.h \
+ gxid_lib.h \
+ gxid_proto.h \
+- gxid_lib.c \
+-@STRIP_END@
++ gxid_lib.c
+
+ #
+ # setup GDK sources and their dependancies
+ #
+ libgdkinclude_HEADERS = $(gdk_public_h_sources)
+ libgdk_la_SOURCES = $(gdk_c_sources)
+-MAINTAINERCLEANFILES +=
+-EXTRA_HEADERS +=
+-EXTRA_DIST +=
+-EXTRA_DIST +=
++MAINTAINERCLEANFILES =
++EXTRA_HEADERS =
++EXTRA_DIST =
+
+ #
+ # rules to generate built sources
+--- gtk+-1.2.10/gtk/Makefile.am~gtk+1.2-reconf-fix
++++ gtk+-1.2.10/gtk/Makefile.am
+@@ -39,7 +39,7 @@
+ # setup source file variables
+ #
+ # GTK+ header files for public installation (non-generated)
+-gtk_public_h_sources = @STRIP_BEGIN@ \
++gtk_public_h_sources = \
+ gtk.h \
+ gtkaccelgroup.h \
+ gtkaccellabel.h \
+@@ -148,13 +148,13 @@
+ gtkvscrollbar.h \
+ gtkvseparator.h \
+ gtkwidget.h \
+- gtkwindow.h \
+-@STRIP_END@
++ gtkwindow.h
++
+ # GTK+ header files that don't get installed
+-gtk_private_h_sources = @STRIP_BEGIN@ \
+-@STRIP_END@
++gtk_private_h_sources =
++
+ # GTK+ C sources to build the library from
+-gtk_c_sources = @STRIP_BEGIN@ \
++gtk_c_sources = \
+ gtkaccelgroup.c \
+ gtkaccellabel.c \
+ gtkadjustment.c \
+@@ -262,8 +262,8 @@
+ gtkwidget.c \
+ gtkwindow.c \
+ fnmatch.c \
+- fnmatch.h \
+-@STRIP_END@
++ fnmatch.h
++
+ # we use our own built_sources variable rules to avoid automake's
+ # BUILT_SOURCES oddities
+ # we generate frequently rebuild files piggyback on a stamp file, so sources
+@@ -271,7 +271,7 @@
+ # content
+ #
+ # built sources that don't get installed
+-gtk_built_sources = @STRIP_BEGIN@ \
++gtk_built_sources = \
+ stamp-gtk.defs \
+ stamp-gtktypebuiltins.h \
+ stamp-gtkmarshal.h \
+@@ -279,17 +279,18 @@
+ gtktypebuiltins_ids.c \
+ gtktypebuiltins_evals.c \
+ gtkmarshal.c \
+- gtk.defs \
+-@STRIP_END@
++ gtk.defs
++
++
+ # built sources that get installed with the header files
+-gtk_built_public_sources = @STRIP_BEGIN@ \
++gtk_built_public_sources = \
+ gtkmarshal.h \
+- gtktypebuiltins.h \
+-@STRIP_END@
++ gtktypebuiltins.h
++
+ # non-header sources (headers should be specified in the above variables)
+ # that don't serve as direct make target sources, i.e. they don't have
+ # their own .lo rules and don't get publically installed
+-gtk_extra_sources = @STRIP_BEGIN@ \
++gtk_extra_sources = \
+ gtkfeatures.h.in \
+ makeenums.pl \
+ makeenums.awk \
+@@ -298,8 +299,8 @@
+ gtkargcollector.c \
+ gtk-boxed.defs \
+ genmarshal.pl \
+- gtkmarshal.list \
+-@STRIP_END@
++ gtkmarshal.list
++
+ # Extra headers that are used for enum type array/id generation
+ gdk_headers = @STRIP_BEGIN@ \
+ ../gdk/gdktypes.h \
+@@ -311,9 +312,9 @@
+ #
+ libgtkinclude_HEADERS = $(gtk_public_h_sources) $(gtk_built_public_sources) gtkfeatures.h
+ libgtk_la_SOURCES = $(gtk_c_sources)
+-MAINTAINERCLEANFILES += $(gtk_built_public_sources) $(gtk_built_sources)
+-EXTRA_HEADERS +=
+-EXTRA_DIST += $(gtk_private_h_sources)
++MAINTAINERCLEANFILES = $(gtk_built_public_sources) $(gtk_built_sources)
++EXTRA_HEADERS =
++EXTRA_DIST = $(gtk_private_h_sources)
+ EXTRA_DIST += $(gtk_built_sources) $(gtk_built_public_sources) $(gtk_extra_sources)
+
+ #
+@@ -321,7 +322,7 @@
+ #
+ # setup autogeneration dependancies
+ gen_sources = xgen-gdef xgen-gtbh xgen-gtbvc xgen-gtbic xgen-gtbec xgen-gmh xgen-gmc
+-CLEANFILES += $(gen_sources)
++CLEANFILES = $(gen_sources)
+ COPYING: $(gtk_built_public_sources) $(gtk_built_sources)
+ $(OBJECTS): COPYING # this is our oldest-source-stamp
+ # initial creation of the real stamp-* files
+--- gtk+-1.2.10/docs/Makefile.am~gtk+1.2-reconf-fix
++++ gtk+-1.2.10/docs/Makefile.am
+@@ -166,7 +166,7 @@
+ echo $$p; \
+ done
+
+-EXTRA_DIST += \
++EXTRA_DIST = \
+ Changes-1.2.txt \
+ debugging.txt \
+ developers.txt \
+--- gtk+-1.2.10/acinclude.m4~gtk+1.2-reconf-fix
++++ gtk+-1.2.10/acinclude.m4
+@@ -21,428 +21,6 @@
+ ## configuration script generated by Autoconf, you may include it under
+ ## the same distribution terms that you use for the rest of that program.
+
+-# serial 40 AC_PROG_LIBTOOL
+-AC_DEFUN(AC_PROG_LIBTOOL,
+-[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+-
+-# Save cache, so that ltconfig can load it
+-AC_CACHE_SAVE
+-
+-# Actually configure libtool. ac_aux_dir is where install-sh is found.
+-CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+-LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+-LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
+-DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
+-${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
+-$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
+-|| AC_MSG_ERROR([libtool configure failed])
+-
+-# Reload cache, that may have been modified by ltconfig
+-AC_CACHE_LOAD
+-
+-# This can be used to rebuild libtool when needed
+-LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
+-
+-# Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+-AC_SUBST(LIBTOOL)dnl
+-
+-# Redirect the config.log output again, so that the ltconfig log is not
+-# clobbered by the next message.
+-exec 5>>./config.log
+-])
+-
+-AC_DEFUN(AC_LIBTOOL_SETUP,
+-[AC_PREREQ(2.13)dnl
+-AC_REQUIRE([AC_ENABLE_SHARED])dnl
+-AC_REQUIRE([AC_ENABLE_STATIC])dnl
+-AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+-AC_REQUIRE([AC_CANONICAL_HOST])dnl
+-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+-AC_REQUIRE([AC_PROG_RANLIB])dnl
+-AC_REQUIRE([AC_PROG_CC])dnl
+-AC_REQUIRE([AC_PROG_LD])dnl
+-AC_REQUIRE([AC_PROG_NM])dnl
+-AC_REQUIRE([AC_PROG_LN_S])dnl
+-dnl
+-
+-case "$target" in
+-NONE) lt_target="$host" ;;
+-*) lt_target="$target" ;;
+-esac
+-
+-# Check for any special flags to pass to ltconfig.
+-libtool_flags="--cache-file=$cache_file"
+-test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+-test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+-test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
+-test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
+-test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+-ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
+-[libtool_flags="$libtool_flags --enable-dlopen"])
+-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+-[libtool_flags="$libtool_flags --enable-win32-dll"])
+-AC_ARG_ENABLE(libtool-lock,
+- [ --disable-libtool-lock avoid locking (might break parallel builds)])
+-test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
+-test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
+-
+-# Some flags need to be propagated to the compiler or linker for good
+-# libtool support.
+-case "$lt_target" in
+-*-*-irix6*)
+- # Find out which ABI we are using.
+- echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+- if AC_TRY_EVAL(ac_compile); then
+- case "`/usr/bin/file conftest.o`" in
+- *32-bit*)
+- LD="${LD-ld} -32"
+- ;;
+- *N32*)
+- LD="${LD-ld} -n32"
+- ;;
+- *64-bit*)
+- LD="${LD-ld} -64"
+- ;;
+- esac
+- fi
+- rm -rf conftest*
+- ;;
+-
+-*-*-sco3.2v5*)
+- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+- SAVE_CFLAGS="$CFLAGS"
+- CFLAGS="$CFLAGS -belf"
+- AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+- [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
+- if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+- CFLAGS="$SAVE_CFLAGS"
+- fi
+- ;;
+-
+-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+-[*-*-cygwin* | *-*-mingw*)
+- AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+- AC_CHECK_TOOL(AS, as, false)
+- AC_CHECK_TOOL(OBJDUMP, objdump, false)
+- ;;
+-])
+-esac
+-])
+-
+-# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
+-AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
+-
+-# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
+-AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
+-
+-# AC_ENABLE_SHARED - implement the --enable-shared flag
+-# Usage: AC_ENABLE_SHARED[(DEFAULT)]
+-# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+-# `yes'.
+-AC_DEFUN(AC_ENABLE_SHARED, [dnl
+-define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+-AC_ARG_ENABLE(shared,
+-changequote(<<, >>)dnl
+-<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
+-changequote([, ])dnl
+-[p=${PACKAGE-default}
+-case "$enableval" in
+-yes) enable_shared=yes ;;
+-no) enable_shared=no ;;
+-*)
+- enable_shared=no
+- # Look at the argument we got. We use all the common list separators.
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+- for pkg in $enableval; do
+- if test "X$pkg" = "X$p"; then
+- enable_shared=yes
+- fi
+- done
+- IFS="$ac_save_ifs"
+- ;;
+-esac],
+-enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
+-])
+-
+-# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
+-AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+-AC_ENABLE_SHARED(no)])
+-
+-# AC_ENABLE_STATIC - implement the --enable-static flag
+-# Usage: AC_ENABLE_STATIC[(DEFAULT)]
+-# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+-# `yes'.
+-AC_DEFUN(AC_ENABLE_STATIC, [dnl
+-define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+-AC_ARG_ENABLE(static,
+-changequote(<<, >>)dnl
+-<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
+-changequote([, ])dnl
+-[p=${PACKAGE-default}
+-case "$enableval" in
+-yes) enable_static=yes ;;
+-no) enable_static=no ;;
+-*)
+- enable_static=no
+- # Look at the argument we got. We use all the common list separators.
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+- for pkg in $enableval; do
+- if test "X$pkg" = "X$p"; then
+- enable_static=yes
+- fi
+- done
+- IFS="$ac_save_ifs"
+- ;;
+-esac],
+-enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
+-])
+-
+-# AC_DISABLE_STATIC - set the default static flag to --disable-static
+-AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+-AC_ENABLE_STATIC(no)])
+-
+-
+-# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
+-# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
+-# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+-# `yes'.
+-AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
+-define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+-AC_ARG_ENABLE(fast-install,
+-changequote(<<, >>)dnl
+-<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
+-changequote([, ])dnl
+-[p=${PACKAGE-default}
+-case "$enableval" in
+-yes) enable_fast_install=yes ;;
+-no) enable_fast_install=no ;;
+-*)
+- enable_fast_install=no
+- # Look at the argument we got. We use all the common list separators.
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+- for pkg in $enableval; do
+- if test "X$pkg" = "X$p"; then
+- enable_fast_install=yes
+- fi
+- done
+- IFS="$ac_save_ifs"
+- ;;
+-esac],
+-enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
+-])
+-
+-# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
+-AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+-AC_ENABLE_FAST_INSTALL(no)])
+-
+-# AC_PROG_LD - find the path to the GNU or non-GNU linker
+-AC_DEFUN(AC_PROG_LD,
+-[AC_ARG_WITH(gnu-ld,
+-[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
+-test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+-AC_REQUIRE([AC_PROG_CC])dnl
+-AC_REQUIRE([AC_CANONICAL_HOST])dnl
+-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+-ac_prog=ld
+-if test "$ac_cv_prog_gcc" = yes; then
+- # Check if gcc -print-prog-name=ld gives a path.
+- AC_MSG_CHECKING([for ld used by GCC])
+- ac_prog=`($CC -print-prog-name=ld) 2>&5`
+- case "$ac_prog" in
+- # Accept absolute paths.
+-changequote(,)dnl
+- [\\/]* | [A-Za-z]:[\\/]*)
+- re_direlt='/[^/][^/]*/\.\./'
+-changequote([,])dnl
+- # Canonicalize the path of ld
+- ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+- ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+- done
+- test -z "$LD" && LD="$ac_prog"
+- ;;
+- "")
+- # If it fails, then pretend we aren't using GCC.
+- ac_prog=ld
+- ;;
+- *)
+- # If it is relative, then search for the first ld in PATH.
+- with_gnu_ld=unknown
+- ;;
+- esac
+-elif test "$with_gnu_ld" = yes; then
+- AC_MSG_CHECKING([for GNU ld])
+-else
+- AC_MSG_CHECKING([for non-GNU ld])
+-fi
+-AC_CACHE_VAL(ac_cv_path_LD,
+-[if test -z "$LD"; then
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+- for ac_dir in $PATH; do
+- test -z "$ac_dir" && ac_dir=.
+- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+- ac_cv_path_LD="$ac_dir/$ac_prog"
+- # Check to see if the program is GNU ld. I'd rather use --version,
+- # but apparently some GNU ld's only accept -v.
+- # Break only if it was the GNU/non-GNU ld that we prefer.
+- if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+- test "$with_gnu_ld" != no && break
+- else
+- test "$with_gnu_ld" != yes && break
+- fi
+- fi
+- done
+- IFS="$ac_save_ifs"
+-else
+- ac_cv_path_LD="$LD" # Let the user override the test with a path.
+-fi])
+-LD="$ac_cv_path_LD"
+-if test -n "$LD"; then
+- AC_MSG_RESULT($LD)
+-else
+- AC_MSG_RESULT(no)
+-fi
+-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+-AC_PROG_LD_GNU
+-])
+-
+-AC_DEFUN(AC_PROG_LD_GNU,
+-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
+-[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+-if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+- ac_cv_prog_gnu_ld=yes
+-else
+- ac_cv_prog_gnu_ld=no
+-fi])
+-])
+-
+-# AC_PROG_NM - find the path to a BSD-compatible name lister
+-AC_DEFUN(AC_PROG_NM,
+-[AC_MSG_CHECKING([for BSD-compatible nm])
+-AC_CACHE_VAL(ac_cv_path_NM,
+-[if test -n "$NM"; then
+- # Let the user override the test.
+- ac_cv_path_NM="$NM"
+-else
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+- for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+- test -z "$ac_dir" && ac_dir=.
+- if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
+- # Check to see if the nm accepts a BSD-compat flag.
+- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+- # nm: unknown option "B" ignored
+- if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+- ac_cv_path_NM="$ac_dir/nm -B"
+- break
+- elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+- ac_cv_path_NM="$ac_dir/nm -p"
+- break
+- else
+- ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
+- continue # so that we can try to find one that supports BSD flags
+- fi
+- fi
+- done
+- IFS="$ac_save_ifs"
+- test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+-fi])
+-NM="$ac_cv_path_NM"
+-AC_MSG_RESULT([$NM])
+-])
+-
+-# AC_CHECK_LIBM - check for math library
+-AC_DEFUN(AC_CHECK_LIBM,
+-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+-LIBM=
+-case "$lt_target" in
+-*-*-beos* | *-*-cygwin*)
+- # These system don't have libm
+- ;;
+-*-ncr-sysv4.3*)
+- AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+- AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
+- ;;
+-*)
+- AC_CHECK_LIB(m, main, LIBM="-lm")
+- ;;
+-esac
+-])
+-
+-# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
+-# the libltdl convenience library, adds --enable-ltdl-convenience to
+-# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
+-# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
+-# to be `${top_builddir}/libltdl'. Make sure you start DIR with
+-# '${top_builddir}/' (note the single quotes!) if your package is not
+-# flat, and, if you're not using automake, define top_builddir as
+-# appropriate in the Makefiles.
+-AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+- case "$enable_ltdl_convenience" in
+- no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+- "") enable_ltdl_convenience=yes
+- ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+- esac
+- LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
+- INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
+-])
+-
+-# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
+-# the libltdl installable library, and adds --enable-ltdl-install to
+-# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
+-# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
+-# to be `${top_builddir}/libltdl'. Make sure you start DIR with
+-# '${top_builddir}/' (note the single quotes!) if your package is not
+-# flat, and, if you're not using automake, define top_builddir as
+-# appropriate in the Makefiles.
+-# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+-AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+- AC_CHECK_LIB(ltdl, main,
+- [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+- [if test x"$enable_ltdl_install" = xno; then
+- AC_MSG_WARN([libltdl not installed, but installation disabled])
+- else
+- enable_ltdl_install=yes
+- fi
+- ])
+- if test x"$enable_ltdl_install" = x"yes"; then
+- ac_configure_args="$ac_configure_args --enable-ltdl-install"
+- LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
+- INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
+- else
+- ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+- LIBLTDL="-lltdl"
+- INCLTDL=
+- fi
+-])
+-
+-dnl old names
+-AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
+-AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
+-AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
+-AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
+-AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
+-AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
+-AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
+-
+-dnl This is just to silence aclocal about the macro not being used
+-ifelse([AC_DISABLE_FAST_INSTALL])dnl
+-
+-# Macro to add for using GNU gettext.
+-# Ulrich Drepper <drepper@cygnus.com>, 1995.
+-#
+-# Modified to never use included libintl.
+-# Owen Taylor <otaylor@redhat.com>, 12/15/1998
+-#
+-#
+-# This file can be copied and used freely without restrictions. It can
+-# be used in projects which are not available under the GNU Public License
+-# but which still want to provide support for the GNU gettext functionality.
+-# Please note that the actual code is *not* freely available.
+-
+-# serial 5
+-
+ AC_DEFUN(AM_GTK_WITH_NLS,
+ [AC_MSG_CHECKING([whether NLS is requested])
+ dnl Default is enabled NLS
+--- gtk+-1.2.10/gtk-config.in~gtk+1.2-reconf-fix
++++ gtk+-1.2.10/gtk-config.in
+@@ -1,10 +1,5 @@
+ #!/bin/sh
+
+-glib_libs="@glib_libs@"
+-glib_cflags="@glib_cflags@"
+-glib_thread_libs="@glib_thread_libs@"
+-glib_thread_cflags="@glib_thread_cflags@"
+-
+ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ exec_prefix_set=no
+@@ -86,27 +81,16 @@
+ fi
+
+ if test "$lib_gthread" = "yes"; then
+- glib_cflags="$glib_thread_cflags"
+- glib_libs="$glib_thread_libs"
++ modules="gtk+ gthread"
++else
++ modules="gtk+"
+ fi
+
+ if test "$echo_cflags" = "yes"; then
+- echo -I@includedir@/gtk-1.2 $glib_cflags @x_cflags@
++ echo `pkg-config --cflags $modules`
+ fi
+
+ if test "$echo_libs" = "yes"; then
+- my_glib_libs=
+- libdirs=-L@libdir@
+- for i in $glib_libs ; do
+- if test $i != -L@libdir@ ; then
+- if test -z "$my_glib_libs" ; then
+- my_glib_libs="$i"
+- else
+- my_glib_libs="$my_glib_libs $i"
+- fi
+- fi
+- done
+-
+- echo $libdirs @x_ldflags@ -lgtk -lgdk $my_glib_libs @INTLLIBS@ @x_libs@ @GDK_WLIBS@ -lm
++ echo `pkg-config --libs $modules`
+ fi
+
diff --git a/recipes/gtk+/gtk+-1.2-1.2.10/no-xwc b/recipes/gtk+/gtk+-1.2-1.2.10/no-xwc
new file mode 100644
index 0000000000..e26bba8ed3
--- /dev/null
+++ b/recipes/gtk+/gtk+-1.2-1.2.10/no-xwc
@@ -0,0 +1,267 @@
+remove mb and XWC support, as tinyx doesnt support this
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+--- gtk+-1.2.10/gdk/gdkdraw.c~no-xwc
++++ gtk+-1.2.10/gdk/gdkdraw.c
+@@ -236,12 +236,14 @@
+ strlen (string) / 2);
+ }
+ }
++#ifdef HAVE_XWC
+ else if (font->type == GDK_FONT_FONTSET)
+ {
+ XFontSet fontset = (XFontSet) font_private->xfont;
+ XmbDrawString (drawable_private->xdisplay, drawable_private->xwindow,
+ fontset, gc_private->xgc, x, y, string, strlen (string));
+ }
++#endif
+ else
+ g_error("undefined font type\n");
+ }
+@@ -291,12 +293,14 @@
+ gc_private->xgc, x, y, (XChar2b *) text, text_length / 2);
+ }
+ }
++#ifdef HAVE_XWC
+ else if (font->type == GDK_FONT_FONTSET)
+ {
+ XFontSet fontset = (XFontSet) font_private->xfont;
+ XmbDrawString (drawable_private->xdisplay, drawable_private->xwindow,
+ fontset, gc_private->xgc, x, y, text, text_length);
+ }
++#endif
+ else
+ g_error("undefined font type\n");
+ }
+@@ -337,6 +341,7 @@
+ g_free (glyphs);
+ }
+ }
++#ifdef HAVE_XWC
+ else if (font->type == GDK_FONT_FONTSET)
+ {
+ if (sizeof(GdkWChar) == sizeof(wchar_t))
+@@ -357,6 +362,7 @@
+ g_free (text_wchar);
+ }
+ }
++#endif
+ else
+ g_error("undefined font type\n");
+ }
+--- gtk+-1.2.10/gdk/gdkim.c~no-xwc
++++ gtk+-1.2.10/gdk/gdkim.c
+@@ -121,6 +121,7 @@
+
+ current_locale = setlocale (LC_ALL, NULL);
+
++#ifdef HAVE_XWC
+ if ((strcmp (current_locale, "C")) && (strcmp (current_locale, "POSIX")))
+ {
+ gdk_use_mb = TRUE;
+@@ -145,7 +146,8 @@
+ GDK_NOTE (XIM,
+ g_message ("%s multi-byte string functions.",
+ gdk_use_mb ? "Using" : "Not using"));
+-
++#endif
++
+ return current_locale;
+ }
+
+@@ -1551,6 +1553,7 @@
+ else
+ length = len;
+
++#ifdef HAVE_XWC
+ if (gdk_use_mb)
+ {
+ XTextProperty tpr;
+@@ -1589,6 +1592,7 @@
+ g_free (src_wc);
+ }
+ else
++#endif
+ {
+ gint i;
+
+@@ -1644,6 +1648,7 @@
+ /* NoMem or LocaleNotSupp */
+ return -1;
+ }
++#ifdef HAVE_XWC
+ if (XwcTextPropertyToTextList (gdk_display, &tpr, &wstrs, &num_wstrs)
+ != Success)
+ {
+@@ -1659,6 +1664,7 @@
+ dest[len_cpy] = wstr_src[len_cpy];
+ XwcFreeStringList (wstrs);
+ return len_cpy;
++#endif
+ }
+ else
+ {
+--- gtk+-1.2.10/gdk/gdkfont.c~no-xwc
++++ gtk+-1.2.10/gdk/gdkfont.c
+@@ -244,9 +244,11 @@
+ gdk_xid_table_remove (((XFontStruct *) private->xfont)->fid);
+ XFreeFont (private->xdisplay, (XFontStruct *) private->xfont);
+ break;
++#ifdef HAVE_XWC
+ case GDK_FONT_FONTSET:
+ XFreeFontSet (private->xdisplay, (XFontSet) private->xfont);
+ break;
++#endif
+ default:
+ g_error ("unknown font type.");
+ break;
+@@ -292,6 +294,7 @@
+ return (((XFontStruct *) privatea->xfont)->fid ==
+ ((XFontStruct *) privateb->xfont)->fid);
+ }
++#ifdef HAVE_XWC
+ else if (fonta->type == GDK_FONT_FONTSET && fontb->type == GDK_FONT_FONTSET)
+ {
+ gchar *namea, *nameb;
+@@ -301,6 +304,7 @@
+
+ return (strcmp(namea, nameb) == 0);
+ }
++#endif
+ else
+ /* fontset != font */
+ return FALSE;
+@@ -333,10 +337,12 @@
+ width = XTextWidth16 (xfont, (XChar2b *) string, strlen (string) / 2);
+ }
+ break;
++#ifdef HAVE_XWC
+ case GDK_FONT_FONTSET:
+ fontset = (XFontSet) font_private->xfont;
+ width = XmbTextEscapement (fontset, string, strlen(string));
+ break;
++#endif
+ default:
+ width = 0;
+ }
+@@ -372,10 +378,12 @@
+ width = XTextWidth16 (xfont, (XChar2b *) text, text_length / 2);
+ }
+ break;
++#ifdef HAVE_XWC
+ case GDK_FONT_FONTSET:
+ fontset = (XFontSet) private->xfont;
+ width = XmbTextEscapement (fontset, text, text_length);
+ break;
++#endif
+ default:
+ width = 0;
+ }
+@@ -414,6 +422,7 @@
+
+ break;
+ }
++#ifdef HAVE_XWC
+ case GDK_FONT_FONTSET:
+ if (sizeof(GdkWChar) == sizeof(wchar_t))
+ {
+@@ -431,6 +440,7 @@
+ g_free (text_wchar);
+ }
+ break;
++#endif
+ default:
+ width = 0;
+ }
+@@ -474,10 +484,12 @@
+ width = XTextWidth (xfont, &character, 1);
+ }
+ break;
++#ifdef HAVE_XWC
+ case GDK_FONT_FONTSET:
+ fontset = (XFontSet) private->xfont;
+ width = XmbTextEscapement (fontset, &character, 1) ;
+ break;
++#endif
+ default:
+ width = 0;
+ }
+@@ -523,6 +535,7 @@
+
+ break;
+ }
++#ifdef HAVE_XWC
+ case GDK_FONT_FONTSET:
+ fontset = (XFontSet) private->xfont;
+ {
+@@ -530,6 +543,7 @@
+ width = XwcTextEscapement (fontset, &char_wc, 1) ;
+ }
+ break;
++#endif
+ default:
+ width = 0;
+ }
+@@ -597,6 +611,7 @@
+ if (descent)
+ *descent = overall.descent;
+ break;
++#ifdef HAVE_XWC
+ case GDK_FONT_FONTSET:
+ fontset = (XFontSet) private->xfont;
+ XmbTextExtents (fontset, text, text_length, &ink, &logical);
+@@ -611,6 +626,7 @@
+ if (descent)
+ *descent = ink.y + ink.height;
+ break;
++#endif
+ }
+
+ }
+@@ -664,6 +680,7 @@
+
+ break;
+ }
++#ifdef HAVE_XWC
+ case GDK_FONT_FONTSET:
+ fontset = (XFontSet) private->xfont;
+
+@@ -691,6 +708,7 @@
+ if (descent)
+ *descent = ink.y + ink.height;
+ break;
++#endif
+ }
+
+ }
+@@ -750,11 +768,13 @@
+ }
+ width = overall.rbearing;
+ break;
++#ifdef HAVE_XWC
+ case GDK_FONT_FONTSET:
+ fontset = (XFontSet) private->xfont;
+ XmbTextExtents (fontset, text, text_length, &ink, &log);
+ width = ink.x + ink.width;
+ break;
++#endif
+ default:
+ width = 0;
+ }
+@@ -818,11 +838,13 @@
+ }
+ height = overall.ascent + overall.descent;
+ break;
++#ifdef HAVE_XWC
+ case GDK_FONT_FONTSET:
+ fontset = (XFontSet) private->xfont;
+ XmbTextExtents (fontset, text, text_length, &ink, &log);
+ height = log.height;
+ break;
++#endif
+ default:
+ height = 0;
+ }
diff --git a/recipes/gtk+/gtk+-1.2-1.2.10/timezone-fix.patch b/recipes/gtk+/gtk+-1.2-1.2.10/timezone-fix.patch
new file mode 100644
index 0000000000..15684145f1
--- /dev/null
+++ b/recipes/gtk+/gtk+-1.2-1.2.10/timezone-fix.patch
@@ -0,0 +1,15 @@
+diff -NurBabdH gtk+-1.2.10/gtk/testrgb.c gtk+-1.2.10-timezone-fix/gtk/testrgb.c
+--- gtk+-1.2.10/gtk/testrgb.c 2000-08-18 23:36:34.000000000 +0200
++++ gtk+-1.2.10-timezone-fix/gtk/testrgb.c 2005-03-03 11:18:09.000000000 +0100
+@@ -49,7 +49,10 @@
+ get_time (void)
+ {
+ struct timeval tv;
+- struct timezone tz;
++ struct timezone {
++ int tz_minuteswest; /* minutes W of Greenwich */
++ int tz_dsttime; /* type of dst correction */
++ } tz;
+
+ gettimeofday (&tv, &tz);
+
diff --git a/recipes/gtk+/gtk+-1.2_1.2.10.bb b/recipes/gtk+/gtk+-1.2_1.2.10.bb
new file mode 100644
index 0000000000..dfe0fbd979
--- /dev/null
+++ b/recipes/gtk+/gtk+-1.2_1.2.10.bb
@@ -0,0 +1,58 @@
+LICENSE = "LGPL"
+DESCRIPTION = "GTK+1.2 is a deprecated library provided for running programs not yet converted to GTK+2.0"
+HOMEPAGE = "http://www.gtk.org"
+SECTION = "libs"
+PRIORITY = "optional"
+DEPENDS = "glib-1.2 jpeg libpng libxext"
+PR = "r3"
+
+SRC_URI = "ftp://ftp.gtk.org/pub/gtk/v1.2/gtk+-${PV}.tar.gz \
+ file://timezone-fix.patch;patch=1 \
+ file://gtk+1.2-reconf-fix;patch=1 \
+ file://no-xwc;patch=1"
+S = "${WORKDIR}/gtk+-${PV}"
+
+inherit autotools pkgconfig flow-lossage
+
+do_configure_prepend() {
+ install -d m4
+ rm -f ltconfig libtool ltmain.sh aclocal.m4
+ sed -i -e s:AM_LC_MESSAGES:gt_LC_MESSAGES:g acinclude.m4
+}
+
+FILES_${PN} += "${datadir}/themes"
+FILES_${PN}-dev += "${datadir}/gtk-1.2/include ${libdir}/gtk-1.2/include"
+
+
+EXTRA_OECONF = "--enable-debug=no --disable-glibtest --disable-xim"
+# --disable-cruft
+
+LIBV = "1.2.10"
+
+gtk_include = "fnmatch.h gtk.h gtkaccelgroup.h gtkaccellabel.h gtkadjustment.h gtkalignment.h gtkarg.h gtkarrow.h gtkaspectframe.h gtkbbox.h gtkbin.h gtkbindings.h gtkbox.h gtkbutton.h gtkcalendar.h gtkcheckbutton.h gtkcheckmenuitem.h gtkclist.h gtkcolorsel.h gtkcombo.h gtkcompat.h gtkcontainer.h gtkctree.h gtkcurve.h gtkdata.h gtkdebug.h gtkdialog.h gtkdnd.h gtkdrawingarea.h gtkeditable.h gtkentry.h gtkenums.h gtkeventbox.h gtkfeatures.h gtkfilesel.h gtkfixed.h gtkfontsel.h gtkframe.h gtkgamma.h gtkgc.h gtkhandlebox.h gtkhbbox.h gtkhbox.h gtkhpaned.h gtkhruler.h gtkhscale.h gtkhscrollbar.h gtkhseparator.h gtkimage.h gtkinputdialog.h gtkintl.h gtkinvisible.h gtkitem.h gtkitemfactory.h gtklabel.h gtklayout.h gtklist.h gtklistitem.h gtkmain.h gtkmarshal.h gtkmenu.h gtkmenubar.h gtkmenufactory.h gtkmenuitem.h gtkmenushell.h gtkmisc.h gtknotebook.h gtkobject.h gtkoptionmenu.h gtkpacker.h gtkpaned.h gtkpixmap.h gtkplug.h gtkpreview.h gtkprivate.h gtkprogress.h gtkprogressbar.h gtkradiobutton.h gtkradiomenuitem.h gtkrange.h gtkrc.h gtkruler.h gtkscale.h gtkscrollbar.h gtkscrolledwindow.h gtkselection.h gtkseparator.h gtksignal.h gtksocket.h gtkspinbutton.h gtkstatusbar.h gtkstyle.h gtktable.h gtktearoffmenuitem.h gtktext.h gtkthemes.h gtktipsquery.h gtktogglebutton.h gtktoolbar.h gtktooltips.h gtktree.h gtktreeitem.h gtktypebuiltins.h gtktypeutils.h gtkvbbox.h gtkvbox.h gtkviewport.h gtkvpaned.h gtkvruler.h gtkvscale.h gtkvscrollbar.h gtkvseparator.h gtkwidget.h gtkwindow.h makeenums.h stamp-gtkmarshal.h stamp-gtktypebuiltins.h"
+gdk_include = "MwmUtil.h gdk.h gdkcursors.h gdki18n.h gdkinput.h gdkinputcommon.h gdkinputgxi.h gdkinputnone.h gdkinputxfree.h gdkkeysyms.h gdkprivate.h gdkrgb.h gdktypes.h gdkx.h gxid_lib.h gxid_proto.h"
+
+do_stage () {
+ oe_libinstall -so -C gtk libgtk ${STAGING_LIBDIR}
+ oe_libinstall -so -C gdk libgdk ${STAGING_LIBDIR}
+
+ mkdir -p ${STAGING_INCDIR}/gtk-1.2/gtk
+ for i in ${gtk_include}; do
+ install -m 0644 gtk/$i ${STAGING_INCDIR}/gtk-1.2/gtk/$i
+ done
+
+ mkdir -p ${STAGING_INCDIR}/gtk-1.2/gdk
+ for i in ${gdk_include}; do
+ install -m 0644 gdk/$i ${STAGING_INCDIR}/gtk-1.2/gdk/$i
+ done
+
+ mkdir -p ${STAGING_LIBDIR}/gtk-1.2/include
+
+ install -m 0644 gtk.m4 ${STAGING_DATADIR}/aclocal/
+ install -m 0755 gtk-config ${STAGING_BINDIR_CROSS}/
+}
+
+do_install_append () {
+ install -d ${D}${sysconfdir}/gtk-1.2
+}
+
diff --git a/recipes/gtk+/gtk+-2.10.14/automake-lossage.patch b/recipes/gtk+/gtk+-2.10.14/automake-lossage.patch
new file mode 100644
index 0000000000..0d423ddbb9
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.10.14/automake-lossage.patch
@@ -0,0 +1,24 @@
+--- gtk+-2.4.1/docs/tutorial/Makefile.am~ 2003-05-06 22:54:20.000000000 +0100
++++ gtk+-2.4.1/docs/tutorial/Makefile.am 2004-05-08 12:31:41.000000000 +0100
+@@ -52,21 +52,5 @@
+
+ dist-hook: html
+ cp -Rp $(srcdir)/html $(distdir)
+-else
+-html:
+- echo "***"
+- echo "*** Warning: Tutorial not built"
+- echo "***"
+-
+-pdf:
+- echo "***"
+- echo "*** Warning: Tutorial not built"
+- echo "***"
+-
+-dist-hook:
+- echo "***"
+- echo "*** Warning: Tutorial not built"
+- echo "*** DISTRIBUTION IS INCOMPLETE"
+- echo "***"
+ endif
+
diff --git a/recipes/gtk+/gtk+-2.10.14/cell-renderer-edit-focus.patch b/recipes/gtk+/gtk+-2.10.14/cell-renderer-edit-focus.patch
new file mode 100644
index 0000000000..aa7e276bec
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.10.14/cell-renderer-edit-focus.patch
@@ -0,0 +1,30 @@
+Index: gtk/gtkcellrenderertext.c
+===================================================================
+--- gtk/gtkcellrenderertext.c (revision 18557)
++++ gtk/gtkcellrenderertext.c (working copy)
+@@ -1794,13 +1794,24 @@ gtk_cell_renderer_text_focus_out_event (
+ gpointer data)
+ {
+ GtkCellRendererTextPrivate *priv;
++ GtkSettings *settings;
++ gboolean in_touchscreen_mode = FALSE;
+
+ priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (data);
+
+ if (priv->in_entry_menu)
+ return FALSE;
+
+- GTK_ENTRY (entry)->editing_canceled = TRUE;
++ if (gtk_widget_has_screen (entry))
++ settings = gtk_settings_get_for_screen (gtk_widget_get_screen (entry));
++ else
++ settings = gtk_settings_get_default ();
++
++ g_object_get (G_OBJECT (settings),
++ "gtk-touchscreen-mode", &in_touchscreen_mode,
++ NULL);
++
++ GTK_ENTRY (entry)->editing_canceled = !in_touchscreen_mode;
+ gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (entry));
+ gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE (entry));
+
diff --git a/recipes/gtk+/gtk+-2.10.14/combo-arrow-size.patch b/recipes/gtk+/gtk+-2.10.14/combo-arrow-size.patch
new file mode 100644
index 0000000000..ec408a5f28
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.10.14/combo-arrow-size.patch
@@ -0,0 +1,66 @@
+Index: gtk/gtkcombobox.c
+===================================================================
+--- gtk/gtkcombobox.c.orig 2007-08-21 11:10:15.000000000 +0000
++++ gtk/gtkcombobox.c 2007-08-21 11:13:00.000000000 +0000
+@@ -692,6 +692,25 @@
+ 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));
+ }
+
+@@ -1926,8 +1945,13 @@
+ {
+ GtkComboBox *combo_box = GTK_COMBO_BOX (widget);
+ gint focus_width, focus_pad;
++ gint font_size;
++ gint arrow_size;
+ GtkAllocation child;
+ GtkRequisition req;
++ PangoContext *context;
++ PangoFontMetrics *metrics;
++ PangoFontDescription *font_desc;
+ gboolean is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
+
+ widget->allocation = *allocation;
+@@ -1935,8 +1959,21 @@
+ 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)
+ {
+ if (combo_box->priv->cell_view)
diff --git a/recipes/gtk+/gtk+-2.10.14/disable-print.patch b/recipes/gtk+/gtk+-2.10.14/disable-print.patch
new file mode 100644
index 0000000000..1067773f12
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.10.14/disable-print.patch
@@ -0,0 +1,50 @@
+--- gtk+-2.10.0/configure.in~ 2006-07-05 18:11:44.000000000 +0200
++++ gtk+-2.10.0/configure.in 2006-07-05 18:11:44.000000000 +0200
+@@ -1539,26 +1539,27 @@
+ # Printing system checks
+ ################################################################
+
+-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 -n $CUPS_API_VERSION | awk -F. '{print $1}'`
+- CUPS_API_MINOR=`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)
+-fi
+-AM_CONDITIONAL(HAVE_CUPS, test "x$CUPS_CONFIG" != "xno")
++#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 -n $CUPS_API_VERSION | awk -F. '{print $1}'`
++# CUPS_API_MINOR=`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)
++#fi
++#AM_CONDITIONAL(HAVE_CUPS, test "x$CUPS_CONFIG" != "xno")
++AM_CONDITIONAL(HAVE_CUPS,false)
+
+ gtk_save_cppflags="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS"
diff --git a/recipes/gtk+/gtk+-2.10.14/disable-tooltips.patch b/recipes/gtk+/gtk+-2.10.14/disable-tooltips.patch
new file mode 100644
index 0000000000..d71d839c3c
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.10.14/disable-tooltips.patch
@@ -0,0 +1,11 @@
+--- gtk+-2.4.3/gtk/gtktooltips.c.old 2004-07-04 18:52:04.000000000 +0100
++++ gtk+-2.4.3/gtk/gtktooltips.c 2004-07-04 18:52:08.000000000 +0100
+@@ -118,7 +118,7 @@
+ tooltips->tips_data_list = NULL;
+
+ tooltips->delay = DEFAULT_DELAY;
+- tooltips->enabled = TRUE;
++ tooltips->enabled = FALSE;
+ tooltips->timer_tag = 0;
+ tooltips->use_sticky_delay = FALSE;
+ tooltips->last_popdown.tv_sec = -1;
diff --git a/recipes/gtk+/gtk+-2.10.14/gnome-bug-341177.patch b/recipes/gtk+/gtk+-2.10.14/gnome-bug-341177.patch
new file mode 100644
index 0000000000..c31868462a
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.10.14/gnome-bug-341177.patch
@@ -0,0 +1,217 @@
+diff -uprN gtk+-2.8.13.org/gdk-pixbuf/pixops/pixops.c gtk+-2.8.13.INNER_LOOP/gdk-pixbuf/pixops/pixops.c
+--- gtk+-2.8.13.org/gdk-pixbuf/pixops/pixops.c Tue Jul 12 18:58:57 2005
++++ gtk+-2.8.13.INNER_LOOP/gdk-pixbuf/pixops/pixops.c Tue May 9 17:30:53 2006
+@@ -71,35 +71,24 @@ get_check_shift (int check_size)
+ return check_shift;
+ }
+
+-static void
+-pixops_scale_nearest (guchar *dest_buf,
+- int render_x0,
+- int render_y0,
+- int render_x1,
+- int render_y1,
+- int dest_rowstride,
+- int dest_channels,
+- gboolean dest_has_alpha,
+- const guchar *src_buf,
+- int src_width,
+- int src_height,
+- int src_rowstride,
+- int src_channels,
+- gboolean src_has_alpha,
+- double scale_x,
+- double scale_y)
+-{
+- int i;
+- int x;
+- int x_step = (1 << SCALE_SHIFT) / scale_x;
+- int y_step = (1 << SCALE_SHIFT) / scale_y;
+- int xmax, xstart, xstop, x_pos, y_pos;
+- const guchar *p;
++typedef struct { guchar a,b,c; } b3;
++extern void BUG_bad_size_of_struct_b3(void);
+
+-#define INNER_LOOP(SRC_CHANNELS,DEST_CHANNELS,ASSIGN_PIXEL) \
++#define INNER_LOOP_PREP() \
++ do { \
++ x = render_x0 * x_step + x_step / 2; \
+ xmax = x + (render_x1 - render_x0) * x_step; \
+ xstart = MIN (0, xmax); \
+ xstop = MIN (src_width << SCALE_SHIFT, xmax); \
++ } while(0)
++
++#define INNER_LOOP_BODY(SRC_CHANNELS,DEST_CHANNELS,ASSIGN_PIXEL)\
++ do { \
++ y_pos = ((i + render_y0) * y_step + y_step / 2) >> SCALE_SHIFT; \
++ y_pos = CLAMP (y_pos, 0, src_height - 1); \
++ src = src_buf + y_pos * src_rowstride; \
++ dest = dest_buf + i * dest_rowstride; \
++ x = render_x0 * x_step + x_step / 2; \
+ p = src + (CLAMP (x, xstart, xstop) >> SCALE_SHIFT) * SRC_CHANNELS; \
+ while (x < xstart) \
+ { \
+@@ -121,42 +110,58 @@ pixops_scale_nearest (guchar *des
+ ASSIGN_PIXEL; \
+ dest += DEST_CHANNELS; \
+ x += x_step; \
+- }
++ } \
++ } while(0)
+
+- for (i = 0; i < (render_y1 - render_y0); i++)
+- {
+- const guchar *src;
+- guchar *dest;
+- y_pos = ((i + render_y0) * y_step + y_step / 2) >> SCALE_SHIFT;
+- y_pos = CLAMP (y_pos, 0, src_height - 1);
+- src = src_buf + y_pos * src_rowstride;
+- dest = dest_buf + i * dest_rowstride;
++static void
++pixops_scale_nearest (guchar *dest_buf,
++ int render_x0,
++ int render_y0,
++ int render_x1,
++ int render_y1,
++ int dest_rowstride,
++ int dest_channels,
++ gboolean dest_has_alpha,
++ const guchar *src_buf,
++ int src_width,
++ int src_height,
++ int src_rowstride,
++ int src_channels,
++ gboolean src_has_alpha,
++ double scale_x,
++ double scale_y)
++{
++ int i;
++ int x;
++ int x_step = (1 << SCALE_SHIFT) / scale_x;
++ int y_step = (1 << SCALE_SHIFT) / scale_y;
++ int xmax, xstart, xstop, x_pos, y_pos;
++ const guchar *p;
+
+- x = render_x0 * x_step + x_step / 2;
++ const guchar *src;
++ guchar *dest;
+
+- if (src_channels == 3)
+- {
+- if (dest_channels == 3)
+- {
+- INNER_LOOP (3, 3, dest[0]=p[0];dest[1]=p[1];dest[2]=p[2]);
+- }
+- else
+- {
+- INNER_LOOP (3, 4, dest[0]=p[0];dest[1]=p[1];dest[2]=p[2];dest[3]=0xff);
+- }
+- }
+- else if (src_channels == 4)
+- {
+- if (dest_channels == 3)
+- {
+- INNER_LOOP (4, 3, dest[0]=p[0];dest[1]=p[1];dest[2]=p[2]);
+- }
+- else
+- {
+- guint32 *p32;
+- INNER_LOOP(4, 4, p32=(guint32*)dest;*p32=*((guint32*)p));
+- }
+- }
++ if(sizeof(b3) != 3) BUG_bad_size_of_struct_b3();
++
++ INNER_LOOP_PREP();
++
++ if (src_channels == 3)
++ {
++ if (dest_channels == 3)
++ for (i = 0; i < (render_y1 - render_y0); i++)
++ INNER_LOOP_BODY (3, 3, *(b3*)dest = *(b3*)p);
++ else
++ for (i = 0; i < (render_y1 - render_y0); i++)
++ INNER_LOOP_BODY (3, 4, (*(b3*)dest = *(b3*)p, dest[3]=0xff) );
++ }
++ else if (src_channels == 4)
++ {
++ if (dest_channels == 3)
++ for (i = 0; i < (render_y1 - render_y0); i++)
++ INNER_LOOP_BODY (4, 3, *(b3*)dest = *(b3*)p);
++ else
++ for (i = 0; i < (render_y1 - render_y0); i++)
++ INNER_LOOP_BODY (4, 4, *(guint32*)dest = *((guint32*)p));
+ }
+ }
+
+@@ -187,18 +192,14 @@ pixops_composite_nearest (guchar
+ const guchar *p;
+ unsigned int a0;
+
++ INNER_LOOP_PREP();
++
+ for (i = 0; i < (render_y1 - render_y0); i++)
+ {
+ const guchar *src;
+ guchar *dest;
+- y_pos = ((i + render_y0) * y_step + y_step / 2) >> SCALE_SHIFT;
+- y_pos = CLAMP (y_pos, 0, src_height - 1);
+- src = src_buf + y_pos * src_rowstride;
+- dest = dest_buf + i * dest_rowstride;
+-
+- x = render_x0 * x_step + x_step / 2;
+
+- INNER_LOOP(src_channels, dest_channels,
++ INNER_LOOP_BODY(src_channels, dest_channels,
+ if (src_has_alpha)
+ a0 = (p[3] * overall_alpha) / 0xff;
+ else
+@@ -209,9 +210,7 @@ pixops_composite_nearest (guchar
+ case 0:
+ break;
+ case 255:
+- dest[0] = p[0];
+- dest[1] = p[1];
+- dest[2] = p[2];
++ *(b3*)dest = *(b3*)p;
+ if (dest_has_alpha)
+ dest[3] = 0xff;
+ break;
+@@ -279,17 +278,12 @@ pixops_composite_color_nearest (guchar
+ const guchar *p;
+ unsigned int a0;
+
++ INNER_LOOP_PREP();
++
+ for (i = 0; i < (render_y1 - render_y0); i++)
+ {
+ const guchar *src;
+ guchar *dest;
+- y_pos = ((i + render_y0) * y_step + y_step / 2) >> SCALE_SHIFT;
+- y_pos = CLAMP (y_pos, 0, src_height - 1);
+- src = src_buf + y_pos * src_rowstride;
+- dest = dest_buf + i * dest_rowstride;
+-
+- x = render_x0 * x_step + x_step / 2;
+-
+
+ if (((i + check_y) >> check_shift) & 1)
+ {
+@@ -313,7 +307,7 @@ pixops_composite_color_nearest (guchar
+ }
+
+ j = 0;
+- INNER_LOOP(src_channels, dest_channels,
++ INNER_LOOP_BODY(src_channels, dest_channels,
+ if (src_has_alpha)
+ a0 = (p[3] * overall_alpha + 0xff) >> 8;
+ else
+@@ -372,7 +366,8 @@ pixops_composite_color_nearest (guchar
+ );
+ }
+ }
+-#undef INNER_LOOP
++#undef INNER_LOOP_BODY
++#undef INNER_LOOP_PREP
+
+ static void
+ composite_pixel (guchar *dest, int dest_x, int dest_channels, int dest_has_alpha,
diff --git a/recipes/gtk+/gtk+-2.10.14/gtk+-handhelds.patch b/recipes/gtk+/gtk+-2.10.14/gtk+-handhelds.patch
new file mode 100644
index 0000000000..1ea86ce6b2
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.10.14/gtk+-handhelds.patch
@@ -0,0 +1,149 @@
+Index: gtk+-2.10.6/gtk/gtkarrow.c
+===================================================================
+--- gtk+-2.10.6.orig/gtk/gtkarrow.c 2006-05-14 05:25:28.000000000 +0100
++++ gtk+-2.10.6/gtk/gtkarrow.c 2006-11-14 12:03:45.000000000 +0000
+@@ -31,7 +31,7 @@
+ #include "gtkintl.h"
+ #include "gtkalias.h"
+
+-#define MIN_ARROW_SIZE 15
++#define MIN_ARROW_SIZE 7
+
+ enum {
+ PROP_0,
+@@ -53,6 +53,8 @@
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec);
++static void gtk_arrow_size_request (GtkWidget *arrow,
++ GtkRequisition *requisition);
+
+
+ G_DEFINE_TYPE (GtkArrow, gtk_arrow, GTK_TYPE_MISC)
+@@ -88,6 +90,7 @@
+ GTK_PARAM_READWRITE));
+
+ widget_class->expose_event = gtk_arrow_expose;
++ widget_class->size_request = gtk_arrow_size_request;
+ }
+
+ static void
+@@ -143,13 +146,18 @@
+ }
+
+ static void
++gtk_arrow_size_request (GtkWidget *arrow,
++ GtkRequisition *requisition)
++{
++ requisition->width = MIN_ARROW_SIZE + GTK_MISC (arrow)->xpad * 2;
++ requisition->height = MIN_ARROW_SIZE + GTK_MISC (arrow)->ypad * 2;
++}
++
++static void
+ gtk_arrow_init (GtkArrow *arrow)
+ {
+ GTK_WIDGET_SET_FLAGS (arrow, GTK_NO_WINDOW);
+
+- GTK_WIDGET (arrow)->requisition.width = MIN_ARROW_SIZE + GTK_MISC (arrow)->xpad * 2;
+- GTK_WIDGET (arrow)->requisition.height = MIN_ARROW_SIZE + GTK_MISC (arrow)->ypad * 2;
+-
+ arrow->arrow_type = GTK_ARROW_RIGHT;
+ arrow->shadow_type = GTK_SHADOW_OUT;
+ }
+Index: gtk+-2.10.6/gtk/gtkentry.c
+===================================================================
+--- gtk+-2.10.6.orig/gtk/gtkentry.c 2006-11-14 12:03:45.000000000 +0000
++++ gtk+-2.10.6/gtk/gtkentry.c 2006-11-14 12:07:02.000000000 +0000
+@@ -577,6 +577,18 @@
+ 0.0,
+ GTK_PARAM_READWRITE));
+
++ // Added by gtk+-handhelds.patch
++ gtk_widget_class_install_style_property (widget_class,
++ g_param_spec_int ("min_width",
++ P_("Minimum width"),
++ P_("Minimum width of the entry field"),
++ 0,
++ G_MAXINT,
++ MIN_ENTRY_WIDTH,
++ G_PARAM_READABLE));
++
++
++
+ /**
+ * GtkEntry:truncate-multiline:
+ *
+@@ -1286,7 +1298,7 @@
+ {
+ GtkEntry *entry = GTK_ENTRY (widget);
+ PangoFontMetrics *metrics;
+- gint xborder, yborder;
++ gint xborder, yborder, min_width;
+ GtkBorder inner_border;
+ PangoContext *context;
+
+@@ -1302,8 +1314,10 @@
+ _gtk_entry_get_borders (entry, &xborder, &yborder);
+ _gtk_entry_effective_inner_border (entry, &inner_border);
+
++ gtk_widget_style_get (widget, "min_width", &min_width, NULL);
++
+ if (entry->width_chars < 0)
+- requisition->width = MIN_ENTRY_WIDTH + xborder * 2 + inner_border.left + inner_border.right;
++ requisition->width = min_width + xborder * 2 + inner_border.left + inner_border.right;
+ else
+ {
+ gint char_width = pango_font_metrics_get_approximate_char_width (metrics);
+Index: gtk+-2.10.6/gtk/gtkrange.c
+===================================================================
+--- gtk+-2.10.6.orig/gtk/gtkrange.c 2006-11-14 12:03:44.000000000 +0000
++++ gtk+-2.10.6/gtk/gtkrange.c 2006-11-14 12:07:40.000000000 +0000
+@@ -197,6 +197,7 @@
+ static gboolean gtk_range_key_press (GtkWidget *range,
+ GdkEventKey *event);
+
++static GdkAtom recognize_protocols_atom, atom_atom;
+
+ static guint signals[LAST_SIGNAL];
+
+@@ -213,6 +214,9 @@
+ object_class = (GtkObjectClass*) class;
+ widget_class = (GtkWidgetClass*) class;
+
++ recognize_protocols_atom = gdk_atom_intern ("RECOGNIZE_PROTOCOLS", FALSE);
++ atom_atom = gdk_atom_intern ("ATOM", FALSE);
++
+ gobject_class->set_property = gtk_range_set_property;
+ gobject_class->get_property = gtk_range_get_property;
+ gobject_class->finalize = gtk_range_finalize;
+@@ -1020,6 +1024,12 @@
+ &attributes, attributes_mask);
+ gdk_window_set_user_data (range->event_window, range);
+
++ gdk_property_change (range->event_window,
++ recognize_protocols_atom,
++ atom_atom,
++ 32, GDK_PROP_MODE_REPLACE,
++ NULL, 0);
++
+ widget->style = gtk_style_attach (widget->style, widget->window);
+ }
+
+@@ -1569,7 +1579,7 @@
+
+ /* ignore presses when we're already doing something else. */
+ if (range->layout->grab_location != MOUSE_OUTSIDE)
+- return FALSE;
++ return TRUE;
+
+ range->layout->mouse_x = event->x;
+ range->layout->mouse_y = event->y;
+@@ -1778,7 +1788,7 @@
+ return TRUE;
+ }
+
+- return FALSE;
++ return TRUE;
+ }
+
+ /**
diff --git a/recipes/gtk+/gtk+-2.10.14/hardcoded_libtool.patch b/recipes/gtk+/gtk+-2.10.14/hardcoded_libtool.patch
new file mode 100644
index 0000000000..6adb0cfef6
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.10.14/hardcoded_libtool.patch
@@ -0,0 +1,29 @@
+--- /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/recipes/gtk+/gtk+-2.10.14/integer-pixops.patch b/recipes/gtk+/gtk+-2.10.14/integer-pixops.patch
new file mode 100644
index 0000000000..490a60dd8a
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.10.14/integer-pixops.patch
@@ -0,0 +1,348 @@
+--- /tmp/config.h.in 2006-12-23 00:00:38.000000000 +0100
++++ gtk+-2.10.6/config.h.in 2006-12-23 00:01:05.632227000 +0100
+@@ -253,3 +253,7 @@
+
+ /* Define to `int' if <sys/types.h> doesn't define. */
+ #undef uid_t
++
++/* Define to use integer math rather than floating point where possible. */
++#undef ENABLE_INTEGER_PIXOPS
++
+--- /tmp/configure.in 2006-12-23 00:02:16.000000000 +0100
++++ gtk+-2.10.6/configure.in 2006-12-23 00:05:11.172227000 +0100
+@@ -203,6 +203,15 @@
+ [AC_HELP_STRING([--disable-rebuilds],
+ [disable all source autogeneration rules])],,
+ [enable_rebuilds=yes])
++AC_ARG_ENABLE(integer-pixops,
++ [AC_HELP_STRING([--enable-integer-pixops],
++ [use integer math where possible])],,
++ [enable_integer_pixops=no])
++
++if test "x$enable_integer_pixops" = "xyes"; then
++ AC_DEFINE(ENABLE_INTEGER_PIXOPS)
++fi
++
+ AC_ARG_ENABLE(visibility,
+ [AC_HELP_STRING([--disable-visibility],
+ [don't use ELF visibility attributes])],,
+--- /tmp/pixops.c 2006-12-23 10:04:02.000000000 +0100
++++ gtk+-2.10.6/gdk-pixbuf/pixops/pixops.c 2006-12-23 10:04:21.772227000 +0100
+@@ -28,6 +28,10 @@
+ #define SUBSAMPLE_MASK ((1 << SUBSAMPLE_BITS)-1)
+ #define SCALE_SHIFT 16
+
++#ifdef ENABLE_INTEGER_PIXOPS
++#define FRAC 0x10000ULL
++#endif
++
+ typedef struct _PixopsFilter PixopsFilter;
+ typedef struct _PixopsFilterDimension PixopsFilterDimension;
+
+@@ -972,6 +976,29 @@
+ (*pixel_func) (dest, dest_x, dest_channels, dest_has_alpha, src_has_alpha, check_size, color1, color2, r, g, b, a);
+ }
+
++#ifdef ENABLE_INTEGER_PIXOPS
++
++static void
++correct_total (int *weights,
++ int n_x,
++ int n_y,
++ int total,
++ unsigned long overall_alpha)
++{
++ int correction = (int)(overall_alpha - total);
++ int i;
++ for (i = n_x * n_y - 1; i >= 0; i--)
++ {
++ if (*(weights + i) + correction >= 0)
++ {
++ *(weights + i) += correction;
++ break;
++ }
++ }
++}
++
++#else
++
+ static void
+ correct_total (int *weights,
+ int n_x,
+@@ -998,6 +1025,8 @@
+ }
+ }
+
++#endif
++
+ static int *
+ make_filter_table (PixopsFilter *filter)
+ {
+@@ -1026,7 +1055,11 @@
+ *(pixel_weights + n_x * i + j) = weight;
+ }
+
+- correct_total (pixel_weights, n_x, n_y, total, filter->overall_alpha);
++#ifdef ENABLE_INTEGER_PIXOPS
++ correct_total (pixel_weights, n_x, n_y, total, overall_alpha * FRAC);
++#else
++ correct_total (pixel_weights, n_x, n_y, total, overall_alpha);
++#endif
+ }
+
+ return weights;
+@@ -1178,6 +1211,93 @@
+ /* Compute weights for reconstruction by replication followed by
+ * sampling with a box filter
+ */
++#ifdef ENABLE_INTEGER_PIXOPS
++
++static void
++tile_make_weights (PixopsFilter *filter, double x_scale_d, double y_scale_d, double overall_alpha_d)
++{
++ int i_offset, j_offset;
++ unsigned long x_scale = x_scale_d * FRAC;
++ unsigned long y_scale = y_scale_d * FRAC;
++ unsigned long overall_alpha = overall_alpha_d * FRAC;
++ unsigned long x_scale_r = FRAC / x_scale;
++ unsigned long y_scale_r = FRAC / y_scale;
++
++ int n_x = ceil(1/x_scale_d + 1);
++ int n_y = ceil(1/y_scale_d + 1);
++
++ filter->x_offset = 0;
++ filter->y_offset = 0;
++ filter->n_x = n_x;
++ filter->n_y = n_y;
++ filter->weights = g_new (int, SUBSAMPLE * SUBSAMPLE * n_x * n_y);
++
++ for (i_offset=0; i_offset<SUBSAMPLE; i_offset++)
++ for (j_offset=0; j_offset<SUBSAMPLE; j_offset++)
++ {
++ int *pixel_weights = filter->weights + ((i_offset*SUBSAMPLE) + j_offset) * n_x * n_y;
++ unsigned long x = j_offset * FRAC / SUBSAMPLE;
++ unsigned long y = i_offset * FRAC / SUBSAMPLE;
++ int i,j;
++ int total = 0;
++
++ for (i = 0; i < n_y; i++)
++ {
++ unsigned long tw, th;
++
++ if (i < y)
++ {
++
++ if (i + FRAC > y)
++ th = MIN(i+FRAC, y + y_scale_r) - y;
++ else
++ th = 0;
++ }
++ else
++ {
++ if (y + FRAC/y_scale > i)
++ th = MIN(i+FRAC, y + y_scale_r) - i;
++ else
++ th = 0;
++ }
++
++ for (j = 0; j < n_x; j++)
++ {
++ int weight;
++
++ if (j < x)
++ {
++ if (j + FRAC > x)
++ tw = MIN(j+FRAC, x + x_scale_r) - x;
++ else
++ tw = 0;
++ }
++ else
++ {
++ if (x + FRAC/x_scale > j)
++ tw = MIN(j+FRAC, x + x_scale_r) - j;
++ else
++ tw = 0;
++ }
++
++ {
++ unsigned long lweight = (tw * x_scale) / FRAC;
++ lweight = (lweight * th) / FRAC;
++ lweight = (lweight * y_scale) / FRAC;
++ lweight = (lweight * overall_alpha) / FRAC;
++ weight = lweight;
++ }
++ total += weight;
++ *(pixel_weights + n_x * i + j) = weight;
++ }
++ }
++
++ correct_total (pixel_weights, n_x, n_y, total, overall_alpha);
++ }
++}
++
++#else
++
+ static void
+ tile_make_weights (PixopsFilterDimension *dim,
+ double scale)
+@@ -1216,10 +1336,151 @@
+ }
+ }
+
++#endif
++
+ /* Compute weights for a filter that, for minification
+ * is the same as 'tiles', and for magnification, is bilinear
+ * reconstruction followed by a sampling with a delta function.
+ */
++#ifdef ENABLE_INTEGER_PIXOPS
++
++static void
++bilinear_magnify_make_weights (PixopsFilter *filter, double x_scale_d, double y_scale_d, double overall_alpha_d)
++{
++ int i_offset, j_offset;
++ unsigned long *x_weights, *y_weights;
++ int n_x, n_y;
++ unsigned long x_scale = x_scale_d * FRAC;
++ unsigned long y_scale = y_scale_d * FRAC;
++ unsigned long overall_alpha = overall_alpha_d * FRAC;
++ unsigned long x_scale_r = (FRAC / x_scale_d);
++ unsigned long y_scale_r = (FRAC / y_scale_d);
++
++ if (x_scale > FRAC) /* Bilinear */
++ {
++ n_x = 2;
++ filter->x_offset = 0.5 * (1/x_scale_d - 1);
++ }
++ else /* Tile */
++ {
++ n_x = ceil(1.0 + 1.0/x_scale_d);
++ filter->x_offset = 0.0;
++ }
++
++ if (y_scale > FRAC) /* Bilinear */
++ {
++ n_y = 2;
++ filter->y_offset = 0.5 * (1/y_scale_d - 1);
++ }
++ else /* Tile */
++ {
++ n_y = ceil(1.0 + 1.0/y_scale_d);
++ filter->y_offset = 0.0;
++ }
++
++ filter->n_y = n_y;
++ filter->n_x = n_x;
++ filter->weights = g_new (int, SUBSAMPLE * SUBSAMPLE * n_x * n_y);
++
++ x_weights = g_new (unsigned long, n_x);
++ y_weights = g_new (unsigned long, n_y);
++
++ for (i_offset=0; i_offset<SUBSAMPLE; i_offset++)
++ for (j_offset=0; j_offset<SUBSAMPLE; j_offset++)
++ {
++ int *pixel_weights = filter->weights + ((i_offset*SUBSAMPLE) + j_offset) * n_x * n_y;
++ unsigned long x = j_offset * FRAC / SUBSAMPLE;
++ unsigned long y = i_offset * FRAC / SUBSAMPLE;
++ int i,j;
++ int total = 0;
++
++ if (x_scale > FRAC) /* Bilinear */
++ {
++ for (i = 0; i < n_x; i++)
++ {
++ /* x_weights[i] = ((i == 0) ? (1 - x) : x) / x_scale; */
++ unsigned long w = (((i == 0) ? (FRAC - x) : x) * x_scale_r);
++ x_weights[i] = w / FRAC;
++ }
++ }
++ else /* Tile */
++ {
++ /* x
++ * ---------|--.-|----|--.-|------- SRC
++ * ------------|---------|--------- DEST
++ */
++ for (i = 0; i < n_x; i++)
++ {
++ if (i < x)
++ {
++ if (i + 1 > x)
++ x_weights[i] = MIN(FRAC*(i+1), FRAC * x + (((unsigned long long)(FRAC * FRAC)) / (unsigned long)x_scale)) - (x * FRAC);
++ else
++ x_weights[i] = 0;
++ }
++ else
++ {
++ if (x + 1/x_scale > i)
++ x_weights[i] = MIN(FRAC*(i+1), FRAC * x + (((unsigned long long)(FRAC * FRAC)) / (unsigned long)x_scale)) - (i * FRAC);
++ else
++ x_weights[i] = 0;
++ }
++ }
++ }
++
++ if (y_scale > FRAC) /* Bilinear */
++ {
++ for (i = 0; i < n_y; i++)
++ {
++ unsigned long w = ((unsigned long)((i == 0) ? (FRAC - y) : y) * y_scale_r);
++ y_weights[i] = w / FRAC;
++ }
++ }
++ else /* Tile */
++ {
++ /* y
++ * ---------|--.-|----|--.-|------- SRC
++ * ------------|---------|--------- DEST
++ */
++ for (i = 0; i < n_y; i++)
++ {
++ if (i < y)
++ {
++ if (i + 1 > y)
++ y_weights[i] = MIN(FRAC*(i+1), FRAC * y + (FRAC * FRAC / (unsigned long)y_scale)) - (y * FRAC);
++ else
++ y_weights[i] = 0;
++ }
++ else
++ {
++ if (y + 1/y_scale > i)
++ y_weights[i] = MIN(FRAC*(i+1), FRAC * y + (FRAC * FRAC / (unsigned long)y_scale)) - (i * FRAC);
++ else
++ y_weights[i] = 0;
++ }
++ }
++ }
++
++ for (i = 0; i < n_y; i++)
++ for (j = 0; j < n_x; j++)
++ {
++ unsigned long long weight = (x_weights[j] * x_scale) / FRAC;
++ weight = (weight * y_weights[i]) / FRAC;
++ weight = (weight * y_scale) / FRAC;
++ weight = (weight * overall_alpha) / FRAC;
++ *(pixel_weights + n_x * i + j) = (unsigned long)weight;
++ total += (unsigned long)weight;
++ }
++
++ correct_total (pixel_weights, n_x, n_y, total, overall_alpha);
++ }
++
++ g_free (x_weights);
++ g_free (y_weights);
++}
++
++#else
++
+ static void
+ bilinear_magnify_make_weights (PixopsFilterDimension *dim,
+ double scale)
+@@ -1283,6 +1544,8 @@
+ }
+ }
+
++#endif
++
+ /* Computes the integral from b0 to b1 of
+ *
+ * f(x) = x; 0 <= x < 1
diff --git a/recipes/gtk+/gtk+-2.10.14/menu-deactivate.patch b/recipes/gtk+/gtk+-2.10.14/menu-deactivate.patch
new file mode 100644
index 0000000000..cfb8849e9f
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.10.14/menu-deactivate.patch
@@ -0,0 +1,51 @@
+--- 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/recipes/gtk+/gtk+-2.10.14/migration.patch b/recipes/gtk+/gtk+-2.10.14/migration.patch
new file mode 100644
index 0000000000..4ee786e688
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.10.14/migration.patch
@@ -0,0 +1,611 @@
+Index: configure.in
+===================================================================
+--- configure.in.orig 2006-10-03 17:54:09.000000000 +0100
++++ configure.in 2006-10-30 12:58:33.000000000 +0000
+@@ -1529,6 +1529,16 @@
+ GTK_EXTRA_CFLAGS="$msnative_struct"
+ fi
+
++AC_ARG_ENABLE(display-migration,
++ [AC_HELP_STRING([--enable-display-migration],
++ [include support for GPE_CHANGE_DISPLAY protocol])],
++ enable_migration=yes, enable_migration=no)
++if test "$enable_migration" = "yes"; then
++ AC_DEFINE([ENABLE_MIGRATION], 1, [Define if display migration is enabled])
++ GTK_DEP_LIBS="$GTK_DEP_LIBS -lgcrypt"
++fi
++AM_CONDITIONAL(ENABLE_MIGRATION, test $enable_migration = "yes")
++
+ AC_SUBST(GTK_PACKAGES)
+ AC_SUBST(GTK_EXTRA_LIBS)
+ AC_SUBST(GTK_EXTRA_CFLAGS)
+Index: gtk/Makefile.am
+===================================================================
+--- gtk/Makefile.am.orig 2006-10-02 18:27:53.000000000 +0100
++++ gtk/Makefile.am 2006-10-30 12:59:14.000000000 +0000
+@@ -589,6 +589,11 @@
+ gtkwindow-decorate.c \
+ gtkwindow.c \
+ $(gtk_clipboard_dnd_c_sources)
++
++if ENABLE_MIGRATION
++gtk_base_c_sources += gtkmigration.c
++endif
++
+ gtk_c_sources = $(gtk_base_c_sources)
+ gtk_all_c_sources = $(gtk_base_c_sources)
+
+Index: gtk/gtkmain.c
+===================================================================
+--- gtk/gtkmain.c.orig 2006-09-03 06:31:21.000000000 +0100
++++ gtk/gtkmain.c 2006-10-30 12:56:34.000000000 +0000
+@@ -507,6 +507,10 @@
+ _gtk_accel_map_init ();
+ _gtk_rc_init ();
+
++#ifdef ENABLE_MIGRATION
++ gtk_migration_init ();
++#endif
++
+ /* Set the 'initialized' flag.
+ */
+ gtk_initialized = TRUE;
+Index: gtk/gtkmigration.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ gtk/gtkmigration.c 2006-10-30 12:56:34.000000000 +0000
+@@ -0,0 +1,529 @@
++/*
++ * Copyright (C) 2003, 2005 Philip Blundell <philb@gnu.org>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version
++ * 2 of the License, or (at your option) any later version.
++ */
++
++#include <stdlib.h>
++#include <ctype.h>
++#include <libintl.h>
++#include <string.h>
++#include <assert.h>
++
++#include <X11/X.h>
++#include <X11/Xlib.h>
++#include <X11/Xatom.h>
++
++#include <gcrypt.h>
++
++#include "gtk.h"
++#include "gdk.h"
++#include "x11/gdkx.h"
++
++#define _(x) gettext(x)
++
++static GdkAtom string_gdkatom, display_change_gdkatom;
++static GdkAtom rsa_challenge_gdkatom;
++
++#define DISPLAY_CHANGE_SUCCESS 0
++#define DISPLAY_CHANGE_UNABLE_TO_CONNECT 1
++#define DISPLAY_CHANGE_NO_SUCH_SCREEN 2
++#define DISPLAY_CHANGE_AUTHENTICATION_BAD 3
++#define DISPLAY_CHANGE_INDETERMINATE_ERROR 4
++
++static gboolean no_auth;
++
++static GSList *all_widgets;
++
++static gboolean gtk_migration_initialised;
++
++#define CHALLENGE_LEN 64
++
++gchar *gtk_migration_auth_challenge_string;
++
++static unsigned char challenge_bytes[CHALLENGE_LEN];
++static unsigned long challenge_seq;
++
++#define hexbyte(x) ((x) >= 10 ? (x) + 'a' - 10 : (x) + '0')
++
++struct rsa_key
++{
++ gcry_mpi_t n, e, d, p, q, u;
++};
++
++static gcry_mpi_t
++mpi_from_sexp (gcry_sexp_t r, char *tag)
++{
++ gcry_sexp_t s = gcry_sexp_find_token (r, tag, 0);
++ return gcry_sexp_nth_mpi (s, 1, GCRYMPI_FMT_USG);
++}
++
++static char *
++hex_from_mpi (gcry_mpi_t m)
++{
++ char *buf;
++ gcry_mpi_aprint (GCRYMPI_FMT_HEX, (void *)&buf, NULL, m);
++ return buf;
++}
++
++static void
++gtk_migration_crypt_create_hash (char *display, char *challenge, size_t len, char *result)
++{
++ size_t dlen = strlen (display);
++ gchar *buf = g_malloc (dlen + 1 + len);
++ strcpy (buf, display);
++ memcpy (buf + dlen + 1, challenge, len);
++ gcry_md_hash_buffer (GCRY_MD_SHA1, result, buf, len + dlen + 1);
++ g_free (buf);
++}
++
++static int
++do_encode_md (const unsigned char *digest, size_t digestlen, int algo,
++ unsigned int nbits, gcry_mpi_t *r_val)
++{
++ int nframe = (nbits+7) / 8;
++ unsigned char *frame;
++ int i, n;
++ unsigned char asn[100];
++ size_t asnlen;
++
++ asnlen = sizeof(asn);
++ if (gcry_md_algo_info (algo, GCRYCTL_GET_ASNOID, asn, &asnlen))
++ return -1;
++
++ if (digestlen + asnlen + 4 > nframe )
++ return -1;
++
++ /* We encode the MD in this way:
++ *
++ * 0 1 PAD(n bytes) 0 ASN(asnlen bytes) MD(len bytes)
++ *
++ * PAD consists of FF bytes.
++ */
++ frame = g_malloc (nframe);
++ n = 0;
++ frame[n++] = 0;
++ frame[n++] = 1; /* block type */
++ i = nframe - digestlen - asnlen -3 ;
++ assert ( i > 1 );
++ memset ( frame+n, 0xff, i ); n += i;
++ frame[n++] = 0;
++ memcpy ( frame+n, asn, asnlen ); n += asnlen;
++ memcpy ( frame+n, digest, digestlen ); n += digestlen;
++ assert ( n == nframe );
++
++ gcry_mpi_scan (r_val, GCRYMPI_FMT_USG, frame, nframe, &nframe);
++ g_free (frame);
++ return 0;
++}
++
++static gboolean
++gtk_migration_crypt_check_signature (struct rsa_key *k, char *hash, char *sigbuf)
++{
++ gcry_mpi_t mpi, mpi2;
++ gcry_sexp_t data, sig, key;
++ int rc;
++
++ do_encode_md (hash, 20, GCRY_MD_SHA1, 1024, &mpi);
++
++ gcry_sexp_build (&data, NULL, "(data (value %m))", mpi);
++
++ gcry_mpi_release (mpi);
++
++ gcry_sexp_build (&key, NULL, "(public-key (rsa (n %m) (e %m)))", k->n, k->e);
++
++ if (gcry_mpi_scan (&mpi2, GCRYMPI_FMT_HEX, sigbuf, 0, NULL))
++ {
++ gcry_sexp_release (data);
++ return FALSE;
++ }
++
++ gcry_sexp_build (&sig, NULL, "(sig-val (rsa (s %m)))", mpi2);
++
++ rc = gcry_pk_verify (sig, data, key);
++
++ gcry_sexp_release (data);
++ gcry_sexp_release (key);
++ gcry_sexp_release (sig);
++ gcry_mpi_release (mpi2);
++
++ if (rc)
++ return FALSE;
++
++ return TRUE;
++}
++
++static void
++gtk_migration_auth_update_challenge (void)
++{
++ int i;
++ unsigned char *p;
++
++ if (gtk_migration_auth_challenge_string == NULL)
++ gtk_migration_auth_challenge_string = g_malloc ((CHALLENGE_LEN * 2) + 9);
++
++ p = gtk_migration_auth_challenge_string;
++
++ for (i = 0; i < CHALLENGE_LEN; i++)
++ {
++ *p++ = hexbyte (challenge_bytes[i] >> 4);
++ *p++ = hexbyte (challenge_bytes[i] & 15);
++ }
++
++ sprintf (p, "%08lx", challenge_seq++);
++}
++
++static void
++gtk_migration_auth_generate_challenge (void)
++{
++ gcry_randomize (challenge_bytes, sizeof (challenge_bytes), GCRY_STRONG_RANDOM);
++ gtk_migration_auth_update_challenge ();
++}
++
++static struct rsa_key *
++parse_pubkey (char *s)
++{
++ struct rsa_key *r;
++ gcry_mpi_t n, e;
++ gchar *sp;
++
++ sp = strtok (s, " \n");
++ gcry_mpi_scan (&e, GCRYMPI_FMT_HEX, sp, 0, NULL);
++ sp = strtok (NULL, " \n");
++ gcry_mpi_scan (&n, GCRYMPI_FMT_HEX, sp, 0, NULL);
++
++ r = g_malloc0 (sizeof (struct rsa_key));
++ r->e = e;
++ r->n = n;
++ return r;
++}
++
++static struct rsa_key *
++lookup_pubkey (u_int32_t id)
++{
++ const gchar *home_dir = g_get_home_dir ();
++ gchar *filename = g_strdup_printf ("%s/.gpe/migrate/public", home_dir);
++ FILE *fp = fopen (filename, "r");
++ struct rsa_key *r = NULL;
++
++ if (fp)
++ {
++ while (!feof (fp))
++ {
++ char buffer[4096];
++ if (fgets (buffer, 4096, fp))
++ {
++ char *p;
++ u_int32_t this_id = strtoul (buffer, &p, 16);
++ if (p != buffer && *p == ' ')
++ {
++#ifdef DEBUG
++ fprintf (stderr, "found id %x\n", this_id);
++#endif
++ if (this_id == id)
++ {
++ r = parse_pubkey (++p);
++ break;
++ }
++ }
++ }
++ }
++ fclose (fp);
++ }
++
++ g_free (filename);
++ return r;
++}
++
++static void
++free_pubkey (struct rsa_key *k)
++{
++ gcry_mpi_release (k->n);
++ gcry_mpi_release (k->e);
++
++ g_free (k);
++}
++
++static gboolean
++gtk_migration_auth_validate_request (char *display, char *data)
++{
++ u_int32_t key_id;
++ char *ep;
++ char *p;
++ struct rsa_key *k;
++ char hash[20];
++ gboolean rc;
++
++ p = strchr (data, ' ');
++ if (p == NULL)
++ return FALSE;
++ *p++ = 0;
++
++ key_id = strtoul (data, &ep, 16);
++ if (*ep)
++ return FALSE;
++
++ k = lookup_pubkey (key_id);
++ if (k == NULL)
++ return FALSE;
++
++ gtk_migration_crypt_create_hash (display, gtk_migration_auth_challenge_string,
++ strlen (gtk_migration_auth_challenge_string), hash);
++
++ rc = gtk_migration_crypt_check_signature (k, hash, p);
++
++ free_pubkey (k);
++
++ return rc;
++}
++
++static int
++do_change_display (GtkWidget *w, char *display_name)
++{
++ GdkDisplay *newdisplay;
++ guint screen_nr = 1;
++ guint i;
++
++ if (display_name[0] == 0)
++ return DISPLAY_CHANGE_INDETERMINATE_ERROR;
++
++ i = strlen (display_name) - 1;
++ while (i > 0 && isdigit (display_name[i]))
++ i--;
++
++ if (display_name[i] == '.')
++ {
++ screen_nr = atoi (display_name + i + 1);
++ display_name[i] = 0;
++ }
++
++ newdisplay = gdk_display_open (display_name);
++ if (newdisplay)
++ {
++ GdkScreen *screen = gdk_display_get_screen (newdisplay, screen_nr);
++ if (screen)
++ {
++ gtk_window_set_screen (GTK_WINDOW (w), screen);
++ gdk_display_manager_set_default_display (gdk_display_manager_get (),
++ newdisplay);
++ return DISPLAY_CHANGE_SUCCESS;
++ }
++ else
++ return DISPLAY_CHANGE_NO_SUCH_SCREEN;
++ }
++
++ return DISPLAY_CHANGE_UNABLE_TO_CONNECT;
++}
++
++static void
++set_challenge_on_window (GdkWindow *window)
++{
++ gdk_property_change (window, rsa_challenge_gdkatom, string_gdkatom,
++ 8, GDK_PROP_MODE_REPLACE, gtk_migration_auth_challenge_string,
++ strlen (gtk_migration_auth_challenge_string));
++}
++
++static void
++update_challenge_on_windows (void)
++{
++ GSList *i;
++
++ gtk_migration_auth_update_challenge ();
++
++ for (i = all_widgets; i; i = i->next)
++ {
++ GtkWidget *w = GTK_WIDGET (i->data);
++ if (w->window)
++ set_challenge_on_window (w->window);
++ }
++}
++
++static void
++reset_state (GdkWindow *window)
++{
++ gdk_property_change (window, display_change_gdkatom, string_gdkatom,
++ 8, GDK_PROP_MODE_REPLACE, NULL, 0);
++}
++
++static void
++generate_response (GdkDisplay *gdisplay, Display *dpy, Window window, int code)
++{
++ XClientMessageEvent ev;
++ Atom atom = gdk_x11_atom_to_xatom_for_display (gdisplay,
++ display_change_gdkatom);
++
++ memset (&ev, 0, sizeof (ev));
++
++ ev.type = ClientMessage;
++ ev.window = window;
++ ev.message_type = atom;
++ ev.format = 32;
++
++ ev.data.l[0] = window;
++ ev.data.l[1] = code;
++
++ XSendEvent (dpy, DefaultRootWindow (dpy), False, SubstructureNotifyMask, (XEvent *)&ev);
++}
++
++static int
++handle_request (GdkWindow *gwindow, char *prop)
++{
++ GtkWidget *widget;
++ char *target, *auth_method, *auth_data;
++ char *p;
++
++ target = prop;
++ auth_method = "NULL";
++ auth_data = NULL;
++
++ p = strchr (prop, ' ');
++ if (p)
++ {
++ *p = 0;
++ auth_method = ++p;
++
++ p = strchr (p, ' ');
++ if (p)
++ {
++ *p = 0;
++ auth_data = ++p;
++ }
++ }
++
++ if (no_auth == FALSE)
++ {
++ if (!strcasecmp (auth_method, "null"))
++ return DISPLAY_CHANGE_AUTHENTICATION_BAD;
++ else if (!strcasecmp (auth_method, "rsa-sig"))
++ {
++ if (gtk_migration_auth_validate_request (target, auth_data) == FALSE)
++ return DISPLAY_CHANGE_AUTHENTICATION_BAD;
++ }
++ else
++ return DISPLAY_CHANGE_AUTHENTICATION_BAD;
++ }
++
++ gdk_window_get_user_data (gwindow, (gpointer*) &widget);
++
++ if (widget)
++ return do_change_display (widget, target);
++
++ return DISPLAY_CHANGE_INDETERMINATE_ERROR;
++}
++
++static GdkFilterReturn
++filter_func (GdkXEvent *xevp, GdkEvent *ev, gpointer p)
++{
++ XPropertyEvent *xev = (XPropertyEvent *)xevp;
++
++ if (xev->type == PropertyNotify)
++ {
++ GdkDisplay *gdisplay;
++ Atom atom;
++
++ gdisplay = gdk_x11_lookup_xdisplay (xev->display);
++ if (gdisplay)
++ {
++ atom = gdk_x11_atom_to_xatom_for_display (gdisplay, display_change_gdkatom);
++
++ if (xev->atom == atom)
++ {
++ GdkWindow *gwindow;
++
++ gwindow = gdk_window_lookup_for_display (gdisplay, xev->window);
++
++ if (gwindow)
++ {
++ GdkAtom actual_type;
++ gint actual_format;
++ gint actual_length;
++ unsigned char *prop = NULL;
++
++ if (gdk_property_get (gwindow, display_change_gdkatom, string_gdkatom,
++ 0, G_MAXLONG, FALSE, &actual_type, &actual_format,
++ &actual_length, &prop))
++ {
++ if (actual_length != 0)
++ {
++ if (actual_type == string_gdkatom && actual_length > 8)
++ {
++ gchar *buf = g_malloc (actual_length + 1);
++ int rc;
++
++ memcpy (buf, prop, actual_length);
++ buf[actual_length] = 0;
++
++ rc = handle_request (gwindow, buf);
++
++ g_free (buf);
++ generate_response (gdisplay, xev->display, xev->window, rc);
++
++ if (rc == DISPLAY_CHANGE_SUCCESS)
++ update_challenge_on_windows ();
++ }
++
++ reset_state (gwindow);
++ }
++ }
++
++ if (prop)
++ g_free (prop);
++ }
++ }
++
++ return GDK_FILTER_REMOVE;
++ }
++ }
++
++ return GDK_FILTER_CONTINUE;
++}
++
++static void
++unrealize_window (GtkWidget *w)
++{
++ all_widgets = g_slist_remove (all_widgets, w);
++}
++
++void
++gtk_migration_mark_window (GtkWidget *w)
++{
++ if (! gtk_migration_initialised)
++ {
++ g_warning ("gtk_migration not initialised yet");
++ return;
++ }
++
++ if (GTK_WIDGET_REALIZED (w))
++ {
++ GdkWindow *window = w->window;
++
++ gdk_window_add_filter (window, filter_func, NULL);
++
++ reset_state (window);
++ set_challenge_on_window (window);
++
++ all_widgets = g_slist_append (all_widgets, w);
++
++ g_signal_connect (G_OBJECT (w), "unrealize", G_CALLBACK (unrealize_window), NULL);
++ }
++ else
++ g_signal_connect (G_OBJECT (w), "realize", G_CALLBACK (gtk_migration_mark_window), NULL);
++}
++
++void
++gtk_migration_init (void)
++{
++ if (getenv ("GPE_DISPLAY_MIGRATION_NO_AUTH") != NULL)
++ no_auth = TRUE;
++
++ string_gdkatom = gdk_atom_intern ("STRING", FALSE);
++ display_change_gdkatom = gdk_atom_intern ("_GPE_DISPLAY_CHANGE", FALSE);
++ rsa_challenge_gdkatom = gdk_atom_intern ("_GPE_DISPLAY_CHANGE_RSA_CHALLENGE", FALSE);
++
++ gtk_migration_auth_generate_challenge ();
++
++ gtk_migration_initialised = TRUE;
++}
+Index: gtk/gtkwindow.c
+===================================================================
+--- gtk/gtkwindow.c.orig 2006-10-03 16:51:46.000000000 +0100
++++ gtk/gtkwindow.c 2006-10-30 12:56:34.000000000 +0000
+@@ -50,6 +50,9 @@
+ #include "x11/gdkx.h"
+ #endif
+
++extern void gtk_migration_mark_window (GtkWidget *w);
++
++
+ enum {
+ SET_FOCUS,
+ FRAME_EVENT,
+@@ -823,6 +826,10 @@
+
+ g_signal_connect (window->screen, "composited_changed",
+ G_CALLBACK (gtk_window_on_composited_changed), window);
++
++#ifdef ENABLE_MIGRATION
++ gtk_migration_mark_window (window);
++#endif
+ }
+
+ static void
diff --git a/recipes/gtk+/gtk+-2.10.14/no-demos.patch b/recipes/gtk+/gtk+-2.10.14/no-demos.patch
new file mode 100644
index 0000000000..0fc4c48d1a
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.10.14/no-demos.patch
@@ -0,0 +1,10 @@
+--- 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/recipes/gtk+/gtk+-2.10.14/no-xwc.patch b/recipes/gtk+/gtk+-2.10.14/no-xwc.patch
new file mode 100644
index 0000000000..affb4a303e
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.10.14/no-xwc.patch
@@ -0,0 +1,151 @@
+diff -urNd ../gtk+-2.6.0-r2/gtk+-2.6.0/gdk/x11/gdkdrawable-x11.c gtk+-2.6.0/gdk/x11/gdkdrawable-x11.c
+--- ../gtk+-2.6.0-r2/gtk+-2.6.0/gdk/x11/gdkdrawable-x11.c 2004-11-30 14:57:14 +00:00
++++ gtk+-2.6.0/gdk/x11/gdkdrawable-x11.c 2005-01-02 15:38:06 +00:00
+@@ -576,12 +576,14 @@
+ GDK_GC_GET_XGC (gc), x, y, (XChar2b *) text, text_length / 2);
+ }
+ }
++#ifdef HAVE_XWC
+ else if (font->type == GDK_FONT_FONTSET)
+ {
+ XFontSet fontset = (XFontSet) GDK_FONT_XFONT (font);
+ XmbDrawString (xdisplay, impl->xid,
+ fontset, GDK_GC_GET_XGC (gc), x, y, text, text_length);
+ }
++#endif
+ else
+ g_error("undefined font type\n");
+ }
+@@ -613,6 +615,7 @@
+ GDK_GC_GET_XGC (gc), x, y, text_8bit, text_length);
+ g_free (text_8bit);
+ }
++#ifdef HAVE_XWC
+ else if (font->type == GDK_FONT_FONTSET)
+ {
+ if (sizeof(GdkWChar) == sizeof(wchar_t))
+@@ -633,6 +636,7 @@
+ g_free (text_wchar);
+ }
+ }
++#endif
+ else
+ g_error("undefined font type\n");
+ }
+diff -urNd ../gtk+-2.6.0-r2/gtk+-2.6.0/gdk/x11/gdkfont-x11.c gtk+-2.6.0/gdk/x11/gdkfont-x11.c
+--- ../gtk+-2.6.0-r2/gtk+-2.6.0/gdk/x11/gdkfont-x11.c 2004-08-26 01:23:46 +01:00
++++ gtk+-2.6.0/gdk/x11/gdkfont-x11.c 2005-01-02 15:45:39 +00:00
+@@ -525,10 +525,12 @@
+ width = XTextWidth16 (xfont, (XChar2b *) text, text_length / 2);
+ }
+ break;
++#ifdef HAVE_XWC
+ case GDK_FONT_FONTSET:
+ fontset = (XFontSet) private->xfont;
+ width = XmbTextEscapement (fontset, text, text_length);
+ break;
++#endif
+ default:
+ width = 0;
+ }
+@@ -578,6 +580,7 @@
+ width = 0;
+ }
+ break;
++#ifdef HAVE_XWC
+ case GDK_FONT_FONTSET:
+ if (sizeof(GdkWChar) == sizeof(wchar_t))
+ {
+@@ -595,6 +598,7 @@
+ g_free (text_wchar);
+ }
+ break;
++#endif
+ default:
+ width = 0;
+ }
+@@ -667,6 +671,7 @@
+ if (descent)
+ *descent = overall.descent;
+ break;
++#ifdef HAVE_XWC
+ case GDK_FONT_FONTSET:
+ fontset = (XFontSet) private->xfont;
+ XmbTextExtents (fontset, text, text_length, &ink, &logical);
+@@ -681,6 +686,7 @@
+ if (descent)
+ *descent = ink.y + ink.height;
+ break;
++#endif
+ }
+
+ }
+@@ -753,6 +759,7 @@
+ *descent = overall.descent;
+ break;
+ }
++#ifdef HAVE_XWC
+ case GDK_FONT_FONTSET:
+ fontset = (XFontSet) private->xfont;
+
+@@ -780,6 +787,7 @@
+ if (descent)
+ *descent = ink.y + ink.height;
+ break;
++#endif
+ }
+
+ }
+diff -urNd ../gtk+-2.6.0-r2/gtk+-2.6.0/gdk/x11/gdkim-x11.c gtk+-2.6.0/gdk/x11/gdkim-x11.c
+--- ../gtk+-2.6.0-r2/gtk+-2.6.0/gdk/x11/gdkim-x11.c 2004-11-17 00:55:10 +00:00
++++ gtk+-2.6.0/gdk/x11/gdkim-x11.c 2005-01-02 15:42:04 +00:00
+@@ -48,6 +48,7 @@
+ void
+ _gdk_x11_initialize_locale (void)
+ {
++#ifdef HAVE_XWC
+ wchar_t result;
+ gchar *current_locale;
+ static char *last_locale = NULL;
+@@ -93,7 +94,8 @@
+ GDK_NOTE (XIM,
+ g_message ("%s multi-byte string functions.",
+ gdk_use_mb ? "Using" : "Not using"));
+-
++#endif
++
+ return;
+ }
+
+@@ -136,6 +138,7 @@
+ {
+ gchar *mbstr;
+
++#ifdef HAVE_XWC
+ if (gdk_use_mb)
+ {
+ GdkDisplay *display = find_a_display ();
+@@ -178,6 +181,7 @@
+ XFree (tpr.value);
+ }
+ else
++#endif
+ {
+ gint length = 0;
+ gint i;
+@@ -210,6 +214,7 @@
+ gint
+ gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max)
+ {
++#ifdef HAVE_XWC
+ if (gdk_use_mb)
+ {
+ GdkDisplay *display = find_a_display ();
+@@ -242,6 +247,7 @@
+ return len_cpy;
+ }
+ else
++#endif
+ {
+ gint i;
+
diff --git a/recipes/gtk+/gtk+-2.10.14/plana-pixops.patch b/recipes/gtk+/gtk+-2.10.14/plana-pixops.patch
new file mode 100644
index 0000000000..21fe4879c5
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.10.14/plana-pixops.patch
@@ -0,0 +1,569 @@
+diff -urN gtk+-2.10.9.orig/config.h.in gtk+-2.10.9-integer-pixops/config.h.in
+--- gtk+-2.10.9.orig/config.h.in 2007-01-22 09:01:23.000000000 -0700
++++ gtk+-2.10.9-integer-pixops/config.h.in 2007-02-10 12:15:39.000000000 -0700
+@@ -259,3 +259,7 @@
+
+ /* Define to `int' if <sys/types.h> doesn't define. */
+ #undef uid_t
++
++/* Define to use integer math rather than floating point where possible. */
++#undef ENABLE_INTEGER_PIXOPS
++
+diff -urN gtk+-2.10.9.orig/configure.in gtk+-2.10.9-integer-pixops/configure.in
+--- gtk+-2.10.9.orig/configure.in 2007-01-22 08:59:41.000000000 -0700
++++ gtk+-2.10.9-integer-pixops/configure.in 2007-02-10 12:15:39.000000000 -0700
+@@ -203,6 +203,15 @@
+ [AC_HELP_STRING([--disable-rebuilds],
+ [disable all source autogeneration rules])],,
+ [enable_rebuilds=yes])
++AC_ARG_ENABLE(integer-pixops,
++ [AC_HELP_STRING([--enable-integer-pixops],
++ [use integer math where possible])],,
++ [enable_integer_pixops=no])
++
++if test "x$enable_integer_pixops" = "xyes"; then
++ AC_DEFINE(ENABLE_INTEGER_PIXOPS)
++fi
++
+ AC_ARG_ENABLE(visibility,
+ [AC_HELP_STRING([--disable-visibility],
+ [don't use ELF visibility attributes])],,
+diff -urN gtk+-2.10.9.orig/gdk-pixbuf/pixops/pixops.c gtk+-2.10.9-integer-pixops/gdk-pixbuf/pixops/pixops.c
+--- gtk+-2.10.9.orig/gdk-pixbuf/pixops/pixops.c 2007-01-22 08:50:43.000000000 -0700
++++ gtk+-2.10.9-integer-pixops/gdk-pixbuf/pixops/pixops.c 2007-02-12 01:00:23.000000000 -0700
+@@ -28,21 +28,42 @@
+ #define SUBSAMPLE_MASK ((1 << SUBSAMPLE_BITS)-1)
+ #define SCALE_SHIFT 16
+
++/* TODO: Add a FLOOR() and CEIL() macro to handle normalized values) */
++/* TODO: Get rid of standard C numeric types (ie. int). Replace with glib types */
++#ifdef ENABLE_INTEGER_PIXOPS
++/* The bigger the value of FRAC is, the better the accuracy. Be wary of
++ overflows, though */
++#define FRAC 0x10000ULL
++#define NORMALIZE(d) (d * FRAC)
++#define UNNORMALIZE(t,i) ((t)(i) / FRAC)
++#define FLOOR(i) (int)((i) / FRAC)
++#define CEIL(i) (((i) - 1) / FRAC + 1)
++#define DOUBLE_TYPE gint32
++#define BIG_DOUBLE_TYPE gint64
++#else
++#define NORMALIZE(d) (d)
++#define UNNORMALIZE(t,i) (t)(i)
++#define FLOOR(i) floor(i)
++#define CEIL(i) ceil(i)
++#define DOUBLE_TYPE double
++#define BIG_DOUBLE_TYPE double
++#endif
++
+ typedef struct _PixopsFilter PixopsFilter;
+ typedef struct _PixopsFilterDimension PixopsFilterDimension;
+
+ struct _PixopsFilterDimension
+ {
+ int n;
+- double offset;
+- double *weights;
++ BIG_DOUBLE_TYPE offset;
++ DOUBLE_TYPE *weights;
+ };
+
+ struct _PixopsFilter
+ {
+ PixopsFilterDimension x;
+ PixopsFilterDimension y;
+- double overall_alpha;
++ gint32 overall_alpha; /* Normalized: alpha * 255; Not sure why original devs chose 255 */
+ };
+
+ typedef guchar *(*PixopsLineFunc) (int *weights, int n_x, int n_y,
+@@ -86,13 +107,13 @@
+ int src_rowstride,
+ int src_channels,
+ gboolean src_has_alpha,
+- double scale_x,
+- double scale_y)
++ DOUBLE_TYPE scale_x,
++ DOUBLE_TYPE scale_y)
+ {
+ int i;
+ int x;
+- int x_step = (1 << SCALE_SHIFT) / scale_x;
+- int y_step = (1 << SCALE_SHIFT) / scale_y;
++ int x_step = NORMALIZE((1 << SCALE_SHIFT)) / scale_x;
++ int y_step = NORMALIZE((1 << SCALE_SHIFT)) / scale_y;
+ int xmax, xstart, xstop, x_pos, y_pos;
+ const guchar *p;
+
+@@ -175,14 +196,14 @@
+ int src_rowstride,
+ int src_channels,
+ gboolean src_has_alpha,
+- double scale_x,
+- double scale_y,
++ DOUBLE_TYPE scale_x,
++ DOUBLE_TYPE scale_y,
+ int overall_alpha)
+ {
+ int i;
+ int x;
+- int x_step = (1 << SCALE_SHIFT) / scale_x;
+- int y_step = (1 << SCALE_SHIFT) / scale_y;
++ int x_step = NORMALIZE((1 << SCALE_SHIFT)) / scale_x;
++ int y_step = NORMALIZE((1 << SCALE_SHIFT)) / scale_y;
+ int xmax, xstart, xstop, x_pos, y_pos;
+ const guchar *p;
+ unsigned int a0;
+@@ -260,8 +281,8 @@
+ int src_rowstride,
+ int src_channels,
+ gboolean src_has_alpha,
+- double scale_x,
+- double scale_y,
++ DOUBLE_TYPE scale_x,
++ DOUBLE_TYPE scale_y,
+ int overall_alpha,
+ int check_x,
+ int check_y,
+@@ -271,8 +292,8 @@
+ {
+ int i, j;
+ int x;
+- int x_step = (1 << SCALE_SHIFT) / scale_x;
+- int y_step = (1 << SCALE_SHIFT) / scale_y;
++ int x_step = NORMALIZE((1 << SCALE_SHIFT)) / scale_x;
++ int y_step = NORMALIZE((1 << SCALE_SHIFT)) / scale_y;
+ int r1, g1, b1, r2, g2, b2;
+ int check_shift = get_check_shift (check_size);
+ int xmax, xstart, xstop, x_pos, y_pos;
+@@ -977,9 +998,9 @@
+ int n_x,
+ int n_y,
+ int total,
+- double overall_alpha)
++ gint32 overall_alpha)
+ {
+- int correction = (int)(0.5 + 65536 * overall_alpha) - total;
++ int correction = (int)(0.5 + 65536 / 255 * overall_alpha) - total;
+ int remaining, c, d, i;
+
+ if (correction != 0)
+@@ -1009,7 +1030,7 @@
+ for (i_offset=0; i_offset < SUBSAMPLE; i_offset++)
+ for (j_offset=0; j_offset < SUBSAMPLE; j_offset++)
+ {
+- double weight;
++ DOUBLE_TYPE weight;
+ int *pixel_weights = weights + ((i_offset*SUBSAMPLE) + j_offset) * n_x * n_y;
+ int total = 0;
+ int i, j;
+@@ -1017,13 +1038,15 @@
+ for (i=0; i < n_y; i++)
+ for (j=0; j < n_x; j++)
+ {
+- weight = filter->x.weights[(j_offset * n_x) + j] *
++ weight = UNNORMALIZE(DOUBLE_TYPE, filter->x.weights[(j_offset * n_x) + j] *
+ filter->y.weights[(i_offset * n_y) + i] *
+- filter->overall_alpha * 65536 + 0.5;
++ filter->overall_alpha * 65536 / 255) + NORMALIZE(0.5);
++ /* Wonder how I should treat the "+ 0.5" for scientific
++ rouding off */
+
+- total += (int)weight;
++ total += UNNORMALIZE(int, weight);
+
+- *(pixel_weights + n_x * i + j) = weight;
++ *(pixel_weights + n_x * i + j) = UNNORMALIZE(int, weight);
+ }
+
+ correct_total (pixel_weights, n_x, n_y, total, filter->overall_alpha);
+@@ -1047,8 +1070,8 @@
+ int src_rowstride,
+ int src_channels,
+ gboolean src_has_alpha,
+- double scale_x,
+- double scale_y,
++ DOUBLE_TYPE scale_x,
++ DOUBLE_TYPE scale_y,
+ int check_x,
+ int check_y,
+ int check_size,
+@@ -1064,12 +1087,13 @@
+ guchar **line_bufs = g_new (guchar *, filter->y.n);
+ int *filter_weights = make_filter_table (filter);
+
+- int x_step = (1 << SCALE_SHIFT) / scale_x; /* X step in source (fixed point) */
+- int y_step = (1 << SCALE_SHIFT) / scale_y; /* Y step in source (fixed point) */
++ int x_step = NORMALIZE((1 << SCALE_SHIFT)) / scale_x; /* X step in source (fixed point) */
++ int y_step = NORMALIZE((1 << SCALE_SHIFT)) / scale_y; /* Y step in source (fixed point) */
+
+ int check_shift = check_size ? get_check_shift (check_size) : 0;
+
+- int scaled_x_offset = floor (filter->x.offset * (1 << SCALE_SHIFT));
++ /* Possible overflow when scale-shifting which is why offset is BIG_DOUBLE_TYPE */
++ int scaled_x_offset = FLOOR(filter->x.offset * (1 << SCALE_SHIFT));
+
+ /* Compute the index where we run off the end of the source buffer. The furthest
+ * source pixel we access at index i is:
+@@ -1087,7 +1111,7 @@
+ int run_end_index = MYDIV (run_end_x + x_step - 1, x_step) - render_x0;
+ run_end_index = MIN (run_end_index, render_x1 - render_x0);
+
+- y = render_y0 * y_step + floor (filter->y.offset * (1 << SCALE_SHIFT));
++ y = render_y0 * y_step + FLOOR(filter->y.offset * (1 << SCALE_SHIFT));
+ for (i = 0; i < (render_y1 - render_y0); i++)
+ {
+ int dest_x;
+@@ -1180,37 +1204,37 @@
+ */
+ static void
+ tile_make_weights (PixopsFilterDimension *dim,
+- double scale)
++ DOUBLE_TYPE scale)
+ {
+- int n = ceil (1 / scale + 1);
+- double *pixel_weights = g_new (double, SUBSAMPLE * n);
++ int n = CEIL(NORMALIZE(NORMALIZE(1)) / scale + NORMALIZE(1)); /* Another possible overflow */
++ DOUBLE_TYPE *pixel_weights = g_new (DOUBLE_TYPE, SUBSAMPLE * n);
+ int offset;
+ int i;
+-
++
+ dim->n = n;
+- dim->offset = 0;
++ dim->offset = NORMALIZE(0);
+ dim->weights = pixel_weights;
+
+ for (offset = 0; offset < SUBSAMPLE; offset++)
+ {
+- double x = (double)offset / SUBSAMPLE;
+- double a = x + 1 / scale;
++ DOUBLE_TYPE x = (DOUBLE_TYPE)NORMALIZE(offset) / SUBSAMPLE;
++ DOUBLE_TYPE a = x + NORMALIZE(NORMALIZE(1)) / scale;
+
+ for (i = 0; i < n; i++)
+ {
+- if (i < x)
++ if (NORMALIZE(i) < x)
+ {
+- if (i + 1 > x)
+- *(pixel_weights++) = (MIN (i + 1, a) - x) * scale;
++ if (NORMALIZE(i + 1) > x)
++ *(pixel_weights++) = UNNORMALIZE(DOUBLE_TYPE, (MIN(NORMALIZE(i + 1), a) - x) * scale);
+ else
+- *(pixel_weights++) = 0;
++ *(pixel_weights++) = NORMALIZE(0);
+ }
+ else
+ {
+- if (a > i)
+- *(pixel_weights++) = (MIN (i + 1, a) - i) * scale;
++ if (a > NORMALIZE(i))
++ *(pixel_weights++) = UNNORMALIZE(DOUBLE_TYPE, (MIN(NORMALIZE(i + 1), a) - i) * scale);
+ else
+- *(pixel_weights++) = 0;
++ *(pixel_weights++) = NORMALIZE(0);
+ }
+ }
+ }
+@@ -1222,41 +1246,44 @@
+ */
+ static void
+ bilinear_magnify_make_weights (PixopsFilterDimension *dim,
+- double scale)
++ DOUBLE_TYPE scale)
+ {
+- double *pixel_weights;
++ DOUBLE_TYPE *pixel_weights;
+ int n;
+ int offset;
+ int i;
+
+- if (scale > 1.0) /* Linear */
++ if (scale > NORMALIZE(1.0)) /* Linear */
+ {
+ n = 2;
+- dim->offset = 0.5 * (1 / scale - 1);
++ dim->offset = NORMALIZE(NORMALIZE(0.5) / (scale - NORMALIZE(1)));
+ }
+ else /* Tile */
+ {
+- n = ceil (1.0 + 1.0 / scale);
+- dim->offset = 0.0;
++ n = CEIL(NORMALIZE(1.0) + NORMALIZE(NORMALIZE(1.0)) / scale);
++ dim->offset = NORMALIZE(0.0);
+ }
+-
++
+ dim->n = n;
+- dim->weights = g_new (double, SUBSAMPLE * n);
++ dim->weights = g_new (DOUBLE_TYPE, SUBSAMPLE * n);
+
+ pixel_weights = dim->weights;
+
+ for (offset=0; offset < SUBSAMPLE; offset++)
+ {
+- double x = (double)offset / SUBSAMPLE;
++ DOUBLE_TYPE x = (DOUBLE_TYPE)NORMALIZE(offset) / SUBSAMPLE;
+
+- if (scale > 1.0) /* Linear */
++ if (scale > NORMALIZE(1.0)) /* Linear */
+ {
+ for (i = 0; i < n; i++)
+- *(pixel_weights++) = (((i == 0) ? (1 - x) : x) / scale) * scale;
++ /* In the original, what is the point of dividing by scale then multiplying by scale? */
++ /* *(pixel_weights++) = (((i == 0) ? (1 - x) : x) / scale) * scale;*/
++ /* *(pixel_weights++) = i == 0 ? NORMALIZE(1) - x : x; */
++ *(pixel_weights++) = (((i == 0) ? NORMALIZE(1) - x : x) / scale) * scale;
+ }
+ else /* Tile */
+ {
+- double a = x + 1 / scale;
++ DOUBLE_TYPE a = x + NORMALIZE(NORMALIZE(1)) / scale;
+
+ /* x
+ * ---------|--.-|----|--.-|------- SRC
+@@ -1264,19 +1291,19 @@
+ */
+ for (i = 0; i < n; i++)
+ {
+- if (i < x)
++ if (NORMALIZE(i) < x)
+ {
+- if (i + 1 > x)
+- *(pixel_weights++) = (MIN (i + 1, a) - x) * scale;
++ if (NORMALIZE(i + 1) > x)
++ *(pixel_weights++) = UNNORMALIZE(DOUBLE_TYPE, (MIN(NORMALIZE(i + 1), a) - x) * scale);
+ else
+- *(pixel_weights++) = 0;
++ *(pixel_weights++) = NORMALIZE(0);
+ }
+ else
+ {
+- if (a > i)
+- *(pixel_weights++) = (MIN (i + 1, a) - i) * scale;
++ if (a > NORMALIZE(i))
++ *(pixel_weights++) = UNNORMALIZE(DOUBLE_TYPE, (MIN(NORMALIZE(i + 1), a) - i) * scale);
+ else
+- *(pixel_weights++) = 0;
++ *(pixel_weights++) = NORMALIZE(0);
+ }
+ }
+ }
+@@ -1291,14 +1318,14 @@
+ * We combine two of these to compute the convolution of
+ * a box filter with a triangular spike.
+ */
+-static double
+-linear_box_half (double b0, double b1)
++static DOUBLE_TYPE
++linear_box_half (DOUBLE_TYPE b0, DOUBLE_TYPE b1)
+ {
+- double a0, a1;
+- double x0, x1;
++ DOUBLE_TYPE a0, a1;
++ DOUBLE_TYPE x0, x1;
+
+- a0 = 0.;
+- a1 = 1.;
++ a0 = NORMALIZE(0.);
++ a1 = NORMALIZE(1.);
+
+ if (a0 < b0)
+ {
+@@ -1308,7 +1335,7 @@
+ x1 = MIN (a1, b1);
+ }
+ else
+- return 0;
++ return NORMALIZE(0);
+ }
+ else
+ {
+@@ -1318,10 +1345,10 @@
+ x1 = MIN (a1, b1);
+ }
+ else
+- return 0;
++ return NORMALIZE(0);
+ }
+
+- return 0.5 * (x1*x1 - x0*x0);
++ return UNNORMALIZE(DOUBLE_TYPE, NORMALIZE(0.5) * UNNORMALIZE(DOUBLE_TYPE, (x1*x1 - x0*x0)));
+ }
+
+ /* Compute weights for reconstructing with bilinear
+@@ -1329,28 +1356,28 @@
+ */
+ static void
+ bilinear_box_make_weights (PixopsFilterDimension *dim,
+- double scale)
++ DOUBLE_TYPE scale)
+ {
+- int n = ceil (1/scale + 3.0);
+- double *pixel_weights = g_new (double, SUBSAMPLE * n);
+- double w;
++ int n = CEIL(NORMALIZE(NORMALIZE(1))/scale + NORMALIZE(3.0));
++ DOUBLE_TYPE *pixel_weights = g_new (DOUBLE_TYPE, SUBSAMPLE * n);
++ DOUBLE_TYPE w;
+ int offset, i;
+
+- dim->offset = -1.0;
++ dim->offset = NORMALIZE(-1.0);
+ dim->n = n;
+ dim->weights = pixel_weights;
+
+ for (offset = 0; offset < SUBSAMPLE; offset++)
+ {
+- double x = (double)offset / SUBSAMPLE;
+- double a = x + 1 / scale;
++ DOUBLE_TYPE x = (DOUBLE_TYPE)NORMALIZE(offset) / SUBSAMPLE;
++ DOUBLE_TYPE a = x + NORMALIZE(NORMALIZE(1)) / scale;
+
+ for (i = 0; i < n; i++)
+ {
+- w = linear_box_half (0.5 + i - a, 0.5 + i - x);
+- w += linear_box_half (1.5 + x - i, 1.5 + a - i);
++ w = linear_box_half (NORMALIZE(0.5) + NORMALIZE(i) - a, NORMALIZE(0.5) + NORMALIZE(i) - x);
++ w += linear_box_half (NORMALIZE(1.5) - NORMALIZE(i) + x, NORMALIZE(1.5) - NORMALIZE(i) + a);
+
+- *(pixel_weights++) = w * scale;
++ *(pixel_weights++) = UNNORMALIZE(DOUBLE_TYPE, w * scale);
+ }
+ }
+ }
+@@ -1358,8 +1385,8 @@
+ static void
+ make_weights (PixopsFilter *filter,
+ PixopsInterpType interp_type,
+- double scale_x,
+- double scale_y)
++ DOUBLE_TYPE scale_x,
++ DOUBLE_TYPE scale_y)
+ {
+ switch (interp_type)
+ {
+@@ -1399,8 +1426,8 @@
+ int src_rowstride,
+ int src_channels,
+ gboolean src_has_alpha,
+- double scale_x,
+- double scale_y,
++ double scale_x_d,
++ double scale_y_d,
+ PixopsInterpType interp_type,
+ int overall_alpha,
+ int check_x,
+@@ -1409,6 +1436,8 @@
+ guint32 color1,
+ guint32 color2)
+ {
++ DOUBLE_TYPE scale_x = NORMALIZE(scale_x_d);
++ DOUBLE_TYPE scale_y = NORMALIZE(scale_y_d);
+ PixopsFilter filter;
+ PixopsLineFunc line_func;
+
+@@ -1419,7 +1448,7 @@
+ g_return_if_fail (!(dest_channels == 3 && dest_has_alpha));
+ g_return_if_fail (!(src_channels == 3 && src_has_alpha));
+
+- if (scale_x == 0 || scale_y == 0)
++ if (scale_x == NORMALIZE(0) || scale_y == NORMALIZE(0))
+ return;
+
+ if (!src_has_alpha && overall_alpha == 255)
+@@ -1427,7 +1456,7 @@
+ _pixops_scale (dest_buf, render_x0, render_y0, render_x1, render_y1,
+ dest_rowstride, dest_channels, dest_has_alpha,
+ src_buf, src_width, src_height, src_rowstride, src_channels,
+- src_has_alpha, scale_x, scale_y, interp_type);
++ src_has_alpha, UNNORMALIZE(double, scale_x), UNNORMALIZE(double, scale_y), interp_type);
+ return;
+ }
+
+@@ -1441,7 +1470,8 @@
+ return;
+ }
+
+- filter.overall_alpha = overall_alpha / 255.;
++ /* filter.overall_alpha = overall_alpha / 255.; /* Why is it 255 instead of 256? */
++ filter.overall_alpha = overall_alpha;
+ make_weights (&filter, interp_type, scale_x, scale_y);
+
+ #ifdef USE_MMX
+@@ -1501,11 +1531,13 @@
+ int src_rowstride,
+ int src_channels,
+ gboolean src_has_alpha,
+- double scale_x,
+- double scale_y,
++ double scale_x_d,
++ double scale_y_d,
+ PixopsInterpType interp_type,
+ int overall_alpha)
+ {
++ DOUBLE_TYPE scale_x = NORMALIZE(scale_x_d);
++ DOUBLE_TYPE scale_y = NORMALIZE(scale_y_d);
+ PixopsFilter filter;
+ PixopsLineFunc line_func;
+
+@@ -1516,7 +1548,7 @@
+ g_return_if_fail (!(dest_channels == 3 && dest_has_alpha));
+ g_return_if_fail (!(src_channels == 3 && src_has_alpha));
+
+- if (scale_x == 0 || scale_y == 0)
++ if (scale_x == NORMALIZE(0) || scale_y == NORMALIZE(0))
+ return;
+
+ if (!src_has_alpha && overall_alpha == 255)
+@@ -1524,7 +1556,7 @@
+ _pixops_scale (dest_buf, render_x0, render_y0, render_x1, render_y1,
+ dest_rowstride, dest_channels, dest_has_alpha,
+ src_buf, src_width, src_height, src_rowstride, src_channels,
+- src_has_alpha, scale_x, scale_y, interp_type);
++ src_has_alpha, UNNORMALIZE(double, scale_x), UNNORMALIZE(double, scale_y), interp_type);
+ return;
+ }
+
+@@ -1537,7 +1569,7 @@
+ return;
+ }
+
+- filter.overall_alpha = overall_alpha / 255.;
++ filter.overall_alpha = overall_alpha;
+ make_weights (&filter, interp_type, scale_x, scale_y);
+
+ if (filter.x.n == 2 && filter.y.n == 2 &&
+@@ -1578,10 +1610,12 @@
+ int src_rowstride,
+ int src_channels,
+ gboolean src_has_alpha,
+- double scale_x,
+- double scale_y,
++ double scale_x_d,
++ double scale_y_d,
+ PixopsInterpType interp_type)
+ {
++ DOUBLE_TYPE scale_x = NORMALIZE(scale_x_d);
++ DOUBLE_TYPE scale_y = NORMALIZE(scale_y_d);
+ PixopsFilter filter;
+ PixopsLineFunc line_func;
+
+@@ -1593,7 +1627,7 @@
+ g_return_if_fail (!(src_channels == 3 && src_has_alpha));
+ g_return_if_fail (!(src_has_alpha && !dest_has_alpha));
+
+- if (scale_x == 0 || scale_y == 0)
++ if (scale_x == NORMALIZE(0) || scale_y == NORMALIZE(0))
+ return;
+
+ if (interp_type == PIXOPS_INTERP_NEAREST)
+@@ -1605,7 +1639,7 @@
+ return;
+ }
+
+- filter.overall_alpha = 1.0;
++ filter.overall_alpha = 255;
+ make_weights (&filter, interp_type, scale_x, scale_y);
+
+ if (filter.x.n == 2 && filter.y.n == 2 && dest_channels == 3 && src_channels == 3)
diff --git a/recipes/gtk+/gtk+-2.10.14/range-no-redraw.patch b/recipes/gtk+/gtk+-2.10.14/range-no-redraw.patch
new file mode 100644
index 0000000000..e3603d7700
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.10.14/range-no-redraw.patch
@@ -0,0 +1,41 @@
+Index: gtk/gtkrange.c
+===================================================================
+--- gtk/gtkrange.c (revision 18523)
++++ gtk/gtkrange.c (working copy)
+@@ -99,6 +99,8 @@
+
+ GtkSensitivityType lower_sensitivity;
+ GtkSensitivityType upper_sensitivity;
++
++ guint motion_idle;
+ };
+
+
+@@ -1721,6 +1723,16 @@
+ &handled);
+ }
+
++static gboolean
++update_slider_position_idle (GtkRange *range)
++{
++ update_slider_position (range, range->layout->mouse_x,range->layout->mouse_y);
++
++ range->layout->motion_idle = 0;
++
++ return FALSE;
++}
++
+ static void
+ stop_scrolling (GtkRange *range)
+ {
+@@ -1860,8 +1872,8 @@
+ if (gtk_range_update_mouse_location (range))
+ gtk_widget_queue_draw (widget);
+
+- if (range->layout->grab_location == MOUSE_SLIDER)
+- update_slider_position (range, x, y);
++ if (range->layout->grab_location == MOUSE_SLIDER && !range->layout->motion_idle)
++ range->layout->motion_idle = g_idle_add ((GSourceFunc)update_slider_position_idle, range);
+
+ /* We handled the event if the mouse was in the range_rect */
+ return range->layout->mouse_location != MOUSE_OUTSIDE;
diff --git a/recipes/gtk+/gtk+-2.10.14/run-iconcache.patch b/recipes/gtk+/gtk+-2.10.14/run-iconcache.patch
new file mode 100644
index 0000000000..ac15e9ab24
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.10.14/run-iconcache.patch
@@ -0,0 +1,19 @@
+--- /tmp/Makefile.am 2007-01-08 17:44:47.000000000 +0100
++++ gtk+-2.10.7/gtk/Makefile.am 2007-01-08 17:45:17.025251000 +0100
+@@ -1128,11 +1128,11 @@
+ ./gtk-update-icon-cache
+ endif
+
+-gtkbuiltincache.h: @REBUILD@ stamp-icons
+- $(MAKE) $(AM_MAKEFLAGS) gtk-update-icon-cache$(EXEEXT)
+- $(gtk_update_icon_cache_program) --force --ignore-theme-index \
+- --source builtin_icons stock-icons > gtkbuiltincache.h.tmp && \
+- mv gtkbuiltincache.h.tmp gtkbuiltincache.h
++#gtkbuiltincache.h: @REBUILD@ stamp-icons
++# $(MAKE) $(AM_MAKEFLAGS) gtk-update-icon-cache$(EXEEXT)
++# $(gtk_update_icon_cache_program) --force --ignore-theme-index \
++# --source builtin_icons stock-icons > gtkbuiltincache.h.tmp && \
++# mv gtkbuiltincache.h.tmp gtkbuiltincache.h
+
+ EXTRA_DIST += \
+ $(STOCK_ICONS) \
diff --git a/recipes/gtk+/gtk+-2.10.14/scroll-timings.patch b/recipes/gtk+/gtk+-2.10.14/scroll-timings.patch
new file mode 100644
index 0000000000..3f823a7880
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.10.14/scroll-timings.patch
@@ -0,0 +1,11 @@
+--- gtk+-2.10.0/gtk/gtkrange.c.orig 2006-07-05 12:41:39.000000000 +0200
++++ gtk+-2.10.0/gtk/gtkrange.c 2006-07-05 12:41:58.000000000 +0200
+@@ -39,7 +39,7 @@
+ #include "gtkalias.h"
+
+ #define SCROLL_DELAY_FACTOR 5 /* Scroll repeat multiplier */
+-#define UPDATE_DELAY 300 /* Delay for queued update */
++#define UPDATE_DELAY 1000 /* Delay for queued update */
+
+ enum {
+ PROP_0,
diff --git a/recipes/gtk+/gtk+-2.10.14/scrolled-placement.patch b/recipes/gtk+/gtk+-2.10.14/scrolled-placement.patch
new file mode 100644
index 0000000000..09ded531ea
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.10.14/scrolled-placement.patch
@@ -0,0 +1,35 @@
+Index: gtk/gtkscrolledwindow.c
+===================================================================
+--- gtk/gtkscrolledwindow.c (revision 18493)
++++ gtk/gtkscrolledwindow.c (working copy)
+@@ -885,7 +885,7 @@
+ if (GTK_IS_SCROLLED_WINDOW (widget))
+ {
+ gtk_scrolled_window_update_real_placement (GTK_SCROLLED_WINDOW (widget));
+- gtk_widget_queue_draw (widget);
++ gtk_widget_queue_resize (widget);
+ }
+ else if (GTK_IS_CONTAINER (widget))
+ gtk_container_forall (GTK_CONTAINER (widget), traverse_container, NULL);
+Index: gdk/x11/gdksettings.c
+===================================================================
+--- gdk/x11/gdksettings.c (revision 18493)
++++ gdk/x11/gdksettings.c (working copy)
+@@ -65,7 +65,8 @@
+ "Xft/RGBA\0" "gtk-xft-rgba\0"
+ "Xft/DPI\0" "gtk-xft-dpi\0"
+ "Net/FallbackIconTheme\0" "gtk-fallback-icon-theme\0"
+- "Gtk/TouchscreenMode\0" "gtk-touchscreen-mode\0";
++ "Gtk/TouchscreenMode\0" "gtk-touchscreen-mode\0"
++ "Gtk/ScrolledWindowPlacement\0" "gtk-scrolled-window-placement\0";
+
+ static const struct
+ {
+@@ -107,5 +108,6 @@
+ { 1197, 1206 },
+ { 1219, 1227 },
+ { 1239, 1261 },
+- { 1285, 1305 }
++ { 1285, 1305 },
++ { 1326, 1354 }
+ };
diff --git a/recipes/gtk+/gtk+-2.10.14/single-click.patch b/recipes/gtk+/gtk+-2.10.14/single-click.patch
new file mode 100644
index 0000000000..250f1629f5
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.10.14/single-click.patch
@@ -0,0 +1,56 @@
+Index: gtk+-2.10.6/gtk/gtkcalendar.c
+===================================================================
+--- gtk+-2.10.6.orig/gtk/gtkcalendar.c
++++ gtk+-2.10.6/gtk/gtkcalendar.c
+@@ -2482,9 +2482,11 @@ calendar_main_button_press (GtkCalendar
+ }
+
+ calendar_select_and_focus_day (calendar, day);
+- }
++
++ // This change causes the calendar to disappear after choosing a day
++/* }
+ else if (event->type == GDK_2BUTTON_PRESS)
+- {
++ {*/
+ priv->in_drag = 0;
+ if (day_month == MONTH_CURRENT)
+ g_signal_emit (calendar,
+Index: gtk+-2.10.6/gtk/gtkfilesel.c
+===================================================================
+--- gtk+-2.10.6.orig/gtk/gtkfilesel.c
++++ gtk+-2.10.6/gtk/gtkfilesel.c
+@@ -2426,6 +2426,33 @@ gtk_file_selection_file_changed (GtkTree
+ if (fs->last_selected != NULL)
+ g_free (fs->last_selected);
+
++ // Single-click directory entry
++ if (new_names->len == 1)
++ {
++ GtkTreeView *tree_view;
++ GtkTreeModel *model;
++ GtkTreePath *path;
++ GtkTreeIter iter;
++ gboolean is_file;
++
++ tree_view = gtk_tree_selection_get_tree_view (selection);
++
++ if (gtk_tree_selection_get_selected (selection, &model, &iter))
++ {
++ path = gtk_tree_model_get_path (model, &iter);
++ gtk_tree_model_get (model, &iter, ISFILE_COLUMN, &is_file, -1);
++
++ if (!is_file)
++ {
++ gtk_file_selection_dir_activate (tree_view, path,
++ gtk_tree_view_get_column (tree_view, DIR_COLUMN),
++ user_data);
++ }
++
++ gtk_tree_path_free (path);
++ }
++ }
++
+ fs->last_selected = g_strdup (g_ptr_array_index (new_names, index));
+ filename = get_real_filename (fs->last_selected, FALSE);
+
diff --git a/recipes/gtk+/gtk+-2.10.14/small-gtkfilechooser.patch b/recipes/gtk+/gtk+-2.10.14/small-gtkfilechooser.patch
new file mode 100644
index 0000000000..7681f1170f
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.10.14/small-gtkfilechooser.patch
@@ -0,0 +1,222 @@
+diff -ur gtk+-2.10.14.org/gtk/gtkfilechooserdefault.c gtk+-2.10.14/gtk/gtkfilechooserdefault.c
+--- gtk+-2.10.14.org/gtk/gtkfilechooserdefault.c 2007-07-16 22:44:17.000000000 +0300
++++ gtk+-2.10.14/gtk/gtkfilechooserdefault.c 2008-01-05 01:32:58.000000000 +0200
+@@ -243,7 +243,9 @@
+ /* Icon size for if we can't get it from the theme */
+ #define FALLBACK_ICON_SIZE 16
+
+-#define PREVIEW_HBOX_SPACING 12
++#define PREVIEW_HBOX_SPACING 2
++#define NORMAL_SPACING 2
++#define DOUBLE_SPACING 2
+ #define NUM_LINES 45
+ #define NUM_CHARS 60
+
+@@ -425,6 +427,17 @@
+ static void location_switch_to_path_bar (GtkFileChooserDefault *impl);
+ static void settings_load (GtkFileChooserDefault *impl);
+
++int
++_gtk_is_pda_mode()
++{
++ /* PDA mode is when we have small screen width, plus small overall screen area
++ too. What we want to do when it is active is to prefer vertical packing over
++ horizontal (so we can show user filenames of as long length as possible), yet
++ still layout vertical space in such way so user can be able to see as many
++ files as possible. And of course, we save space overall - no big spacings and
++ borders. */
++ return gdk_screen_width() < 490;
++}
+
+
+ /* Drag and drop interface declarations */
+@@ -689,7 +702,7 @@
+ impl->pending_select_paths = NULL;
+ impl->location_mode = LOCATION_MODE_PATH_BAR;
+
+- gtk_box_set_spacing (GTK_BOX (impl), 12);
++ gtk_box_set_spacing (GTK_BOX (impl), DOUBLE_SPACING);
+
+ impl->tooltips = gtk_tooltips_new ();
+ g_object_ref_sink (impl->tooltips);
+@@ -3603,8 +3616,9 @@
+ GtkWidget *vbox;
+ GtkWidget *hbox;
+ GtkWidget *widget;
++ gboolean is_pda = _gtk_is_pda_mode();
+
+- vbox = gtk_vbox_new (FALSE, 6);
++ vbox = (is_pda?gtk_hbox_new:gtk_vbox_new) (FALSE, NORMAL_SPACING);
+ gtk_widget_show (vbox);
+
+ /* Shortcuts tree */
+@@ -3614,7 +3628,7 @@
+
+ /* Box for buttons */
+
+- hbox = gtk_hbox_new (TRUE, 6);
++ hbox = (is_pda?gtk_vbox_new:gtk_hbox_new) (TRUE, NORMAL_SPACING);
+ gtk_size_group_add_widget (size_group, hbox);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
+ gtk_widget_show (hbox);
+@@ -3622,7 +3636,7 @@
+ /* Add bookmark button */
+
+ impl->browse_shortcuts_add_button = button_new (impl,
+- _("_Add"),
++ "",
+ GTK_STOCK_ADD,
+ FALSE,
+ TRUE,
+@@ -3634,14 +3648,22 @@
+ /* Remove bookmark button */
+
+ impl->browse_shortcuts_remove_button = button_new (impl,
+- _("_Remove"),
++ "",
+ GTK_STOCK_REMOVE,
+ FALSE,
+ TRUE,
+ G_CALLBACK (remove_bookmark_button_clicked_cb));
++ if (!is_pda) {
++ /* Remove button is pretty reduntant, as that choice is available from popup menu (and would
++ be intuitively expected to be there; compare that with the "Add to shortucts" in popup
++ in files pane - most users would never try that and never new what shortcuts are).
++ If we suspect we can be short of screen space (PDA device is what often has portrait
++ layout), don't pack it, to allow more visually pleasing layout when minimizing location
++ pane. Note that we still instantiate it, as it is referenced thruout the code. */
+ gtk_box_pack_start (GTK_BOX (hbox), impl->browse_shortcuts_remove_button, TRUE, TRUE, 0);
+ gtk_tooltips_set_tip (impl->tooltips, impl->browse_shortcuts_remove_button,
+ _("Remove the selected bookmark"), NULL);
++ }
+
+ return vbox;
+ }
+@@ -4221,7 +4243,7 @@
+ GtkWidget *hbox;
+ GtkWidget *widget;
+
+- vbox = gtk_vbox_new (FALSE, 6);
++ vbox = gtk_vbox_new (FALSE, NORMAL_SPACING);
+ gtk_widget_show (vbox);
+
+ /* Box for lists and preview */
+@@ -4237,13 +4259,13 @@
+
+ /* Preview */
+
+- impl->preview_box = gtk_vbox_new (FALSE, 12);
++ impl->preview_box = gtk_vbox_new (FALSE, DOUBLE_SPACING);
+ gtk_box_pack_start (GTK_BOX (hbox), impl->preview_box, FALSE, FALSE, 0);
+ /* Don't show preview box initially */
+
+ /* Filter combo */
+
+- impl->filter_combo_hbox = gtk_hbox_new (FALSE, 12);
++ impl->filter_combo_hbox = gtk_hbox_new (FALSE, DOUBLE_SPACING);
+
+ widget = filter_create (impl);
+
+@@ -4336,13 +4358,13 @@
+
+ location_switch_to_path_bar (impl);
+
+- vbox = gtk_vbox_new (FALSE, 12);
++ vbox = gtk_vbox_new (FALSE, DOUBLE_SPACING);
+
+ table = gtk_table_new (2, 2, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
+ gtk_widget_show (table);
+- gtk_table_set_row_spacings (GTK_TABLE (table), 12);
+- gtk_table_set_col_spacings (GTK_TABLE (table), 12);
++ gtk_table_set_row_spacings (GTK_TABLE (table), DOUBLE_SPACING);
++ gtk_table_set_col_spacings (GTK_TABLE (table), DOUBLE_SPACING);
+
+ /* Label */
+
+@@ -4653,10 +4675,10 @@
+
+ /* size group is used by the [+][-] buttons and the filter combo */
+ size_group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
+- vbox = gtk_vbox_new (FALSE, 12);
++ vbox = gtk_vbox_new (FALSE, DOUBLE_SPACING);
+
+ /* Location widgets */
+- hbox = gtk_hbox_new (FALSE, 12);
++ hbox = gtk_hbox_new (FALSE, DOUBLE_SPACING);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
+ gtk_widget_show (hbox);
+
+@@ -4678,7 +4700,7 @@
+
+ /* Box for the location label and entry */
+
+- impl->location_entry_box = gtk_hbox_new (FALSE, 12);
++ impl->location_entry_box = gtk_hbox_new (FALSE, DOUBLE_SPACING);
+ gtk_box_pack_start (GTK_BOX (vbox), impl->location_entry_box, FALSE, FALSE, 0);
+
+ impl->location_label = gtk_label_new_with_mnemonic (_("_Location:"));
+@@ -4686,12 +4708,16 @@
+ gtk_box_pack_start (GTK_BOX (impl->location_entry_box), impl->location_label, FALSE, FALSE, 0);
+
+ /* Paned widget */
+- hpaned = gtk_hpaned_new ();
++ if (_gtk_is_pda_mode())
++ hpaned = gtk_vpaned_new ();
++ else
++ hpaned = gtk_hpaned_new ();
++
+ gtk_widget_show (hpaned);
+ gtk_box_pack_start (GTK_BOX (vbox), hpaned, TRUE, TRUE, 0);
+
+ widget = shortcuts_pane_create (impl, size_group);
+- gtk_paned_pack1 (GTK_PANED (hpaned), widget, FALSE, FALSE);
++ gtk_paned_pack1 (GTK_PANED (hpaned), widget, FALSE, TRUE); /* Shortcuts can shrink beyond requested size */
+ widget = file_pane_create (impl, size_group);
+ gtk_paned_pack2 (GTK_PANED (hpaned), widget, TRUE, FALSE);
+
+diff -ur gtk+-2.10.14.org/gtk/gtkfilechooserdialog.c gtk+-2.10.14/gtk/gtkfilechooserdialog.c
+--- gtk+-2.10.14.org/gtk/gtkfilechooserdialog.c 2007-07-16 22:44:16.000000000 +0300
++++ gtk+-2.10.14/gtk/gtkfilechooserdialog.c 2008-01-05 01:28:35.000000000 +0200
+@@ -32,8 +32,12 @@
+
+ #include <stdarg.h>
+
++#define NORMAL_SPACING 2
++#define DOUBLE_SPACING 2
++
+ #define GTK_FILE_CHOOSER_DIALOG_GET_PRIVATE(o) (GTK_FILE_CHOOSER_DIALOG (o)->priv)
+
++extern int _gtk_is_pda_mode(void);
+ static void gtk_file_chooser_dialog_finalize (GObject *object);
+
+ static GObject* gtk_file_chooser_dialog_constructor (GType type,
+@@ -162,8 +166,13 @@
+
+ gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
+
+- if (width)
+- *width = MIN (*width, (monitor.width * 3) / 4);
++ if (width) {
++ if (_gtk_is_pda_mode())
++ /* If width is physically small, use it all */
++ *width = monitor.width;
++ else
++ *width = MIN (*width, (monitor.width * 3) / 4);
++ }
+
+ if (height)
+ *height = MIN (*height, (monitor.height * 3) / 4);
+@@ -430,8 +439,8 @@
+ * http://developer.gnome.org/projects/gup/hig/1.0/windows.html#alert-spacing
+ */
+
+- gtk_container_set_border_width (GTK_CONTAINER (dialog->vbox), 12);
+- gtk_box_set_spacing (GTK_BOX (dialog->vbox), 24);
++ gtk_container_set_border_width (GTK_CONTAINER (dialog->vbox), DOUBLE_SPACING);
++ gtk_box_set_spacing (GTK_BOX (dialog->vbox), DOUBLE_SPACING * 2);
+
+ gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 0);
+ gtk_box_set_spacing (GTK_BOX (dialog->action_area), 6);
+Only in gtk+-2.10.14/.pc/migration.patch/gtk: gtkmigration.c
+Only in gtk+-2.10.14: small-gtkfilechooser.patch
diff --git a/recipes/gtk+/gtk+-2.10.14/small-gtkfilesel.patch b/recipes/gtk+/gtk+-2.10.14/small-gtkfilesel.patch
new file mode 100644
index 0000000000..20bf4cf366
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.10.14/small-gtkfilesel.patch
@@ -0,0 +1,267 @@
+diff -urNd ../gtk+-2.4.4-r5/gtk+-2.4.4/gtk/gtkfilesel.c gtk+-2.4.4/gtk/gtkfilesel.c
+--- ../gtk+-2.4.4-r5/gtk+-2.4.4/gtk/gtkfilesel.c 2004-07-10 05:02:10.000000000 +0100
++++ gtk+-2.4.4/gtk/gtkfilesel.c 2004-09-13 13:40:09.000000000 +0100
+@@ -68,6 +68,7 @@
+ #include "gtkprivate.h"
+ #include "gtkscrolledwindow.h"
+ #include "gtkstock.h"
++#include "gtksignal.h"
+ #include "gtktreeselection.h"
+ #include "gtktreeview.h"
+ #include "gtkvbox.h"
+@@ -77,6 +78,7 @@
+ #include "gtkmessagedialog.h"
+ #include "gtkdnd.h"
+ #include "gtkeventbox.h"
++#include "gtkimage.h"
+
+ #undef GTK_DISABLE_DEPRECATED
+ #include "gtkoptionmenu.h"
+@@ -245,7 +247,8 @@
+ };
+
+ enum {
+- DIR_COLUMN
++ DIR_COLUMN,
++ ISFILE_COLUMN
+ };
+
+ enum {
+@@ -400,6 +403,12 @@
+ GtkTreePath *path,
+ GtkTreeViewColumn *column,
+ gpointer user_data);
++
++static void gtk_file_selection_activate (GtkTreeView *tree_view,
++ GtkTreePath *path,
++ GtkTreeViewColumn *column,
++ gpointer user_data);
++
+ static void gtk_file_selection_file_changed (GtkTreeSelection *selection,
+ gpointer user_data);
+ static void gtk_file_selection_dir_activate (GtkTreeView *tree_view,
+@@ -419,6 +428,7 @@
+ static void gtk_file_selection_create_dir (GtkWidget *widget, gpointer data);
+ static void gtk_file_selection_delete_file (GtkWidget *widget, gpointer data);
+ static void gtk_file_selection_rename_file (GtkWidget *widget, gpointer data);
++static void gtk_file_selection_style_set (GtkWidget *widget, GtkStyle *prev_style);
+
+ static void free_selected_names (GPtrArray *names);
+
+@@ -578,6 +588,23 @@
+ G_PARAM_WRITABLE));
+ object_class->destroy = gtk_file_selection_destroy;
+ widget_class->map = gtk_file_selection_map;
++ widget_class->style_set = gtk_file_selection_style_set;
++
++ gtk_widget_class_install_style_property (widget_class,
++ g_param_spec_boolean ("show_fileops_default",
++ _("Show fileop buttons by default"),
++ _("Whether file operation buttons are shown by default"),
++ TRUE,
++ G_PARAM_READABLE));
++
++ gtk_widget_class_install_style_property (widget_class,
++ g_param_spec_int ("border_width",
++ _("Border width"),
++ _("Width of border around the main dialog area"),
++ 0,
++ G_MAXINT,
++ 10,
++ G_PARAM_READABLE));
+ }
+
+ static void gtk_file_selection_set_property (GObject *object,
+@@ -649,7 +676,29 @@
+ gtk_widget_grab_default (widget);
+ return FALSE;
+ }
+-
++
++static void
++gtk_file_selection_style_set (GtkWidget *filesel,
++ GtkStyle *prev_style)
++{
++ gboolean show_fileops;
++ gint border_width;
++
++ gtk_widget_style_get (filesel,
++ "show_fileops_default",
++ &show_fileops,
++ "border_width",
++ &border_width,
++ NULL);
++
++ gtk_container_set_border_width (GTK_CONTAINER (filesel), border_width);
++
++ if (show_fileops)
++ gtk_file_selection_show_fileop_buttons (GTK_FILE_SELECTION (filesel));
++ else
++ gtk_file_selection_hide_fileop_buttons (GTK_FILE_SELECTION (filesel));
++}
++
+ static void
+ gtk_file_selection_init (GtkFileSelection *filesel)
+ {
+@@ -674,17 +723,15 @@
+
+ /* The dialog-sized vertical box */
+ filesel->main_vbox = dialog->vbox;
+- gtk_container_set_border_width (GTK_CONTAINER (filesel), 10);
+
+ /* The horizontal box containing create, rename etc. buttons */
+ filesel->button_area = gtk_hbutton_box_new ();
+ gtk_button_box_set_layout (GTK_BUTTON_BOX (filesel->button_area), GTK_BUTTONBOX_START);
+- gtk_box_set_spacing (GTK_BOX (filesel->button_area), 0);
+ gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->button_area,
+ FALSE, FALSE, 0);
+ gtk_widget_show (filesel->button_area);
+
+- gtk_file_selection_show_fileop_buttons (filesel);
++ gtk_file_selection_style_set (GTK_WIDGET (filesel), NULL);
+
+ /* hbox for pulldown menu */
+ pulldown_hbox = gtk_hbox_new (TRUE, 5);
+@@ -723,25 +770,32 @@
+
+ /* The directories list */
+
+- model = gtk_list_store_new (1, G_TYPE_STRING);
++ model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_BOOLEAN); /* MA */
+ filesel->dir_list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
+ g_object_unref (model);
+
+- column = gtk_tree_view_column_new_with_attributes (_("Folders"),
++ column = gtk_tree_view_column_new_with_attributes (/*_("Folders")*/ NULL,
+ gtk_cell_renderer_text_new (),
+ "text", DIR_COLUMN,
+ NULL);
+ label = gtk_label_new_with_mnemonic (_("Fol_ders"));
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), filesel->dir_list);
+ gtk_widget_show (label);
+- gtk_tree_view_column_set_widget (column, label);
++
++ /* gtk_tree_view_column_set_widget (column, label); */
++ gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (filesel->dir_list), FALSE);
++
+ gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
+ gtk_tree_view_append_column (GTK_TREE_VIEW (filesel->dir_list), column);
+
+ gtk_widget_set_size_request (filesel->dir_list,
+ DIR_LIST_WIDTH, DIR_LIST_HEIGHT);
+ g_signal_connect (filesel->dir_list, "row_activated",
+- G_CALLBACK (gtk_file_selection_dir_activate), filesel);
++ G_CALLBACK (gtk_file_selection_activate), filesel);
++
++ g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (filesel->dir_list)), "changed",
++ G_CALLBACK (gtk_file_selection_file_changed), filesel);
++
+
+ /* gtk_clist_column_titles_passive (GTK_CLIST (filesel->dir_list)); */
+
+@@ -758,41 +812,6 @@
+ gtk_widget_show (filesel->dir_list);
+ gtk_widget_show (scrolled_win);
+
+- /* The files list */
+- model = gtk_list_store_new (1, G_TYPE_STRING);
+- filesel->file_list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
+- g_object_unref (model);
+-
+- column = gtk_tree_view_column_new_with_attributes (_("Files"),
+- gtk_cell_renderer_text_new (),
+- "text", FILE_COLUMN,
+- NULL);
+- label = gtk_label_new_with_mnemonic (_("_Files"));
+- gtk_label_set_mnemonic_widget (GTK_LABEL (label), filesel->file_list);
+- gtk_widget_show (label);
+- gtk_tree_view_column_set_widget (column, label);
+- gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
+- gtk_tree_view_append_column (GTK_TREE_VIEW (filesel->file_list), column);
+-
+- gtk_widget_set_size_request (filesel->file_list,
+- FILE_LIST_WIDTH, FILE_LIST_HEIGHT);
+- g_signal_connect (filesel->file_list, "row_activated",
+- G_CALLBACK (gtk_file_selection_file_activate), filesel);
+- g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (filesel->file_list)), "changed",
+- G_CALLBACK (gtk_file_selection_file_changed), filesel);
+-
+- /* gtk_clist_column_titles_passive (GTK_CLIST (filesel->file_list)); */
+-
+- scrolled_win = gtk_scrolled_window_new (NULL, NULL);
+- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN);
+- gtk_container_add (GTK_CONTAINER (scrolled_win), filesel->file_list);
+- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
+- GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
+- gtk_container_set_border_width (GTK_CONTAINER (scrolled_win), 0);
+- gtk_container_add (GTK_CONTAINER (list_container), scrolled_win);
+- gtk_widget_show (filesel->file_list);
+- gtk_widget_show (scrolled_win);
+-
+ /* action area for packing buttons into. */
+ filesel->action_area = gtk_hbox_new (TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->action_area,
+@@ -2008,6 +2027,23 @@
+ }
+
+ static void
++gtk_file_selection_activate (GtkTreeView *tree_view,
++ GtkTreePath *path,
++ GtkTreeViewColumn *column,
++ gpointer user_data)
++{
++ GtkTreeModel *model = gtk_tree_view_get_model (tree_view);
++ GtkTreeIter iter;
++ gboolean is_file;
++
++ gtk_tree_model_get_iter (model, &iter, path);
++ gtk_tree_model_get (model, &iter, ISFILE_COLUMN, &is_file, -1);
++
++ if (! is_file)
++ gtk_file_selection_dir_activate (tree_view, path, column, user_data);
++}
++
++static void
+ gtk_file_selection_file_activate (GtkTreeView *tree_view,
+ GtkTreePath *path,
+ GtkTreeViewColumn *column,
+@@ -2103,7 +2139,6 @@
+ PossibleCompletion* poss;
+ GtkTreeIter iter;
+ GtkListStore *dir_model;
+- GtkListStore *file_model;
+ gchar* filename;
+ gchar* rem_path = rel_path;
+ gchar* sel_text;
+@@ -2125,10 +2160,8 @@
+ g_assert (cmpl_state->reference_dir);
+
+ dir_model = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (fs->dir_list)));
+- file_model = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (fs->file_list)));
+
+ gtk_list_store_clear (dir_model);
+- gtk_list_store_clear (file_model);
+
+ /* Set the dir list to include ./ and ../ */
+ gtk_list_store_append (dir_model, &iter);
+@@ -2150,13 +2183,17 @@
+ strcmp (filename, ".." G_DIR_SEPARATOR_S) != 0)
+ {
+ gtk_list_store_append (dir_model, &iter);
+- gtk_list_store_set (dir_model, &iter, DIR_COLUMN, filename, -1);
++ gtk_list_store_set (dir_model, &iter,
++ DIR_COLUMN, filename,
++ ISFILE_COLUMN, FALSE, -1);
+ }
+ }
+ else
+ {
+- gtk_list_store_append (file_model, &iter);
+- gtk_list_store_set (file_model, &iter, DIR_COLUMN, filename, -1);
++ gtk_list_store_append (dir_model, &iter);
++ gtk_list_store_set (dir_model, &iter,
++ DIR_COLUMN, filename,
++ ISFILE_COLUMN, TRUE, -1);
+ }
+ }
+
diff --git a/recipes/gtk+/gtk+-2.10.14/spinbutton.patch b/recipes/gtk+/gtk+-2.10.14/spinbutton.patch
new file mode 100644
index 0000000000..c26dc6d93c
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.10.14/spinbutton.patch
@@ -0,0 +1,130 @@
+Index: gtk+-2.10.6/gtk/gtkspinbutton.c
+===================================================================
+--- gtk+-2.10.6.orig/gtk/gtkspinbutton.c
++++ gtk+-2.10.6/gtk/gtkspinbutton.c
+@@ -682,7 +682,7 @@ gtk_spin_button_size_allocate (GtkWidget
+
+ spin = GTK_SPIN_BUTTON (widget);
+ arrow_size = spin_button_get_arrow_size (spin);
+- panel_width = arrow_size + 2 * widget->style->xthickness;
++ panel_width = (2 * arrow_size) + 4 * widget->style->xthickness;
+
+ widget->allocation = *allocation;
+
+@@ -815,19 +815,16 @@ gtk_spin_button_draw_arrow (GtkSpinButto
+ {
+ width = spin_button_get_arrow_size (spin_button) + 2 * widget->style->xthickness;
+
++ y = widget->style->ythickness;
++ height = widget->requisition.height - (2 * y);
++
+ if (arrow_type == GTK_ARROW_UP)
+ {
+ x = 0;
+- y = 0;
+-
+- height = widget->requisition.height / 2;
+ }
+ else
+ {
+- x = 0;
+- y = widget->requisition.height / 2;
+-
+- height = (widget->requisition.height + 1) / 2;
++ x = width;
+ }
+
+ if (spin_button_at_limit (spin_button, arrow_type))
+@@ -857,32 +854,17 @@ gtk_spin_button_draw_arrow (GtkSpinButto
+ shadow_type = GTK_SHADOW_OUT;
+ }
+ }
+-
++
+ gtk_paint_box (widget->style, spin_button->panel,
+ state_type, shadow_type,
+ NULL, widget,
+- (arrow_type == GTK_ARROW_UP)? "spinbutton_up" : "spinbutton_down",
++ NULL,
+ x, y, width, height);
+
+ height = widget->requisition.height;
+
+- if (arrow_type == GTK_ARROW_DOWN)
+- {
+- y = height / 2;
+- height = height - y - 2;
+- }
+- else
+- {
+- y = 2;
+- height = height / 2 - 2;
+- }
+-
+ width -= 3;
+-
+- if (widget && gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
+- x = 2;
+- else
+- x = 1;
++ height -= 3;
+
+ w = width / 2;
+ w -= w % 2 - 1; /* force odd */
+@@ -1062,7 +1044,7 @@ gtk_spin_button_button_press (GtkWidget
+ if (GTK_ENTRY (widget)->editable)
+ gtk_spin_button_update (spin);
+
+- if (event->y <= widget->requisition.height / 2)
++ if (event->x <= (spin_button_get_arrow_size (spin) + widget->style->xthickness))
+ {
+ if (event->button == 1)
+ start_spinning (spin, GTK_ARROW_UP, spin->adjustment->step_increment);
+@@ -1097,44 +1079,11 @@ gtk_spin_button_button_release (GtkWidge
+
+ arrow_size = spin_button_get_arrow_size (spin);
+
+- if (event->button == spin->button)
+- {
+- int click_child = spin->click_child;
++ gtk_spin_button_stop_spinning (spin);
+
+- gtk_spin_button_stop_spinning (spin);
+-
+- if (event->button == 3)
+- {
+- if (event->y >= 0 && event->x >= 0 &&
+- event->y <= widget->requisition.height &&
+- event->x <= arrow_size + 2 * widget->style->xthickness)
+- {
+- if (click_child == GTK_ARROW_UP &&
+- event->y <= widget->requisition.height / 2)
+- {
+- gdouble diff;
+-
+- diff = spin->adjustment->upper - spin->adjustment->value;
+- if (diff > EPSILON)
+- gtk_spin_button_real_spin (spin, diff);
+- }
+- else if (click_child == GTK_ARROW_DOWN &&
+- event->y > widget->requisition.height / 2)
+- {
+- gdouble diff;
+-
+- diff = spin->adjustment->value - spin->adjustment->lower;
+- if (diff > EPSILON)
+- gtk_spin_button_real_spin (spin, -diff);
+- }
+- }
+- }
+- spin_button_redraw (spin);
++ spin_button_redraw (spin);
+
+- return TRUE;
+- }
+- else
+- return GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->button_release_event (widget, event);
++ return TRUE;
+ }
+
+ static gint
diff --git a/recipes/gtk+/gtk+-2.10.14/toggle-font.diff b/recipes/gtk+/gtk+-2.10.14/toggle-font.diff
new file mode 100644
index 0000000000..928da72430
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.10.14/toggle-font.diff
@@ -0,0 +1,100 @@
+Index: gtk/gtkcellrenderertoggle.c
+===================================================================
+--- gtk/gtkcellrenderertoggle.c (revision 18523)
++++ gtk/gtkcellrenderertoggle.c (working copy)
+@@ -71,6 +71,8 @@
+ PROP_INDICATOR_SIZE
+ };
+
++/* This is a hard-coded default which promptly gets overridden by a size
++ calculated from the font size. */
+ #define TOGGLE_WIDTH 12
+
+ static guint toggle_cell_signals[LAST_SIGNAL] = { 0 };
+@@ -80,8 +82,9 @@
+ typedef struct _GtkCellRendererTogglePrivate GtkCellRendererTogglePrivate;
+ struct _GtkCellRendererTogglePrivate
+ {
+- gint indicator_size;
+-
++ gint indicator_size; /* This is the real size */
++ gint override_size; /* This is the size set from the indicator-size property */
++ GtkWidget *cached_widget;
+ guint inconsistent : 1;
+ };
+
+@@ -104,6 +107,7 @@
+ GTK_CELL_RENDERER (celltoggle)->ypad = 2;
+
+ priv->indicator_size = TOGGLE_WIDTH;
++ priv->override_size = 0;
+ priv->inconsistent = FALSE;
+ }
+
+@@ -210,7 +214,7 @@
+ g_value_set_boolean (value, celltoggle->radio);
+ break;
+ case PROP_INDICATOR_SIZE:
+- g_value_set_int (value, priv->indicator_size);
++ g_value_set_int (value, priv->override_size ? priv->override_size : priv->indicator_size);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+@@ -245,7 +249,7 @@
+ celltoggle->radio = g_value_get_boolean (value);
+ break;
+ case PROP_INDICATOR_SIZE:
+- priv->indicator_size = g_value_get_int (value);
++ priv->override_size = g_value_get_int (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+@@ -273,6 +277,27 @@
+ }
+
+ static void
++on_widget_style_set (GtkWidget *widget, GtkStyle *previous, gpointer user_data)
++{
++ GtkCellRendererTogglePrivate *priv = user_data;
++ PangoContext *context;
++ PangoFontMetrics *metrics;
++ int height;
++
++ context = gtk_widget_get_pango_context (widget);
++ metrics = pango_context_get_metrics (context,
++ widget->style->font_desc,
++ pango_context_get_language (context));
++
++ height = pango_font_metrics_get_ascent (metrics) +
++ pango_font_metrics_get_descent (metrics);
++
++ pango_font_metrics_unref (metrics);
++
++ priv->indicator_size = PANGO_PIXELS (height * 0.85);
++}
++
++static void
+ gtk_cell_renderer_toggle_get_size (GtkCellRenderer *cell,
+ GtkWidget *widget,
+ GdkRectangle *cell_area,
+@@ -287,6 +312,20 @@
+
+ priv = GTK_CELL_RENDERER_TOGGLE_GET_PRIVATE (cell);
+
++ if (priv->override_size) {
++ priv->indicator_size = priv->override_size;
++ } else if (priv->cached_widget != widget) {
++ if (priv->cached_widget) {
++ g_object_remove_weak_pointer (widget, &priv->cached_widget);
++ g_signal_handlers_disconnect_by_func (priv->cached_widget, on_widget_style_set, priv);
++ }
++ priv->cached_widget = widget;
++ g_object_add_weak_pointer (widget, &priv->cached_widget);
++ g_signal_connect (widget, "style-set", on_widget_style_set, priv);
++
++ on_widget_style_set (widget, NULL, priv);
++ }
++
+ calc_width = (gint) cell->xpad * 2 + priv->indicator_size;
+ calc_height = (gint) cell->ypad * 2 + priv->indicator_size;
+
diff --git a/recipes/gtk+/gtk+-2.10.14/treeview-checkbox-size.patch b/recipes/gtk+/gtk+-2.10.14/treeview-checkbox-size.patch
new file mode 100644
index 0000000000..ab3c208ee5
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.10.14/treeview-checkbox-size.patch
@@ -0,0 +1,100 @@
+Index: gtk/gtkcellrenderertoggle.c
+===================================================================
+--- gtk/gtkcellrenderertoggle.c (revision 18523)
++++ gtk/gtkcellrenderertoggle.c (working copy)
+@@ -71,6 +71,8 @@
+ PROP_INDICATOR_SIZE
+ };
+
++/* This is a hard-coded default which promptly gets overridden by a size
++ calculated from the font size. */
+ #define TOGGLE_WIDTH 12
+
+ static guint toggle_cell_signals[LAST_SIGNAL] = { 0 };
+@@ -80,8 +82,9 @@
+ typedef struct _GtkCellRendererTogglePrivate GtkCellRendererTogglePrivate;
+ struct _GtkCellRendererTogglePrivate
+ {
+- gint indicator_size;
+-
++ gint indicator_size; /* This is the real size */
++ gint override_size; /* This is the size set from the indicator-size property */
++ GtkWidget *cached_widget;
+ guint inconsistent : 1;
+ };
+
+@@ -104,6 +107,7 @@
+ GTK_CELL_RENDERER (celltoggle)->ypad = 2;
+
+ priv->indicator_size = TOGGLE_WIDTH;
++ priv->override_size = 0;
+ priv->inconsistent = FALSE;
+ }
+
+@@ -210,7 +214,7 @@
+ g_value_set_boolean (value, celltoggle->radio);
+ break;
+ case PROP_INDICATOR_SIZE:
+- g_value_set_int (value, priv->indicator_size);
++ g_value_set_int (value, priv->override_size ? priv->override_size : priv->indicator_size);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+@@ -245,7 +249,7 @@
+ celltoggle->radio = g_value_get_boolean (value);
+ break;
+ case PROP_INDICATOR_SIZE:
+- priv->indicator_size = g_value_get_int (value);
++ priv->override_size = g_value_get_int (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+@@ -273,6 +277,27 @@
+ }
+
+ static void
++on_widget_style_set (GtkWidget *widget, GtkStyle *previous, gpointer user_data)
++{
++ GtkCellRendererTogglePrivate *priv = user_data;
++ PangoContext *context;
++ PangoFontMetrics *metrics;
++ int height;
++
++ context = gtk_widget_get_pango_context (widget);
++ metrics = pango_context_get_metrics (context,
++ widget->style->font_desc,
++ pango_context_get_language (context));
++
++ height = pango_font_metrics_get_ascent (metrics) +
++ pango_font_metrics_get_descent (metrics);
++
++ pango_font_metrics_unref (metrics);
++
++ priv->indicator_size = PANGO_PIXELS (height * 0.85);
++}
++
++static void
+ gtk_cell_renderer_toggle_get_size (GtkCellRenderer *cell,
+ GtkWidget *widget,
+ GdkRectangle *cell_area,
+@@ -287,6 +312,20 @@
+
+ priv = GTK_CELL_RENDERER_TOGGLE_GET_PRIVATE (cell);
+
++ if (priv->override_size) {
++ priv->indicator_size = priv->override_size;
++ } else if (priv->cached_widget != widget) {
++ if (priv->cached_widget) {
++ g_object_remove_weak_pointer (G_OBJECT (widget), (gpointer*)&priv->cached_widget);
++ g_signal_handlers_disconnect_by_func (priv->cached_widget, on_widget_style_set, priv);
++ }
++ priv->cached_widget = widget;
++ g_object_add_weak_pointer (G_OBJECT (widget), (gpointer*)&priv->cached_widget);
++ g_signal_connect (widget, "style-set", G_CALLBACK (on_widget_style_set), priv);
++
++ on_widget_style_set (widget, NULL, priv);
++ }
++
+ calc_width = (gint) cell->xpad * 2 + priv->indicator_size;
+ calc_height = (gint) cell->ypad * 2 + priv->indicator_size;
+
diff --git a/recipes/gtk+/gtk+-2.12.0/cellrenderer-cairo.patch b/recipes/gtk+/gtk+-2.12.0/cellrenderer-cairo.patch
new file mode 100644
index 0000000000..4439e69fb6
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.0/cellrenderer-cairo.patch
@@ -0,0 +1,32 @@
+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/recipes/gtk+/gtk+-2.12.0/combo-arrow-size.patch b/recipes/gtk+/gtk+-2.12.0/combo-arrow-size.patch
new file mode 100644
index 0000000000..d44c454ce3
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.0/combo-arrow-size.patch
@@ -0,0 +1,67 @@
+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/recipes/gtk+/gtk+-2.12.0/disable-print.patch b/recipes/gtk+/gtk+-2.12.0/disable-print.patch
new file mode 100644
index 0000000000..21a4be4da8
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.0/disable-print.patch
@@ -0,0 +1,26 @@
+--- 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 -n $CUPS_API_VERSION | awk -F. '{print $1}'`
+- CUPS_API_MINOR=`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/recipes/gtk+/gtk+-2.12.0/entry-cairo.patch b/recipes/gtk+/gtk+-2.12.0/entry-cairo.patch
new file mode 100644
index 0000000000..3313e7f132
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.0/entry-cairo.patch
@@ -0,0 +1,103 @@
+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/recipes/gtk+/gtk+-2.12.0/hardcoded_libtool.patch b/recipes/gtk+/gtk+-2.12.0/hardcoded_libtool.patch
new file mode 100644
index 0000000000..6adb0cfef6
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.0/hardcoded_libtool.patch
@@ -0,0 +1,29 @@
+--- /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/recipes/gtk+/gtk+-2.12.0/menu-deactivate.patch b/recipes/gtk+/gtk+-2.12.0/menu-deactivate.patch
new file mode 100644
index 0000000000..cfb8849e9f
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.0/menu-deactivate.patch
@@ -0,0 +1,51 @@
+--- 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/recipes/gtk+/gtk+-2.12.0/no-demos.patch b/recipes/gtk+/gtk+-2.12.0/no-demos.patch
new file mode 100644
index 0000000000..0fc4c48d1a
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.0/no-demos.patch
@@ -0,0 +1,10 @@
+--- 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/recipes/gtk+/gtk+-2.12.0/pangoxft2.10.6.diff b/recipes/gtk+/gtk+-2.12.0/pangoxft2.10.6.diff
new file mode 100644
index 0000000000..63828cec63
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.0/pangoxft2.10.6.diff
@@ -0,0 +1,2456 @@
+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 <config.h>
+
++#include <pango/pangoxft.h>
++
+ #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 <X11/Xlib.h>
+ #include <X11/extensions/Xrender.h>
++#include <X11/Xft/Xft.h>
+
+ 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;
++
++ return XRenderCreatePicture (GDK_GC_XDISPLAY (gc),
++ GDK_PIXMAP_XID (_gdk_gc_get_tile (gc)),
++ format,
++ CPRepeat, &pa);
++ }
++
++ return None;
++}
++
++static Picture
++make_stipple_picture (GdkGC *gc)
++{
++ XRenderPictFormat *format = NULL;
++ XRenderPictureAttributes pa;
++
++ format = XRenderFindStandardFormat (GDK_GC_XDISPLAY (gc),
++ PictStandardA1);
++
++ pa.repeat = True;
++ return XRenderCreatePicture (GDK_GC_XDISPLAY (gc),
++ GDK_PIXMAP_XID (_gdk_gc_get_stipple (gc)),
++ format,
++ CPRepeat, &pa);
++}
++
++static Picture
++make_color_picture (GdkGC *gc,
++ XRenderColor *color)
++{
++ GdkGCX11 *x11_gc = GDK_GC_X11 (gc);
++ XRenderPictureAttributes pa;
++ XRenderPictFormat *pix_format = foreground_format (gc);
++ Pixmap pix;
++ Picture picture;
++
++ if (!pix_format)
++ return None;
++
++ pix = XCreatePixmap (GDK_GC_XDISPLAY (gc),
++ GDK_SCREEN_XROOTWIN (x11_gc->screen),
++ 1, 1, pix_format->depth);
++ pa.repeat = True;
++ picture = XRenderCreatePicture (GDK_GC_XDISPLAY (gc),
++ pix,
++ pix_format,
++ CPRepeat, &pa);
++ XFreePixmap (GDK_GC_XDISPLAY (gc), pix);
++
++ XRenderFillRectangle (GDK_GC_XDISPLAY (gc), PictOpSrc,
++ picture, color,
++ 0, 0, 1, 1);
++
++ return picture;
++}
++
++static void
++get_bg_color (GdkGC *gc,
++ XRenderColor *render_color)
++{
++ GdkColormap *cmap;
++
++ cmap = gdk_gc_get_colormap (gc);
++
++ if (cmap)
++ {
++ GdkColor color;
++
++ gdk_colormap_query_color (cmap, _gdk_gc_get_bg_pixel (gc), &color);
++
++ render_color->alpha = 0xffff;
++ render_color->red = color.red;
++ render_color->green = color.green;
++ render_color->blue = color.blue;
++ }
++ else /* Not worth warning, just use black */
++ {
++ render_color->alpha = 0xffff;
++ render_color->red = 0;
++ render_color->green = 0;
++ render_color->blue = 0;
++ }
++}
++
++/**
++ * _gdk_x11_gc_get_fg_picture:
++ * @gc: a #GdkGC
++ *
++ * Gets a Xrender Picture object suitable for being the source
++ * drawable for drawing with the foreground the graphics context.
++ *
++ * Return value: a Picture, owned by the GC; this cannot be
++ * used over subsequent modification of the GC.
++ **/
++Picture
++_gdk_x11_gc_get_fg_picture (GdkGC *gc)
++{
++ GdkGCX11 *x11_gc;
++ gboolean new = FALSE;
++ XftColor xftcolor;
++ GdkFill fill;
++ int width, height;
++
++ g_return_val_if_fail (GDK_IS_GC_X11 (gc), None);
++
++ if (!_gdk_x11_have_render (GDK_GC_DISPLAY (gc)))
++ return None;
++
++ x11_gc = GDK_GC_X11 (gc);
++
++ fill = GDK_SOLID;
++ width = 1;
++ height = 1;
++
++ switch (_gdk_gc_get_fill (gc))
++ {
++ case GDK_SOLID:
++ break;
++ case GDK_TILED:
++ if (_gdk_gc_get_tile (gc))
++ {
++ if (!x11_gc->fg_picture)
++ x11_gc->fg_picture = make_fg_tile_picture (gc);
++
++ if (x11_gc->fg_picture != None)
++ return x11_gc->fg_picture;
++ }
++ break;
++ case GDK_STIPPLED:
++ case GDK_OPAQUE_STIPPLED:
++ if (_gdk_gc_get_stipple (gc))
++ {
++ gdk_drawable_get_size (_gdk_gc_get_stipple (gc), &width, &height);
++ fill = _gdk_gc_get_fill (gc);
++ }
++ break;
++ }
++
++ if (x11_gc->fg_picture == None)
++ {
++ XRenderPictureAttributes pa;
++ XRenderPictFormat *pix_format = foreground_format (gc);
++ Pixmap pix;
++
++ if (!pix_format)
++ return None;
++
++ pix = XCreatePixmap (GDK_GC_XDISPLAY (gc),
++ GDK_SCREEN_XROOTWIN (x11_gc->screen),
++ width, height, pix_format->depth);
++ pa.repeat = True;
++ x11_gc->fg_picture = XRenderCreatePicture (GDK_GC_XDISPLAY (gc),
++ pix,
++ pix_format,
++ CPRepeat, &pa);
++ XFreePixmap (GDK_GC_XDISPLAY (gc), pix);
++
++ new = TRUE;
++ }
++
++ _gdk_gc_x11_get_fg_xft_color (gc, &xftcolor);
++
++ if (x11_gc->fg_picture_color.alpha != 0xffff ||
++ x11_gc->fg_picture_color.red != xftcolor.color.red ||
++ x11_gc->fg_picture_color.green != xftcolor.color.green ||
++ x11_gc->fg_picture_color.blue != xftcolor.color.blue)
++ {
++ x11_gc->fg_picture_color.alpha = 0xffff;
++ x11_gc->fg_picture_color.red = xftcolor.color.red;
++ x11_gc->fg_picture_color.green = xftcolor.color.green;
++ x11_gc->fg_picture_color.blue = xftcolor.color.blue;
++
++ new = TRUE;
++ }
++
++ switch (fill)
++ {
++ case GDK_SOLID:
++ XRenderFillRectangle (GDK_GC_XDISPLAY (gc), PictOpSrc,
++ x11_gc->fg_picture, &x11_gc->fg_picture_color,
++ 0, 0, width, height);
++ break;
++ case GDK_STIPPLED:
++ {
++ Picture stipple_picture = make_stipple_picture (gc);
++
++ XRenderFillRectangle (GDK_GC_XDISPLAY (gc), PictOpSrc,
++ x11_gc->fg_picture, &x11_gc->fg_picture_color,
++ 0, 0, width, height);
++ XRenderComposite (GDK_GC_XDISPLAY (gc),
++ PictOpInReverse,
++ stipple_picture, None, x11_gc->fg_picture,
++ 0, 0, 0, 0, 0, 0, width, height);
++
++ XRenderFreePicture (GDK_GC_XDISPLAY (x11_gc), stipple_picture);
++ }
++ break;
++ case GDK_OPAQUE_STIPPLED:
++ {
++ XRenderColor bg_color;
++
++ Picture stipple_picture = make_stipple_picture (gc);
++ Picture fg_picture = make_color_picture (gc, &x11_gc->fg_picture_color);
++
++ get_bg_color (gc, &bg_color);
++
++ XRenderFillRectangle (GDK_GC_XDISPLAY (gc), PictOpSrc,
++ x11_gc->fg_picture, &bg_color,
++ 0, 0, width, height);
++ XRenderComposite (GDK_GC_XDISPLAY (gc),
++ PictOpOver,
++ fg_picture, stipple_picture, x11_gc->fg_picture,
++ 0, 0, 0, 0, 0, 0, width, height);
++
++ XRenderFreePicture (GDK_GC_XDISPLAY (x11_gc), stipple_picture);
++ XRenderFreePicture (GDK_GC_XDISPLAY (x11_gc), fg_picture);
++ }
++ break;
++ case GDK_TILED:
++ g_assert_not_reached (); /* handled above */
++ break;
++ }
++
++ return x11_gc->fg_picture;
++}
++
++/**
++ * _gdk_gc_x11_get_fg_xft_color:
++ * @gc: a #GdkGC
++ * @xftcolor: location to store the color
++ *
++ * Gets the foreground color of the GC as a XftColor.
++ **/
++void
++_gdk_gc_x11_get_fg_xft_color (GdkGC *gc,
++ XftColor *xftcolor)
++{
++ GdkGCX11 *x11_gc;
++ GdkColormap *cmap;
++ GdkColor color;
++
++ g_return_if_fail (GDK_IS_GC_X11 (gc));
++
++ x11_gc = GDK_GC_X11 (gc);
++
++ cmap = gdk_gc_get_colormap (gc);
++
++ xftcolor->pixel = _gdk_gc_get_fg_pixel (gc);
++
++ if (cmap)
++ {
++ gdk_colormap_query_color (cmap, xftcolor->pixel, &color);
++ xftcolor->color.alpha = 0xffff;
++ xftcolor->color.red = color.red;
++ xftcolor->color.green = color.green;
++ xftcolor->color.blue = color.blue;
++ }
++ else if (x11_gc->depth == 1)
++ {
++ /* Drawing with Xft on a bitmap is a bit bizzare; it
++ * takes alpha >= 0x8000 to mean 'set to 1' and
++ * alpha < 0x8000 to mean 'set to 0'.
++ */
++ if (xftcolor->pixel)
++ {
++ xftcolor->color.red = 0xffff;
++ xftcolor->color.green = 0xffff;
++ xftcolor->color.blue = 0xffff;
++ xftcolor->color.alpha = 0xffff;
++ }
++ else
++ {
++ xftcolor->color.red = 0;
++ xftcolor->color.green = 0;
++ xftcolor->color.blue = 0;
++ xftcolor->color.alpha = 0;
++ }
++ }
++ else
++ {
++ g_warning ("Using Xft rendering requires the GC argument to have a\n"
++ "specified colormap. If the GC was created for a drawable\n"
++ "with a colormap, the colormap will be set on the GC\n"
++ "automatically. Otherwise, a colormap must be set on it with"
++ "gdk_gc_set_colormap");
++ }
++}
++
++void
++_gdk_windowing_gc_get_foreground (GdkGC *gc,
++ GdkColor *color)
++{
++ GdkColormap *cmap;
++
++ g_return_if_fail (GDK_IS_GC_X11 (gc));
++
++ color->pixel = _gdk_gc_get_fg_pixel (gc);
++
++ cmap = gdk_gc_get_colormap (gc);
++
++ if (cmap)
++ gdk_colormap_query_color (cmap, _gdk_gc_get_fg_pixel (gc), color);
++ else
++ g_warning ("No colormap in _gdk_windowing_gc_get_foreground");
++}
+ #define __GDK_GC_X11_C__
+ #include "gdkaliasdef.c"
+Index: gtk+-2.10.6/gdk/x11/gdkprivate-x11.h
+===================================================================
+--- gtk+-2.10.6.orig/gdk/x11/gdkprivate-x11.h 2006-10-30 12:58:30.000000000 +0000
++++ gtk+-2.10.6/gdk/x11/gdkprivate-x11.h 2006-10-30 12:59:30.000000000 +0000
+@@ -63,6 +63,9 @@
+ guint have_clip_region : 1;
+ guint have_clip_mask : 1;
+ guint depth : 8;
++
++ Picture fg_picture;
++ XRenderColor fg_picture_color;
+ };
+
+ struct _GdkGCX11Class
+@@ -102,6 +105,11 @@
+ GType _gdk_gc_x11_get_type (void);
+
+ gboolean _gdk_x11_have_render (GdkDisplay *display);
++gboolean _gdk_x11_have_render_with_trapezoids (GdkDisplay *display);
++
++Picture _gdk_x11_gc_get_fg_picture (GdkGC *gc);
++void _gdk_gc_x11_get_fg_xft_color (GdkGC *gc,
++ XftColor *xftcolor);
+
+ GdkGC *_gdk_x11_gc_new (GdkDrawable *drawable,
+ GdkGCValues *values,
+Index: gtk+-2.10.6/gdk/x11/gdkwindow-x11.c
+===================================================================
+--- gtk+-2.10.6.orig/gdk/x11/gdkwindow-x11.c 2006-10-30 12:58:30.000000000 +0000
++++ gtk+-2.10.6/gdk/x11/gdkwindow-x11.c 2006-10-30 12:59:30.000000000 +0000
+@@ -1114,7 +1114,8 @@
+ {
+ GdkWindowObject *private = (GdkWindowObject *)window;
+ GdkToplevelX11 *toplevel;
+-
++ GdkDrawableImplX11 *draw_impl;
++
+ g_return_if_fail (GDK_IS_WINDOW (window));
+
+ _gdk_selection_window_destroyed (window);
+@@ -1126,6 +1127,11 @@
+ if (toplevel)
+ gdk_toplevel_x11_free_contents (GDK_WINDOW_DISPLAY (window), toplevel);
+
++ draw_impl = GDK_DRAWABLE_IMPL_X11 (private->impl);
++
++ if (draw_impl->xft_draw)
++ XftDrawDestroy (draw_impl->xft_draw);
++
+ _gdk_x11_drawable_finish (private->impl);
+
+ if (!recursing && !foreign_destroy)
+Index: gtk+-2.10.6/gdk/x11/Makefile.am
+===================================================================
+--- gtk+-2.10.6.orig/gdk/x11/Makefile.am 2006-10-30 12:58:30.000000000 +0000
++++ gtk+-2.10.6/gdk/x11/Makefile.am 2006-10-30 12:59:30.000000000 +0000
+@@ -37,6 +37,7 @@
+ gdkinput.c \
+ gdkkeys-x11.c \
+ gdkmain-x11.c \
++ gdkpango-x11.c \
+ gdkpixmap-x11.c \
+ gdkpixmap-x11.h \
+ gdkproperty-x11.c \
+Index: gtk+-2.10.6/gtk/gtkcalendar.c
+===================================================================
+--- gtk+-2.10.6.orig/gtk/gtkcalendar.c 2006-10-30 12:58:30.000000000 +0000
++++ gtk+-2.10.6/gtk/gtkcalendar.c 2006-10-30 12:59:30.000000000 +0000
+@@ -1821,7 +1821,7 @@
+ }
+ }
+
+-
++
+ /****************************************
+ * Repainting *
+ ****************************************/
+@@ -1831,7 +1831,7 @@
+ {
+ GtkWidget *widget = GTK_WIDGET (calendar);
+ GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
+- cairo_t *cr;
++ GdkGC *gc;
+ char buffer[255];
+ int x, y;
+ gint header_width;
+@@ -1849,7 +1849,7 @@
+ else
+ year_left = !priv->year_before;
+
+- cr = gdk_cairo_create (priv->header_win);
++ gc = calendar->gc;
+
+ header_width = widget->allocation.width - 2 * widget->style->xthickness;
+
+@@ -1902,9 +1902,9 @@
+ - (max_year_width - logical_rect.width)/2);
+
+
+- gdk_cairo_set_source_color (cr, HEADER_FG_COLOR (GTK_WIDGET (calendar)));
+- cairo_move_to (cr, x, y);
+- pango_cairo_show_layout (cr, layout);
++ gdk_gc_set_foreground (gc, HEADER_FG_COLOR (GTK_WIDGET (calendar)));
++ gdk_draw_layout (priv->header_win, gc, x, y, layout);
++
+
+ /* Draw month */
+ g_snprintf (buffer, sizeof (buffer), "%s", default_monthname[calendar->month]);
+@@ -1924,19 +1924,19 @@
+ else
+ x = 3 + priv->arrow_width + (max_month_width - logical_rect.width)/2;
+
+- cairo_move_to (cr, x, y);
+- pango_cairo_show_layout (cr, layout);
+-
++ gdk_draw_layout (priv->header_win, gc, x, y, layout);
++
++ gdk_gc_set_foreground (gc, BACKGROUND_COLOR (GTK_WIDGET (calendar)));
++
+ g_object_unref (layout);
+- cairo_destroy (cr);
+ }
+
+ static void
+ calendar_paint_day_names (GtkCalendar *calendar)
+ {
+ GtkWidget *widget = GTK_WIDGET (calendar);
++ GdkGC *gc;
+ GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
+- cairo_t *cr;
+ char buffer[255];
+ int day,i;
+ int day_width, cal_width;
+@@ -1946,8 +1946,7 @@
+ gint focus_padding;
+ gint focus_width;
+
+- cr = gdk_cairo_create (priv->day_name_win);
+-
++ gc = calendar->gc;
+ gtk_widget_style_get (GTK_WIDGET (widget),
+ "focus-line-width", &focus_width,
+ "focus-padding", &focus_padding,
+@@ -1961,22 +1960,19 @@
+ * Draw rectangles as inverted background for the labels.
+ */
+
+- gdk_cairo_set_source_color (cr, SELECTED_BG_COLOR (widget));
+- cairo_rectangle (cr,
+- CALENDAR_MARGIN, CALENDAR_MARGIN,
+- cal_width-CALENDAR_MARGIN * 2,
+- priv->day_name_h - CALENDAR_MARGIN);
+- cairo_fill (cr);
+-
++ gdk_gc_set_foreground (gc, SELECTED_BG_COLOR (widget));
++ gdk_draw_rectangle (priv->day_name_win, gc, TRUE,
++ CALENDAR_MARGIN, CALENDAR_MARGIN,
++ cal_width-CALENDAR_MARGIN * 2,
++ priv->day_name_h - CALENDAR_MARGIN);
++
+ if (calendar->display_flags & GTK_CALENDAR_SHOW_WEEK_NUMBERS)
+- {
+- cairo_rectangle (cr,
+- CALENDAR_MARGIN,
+- priv->day_name_h - CALENDAR_YSEP,
+- priv->week_width - CALENDAR_YSEP - CALENDAR_MARGIN,
+- CALENDAR_YSEP);
+- cairo_fill (cr);
+- }
++ gdk_draw_rectangle (priv->day_name_win, gc, TRUE,
++ CALENDAR_MARGIN,
++ priv->day_name_h - CALENDAR_YSEP,
++ priv->week_width - CALENDAR_YSEP - CALENDAR_MARGIN,
++ CALENDAR_YSEP);
++
+
+ /*
+ * Write the labels
+@@ -1984,7 +1980,7 @@
+
+ layout = gtk_widget_create_pango_layout (widget, NULL);
+
+- gdk_cairo_set_source_color (cr, SELECTED_FG_COLOR (widget));
++ gdk_gc_set_foreground (gc, SELECTED_FG_COLOR (widget));
+ for (i = 0; i < 7; i++)
+ {
+ if (gtk_widget_get_direction (GTK_WIDGET (calendar)) == GTK_TEXT_DIR_RTL)
+@@ -1997,19 +1993,18 @@
+ pango_layout_set_text (layout, buffer, -1);
+ pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
+
+- cairo_move_to (cr,
+- (CALENDAR_MARGIN +
+- + (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR ?
+- (priv->week_width + (priv->week_width ? CALENDAR_XSEP : 0))
+- : 0)
+- + day_wid_sep * i
+- + (day_width - logical_rect.width)/2),
+- CALENDAR_MARGIN + focus_width + focus_padding + logical_rect.y);
+- pango_cairo_show_layout (cr, layout);
++ gdk_draw_layout (priv->day_name_win, gc,
++ (CALENDAR_MARGIN +
++ + (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR ?
++ (priv->week_width + (priv->week_width ? CALENDAR_XSEP : 0))
++ : 0)
++ + day_wid_sep * i
++ + (day_width - logical_rect.width)/2),
++ CALENDAR_MARGIN + focus_width + focus_padding + logical_rect.y,
++ layout);
+ }
+
+ g_object_unref (layout);
+- cairo_destroy (cr);
+ }
+
+ static void
+@@ -2017,7 +2012,7 @@
+ {
+ GtkWidget *widget = GTK_WIDGET (calendar);
+ GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
+- cairo_t *cr;
++ GdkGC *gc;
+ gint row, week = 0, year;
+ gint x_loc;
+ char buffer[32];
+@@ -2027,7 +2022,7 @@
+ gint focus_padding;
+ gint focus_width;
+
+- cr = gdk_cairo_create (priv->week_win);
++ gc = calendar->gc;
+
+ gtk_widget_style_get (GTK_WIDGET (widget),
+ "focus-line-width", &focus_width,
+@@ -2038,20 +2033,20 @@
+ * Draw a rectangle as inverted background for the labels.
+ */
+
+- gdk_cairo_set_source_color (cr, SELECTED_BG_COLOR (widget));
++ gdk_gc_set_foreground (gc, SELECTED_BG_COLOR (widget));
+ if (priv->day_name_win)
+- cairo_rectangle (cr,
+- CALENDAR_MARGIN,
+- 0,
+- priv->week_width - CALENDAR_MARGIN,
+- priv->main_h - CALENDAR_MARGIN);
++ gdk_draw_rectangle (priv->week_win, gc, TRUE,
++ CALENDAR_MARGIN,
++ 0,
++ priv->week_width - CALENDAR_MARGIN,
++ priv->main_h - CALENDAR_MARGIN);
+ else
+- cairo_rectangle (cr,
+- CALENDAR_MARGIN,
+- CALENDAR_MARGIN,
+- priv->week_width - CALENDAR_MARGIN,
+- priv->main_h - 2 * CALENDAR_MARGIN);
+- cairo_fill (cr);
++ gdk_draw_rectangle (priv->week_win, gc, TRUE,
++ CALENDAR_MARGIN,
++ CALENDAR_MARGIN,
++ priv->week_width - CALENDAR_MARGIN,
++ priv->main_h - 2 * CALENDAR_MARGIN);
++
+
+ /*
+ * Write the labels
+@@ -2059,7 +2054,7 @@
+
+ layout = gtk_widget_create_pango_layout (widget, NULL);
+
+- gdk_cairo_set_source_color (cr, SELECTED_FG_COLOR (widget));
++ gdk_gc_set_foreground (gc, SELECTED_FG_COLOR (widget));
+ day_height = calendar_row_height (calendar);
+ for (row = 0; row < 6; row++)
+ {
+@@ -2095,12 +2090,10 @@
+ - logical_rect.width
+ - CALENDAR_XSEP - focus_padding - focus_width);
+
+- cairo_move_to (cr, x_loc, y_loc);
+- pango_cairo_show_layout (cr, layout);
++ gdk_draw_layout (priv->week_win, gc, x_loc, y_loc, layout);
+ }
+
+ g_object_unref (layout);
+- cairo_destroy (cr);
+ }
+
+ static void
+@@ -2149,7 +2142,7 @@
+ {
+ GtkWidget *widget = GTK_WIDGET (calendar);
+ GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
+- cairo_t *cr;
++ GdkGC *gc;
+ GdkColor *text_color;
+ gchar buffer[32];
+ gint day;
+@@ -2162,7 +2155,7 @@
+ g_return_if_fail (row < 6);
+ g_return_if_fail (col < 7);
+
+- cr = gdk_cairo_create (priv->main_win);
++ gc = calendar->gc;
+
+ day = calendar->day[row][col];
+
+@@ -2170,11 +2163,11 @@
+
+ if (calendar->day_month[row][col] == MONTH_PREV)
+ {
+- text_color = PREV_MONTH_COLOR (widget);
++ gdk_gc_set_foreground (gc, PREV_MONTH_COLOR (GTK_WIDGET (calendar)));
+ }
+ else if (calendar->day_month[row][col] == MONTH_NEXT)
+ {
+- text_color = NEXT_MONTH_COLOR (widget);
++ gdk_gc_set_foreground (gc, NEXT_MONTH_COLOR (GTK_WIDGET (calendar)));
+ }
+ else
+ {
+@@ -2188,16 +2181,16 @@
+ #endif
+ if (calendar->selected_day == day)
+ {
+- gdk_cairo_set_source_color (cr, SELECTED_BG_COLOR (widget));
+- gdk_cairo_rectangle (cr, &day_rect);
+- cairo_fill (cr);
++ gdk_gc_set_foreground (gc, SELECTED_BG_COLOR (GTK_WIDGET (calendar)));
++ gdk_draw_rectangle (priv->main_win, gc, TRUE, day_rect.x, day_rect.y,
++ day_rect.width, day_rect.height);
+ }
+ if (calendar->selected_day == day)
+- text_color = SELECTED_FG_COLOR (widget);
++ gdk_gc_set_foreground (gc, SELECTED_FG_COLOR (GTK_WIDGET (calendar)));
+ else if (calendar->marked_date[day-1])
+- text_color = MARKED_COLOR (widget);
++ gdk_gc_set_foreground (gc, MARKED_COLOR (GTK_WIDGET (calendar)));
+ else
+- text_color = NORMAL_DAY_COLOR (widget);
++ gdk_gc_set_foreground (gc, NORMAL_DAY_COLOR (GTK_WIDGET (calendar)));
+ }
+
+ /* Translators: this defines whether the day numbers should use
+@@ -2219,16 +2212,13 @@
+ x_loc -= logical_rect.width;
+ y_loc = day_rect.y + (day_rect.height - logical_rect.height) / 2;
+
+- gdk_cairo_set_source_color (cr, text_color);
+- cairo_move_to (cr, x_loc, y_loc);
+- pango_cairo_show_layout (cr, layout);
++ gdk_draw_layout (priv->main_win, gc,
++ x_loc, y_loc, layout);
+
+ if (calendar->marked_date[day-1]
+ && calendar->day_month[row][col] == MONTH_CURRENT)
+- {
+- cairo_move_to (cr, x_loc - 1, y_loc);
+- pango_cairo_show_layout (cr, layout);
+- }
++ gdk_draw_layout (priv->main_win, gc,
++ x_loc-1, y_loc, layout);
+
+ if (GTK_WIDGET_HAS_FOCUS (calendar)
+ && calendar->focus_row == row && calendar->focus_col == col)
+@@ -2253,7 +2243,6 @@
+ }
+
+ g_object_unref (layout);
+- cairo_destroy (cr);
+ }
+
+ static void
+Index: gtk+-2.10.6/gtk/gtkentry.c
+===================================================================
+--- gtk+-2.10.6.orig/gtk/gtkentry.c 2006-10-30 12:58:30.000000000 +0000
++++ gtk+-2.10.6/gtk/gtkentry.c 2006-10-30 12:59:30.000000000 +0000
+@@ -3333,7 +3333,6 @@
+ if (GTK_WIDGET_DRAWABLE (entry))
+ {
+ PangoLayout *layout = gtk_entry_ensure_layout (entry, TRUE);
+- cairo_t *cr;
+ gint x, y;
+ gint start_pos, end_pos;
+
+@@ -3341,56 +3340,60 @@
+
+ get_layout_position (entry, &x, &y);
+
+- 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);
+-
++ gdk_draw_layout (entry->text_area, widget->style->text_gc [widget->state],
++ x, y,
++ layout);
++
+ 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;
++ GdkGC *selection_gc, *text_gc;
+ GtkBorder inner_border;
+-
++ GdkRegion *clip_region;
++
+ pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
+ gtk_entry_get_pixel_ranges (entry, &ranges, &n_ranges);
+
+ if (GTK_WIDGET_HAS_FOCUS (entry))
+ {
+- selection_color = &widget->style->base [GTK_STATE_SELECTED];
+- text_color = &widget->style->text [GTK_STATE_SELECTED];
++ selection_gc = widget->style->base_gc [GTK_STATE_SELECTED];
++ text_gc = widget->style->text_gc [GTK_STATE_SELECTED];
+ }
+ else
+ {
+- selection_color = &widget->style->base [GTK_STATE_ACTIVE];
+- text_color = &widget->style->text [GTK_STATE_ACTIVE];
++ selection_gc = widget->style->base_gc [GTK_STATE_ACTIVE];
++ text_gc = widget->style->text_gc [GTK_STATE_ACTIVE];
+ }
+-
++
++ clip_region = gdk_region_new ();
+ _gtk_entry_effective_inner_border (entry, &inner_border);
+
+ for (i = 0; i < n_ranges; ++i)
+- cairo_rectangle (cr,
+- inner_border.left - entry->scroll_offset + ranges[2 * i],
+- y,
+- ranges[2 * i + 1],
+- logical_rect.height);
++ {
++ GdkRectangle rect;
+
+- cairo_clip (cr);
+-
+- gdk_cairo_set_source_color (cr, selection_color);
+- cairo_paint (cr);
++ 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);
+
+- cairo_move_to (cr, x, y);
+- gdk_cairo_set_source_color (cr, text_color);
+- pango_cairo_show_layout (cr, layout);
++ 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);
+ g_free (ranges);
+ }
+-
+- cairo_destroy (cr);
+ }
+ }
+
+Index: gtk+-2.10.6/gtk/gtkwidget.c
+===================================================================
+--- gtk+-2.10.6.orig/gtk/gtkwidget.c 2006-10-30 12:58:30.000000000 +0000
++++ gtk+-2.10.6/gtk/gtkwidget.c 2006-10-30 12:59:30.000000000 +0000
+@@ -5445,7 +5445,8 @@
+ GdkScreen *screen;
+
+ update_pango_context (widget, context);
+-
++/* TODO: Figure out the proper way to handle this in a pangoxft setting
++
+ screen = gtk_widget_get_screen_unchecked (widget);
+ if (screen)
+ {
+@@ -5453,7 +5454,7 @@
+ gdk_screen_get_resolution (screen));
+ pango_cairo_context_set_font_options (context,
+ gdk_screen_get_font_options (screen));
+- }
++ }*/
+ }
+ }
+
+Index: gtk+-2.10.6/gdk/x11/gdkpango-x11.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ gtk+-2.10.6/gdk/x11/gdkpango-x11.c 2006-10-30 12:59:30.000000000 +0000
+@@ -0,0 +1,174 @@
++/* GDK - The GIMP Drawing Kit
++ * Copyright (C) 2000 Red Hat, Inc.
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; if not, write to the
++ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++ * Boston, MA 02111-1307, USA.
++ */
++
++#include <config.h>
++#include <stdlib.h>
++
++#include "gdkx.h"
++#include "gdkdisplay-x11.h"
++#include "gdkpango.h"
++#include <pango/pangoxft.h>
++#include <pango/pangoxft-render.h>
++#include "gdkalias.h"
++
++#include <math.h>
++
++typedef struct _GdkX11Renderer GdkX11Renderer;
++typedef struct _GdkX11RendererClass GdkX11RendererClass;
++
++#define GDK_TYPE_X11_RENDERER (_gdk_x11_renderer_get_type())
++#define GDK_X11_RENDERER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_X11_RENDERER, GdkX11Renderer))
++#define GDK_IS_X11_RENDERER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_X11_RENDERER))
++#define GDK_X11_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_X11_RENDERER, GdkX11RendererClass))
++#define GDK_IS_X11_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_X11_RENDERER))
++#define GDK_X11_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_X11_RENDERER, GdkX11RendererClass))
++
++#define MAX_RENDER_PART PANGO_RENDER_PART_STRIKETHROUGH
++
++struct _GdkX11Renderer
++{
++ PangoXftRenderer parent_instance;
++
++ XRenderPictFormat *mask_format;
++
++ GdkDrawable *drawable;
++ GdkGC *gc;
++};
++
++struct _GdkX11RendererClass
++{
++ PangoXftRendererClass parent_class;
++};
++
++G_DEFINE_TYPE (GdkX11Renderer, _gdk_x11_renderer, PANGO_TYPE_XFT_RENDERER)
++
++static void
++gdk_x11_renderer_finalize (GObject *object)
++{
++ G_OBJECT_CLASS (_gdk_x11_renderer_parent_class)->finalize (object);
++}
++
++static void
++gdk_x11_renderer_composite_trapezoids (PangoXftRenderer *xftrenderer,
++ PangoRenderPart part,
++ XTrapezoid *trapezoids,
++ int n_trapezoids)
++{
++ /* Because we only use this renderer for "draw_glyphs()" calls, we
++ * won't hit this code path much. However, it is hit for drawing
++ * the "unknown glyph" hex squares. We can safely ignore the part,
++ */
++ GdkX11Renderer *x11_renderer = GDK_X11_RENDERER (xftrenderer);
++
++ _gdk_x11_drawable_draw_xtrapezoids (x11_renderer->drawable,
++ x11_renderer->gc,
++ trapezoids, n_trapezoids);
++
++}
++
++static void
++gdk_x11_renderer_composite_glyphs (PangoXftRenderer *xftrenderer,
++ XftFont *xft_font,
++ XftGlyphSpec *glyphs,
++ gint n_glyphs)
++{
++ GdkX11Renderer *x11_renderer = GDK_X11_RENDERER (xftrenderer);
++
++ _gdk_x11_drawable_draw_xft_glyphs (x11_renderer->drawable,
++ x11_renderer->gc,
++ xft_font, glyphs, n_glyphs);
++}
++
++static void
++_gdk_x11_renderer_init (GdkX11Renderer *renderer)
++{
++}
++
++static void
++_gdk_x11_renderer_class_init (GdkX11RendererClass *klass)
++{
++ PangoXftRendererClass *xftrenderer_class = PANGO_XFT_RENDERER_CLASS (klass);
++ GObjectClass *object_class = G_OBJECT_CLASS (klass);
++
++ xftrenderer_class->composite_glyphs = gdk_x11_renderer_composite_glyphs;
++ xftrenderer_class->composite_trapezoids = gdk_x11_renderer_composite_trapezoids;
++
++ object_class->finalize = gdk_x11_renderer_finalize;
++}
++
++PangoRenderer *
++_gdk_x11_renderer_get (GdkDrawable *drawable,
++ GdkGC *gc)
++{
++ GdkScreen *screen = GDK_DRAWABLE_IMPL_X11 (drawable)->screen;
++ GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (screen);
++ GdkX11Renderer *x11_renderer;
++
++ if (!screen_x11->renderer)
++ {
++ screen_x11->renderer = g_object_new (GDK_TYPE_X11_RENDERER,
++ "display", GDK_SCREEN_XDISPLAY (screen),
++ "screen", GDK_SCREEN_XNUMBER (screen),
++ NULL);
++ }
++
++ x11_renderer = GDK_X11_RENDERER (screen_x11->renderer);
++
++ x11_renderer->drawable = drawable;
++ x11_renderer->gc = gc;
++
++ return screen_x11->renderer;
++}
++
++/**
++ * 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.
++ *
++ * Return value: a new #PangoContext for @screen
++ *
++ * Since: 2.2
++ **/
++PangoContext *
++gdk_pango_context_get_for_screen (GdkScreen *screen)
++{
++ PangoContext *context;
++
++ g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
++
++ if (screen->closed)
++ return NULL;
++
++ context = pango_xft_get_context (GDK_SCREEN_XDISPLAY (screen),
++ GDK_SCREEN_X11 (screen)->screen_num);
++
++ g_object_set_data (G_OBJECT (context), "gdk-pango-screen", screen);
++
++ return context;
++}
++
++#define __GDK_PANGO_X11_C__
++#include "gdkaliasdef.c"
+Index: gtk+-2.10.6/gdk/x11/gdkpixmap-x11.c
+===================================================================
+--- gtk+-2.10.6.orig/gdk/x11/gdkpixmap-x11.c 2006-10-30 12:58:30.000000000 +0000
++++ gtk+-2.10.6/gdk/x11/gdkpixmap-x11.c 2006-10-30 12:59:30.000000000 +0000
+@@ -119,6 +119,9 @@
+ {
+ GdkDrawableImplX11 *draw_impl = GDK_DRAWABLE_IMPL_X11 (impl);
+
++ if (draw_impl->xft_draw)
++ XftDrawDestroy (draw_impl->xft_draw);
++
+ _gdk_x11_drawable_finish (GDK_DRAWABLE (draw_impl));
+ }
+
+--- gtk+-2.10.6.orig/gtk/gtkcalendar.c.orig 2006-11-14 14:39:34.000000000 -0800
++++ gtk+-2.10.6/gtk/gtkcalendar.c 2006-11-14 14:37:34.000000000 -0800
+@@ -1495,6 +1495,10 @@ gtk_calendar_realize (GtkWidget *widget)
+ BACKGROUND_COLOR ( GTK_WIDGET ( calendar)));
+ gdk_window_show (priv->main_win);
+ gdk_window_set_user_data (priv->main_win, widget);
++
++ /* Set widgets gc */
++ calendar->gc = gdk_gc_new (widget->window);
++
+ gdk_window_set_background (widget->window, BACKGROUND_COLOR (widget));
+ gdk_window_show (widget->window);
+ gdk_window_set_user_data (widget->window, widget);
diff --git a/recipes/gtk+/gtk+-2.12.0/range-no-redraw.patch b/recipes/gtk+/gtk+-2.12.0/range-no-redraw.patch
new file mode 100644
index 0000000000..14387b8a2e
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.0/range-no-redraw.patch
@@ -0,0 +1,127 @@
+5f084ea0849d5967a3c22821542ecaaa8accb398
+diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
+index bd95351..64e0e59 100644
+--- gtk/gtkrange.c
++++ gtk/gtkrange.c
+@@ -109,6 +109,8 @@ struct _GtkRangeLayout
+ GtkSensitivityType upper_sensitivity;
+
+ gdouble fill_level;
++
++ guint motion_idle_id;
+ };
+
+
+@@ -205,6 +207,8 @@ static gboolean gtk_range_real_change_value (GtkRange *range,
+ static void gtk_range_update_value (GtkRange *range);
+ static gboolean gtk_range_key_press (GtkWidget *range,
+ GdkEventKey *event);
++static void gtk_range_add_motion_idle (GtkRange *range);
++static void gtk_range_remove_motion_idle (GtkRange *range);
+
+
+ static guint signals[LAST_SIGNAL];
+@@ -1167,6 +1171,7 @@ gtk_range_destroy (GtkObject *object)
+
+ gtk_range_remove_step_timer (range);
+ gtk_range_remove_update_timer (range);
++ gtk_range_remove_motion_idle (range);
+
+ if (range->adjustment)
+ {
+@@ -1276,6 +1281,7 @@ gtk_range_unrealize (GtkWidget *widget)
+
+ gtk_range_remove_step_timer (range);
+ gtk_range_remove_update_timer (range);
++ gtk_range_remove_motion_idle (range);
+
+ gdk_window_set_user_data (range->event_window, NULL);
+ gdk_window_destroy (range->event_window);
+@@ -2165,7 +2171,7 @@ gtk_range_motion_notify (GtkWidget *widget,
+ gtk_widget_queue_draw (widget);
+
+ if (range->layout->grab_location == MOUSE_SLIDER)
+- update_slider_position (range, x, y);
++ gtk_range_add_motion_idle (range);
+
+ /* We handled the event if the mouse was in the range_rect */
+ return range->layout->mouse_location != MOUSE_OUTSIDE;
+@@ -3335,9 +3341,10 @@ initial_timeout (gpointer data)
+ g_object_get (settings, "gtk-timeout-repeat", &timeout, NULL);
+
+ range = GTK_RANGE (data);
+- range->timer->timeout_id = gdk_threads_add_timeout (timeout * SCROLL_DELAY_FACTOR,
+- second_timeout,
+- range);
++ range->timer->timeout_id =
++ gdk_threads_add_timeout (timeout * SCROLL_DELAY_FACTOR,
++ second_timeout,
++ range);
+ /* remove self */
+ return FALSE;
+ }
+@@ -3357,9 +3364,8 @@ gtk_range_add_step_timer (GtkRange *range,
+
+ range->timer = g_new (GtkRangeStepTimer, 1);
+
+- range->timer->timeout_id = gdk_threads_add_timeout (timeout,
+- initial_timeout,
+- range);
++ range->timer->timeout_id =
++ gdk_threads_add_timeout (timeout, initial_timeout, range);
+ range->timer->step = step;
+
+ gtk_range_scroll (range, range->timer->step);
+@@ -3397,9 +3403,8 @@ gtk_range_reset_update_timer (GtkRange *range)
+ {
+ gtk_range_remove_update_timer (range);
+
+- range->update_timeout_id = gdk_threads_add_timeout (UPDATE_DELAY,
+- update_timeout,
+- range);
++ range->update_timeout_id =
++ gdk_threads_add_timeout (UPDATE_DELAY, update_timeout, range);
+ }
+
+ static void
+@@ -3412,5 +3417,40 @@ gtk_range_remove_update_timer (GtkRange *range)
+ }
+ }
+
++static gboolean
++motion_idle (gpointer data)
++{
++ GtkRange *range = data;
++ GtkRangeLayout *layout = range->layout;
++
++ update_slider_position (range, layout->mouse_x, layout->mouse_y);
++
++ layout->motion_idle_id = 0;
++
++ return FALSE;
++}
++
++static void
++gtk_range_add_motion_idle (GtkRange *range)
++{
++ if (!range->layout->motion_idle_id)
++ {
++ range->layout->motion_idle_id =
++ gdk_threads_add_idle_full (GDK_PRIORITY_REDRAW,
++ motion_idle, range,
++ NULL);
++ }
++}
++
++static void
++gtk_range_remove_motion_idle (GtkRange *range)
++{
++ if (range->layout->motion_idle_id != 0)
++ {
++ g_source_remove (range->layout->motion_idle_id);
++ range->layout->motion_idle_id = 0;
++ }
++}
++
+ #define __GTK_RANGE_C__
+ #include "gtkaliasdef.c"
diff --git a/recipes/gtk+/gtk+-2.12.0/run-iconcache.patch b/recipes/gtk+/gtk+-2.12.0/run-iconcache.patch
new file mode 100644
index 0000000000..ac15e9ab24
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.0/run-iconcache.patch
@@ -0,0 +1,19 @@
+--- /tmp/Makefile.am 2007-01-08 17:44:47.000000000 +0100
++++ gtk+-2.10.7/gtk/Makefile.am 2007-01-08 17:45:17.025251000 +0100
+@@ -1128,11 +1128,11 @@
+ ./gtk-update-icon-cache
+ endif
+
+-gtkbuiltincache.h: @REBUILD@ stamp-icons
+- $(MAKE) $(AM_MAKEFLAGS) gtk-update-icon-cache$(EXEEXT)
+- $(gtk_update_icon_cache_program) --force --ignore-theme-index \
+- --source builtin_icons stock-icons > gtkbuiltincache.h.tmp && \
+- mv gtkbuiltincache.h.tmp gtkbuiltincache.h
++#gtkbuiltincache.h: @REBUILD@ stamp-icons
++# $(MAKE) $(AM_MAKEFLAGS) gtk-update-icon-cache$(EXEEXT)
++# $(gtk_update_icon_cache_program) --force --ignore-theme-index \
++# --source builtin_icons stock-icons > gtkbuiltincache.h.tmp && \
++# mv gtkbuiltincache.h.tmp gtkbuiltincache.h
+
+ EXTRA_DIST += \
+ $(STOCK_ICONS) \
diff --git a/recipes/gtk+/gtk+-2.12.0/scrolled-placement.patch b/recipes/gtk+/gtk+-2.12.0/scrolled-placement.patch
new file mode 100644
index 0000000000..a0b50c8cac
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.0/scrolled-placement.patch
@@ -0,0 +1,22 @@
+Index: gdk/x11/gdksettings.c
+===================================================================
+--- gdk/x11/gdksettings.c (revision 18493)
++++ gdk/x11/gdksettings.c (working copy)
+@@ -65,7 +65,8 @@
+ "Xft/RGBA\0" "gtk-xft-rgba\0"
+ "Xft/DPI\0" "gtk-xft-dpi\0"
+ "Net/FallbackIconTheme\0" "gtk-fallback-icon-theme\0"
+- "Gtk/TouchscreenMode\0" "gtk-touchscreen-mode\0";
++ "Gtk/TouchscreenMode\0" "gtk-touchscreen-mode\0"
++ "Gtk/ScrolledWindowPlacement\0" "gtk-scrolled-window-placement\0";
+
+ static const struct
+ {
+@@ -107,5 +108,6 @@
+ { 1197, 1206 },
+ { 1219, 1227 },
+ { 1239, 1261 },
+- { 1285, 1305 }
++ { 1285, 1305 },
++ { 1326, 1354 }
+ };
diff --git a/recipes/gtk+/gtk+-2.12.0/toggle-font.diff b/recipes/gtk+/gtk+-2.12.0/toggle-font.diff
new file mode 100644
index 0000000000..59ad150b2f
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.0/toggle-font.diff
@@ -0,0 +1,100 @@
+Index: gtk/gtkcellrenderertoggle.c
+===================================================================
+--- gtk/gtkcellrenderertoggle.c (revision 18523)
++++ gtk/gtkcellrenderertoggle.c (working copy)
+@@ -71,6 +71,8 @@
+ PROP_INDICATOR_SIZE
+ };
+
++/* This is a hard-coded default which promptly gets overridden by a size
++ calculated from the font size. */
+ #define TOGGLE_WIDTH 13
+
+ static guint toggle_cell_signals[LAST_SIGNAL] = { 0 };
+@@ -80,8 +82,9 @@
+ typedef struct _GtkCellRendererTogglePrivate GtkCellRendererTogglePrivate;
+ struct _GtkCellRendererTogglePrivate
+ {
+- gint indicator_size;
+-
++ gint indicator_size; /* This is the real size */
++ gint override_size; /* This is the size set from the indicator-size property */
++ GtkWidget *cached_widget;
+ guint inconsistent : 1;
+ };
+
+@@ -104,6 +107,7 @@
+ GTK_CELL_RENDERER (celltoggle)->ypad = 2;
+
+ priv->indicator_size = TOGGLE_WIDTH;
++ priv->override_size = 0;
+ priv->inconsistent = FALSE;
+ }
+
+@@ -210,7 +214,7 @@
+ g_value_set_boolean (value, celltoggle->radio);
+ break;
+ case PROP_INDICATOR_SIZE:
+- g_value_set_int (value, priv->indicator_size);
++ g_value_set_int (value, priv->override_size ? priv->override_size : priv->indicator_size);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+@@ -245,7 +249,7 @@
+ celltoggle->radio = g_value_get_boolean (value);
+ break;
+ case PROP_INDICATOR_SIZE:
+- priv->indicator_size = g_value_get_int (value);
++ priv->override_size = g_value_get_int (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+@@ -273,6 +277,27 @@
+ }
+
+ static void
++on_widget_style_set (GtkWidget *widget, GtkStyle *previous, gpointer user_data)
++{
++ GtkCellRendererTogglePrivate *priv = user_data;
++ PangoContext *context;
++ PangoFontMetrics *metrics;
++ int height;
++
++ context = gtk_widget_get_pango_context (widget);
++ metrics = pango_context_get_metrics (context,
++ widget->style->font_desc,
++ pango_context_get_language (context));
++
++ height = pango_font_metrics_get_ascent (metrics) +
++ pango_font_metrics_get_descent (metrics);
++
++ pango_font_metrics_unref (metrics);
++
++ priv->indicator_size = PANGO_PIXELS (height * 0.85);
++}
++
++static void
+ gtk_cell_renderer_toggle_get_size (GtkCellRenderer *cell,
+ GtkWidget *widget,
+ GdkRectangle *cell_area,
+@@ -287,6 +312,20 @@
+
+ priv = GTK_CELL_RENDERER_TOGGLE_GET_PRIVATE (cell);
+
++ if (priv->override_size) {
++ priv->indicator_size = priv->override_size;
++ } else if (priv->cached_widget != widget) {
++ if (priv->cached_widget) {
++ g_object_remove_weak_pointer (widget, &priv->cached_widget);
++ g_signal_handlers_disconnect_by_func (priv->cached_widget, on_widget_style_set, priv);
++ }
++ priv->cached_widget = widget;
++ g_object_add_weak_pointer (widget, &priv->cached_widget);
++ g_signal_connect (widget, "style-set", on_widget_style_set, priv);
++
++ on_widget_style_set (widget, NULL, priv);
++ }
++
+ calc_width = (gint) cell->xpad * 2 + priv->indicator_size;
+ calc_height = (gint) cell->ypad * 2 + priv->indicator_size;
+
diff --git a/recipes/gtk+/gtk+-2.12.11/cellrenderer-cairo.patch b/recipes/gtk+/gtk+-2.12.11/cellrenderer-cairo.patch
new file mode 100644
index 0000000000..4439e69fb6
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.11/cellrenderer-cairo.patch
@@ -0,0 +1,32 @@
+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/recipes/gtk+/gtk+-2.12.11/combo-arrow-size.patch b/recipes/gtk+/gtk+-2.12.11/combo-arrow-size.patch
new file mode 100644
index 0000000000..d44c454ce3
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.11/combo-arrow-size.patch
@@ -0,0 +1,67 @@
+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/recipes/gtk+/gtk+-2.12.11/disable-print.patch b/recipes/gtk+/gtk+-2.12.11/disable-print.patch
new file mode 100644
index 0000000000..21a4be4da8
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.11/disable-print.patch
@@ -0,0 +1,26 @@
+--- 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 -n $CUPS_API_VERSION | awk -F. '{print $1}'`
+- CUPS_API_MINOR=`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/recipes/gtk+/gtk+-2.12.11/entry-cairo.patch b/recipes/gtk+/gtk+-2.12.11/entry-cairo.patch
new file mode 100644
index 0000000000..3313e7f132
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.11/entry-cairo.patch
@@ -0,0 +1,103 @@
+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/recipes/gtk+/gtk+-2.12.11/hardcoded_libtool.patch b/recipes/gtk+/gtk+-2.12.11/hardcoded_libtool.patch
new file mode 100644
index 0000000000..1c2cd0576d
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.11/hardcoded_libtool.patch
@@ -0,0 +1,29 @@
+--- /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/recipes/gtk+/gtk+-2.12.11/menu-deactivate.patch b/recipes/gtk+/gtk+-2.12.11/menu-deactivate.patch
new file mode 100644
index 0000000000..cfb8849e9f
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.11/menu-deactivate.patch
@@ -0,0 +1,51 @@
+--- 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/recipes/gtk+/gtk+-2.12.11/no-demos.patch b/recipes/gtk+/gtk+-2.12.11/no-demos.patch
new file mode 100644
index 0000000000..0fc4c48d1a
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.11/no-demos.patch
@@ -0,0 +1,10 @@
+--- 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/recipes/gtk+/gtk+-2.12.11/pangoxft2.10.6.diff b/recipes/gtk+/gtk+-2.12.11/pangoxft2.10.6.diff
new file mode 100644
index 0000000000..63828cec63
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.11/pangoxft2.10.6.diff
@@ -0,0 +1,2456 @@
+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 <config.h>
+
++#include <pango/pangoxft.h>
++
+ #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 <X11/Xlib.h>
+ #include <X11/extensions/Xrender.h>
++#include <X11/Xft/Xft.h>
+
+ 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;
++
++ return XRenderCreatePicture (GDK_GC_XDISPLAY (gc),
++ GDK_PIXMAP_XID (_gdk_gc_get_tile (gc)),
++ format,
++ CPRepeat, &pa);
++ }
++
++ return None;
++}
++
++static Picture
++make_stipple_picture (GdkGC *gc)
++{
++ XRenderPictFormat *format = NULL;
++ XRenderPictureAttributes pa;
++
++ format = XRenderFindStandardFormat (GDK_GC_XDISPLAY (gc),
++ PictStandardA1);
++
++ pa.repeat = True;
++ return XRenderCreatePicture (GDK_GC_XDISPLAY (gc),
++ GDK_PIXMAP_XID (_gdk_gc_get_stipple (gc)),
++ format,
++ CPRepeat, &pa);
++}
++
++static Picture
++make_color_picture (GdkGC *gc,
++ XRenderColor *color)
++{
++ GdkGCX11 *x11_gc = GDK_GC_X11 (gc);
++ XRenderPictureAttributes pa;
++ XRenderPictFormat *pix_format = foreground_format (gc);
++ Pixmap pix;
++ Picture picture;
++
++ if (!pix_format)
++ return None;
++
++ pix = XCreatePixmap (GDK_GC_XDISPLAY (gc),
++ GDK_SCREEN_XROOTWIN (x11_gc->screen),
++ 1, 1, pix_format->depth);
++ pa.repeat = True;
++ picture = XRenderCreatePicture (GDK_GC_XDISPLAY (gc),
++ pix,
++ pix_format,
++ CPRepeat, &pa);
++ XFreePixmap (GDK_GC_XDISPLAY (gc), pix);
++
++ XRenderFillRectangle (GDK_GC_XDISPLAY (gc), PictOpSrc,
++ picture, color,
++ 0, 0, 1, 1);
++
++ return picture;
++}
++
++static void
++get_bg_color (GdkGC *gc,
++ XRenderColor *render_color)
++{
++ GdkColormap *cmap;
++
++ cmap = gdk_gc_get_colormap (gc);
++
++ if (cmap)
++ {
++ GdkColor color;
++
++ gdk_colormap_query_color (cmap, _gdk_gc_get_bg_pixel (gc), &color);
++
++ render_color->alpha = 0xffff;
++ render_color->red = color.red;
++ render_color->green = color.green;
++ render_color->blue = color.blue;
++ }
++ else /* Not worth warning, just use black */
++ {
++ render_color->alpha = 0xffff;
++ render_color->red = 0;
++ render_color->green = 0;
++ render_color->blue = 0;
++ }
++}
++
++/**
++ * _gdk_x11_gc_get_fg_picture:
++ * @gc: a #GdkGC
++ *
++ * Gets a Xrender Picture object suitable for being the source
++ * drawable for drawing with the foreground the graphics context.
++ *
++ * Return value: a Picture, owned by the GC; this cannot be
++ * used over subsequent modification of the GC.
++ **/
++Picture
++_gdk_x11_gc_get_fg_picture (GdkGC *gc)
++{
++ GdkGCX11 *x11_gc;
++ gboolean new = FALSE;
++ XftColor xftcolor;
++ GdkFill fill;
++ int width, height;
++
++ g_return_val_if_fail (GDK_IS_GC_X11 (gc), None);
++
++ if (!_gdk_x11_have_render (GDK_GC_DISPLAY (gc)))
++ return None;
++
++ x11_gc = GDK_GC_X11 (gc);
++
++ fill = GDK_SOLID;
++ width = 1;
++ height = 1;
++
++ switch (_gdk_gc_get_fill (gc))
++ {
++ case GDK_SOLID:
++ break;
++ case GDK_TILED:
++ if (_gdk_gc_get_tile (gc))
++ {
++ if (!x11_gc->fg_picture)
++ x11_gc->fg_picture = make_fg_tile_picture (gc);
++
++ if (x11_gc->fg_picture != None)
++ return x11_gc->fg_picture;
++ }
++ break;
++ case GDK_STIPPLED:
++ case GDK_OPAQUE_STIPPLED:
++ if (_gdk_gc_get_stipple (gc))
++ {
++ gdk_drawable_get_size (_gdk_gc_get_stipple (gc), &width, &height);
++ fill = _gdk_gc_get_fill (gc);
++ }
++ break;
++ }
++
++ if (x11_gc->fg_picture == None)
++ {
++ XRenderPictureAttributes pa;
++ XRenderPictFormat *pix_format = foreground_format (gc);
++ Pixmap pix;
++
++ if (!pix_format)
++ return None;
++
++ pix = XCreatePixmap (GDK_GC_XDISPLAY (gc),
++ GDK_SCREEN_XROOTWIN (x11_gc->screen),
++ width, height, pix_format->depth);
++ pa.repeat = True;
++ x11_gc->fg_picture = XRenderCreatePicture (GDK_GC_XDISPLAY (gc),
++ pix,
++ pix_format,
++ CPRepeat, &pa);
++ XFreePixmap (GDK_GC_XDISPLAY (gc), pix);
++
++ new = TRUE;
++ }
++
++ _gdk_gc_x11_get_fg_xft_color (gc, &xftcolor);
++
++ if (x11_gc->fg_picture_color.alpha != 0xffff ||
++ x11_gc->fg_picture_color.red != xftcolor.color.red ||
++ x11_gc->fg_picture_color.green != xftcolor.color.green ||
++ x11_gc->fg_picture_color.blue != xftcolor.color.blue)
++ {
++ x11_gc->fg_picture_color.alpha = 0xffff;
++ x11_gc->fg_picture_color.red = xftcolor.color.red;
++ x11_gc->fg_picture_color.green = xftcolor.color.green;
++ x11_gc->fg_picture_color.blue = xftcolor.color.blue;
++
++ new = TRUE;
++ }
++
++ switch (fill)
++ {
++ case GDK_SOLID:
++ XRenderFillRectangle (GDK_GC_XDISPLAY (gc), PictOpSrc,
++ x11_gc->fg_picture, &x11_gc->fg_picture_color,
++ 0, 0, width, height);
++ break;
++ case GDK_STIPPLED:
++ {
++ Picture stipple_picture = make_stipple_picture (gc);
++
++ XRenderFillRectangle (GDK_GC_XDISPLAY (gc), PictOpSrc,
++ x11_gc->fg_picture, &x11_gc->fg_picture_color,
++ 0, 0, width, height);
++ XRenderComposite (GDK_GC_XDISPLAY (gc),
++ PictOpInReverse,
++ stipple_picture, None, x11_gc->fg_picture,
++ 0, 0, 0, 0, 0, 0, width, height);
++
++ XRenderFreePicture (GDK_GC_XDISPLAY (x11_gc), stipple_picture);
++ }
++ break;
++ case GDK_OPAQUE_STIPPLED:
++ {
++ XRenderColor bg_color;
++
++ Picture stipple_picture = make_stipple_picture (gc);
++ Picture fg_picture = make_color_picture (gc, &x11_gc->fg_picture_color);
++
++ get_bg_color (gc, &bg_color);
++
++ XRenderFillRectangle (GDK_GC_XDISPLAY (gc), PictOpSrc,
++ x11_gc->fg_picture, &bg_color,
++ 0, 0, width, height);
++ XRenderComposite (GDK_GC_XDISPLAY (gc),
++ PictOpOver,
++ fg_picture, stipple_picture, x11_gc->fg_picture,
++ 0, 0, 0, 0, 0, 0, width, height);
++
++ XRenderFreePicture (GDK_GC_XDISPLAY (x11_gc), stipple_picture);
++ XRenderFreePicture (GDK_GC_XDISPLAY (x11_gc), fg_picture);
++ }
++ break;
++ case GDK_TILED:
++ g_assert_not_reached (); /* handled above */
++ break;
++ }
++
++ return x11_gc->fg_picture;
++}
++
++/**
++ * _gdk_gc_x11_get_fg_xft_color:
++ * @gc: a #GdkGC
++ * @xftcolor: location to store the color
++ *
++ * Gets the foreground color of the GC as a XftColor.
++ **/
++void
++_gdk_gc_x11_get_fg_xft_color (GdkGC *gc,
++ XftColor *xftcolor)
++{
++ GdkGCX11 *x11_gc;
++ GdkColormap *cmap;
++ GdkColor color;
++
++ g_return_if_fail (GDK_IS_GC_X11 (gc));
++
++ x11_gc = GDK_GC_X11 (gc);
++
++ cmap = gdk_gc_get_colormap (gc);
++
++ xftcolor->pixel = _gdk_gc_get_fg_pixel (gc);
++
++ if (cmap)
++ {
++ gdk_colormap_query_color (cmap, xftcolor->pixel, &color);
++ xftcolor->color.alpha = 0xffff;
++ xftcolor->color.red = color.red;
++ xftcolor->color.green = color.green;
++ xftcolor->color.blue = color.blue;
++ }
++ else if (x11_gc->depth == 1)
++ {
++ /* Drawing with Xft on a bitmap is a bit bizzare; it
++ * takes alpha >= 0x8000 to mean 'set to 1' and
++ * alpha < 0x8000 to mean 'set to 0'.
++ */
++ if (xftcolor->pixel)
++ {
++ xftcolor->color.red = 0xffff;
++ xftcolor->color.green = 0xffff;
++ xftcolor->color.blue = 0xffff;
++ xftcolor->color.alpha = 0xffff;
++ }
++ else
++ {
++ xftcolor->color.red = 0;
++ xftcolor->color.green = 0;
++ xftcolor->color.blue = 0;
++ xftcolor->color.alpha = 0;
++ }
++ }
++ else
++ {
++ g_warning ("Using Xft rendering requires the GC argument to have a\n"
++ "specified colormap. If the GC was created for a drawable\n"
++ "with a colormap, the colormap will be set on the GC\n"
++ "automatically. Otherwise, a colormap must be set on it with"
++ "gdk_gc_set_colormap");
++ }
++}
++
++void
++_gdk_windowing_gc_get_foreground (GdkGC *gc,
++ GdkColor *color)
++{
++ GdkColormap *cmap;
++
++ g_return_if_fail (GDK_IS_GC_X11 (gc));
++
++ color->pixel = _gdk_gc_get_fg_pixel (gc);
++
++ cmap = gdk_gc_get_colormap (gc);
++
++ if (cmap)
++ gdk_colormap_query_color (cmap, _gdk_gc_get_fg_pixel (gc), color);
++ else
++ g_warning ("No colormap in _gdk_windowing_gc_get_foreground");
++}
+ #define __GDK_GC_X11_C__
+ #include "gdkaliasdef.c"
+Index: gtk+-2.10.6/gdk/x11/gdkprivate-x11.h
+===================================================================
+--- gtk+-2.10.6.orig/gdk/x11/gdkprivate-x11.h 2006-10-30 12:58:30.000000000 +0000
++++ gtk+-2.10.6/gdk/x11/gdkprivate-x11.h 2006-10-30 12:59:30.000000000 +0000
+@@ -63,6 +63,9 @@
+ guint have_clip_region : 1;
+ guint have_clip_mask : 1;
+ guint depth : 8;
++
++ Picture fg_picture;
++ XRenderColor fg_picture_color;
+ };
+
+ struct _GdkGCX11Class
+@@ -102,6 +105,11 @@
+ GType _gdk_gc_x11_get_type (void);
+
+ gboolean _gdk_x11_have_render (GdkDisplay *display);
++gboolean _gdk_x11_have_render_with_trapezoids (GdkDisplay *display);
++
++Picture _gdk_x11_gc_get_fg_picture (GdkGC *gc);
++void _gdk_gc_x11_get_fg_xft_color (GdkGC *gc,
++ XftColor *xftcolor);
+
+ GdkGC *_gdk_x11_gc_new (GdkDrawable *drawable,
+ GdkGCValues *values,
+Index: gtk+-2.10.6/gdk/x11/gdkwindow-x11.c
+===================================================================
+--- gtk+-2.10.6.orig/gdk/x11/gdkwindow-x11.c 2006-10-30 12:58:30.000000000 +0000
++++ gtk+-2.10.6/gdk/x11/gdkwindow-x11.c 2006-10-30 12:59:30.000000000 +0000
+@@ -1114,7 +1114,8 @@
+ {
+ GdkWindowObject *private = (GdkWindowObject *)window;
+ GdkToplevelX11 *toplevel;
+-
++ GdkDrawableImplX11 *draw_impl;
++
+ g_return_if_fail (GDK_IS_WINDOW (window));
+
+ _gdk_selection_window_destroyed (window);
+@@ -1126,6 +1127,11 @@
+ if (toplevel)
+ gdk_toplevel_x11_free_contents (GDK_WINDOW_DISPLAY (window), toplevel);
+
++ draw_impl = GDK_DRAWABLE_IMPL_X11 (private->impl);
++
++ if (draw_impl->xft_draw)
++ XftDrawDestroy (draw_impl->xft_draw);
++
+ _gdk_x11_drawable_finish (private->impl);
+
+ if (!recursing && !foreign_destroy)
+Index: gtk+-2.10.6/gdk/x11/Makefile.am
+===================================================================
+--- gtk+-2.10.6.orig/gdk/x11/Makefile.am 2006-10-30 12:58:30.000000000 +0000
++++ gtk+-2.10.6/gdk/x11/Makefile.am 2006-10-30 12:59:30.000000000 +0000
+@@ -37,6 +37,7 @@
+ gdkinput.c \
+ gdkkeys-x11.c \
+ gdkmain-x11.c \
++ gdkpango-x11.c \
+ gdkpixmap-x11.c \
+ gdkpixmap-x11.h \
+ gdkproperty-x11.c \
+Index: gtk+-2.10.6/gtk/gtkcalendar.c
+===================================================================
+--- gtk+-2.10.6.orig/gtk/gtkcalendar.c 2006-10-30 12:58:30.000000000 +0000
++++ gtk+-2.10.6/gtk/gtkcalendar.c 2006-10-30 12:59:30.000000000 +0000
+@@ -1821,7 +1821,7 @@
+ }
+ }
+
+-
++
+ /****************************************
+ * Repainting *
+ ****************************************/
+@@ -1831,7 +1831,7 @@
+ {
+ GtkWidget *widget = GTK_WIDGET (calendar);
+ GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
+- cairo_t *cr;
++ GdkGC *gc;
+ char buffer[255];
+ int x, y;
+ gint header_width;
+@@ -1849,7 +1849,7 @@
+ else
+ year_left = !priv->year_before;
+
+- cr = gdk_cairo_create (priv->header_win);
++ gc = calendar->gc;
+
+ header_width = widget->allocation.width - 2 * widget->style->xthickness;
+
+@@ -1902,9 +1902,9 @@
+ - (max_year_width - logical_rect.width)/2);
+
+
+- gdk_cairo_set_source_color (cr, HEADER_FG_COLOR (GTK_WIDGET (calendar)));
+- cairo_move_to (cr, x, y);
+- pango_cairo_show_layout (cr, layout);
++ gdk_gc_set_foreground (gc, HEADER_FG_COLOR (GTK_WIDGET (calendar)));
++ gdk_draw_layout (priv->header_win, gc, x, y, layout);
++
+
+ /* Draw month */
+ g_snprintf (buffer, sizeof (buffer), "%s", default_monthname[calendar->month]);
+@@ -1924,19 +1924,19 @@
+ else
+ x = 3 + priv->arrow_width + (max_month_width - logical_rect.width)/2;
+
+- cairo_move_to (cr, x, y);
+- pango_cairo_show_layout (cr, layout);
+-
++ gdk_draw_layout (priv->header_win, gc, x, y, layout);
++
++ gdk_gc_set_foreground (gc, BACKGROUND_COLOR (GTK_WIDGET (calendar)));
++
+ g_object_unref (layout);
+- cairo_destroy (cr);
+ }
+
+ static void
+ calendar_paint_day_names (GtkCalendar *calendar)
+ {
+ GtkWidget *widget = GTK_WIDGET (calendar);
++ GdkGC *gc;
+ GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
+- cairo_t *cr;
+ char buffer[255];
+ int day,i;
+ int day_width, cal_width;
+@@ -1946,8 +1946,7 @@
+ gint focus_padding;
+ gint focus_width;
+
+- cr = gdk_cairo_create (priv->day_name_win);
+-
++ gc = calendar->gc;
+ gtk_widget_style_get (GTK_WIDGET (widget),
+ "focus-line-width", &focus_width,
+ "focus-padding", &focus_padding,
+@@ -1961,22 +1960,19 @@
+ * Draw rectangles as inverted background for the labels.
+ */
+
+- gdk_cairo_set_source_color (cr, SELECTED_BG_COLOR (widget));
+- cairo_rectangle (cr,
+- CALENDAR_MARGIN, CALENDAR_MARGIN,
+- cal_width-CALENDAR_MARGIN * 2,
+- priv->day_name_h - CALENDAR_MARGIN);
+- cairo_fill (cr);
+-
++ gdk_gc_set_foreground (gc, SELECTED_BG_COLOR (widget));
++ gdk_draw_rectangle (priv->day_name_win, gc, TRUE,
++ CALENDAR_MARGIN, CALENDAR_MARGIN,
++ cal_width-CALENDAR_MARGIN * 2,
++ priv->day_name_h - CALENDAR_MARGIN);
++
+ if (calendar->display_flags & GTK_CALENDAR_SHOW_WEEK_NUMBERS)
+- {
+- cairo_rectangle (cr,
+- CALENDAR_MARGIN,
+- priv->day_name_h - CALENDAR_YSEP,
+- priv->week_width - CALENDAR_YSEP - CALENDAR_MARGIN,
+- CALENDAR_YSEP);
+- cairo_fill (cr);
+- }
++ gdk_draw_rectangle (priv->day_name_win, gc, TRUE,
++ CALENDAR_MARGIN,
++ priv->day_name_h - CALENDAR_YSEP,
++ priv->week_width - CALENDAR_YSEP - CALENDAR_MARGIN,
++ CALENDAR_YSEP);
++
+
+ /*
+ * Write the labels
+@@ -1984,7 +1980,7 @@
+
+ layout = gtk_widget_create_pango_layout (widget, NULL);
+
+- gdk_cairo_set_source_color (cr, SELECTED_FG_COLOR (widget));
++ gdk_gc_set_foreground (gc, SELECTED_FG_COLOR (widget));
+ for (i = 0; i < 7; i++)
+ {
+ if (gtk_widget_get_direction (GTK_WIDGET (calendar)) == GTK_TEXT_DIR_RTL)
+@@ -1997,19 +1993,18 @@
+ pango_layout_set_text (layout, buffer, -1);
+ pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
+
+- cairo_move_to (cr,
+- (CALENDAR_MARGIN +
+- + (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR ?
+- (priv->week_width + (priv->week_width ? CALENDAR_XSEP : 0))
+- : 0)
+- + day_wid_sep * i
+- + (day_width - logical_rect.width)/2),
+- CALENDAR_MARGIN + focus_width + focus_padding + logical_rect.y);
+- pango_cairo_show_layout (cr, layout);
++ gdk_draw_layout (priv->day_name_win, gc,
++ (CALENDAR_MARGIN +
++ + (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR ?
++ (priv->week_width + (priv->week_width ? CALENDAR_XSEP : 0))
++ : 0)
++ + day_wid_sep * i
++ + (day_width - logical_rect.width)/2),
++ CALENDAR_MARGIN + focus_width + focus_padding + logical_rect.y,
++ layout);
+ }
+
+ g_object_unref (layout);
+- cairo_destroy (cr);
+ }
+
+ static void
+@@ -2017,7 +2012,7 @@
+ {
+ GtkWidget *widget = GTK_WIDGET (calendar);
+ GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
+- cairo_t *cr;
++ GdkGC *gc;
+ gint row, week = 0, year;
+ gint x_loc;
+ char buffer[32];
+@@ -2027,7 +2022,7 @@
+ gint focus_padding;
+ gint focus_width;
+
+- cr = gdk_cairo_create (priv->week_win);
++ gc = calendar->gc;
+
+ gtk_widget_style_get (GTK_WIDGET (widget),
+ "focus-line-width", &focus_width,
+@@ -2038,20 +2033,20 @@
+ * Draw a rectangle as inverted background for the labels.
+ */
+
+- gdk_cairo_set_source_color (cr, SELECTED_BG_COLOR (widget));
++ gdk_gc_set_foreground (gc, SELECTED_BG_COLOR (widget));
+ if (priv->day_name_win)
+- cairo_rectangle (cr,
+- CALENDAR_MARGIN,
+- 0,
+- priv->week_width - CALENDAR_MARGIN,
+- priv->main_h - CALENDAR_MARGIN);
++ gdk_draw_rectangle (priv->week_win, gc, TRUE,
++ CALENDAR_MARGIN,
++ 0,
++ priv->week_width - CALENDAR_MARGIN,
++ priv->main_h - CALENDAR_MARGIN);
+ else
+- cairo_rectangle (cr,
+- CALENDAR_MARGIN,
+- CALENDAR_MARGIN,
+- priv->week_width - CALENDAR_MARGIN,
+- priv->main_h - 2 * CALENDAR_MARGIN);
+- cairo_fill (cr);
++ gdk_draw_rectangle (priv->week_win, gc, TRUE,
++ CALENDAR_MARGIN,
++ CALENDAR_MARGIN,
++ priv->week_width - CALENDAR_MARGIN,
++ priv->main_h - 2 * CALENDAR_MARGIN);
++
+
+ /*
+ * Write the labels
+@@ -2059,7 +2054,7 @@
+
+ layout = gtk_widget_create_pango_layout (widget, NULL);
+
+- gdk_cairo_set_source_color (cr, SELECTED_FG_COLOR (widget));
++ gdk_gc_set_foreground (gc, SELECTED_FG_COLOR (widget));
+ day_height = calendar_row_height (calendar);
+ for (row = 0; row < 6; row++)
+ {
+@@ -2095,12 +2090,10 @@
+ - logical_rect.width
+ - CALENDAR_XSEP - focus_padding - focus_width);
+
+- cairo_move_to (cr, x_loc, y_loc);
+- pango_cairo_show_layout (cr, layout);
++ gdk_draw_layout (priv->week_win, gc, x_loc, y_loc, layout);
+ }
+
+ g_object_unref (layout);
+- cairo_destroy (cr);
+ }
+
+ static void
+@@ -2149,7 +2142,7 @@
+ {
+ GtkWidget *widget = GTK_WIDGET (calendar);
+ GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
+- cairo_t *cr;
++ GdkGC *gc;
+ GdkColor *text_color;
+ gchar buffer[32];
+ gint day;
+@@ -2162,7 +2155,7 @@
+ g_return_if_fail (row < 6);
+ g_return_if_fail (col < 7);
+
+- cr = gdk_cairo_create (priv->main_win);
++ gc = calendar->gc;
+
+ day = calendar->day[row][col];
+
+@@ -2170,11 +2163,11 @@
+
+ if (calendar->day_month[row][col] == MONTH_PREV)
+ {
+- text_color = PREV_MONTH_COLOR (widget);
++ gdk_gc_set_foreground (gc, PREV_MONTH_COLOR (GTK_WIDGET (calendar)));
+ }
+ else if (calendar->day_month[row][col] == MONTH_NEXT)
+ {
+- text_color = NEXT_MONTH_COLOR (widget);
++ gdk_gc_set_foreground (gc, NEXT_MONTH_COLOR (GTK_WIDGET (calendar)));
+ }
+ else
+ {
+@@ -2188,16 +2181,16 @@
+ #endif
+ if (calendar->selected_day == day)
+ {
+- gdk_cairo_set_source_color (cr, SELECTED_BG_COLOR (widget));
+- gdk_cairo_rectangle (cr, &day_rect);
+- cairo_fill (cr);
++ gdk_gc_set_foreground (gc, SELECTED_BG_COLOR (GTK_WIDGET (calendar)));
++ gdk_draw_rectangle (priv->main_win, gc, TRUE, day_rect.x, day_rect.y,
++ day_rect.width, day_rect.height);
+ }
+ if (calendar->selected_day == day)
+- text_color = SELECTED_FG_COLOR (widget);
++ gdk_gc_set_foreground (gc, SELECTED_FG_COLOR (GTK_WIDGET (calendar)));
+ else if (calendar->marked_date[day-1])
+- text_color = MARKED_COLOR (widget);
++ gdk_gc_set_foreground (gc, MARKED_COLOR (GTK_WIDGET (calendar)));
+ else
+- text_color = NORMAL_DAY_COLOR (widget);
++ gdk_gc_set_foreground (gc, NORMAL_DAY_COLOR (GTK_WIDGET (calendar)));
+ }
+
+ /* Translators: this defines whether the day numbers should use
+@@ -2219,16 +2212,13 @@
+ x_loc -= logical_rect.width;
+ y_loc = day_rect.y + (day_rect.height - logical_rect.height) / 2;
+
+- gdk_cairo_set_source_color (cr, text_color);
+- cairo_move_to (cr, x_loc, y_loc);
+- pango_cairo_show_layout (cr, layout);
++ gdk_draw_layout (priv->main_win, gc,
++ x_loc, y_loc, layout);
+
+ if (calendar->marked_date[day-1]
+ && calendar->day_month[row][col] == MONTH_CURRENT)
+- {
+- cairo_move_to (cr, x_loc - 1, y_loc);
+- pango_cairo_show_layout (cr, layout);
+- }
++ gdk_draw_layout (priv->main_win, gc,
++ x_loc-1, y_loc, layout);
+
+ if (GTK_WIDGET_HAS_FOCUS (calendar)
+ && calendar->focus_row == row && calendar->focus_col == col)
+@@ -2253,7 +2243,6 @@
+ }
+
+ g_object_unref (layout);
+- cairo_destroy (cr);
+ }
+
+ static void
+Index: gtk+-2.10.6/gtk/gtkentry.c
+===================================================================
+--- gtk+-2.10.6.orig/gtk/gtkentry.c 2006-10-30 12:58:30.000000000 +0000
++++ gtk+-2.10.6/gtk/gtkentry.c 2006-10-30 12:59:30.000000000 +0000
+@@ -3333,7 +3333,6 @@
+ if (GTK_WIDGET_DRAWABLE (entry))
+ {
+ PangoLayout *layout = gtk_entry_ensure_layout (entry, TRUE);
+- cairo_t *cr;
+ gint x, y;
+ gint start_pos, end_pos;
+
+@@ -3341,56 +3340,60 @@
+
+ get_layout_position (entry, &x, &y);
+
+- 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);
+-
++ gdk_draw_layout (entry->text_area, widget->style->text_gc [widget->state],
++ x, y,
++ layout);
++
+ 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;
++ GdkGC *selection_gc, *text_gc;
+ GtkBorder inner_border;
+-
++ GdkRegion *clip_region;
++
+ pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
+ gtk_entry_get_pixel_ranges (entry, &ranges, &n_ranges);
+
+ if (GTK_WIDGET_HAS_FOCUS (entry))
+ {
+- selection_color = &widget->style->base [GTK_STATE_SELECTED];
+- text_color = &widget->style->text [GTK_STATE_SELECTED];
++ selection_gc = widget->style->base_gc [GTK_STATE_SELECTED];
++ text_gc = widget->style->text_gc [GTK_STATE_SELECTED];
+ }
+ else
+ {
+- selection_color = &widget->style->base [GTK_STATE_ACTIVE];
+- text_color = &widget->style->text [GTK_STATE_ACTIVE];
++ selection_gc = widget->style->base_gc [GTK_STATE_ACTIVE];
++ text_gc = widget->style->text_gc [GTK_STATE_ACTIVE];
+ }
+-
++
++ clip_region = gdk_region_new ();
+ _gtk_entry_effective_inner_border (entry, &inner_border);
+
+ for (i = 0; i < n_ranges; ++i)
+- cairo_rectangle (cr,
+- inner_border.left - entry->scroll_offset + ranges[2 * i],
+- y,
+- ranges[2 * i + 1],
+- logical_rect.height);
++ {
++ GdkRectangle rect;
+
+- cairo_clip (cr);
+-
+- gdk_cairo_set_source_color (cr, selection_color);
+- cairo_paint (cr);
++ 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);
+
+- cairo_move_to (cr, x, y);
+- gdk_cairo_set_source_color (cr, text_color);
+- pango_cairo_show_layout (cr, layout);
++ 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);
+ g_free (ranges);
+ }
+-
+- cairo_destroy (cr);
+ }
+ }
+
+Index: gtk+-2.10.6/gtk/gtkwidget.c
+===================================================================
+--- gtk+-2.10.6.orig/gtk/gtkwidget.c 2006-10-30 12:58:30.000000000 +0000
++++ gtk+-2.10.6/gtk/gtkwidget.c 2006-10-30 12:59:30.000000000 +0000
+@@ -5445,7 +5445,8 @@
+ GdkScreen *screen;
+
+ update_pango_context (widget, context);
+-
++/* TODO: Figure out the proper way to handle this in a pangoxft setting
++
+ screen = gtk_widget_get_screen_unchecked (widget);
+ if (screen)
+ {
+@@ -5453,7 +5454,7 @@
+ gdk_screen_get_resolution (screen));
+ pango_cairo_context_set_font_options (context,
+ gdk_screen_get_font_options (screen));
+- }
++ }*/
+ }
+ }
+
+Index: gtk+-2.10.6/gdk/x11/gdkpango-x11.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ gtk+-2.10.6/gdk/x11/gdkpango-x11.c 2006-10-30 12:59:30.000000000 +0000
+@@ -0,0 +1,174 @@
++/* GDK - The GIMP Drawing Kit
++ * Copyright (C) 2000 Red Hat, Inc.
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; if not, write to the
++ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++ * Boston, MA 02111-1307, USA.
++ */
++
++#include <config.h>
++#include <stdlib.h>
++
++#include "gdkx.h"
++#include "gdkdisplay-x11.h"
++#include "gdkpango.h"
++#include <pango/pangoxft.h>
++#include <pango/pangoxft-render.h>
++#include "gdkalias.h"
++
++#include <math.h>
++
++typedef struct _GdkX11Renderer GdkX11Renderer;
++typedef struct _GdkX11RendererClass GdkX11RendererClass;
++
++#define GDK_TYPE_X11_RENDERER (_gdk_x11_renderer_get_type())
++#define GDK_X11_RENDERER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_X11_RENDERER, GdkX11Renderer))
++#define GDK_IS_X11_RENDERER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_X11_RENDERER))
++#define GDK_X11_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_X11_RENDERER, GdkX11RendererClass))
++#define GDK_IS_X11_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_X11_RENDERER))
++#define GDK_X11_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_X11_RENDERER, GdkX11RendererClass))
++
++#define MAX_RENDER_PART PANGO_RENDER_PART_STRIKETHROUGH
++
++struct _GdkX11Renderer
++{
++ PangoXftRenderer parent_instance;
++
++ XRenderPictFormat *mask_format;
++
++ GdkDrawable *drawable;
++ GdkGC *gc;
++};
++
++struct _GdkX11RendererClass
++{
++ PangoXftRendererClass parent_class;
++};
++
++G_DEFINE_TYPE (GdkX11Renderer, _gdk_x11_renderer, PANGO_TYPE_XFT_RENDERER)
++
++static void
++gdk_x11_renderer_finalize (GObject *object)
++{
++ G_OBJECT_CLASS (_gdk_x11_renderer_parent_class)->finalize (object);
++}
++
++static void
++gdk_x11_renderer_composite_trapezoids (PangoXftRenderer *xftrenderer,
++ PangoRenderPart part,
++ XTrapezoid *trapezoids,
++ int n_trapezoids)
++{
++ /* Because we only use this renderer for "draw_glyphs()" calls, we
++ * won't hit this code path much. However, it is hit for drawing
++ * the "unknown glyph" hex squares. We can safely ignore the part,
++ */
++ GdkX11Renderer *x11_renderer = GDK_X11_RENDERER (xftrenderer);
++
++ _gdk_x11_drawable_draw_xtrapezoids (x11_renderer->drawable,
++ x11_renderer->gc,
++ trapezoids, n_trapezoids);
++
++}
++
++static void
++gdk_x11_renderer_composite_glyphs (PangoXftRenderer *xftrenderer,
++ XftFont *xft_font,
++ XftGlyphSpec *glyphs,
++ gint n_glyphs)
++{
++ GdkX11Renderer *x11_renderer = GDK_X11_RENDERER (xftrenderer);
++
++ _gdk_x11_drawable_draw_xft_glyphs (x11_renderer->drawable,
++ x11_renderer->gc,
++ xft_font, glyphs, n_glyphs);
++}
++
++static void
++_gdk_x11_renderer_init (GdkX11Renderer *renderer)
++{
++}
++
++static void
++_gdk_x11_renderer_class_init (GdkX11RendererClass *klass)
++{
++ PangoXftRendererClass *xftrenderer_class = PANGO_XFT_RENDERER_CLASS (klass);
++ GObjectClass *object_class = G_OBJECT_CLASS (klass);
++
++ xftrenderer_class->composite_glyphs = gdk_x11_renderer_composite_glyphs;
++ xftrenderer_class->composite_trapezoids = gdk_x11_renderer_composite_trapezoids;
++
++ object_class->finalize = gdk_x11_renderer_finalize;
++}
++
++PangoRenderer *
++_gdk_x11_renderer_get (GdkDrawable *drawable,
++ GdkGC *gc)
++{
++ GdkScreen *screen = GDK_DRAWABLE_IMPL_X11 (drawable)->screen;
++ GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (screen);
++ GdkX11Renderer *x11_renderer;
++
++ if (!screen_x11->renderer)
++ {
++ screen_x11->renderer = g_object_new (GDK_TYPE_X11_RENDERER,
++ "display", GDK_SCREEN_XDISPLAY (screen),
++ "screen", GDK_SCREEN_XNUMBER (screen),
++ NULL);
++ }
++
++ x11_renderer = GDK_X11_RENDERER (screen_x11->renderer);
++
++ x11_renderer->drawable = drawable;
++ x11_renderer->gc = gc;
++
++ return screen_x11->renderer;
++}
++
++/**
++ * 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.
++ *
++ * Return value: a new #PangoContext for @screen
++ *
++ * Since: 2.2
++ **/
++PangoContext *
++gdk_pango_context_get_for_screen (GdkScreen *screen)
++{
++ PangoContext *context;
++
++ g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
++
++ if (screen->closed)
++ return NULL;
++
++ context = pango_xft_get_context (GDK_SCREEN_XDISPLAY (screen),
++ GDK_SCREEN_X11 (screen)->screen_num);
++
++ g_object_set_data (G_OBJECT (context), "gdk-pango-screen", screen);
++
++ return context;
++}
++
++#define __GDK_PANGO_X11_C__
++#include "gdkaliasdef.c"
+Index: gtk+-2.10.6/gdk/x11/gdkpixmap-x11.c
+===================================================================
+--- gtk+-2.10.6.orig/gdk/x11/gdkpixmap-x11.c 2006-10-30 12:58:30.000000000 +0000
++++ gtk+-2.10.6/gdk/x11/gdkpixmap-x11.c 2006-10-30 12:59:30.000000000 +0000
+@@ -119,6 +119,9 @@
+ {
+ GdkDrawableImplX11 *draw_impl = GDK_DRAWABLE_IMPL_X11 (impl);
+
++ if (draw_impl->xft_draw)
++ XftDrawDestroy (draw_impl->xft_draw);
++
+ _gdk_x11_drawable_finish (GDK_DRAWABLE (draw_impl));
+ }
+
+--- gtk+-2.10.6.orig/gtk/gtkcalendar.c.orig 2006-11-14 14:39:34.000000000 -0800
++++ gtk+-2.10.6/gtk/gtkcalendar.c 2006-11-14 14:37:34.000000000 -0800
+@@ -1495,6 +1495,10 @@ gtk_calendar_realize (GtkWidget *widget)
+ BACKGROUND_COLOR ( GTK_WIDGET ( calendar)));
+ gdk_window_show (priv->main_win);
+ gdk_window_set_user_data (priv->main_win, widget);
++
++ /* Set widgets gc */
++ calendar->gc = gdk_gc_new (widget->window);
++
+ gdk_window_set_background (widget->window, BACKGROUND_COLOR (widget));
+ gdk_window_show (widget->window);
+ gdk_window_set_user_data (widget->window, widget);
diff --git a/recipes/gtk+/gtk+-2.12.11/range-no-redraw.patch b/recipes/gtk+/gtk+-2.12.11/range-no-redraw.patch
new file mode 100644
index 0000000000..14387b8a2e
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.11/range-no-redraw.patch
@@ -0,0 +1,127 @@
+5f084ea0849d5967a3c22821542ecaaa8accb398
+diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
+index bd95351..64e0e59 100644
+--- gtk/gtkrange.c
++++ gtk/gtkrange.c
+@@ -109,6 +109,8 @@ struct _GtkRangeLayout
+ GtkSensitivityType upper_sensitivity;
+
+ gdouble fill_level;
++
++ guint motion_idle_id;
+ };
+
+
+@@ -205,6 +207,8 @@ static gboolean gtk_range_real_change_value (GtkRange *range,
+ static void gtk_range_update_value (GtkRange *range);
+ static gboolean gtk_range_key_press (GtkWidget *range,
+ GdkEventKey *event);
++static void gtk_range_add_motion_idle (GtkRange *range);
++static void gtk_range_remove_motion_idle (GtkRange *range);
+
+
+ static guint signals[LAST_SIGNAL];
+@@ -1167,6 +1171,7 @@ gtk_range_destroy (GtkObject *object)
+
+ gtk_range_remove_step_timer (range);
+ gtk_range_remove_update_timer (range);
++ gtk_range_remove_motion_idle (range);
+
+ if (range->adjustment)
+ {
+@@ -1276,6 +1281,7 @@ gtk_range_unrealize (GtkWidget *widget)
+
+ gtk_range_remove_step_timer (range);
+ gtk_range_remove_update_timer (range);
++ gtk_range_remove_motion_idle (range);
+
+ gdk_window_set_user_data (range->event_window, NULL);
+ gdk_window_destroy (range->event_window);
+@@ -2165,7 +2171,7 @@ gtk_range_motion_notify (GtkWidget *widget,
+ gtk_widget_queue_draw (widget);
+
+ if (range->layout->grab_location == MOUSE_SLIDER)
+- update_slider_position (range, x, y);
++ gtk_range_add_motion_idle (range);
+
+ /* We handled the event if the mouse was in the range_rect */
+ return range->layout->mouse_location != MOUSE_OUTSIDE;
+@@ -3335,9 +3341,10 @@ initial_timeout (gpointer data)
+ g_object_get (settings, "gtk-timeout-repeat", &timeout, NULL);
+
+ range = GTK_RANGE (data);
+- range->timer->timeout_id = gdk_threads_add_timeout (timeout * SCROLL_DELAY_FACTOR,
+- second_timeout,
+- range);
++ range->timer->timeout_id =
++ gdk_threads_add_timeout (timeout * SCROLL_DELAY_FACTOR,
++ second_timeout,
++ range);
+ /* remove self */
+ return FALSE;
+ }
+@@ -3357,9 +3364,8 @@ gtk_range_add_step_timer (GtkRange *range,
+
+ range->timer = g_new (GtkRangeStepTimer, 1);
+
+- range->timer->timeout_id = gdk_threads_add_timeout (timeout,
+- initial_timeout,
+- range);
++ range->timer->timeout_id =
++ gdk_threads_add_timeout (timeout, initial_timeout, range);
+ range->timer->step = step;
+
+ gtk_range_scroll (range, range->timer->step);
+@@ -3397,9 +3403,8 @@ gtk_range_reset_update_timer (GtkRange *range)
+ {
+ gtk_range_remove_update_timer (range);
+
+- range->update_timeout_id = gdk_threads_add_timeout (UPDATE_DELAY,
+- update_timeout,
+- range);
++ range->update_timeout_id =
++ gdk_threads_add_timeout (UPDATE_DELAY, update_timeout, range);
+ }
+
+ static void
+@@ -3412,5 +3417,40 @@ gtk_range_remove_update_timer (GtkRange *range)
+ }
+ }
+
++static gboolean
++motion_idle (gpointer data)
++{
++ GtkRange *range = data;
++ GtkRangeLayout *layout = range->layout;
++
++ update_slider_position (range, layout->mouse_x, layout->mouse_y);
++
++ layout->motion_idle_id = 0;
++
++ return FALSE;
++}
++
++static void
++gtk_range_add_motion_idle (GtkRange *range)
++{
++ if (!range->layout->motion_idle_id)
++ {
++ range->layout->motion_idle_id =
++ gdk_threads_add_idle_full (GDK_PRIORITY_REDRAW,
++ motion_idle, range,
++ NULL);
++ }
++}
++
++static void
++gtk_range_remove_motion_idle (GtkRange *range)
++{
++ if (range->layout->motion_idle_id != 0)
++ {
++ g_source_remove (range->layout->motion_idle_id);
++ range->layout->motion_idle_id = 0;
++ }
++}
++
+ #define __GTK_RANGE_C__
+ #include "gtkaliasdef.c"
diff --git a/recipes/gtk+/gtk+-2.12.11/run-iconcache.patch b/recipes/gtk+/gtk+-2.12.11/run-iconcache.patch
new file mode 100644
index 0000000000..ac15e9ab24
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.11/run-iconcache.patch
@@ -0,0 +1,19 @@
+--- /tmp/Makefile.am 2007-01-08 17:44:47.000000000 +0100
++++ gtk+-2.10.7/gtk/Makefile.am 2007-01-08 17:45:17.025251000 +0100
+@@ -1128,11 +1128,11 @@
+ ./gtk-update-icon-cache
+ endif
+
+-gtkbuiltincache.h: @REBUILD@ stamp-icons
+- $(MAKE) $(AM_MAKEFLAGS) gtk-update-icon-cache$(EXEEXT)
+- $(gtk_update_icon_cache_program) --force --ignore-theme-index \
+- --source builtin_icons stock-icons > gtkbuiltincache.h.tmp && \
+- mv gtkbuiltincache.h.tmp gtkbuiltincache.h
++#gtkbuiltincache.h: @REBUILD@ stamp-icons
++# $(MAKE) $(AM_MAKEFLAGS) gtk-update-icon-cache$(EXEEXT)
++# $(gtk_update_icon_cache_program) --force --ignore-theme-index \
++# --source builtin_icons stock-icons > gtkbuiltincache.h.tmp && \
++# mv gtkbuiltincache.h.tmp gtkbuiltincache.h
+
+ EXTRA_DIST += \
+ $(STOCK_ICONS) \
diff --git a/recipes/gtk+/gtk+-2.12.11/scrolled-placement.patch b/recipes/gtk+/gtk+-2.12.11/scrolled-placement.patch
new file mode 100644
index 0000000000..a0b50c8cac
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.11/scrolled-placement.patch
@@ -0,0 +1,22 @@
+Index: gdk/x11/gdksettings.c
+===================================================================
+--- gdk/x11/gdksettings.c (revision 18493)
++++ gdk/x11/gdksettings.c (working copy)
+@@ -65,7 +65,8 @@
+ "Xft/RGBA\0" "gtk-xft-rgba\0"
+ "Xft/DPI\0" "gtk-xft-dpi\0"
+ "Net/FallbackIconTheme\0" "gtk-fallback-icon-theme\0"
+- "Gtk/TouchscreenMode\0" "gtk-touchscreen-mode\0";
++ "Gtk/TouchscreenMode\0" "gtk-touchscreen-mode\0"
++ "Gtk/ScrolledWindowPlacement\0" "gtk-scrolled-window-placement\0";
+
+ static const struct
+ {
+@@ -107,5 +108,6 @@
+ { 1197, 1206 },
+ { 1219, 1227 },
+ { 1239, 1261 },
+- { 1285, 1305 }
++ { 1285, 1305 },
++ { 1326, 1354 }
+ };
diff --git a/recipes/gtk+/gtk+-2.12.11/toggle-font.diff b/recipes/gtk+/gtk+-2.12.11/toggle-font.diff
new file mode 100644
index 0000000000..59ad150b2f
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.11/toggle-font.diff
@@ -0,0 +1,100 @@
+Index: gtk/gtkcellrenderertoggle.c
+===================================================================
+--- gtk/gtkcellrenderertoggle.c (revision 18523)
++++ gtk/gtkcellrenderertoggle.c (working copy)
+@@ -71,6 +71,8 @@
+ PROP_INDICATOR_SIZE
+ };
+
++/* This is a hard-coded default which promptly gets overridden by a size
++ calculated from the font size. */
+ #define TOGGLE_WIDTH 13
+
+ static guint toggle_cell_signals[LAST_SIGNAL] = { 0 };
+@@ -80,8 +82,9 @@
+ typedef struct _GtkCellRendererTogglePrivate GtkCellRendererTogglePrivate;
+ struct _GtkCellRendererTogglePrivate
+ {
+- gint indicator_size;
+-
++ gint indicator_size; /* This is the real size */
++ gint override_size; /* This is the size set from the indicator-size property */
++ GtkWidget *cached_widget;
+ guint inconsistent : 1;
+ };
+
+@@ -104,6 +107,7 @@
+ GTK_CELL_RENDERER (celltoggle)->ypad = 2;
+
+ priv->indicator_size = TOGGLE_WIDTH;
++ priv->override_size = 0;
+ priv->inconsistent = FALSE;
+ }
+
+@@ -210,7 +214,7 @@
+ g_value_set_boolean (value, celltoggle->radio);
+ break;
+ case PROP_INDICATOR_SIZE:
+- g_value_set_int (value, priv->indicator_size);
++ g_value_set_int (value, priv->override_size ? priv->override_size : priv->indicator_size);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+@@ -245,7 +249,7 @@
+ celltoggle->radio = g_value_get_boolean (value);
+ break;
+ case PROP_INDICATOR_SIZE:
+- priv->indicator_size = g_value_get_int (value);
++ priv->override_size = g_value_get_int (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+@@ -273,6 +277,27 @@
+ }
+
+ static void
++on_widget_style_set (GtkWidget *widget, GtkStyle *previous, gpointer user_data)
++{
++ GtkCellRendererTogglePrivate *priv = user_data;
++ PangoContext *context;
++ PangoFontMetrics *metrics;
++ int height;
++
++ context = gtk_widget_get_pango_context (widget);
++ metrics = pango_context_get_metrics (context,
++ widget->style->font_desc,
++ pango_context_get_language (context));
++
++ height = pango_font_metrics_get_ascent (metrics) +
++ pango_font_metrics_get_descent (metrics);
++
++ pango_font_metrics_unref (metrics);
++
++ priv->indicator_size = PANGO_PIXELS (height * 0.85);
++}
++
++static void
+ gtk_cell_renderer_toggle_get_size (GtkCellRenderer *cell,
+ GtkWidget *widget,
+ GdkRectangle *cell_area,
+@@ -287,6 +312,20 @@
+
+ priv = GTK_CELL_RENDERER_TOGGLE_GET_PRIVATE (cell);
+
++ if (priv->override_size) {
++ priv->indicator_size = priv->override_size;
++ } else if (priv->cached_widget != widget) {
++ if (priv->cached_widget) {
++ g_object_remove_weak_pointer (widget, &priv->cached_widget);
++ g_signal_handlers_disconnect_by_func (priv->cached_widget, on_widget_style_set, priv);
++ }
++ priv->cached_widget = widget;
++ g_object_add_weak_pointer (widget, &priv->cached_widget);
++ g_signal_connect (widget, "style-set", on_widget_style_set, priv);
++
++ on_widget_style_set (widget, NULL, priv);
++ }
++
+ calc_width = (gint) cell->xpad * 2 + priv->indicator_size;
+ calc_height = (gint) cell->ypad * 2 + priv->indicator_size;
+
diff --git a/recipes/gtk+/gtk+-2.12.3/cellrenderer-cairo.patch b/recipes/gtk+/gtk+-2.12.3/cellrenderer-cairo.patch
new file mode 100644
index 0000000000..4439e69fb6
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.3/cellrenderer-cairo.patch
@@ -0,0 +1,32 @@
+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/recipes/gtk+/gtk+-2.12.3/combo-arrow-size.patch b/recipes/gtk+/gtk+-2.12.3/combo-arrow-size.patch
new file mode 100644
index 0000000000..d44c454ce3
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.3/combo-arrow-size.patch
@@ -0,0 +1,67 @@
+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/recipes/gtk+/gtk+-2.12.3/disable-print.patch b/recipes/gtk+/gtk+-2.12.3/disable-print.patch
new file mode 100644
index 0000000000..21a4be4da8
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.3/disable-print.patch
@@ -0,0 +1,26 @@
+--- 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 -n $CUPS_API_VERSION | awk -F. '{print $1}'`
+- CUPS_API_MINOR=`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/recipes/gtk+/gtk+-2.12.3/entry-cairo.patch b/recipes/gtk+/gtk+-2.12.3/entry-cairo.patch
new file mode 100644
index 0000000000..3313e7f132
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.3/entry-cairo.patch
@@ -0,0 +1,103 @@
+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/recipes/gtk+/gtk+-2.12.3/hardcoded_libtool.patch b/recipes/gtk+/gtk+-2.12.3/hardcoded_libtool.patch
new file mode 100644
index 0000000000..1c2cd0576d
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.3/hardcoded_libtool.patch
@@ -0,0 +1,29 @@
+--- /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/recipes/gtk+/gtk+-2.12.3/menu-deactivate.patch b/recipes/gtk+/gtk+-2.12.3/menu-deactivate.patch
new file mode 100644
index 0000000000..cfb8849e9f
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.3/menu-deactivate.patch
@@ -0,0 +1,51 @@
+--- 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/recipes/gtk+/gtk+-2.12.3/no-demos.patch b/recipes/gtk+/gtk+-2.12.3/no-demos.patch
new file mode 100644
index 0000000000..0fc4c48d1a
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.3/no-demos.patch
@@ -0,0 +1,10 @@
+--- 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/recipes/gtk+/gtk+-2.12.3/pangoxft2.10.6.diff b/recipes/gtk+/gtk+-2.12.3/pangoxft2.10.6.diff
new file mode 100644
index 0000000000..63828cec63
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.3/pangoxft2.10.6.diff
@@ -0,0 +1,2456 @@
+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 <config.h>
+
++#include <pango/pangoxft.h>
++
+ #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 <X11/Xlib.h>
+ #include <X11/extensions/Xrender.h>
++#include <X11/Xft/Xft.h>
+
+ 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;
++
++ return XRenderCreatePicture (GDK_GC_XDISPLAY (gc),
++ GDK_PIXMAP_XID (_gdk_gc_get_tile (gc)),
++ format,
++ CPRepeat, &pa);
++ }
++
++ return None;
++}
++
++static Picture
++make_stipple_picture (GdkGC *gc)
++{
++ XRenderPictFormat *format = NULL;
++ XRenderPictureAttributes pa;
++
++ format = XRenderFindStandardFormat (GDK_GC_XDISPLAY (gc),
++ PictStandardA1);
++
++ pa.repeat = True;
++ return XRenderCreatePicture (GDK_GC_XDISPLAY (gc),
++ GDK_PIXMAP_XID (_gdk_gc_get_stipple (gc)),
++ format,
++ CPRepeat, &pa);
++}
++
++static Picture
++make_color_picture (GdkGC *gc,
++ XRenderColor *color)
++{
++ GdkGCX11 *x11_gc = GDK_GC_X11 (gc);
++ XRenderPictureAttributes pa;
++ XRenderPictFormat *pix_format = foreground_format (gc);
++ Pixmap pix;
++ Picture picture;
++
++ if (!pix_format)
++ return None;
++
++ pix = XCreatePixmap (GDK_GC_XDISPLAY (gc),
++ GDK_SCREEN_XROOTWIN (x11_gc->screen),
++ 1, 1, pix_format->depth);
++ pa.repeat = True;
++ picture = XRenderCreatePicture (GDK_GC_XDISPLAY (gc),
++ pix,
++ pix_format,
++ CPRepeat, &pa);
++ XFreePixmap (GDK_GC_XDISPLAY (gc), pix);
++
++ XRenderFillRectangle (GDK_GC_XDISPLAY (gc), PictOpSrc,
++ picture, color,
++ 0, 0, 1, 1);
++
++ return picture;
++}
++
++static void
++get_bg_color (GdkGC *gc,
++ XRenderColor *render_color)
++{
++ GdkColormap *cmap;
++
++ cmap = gdk_gc_get_colormap (gc);
++
++ if (cmap)
++ {
++ GdkColor color;
++
++ gdk_colormap_query_color (cmap, _gdk_gc_get_bg_pixel (gc), &color);
++
++ render_color->alpha = 0xffff;
++ render_color->red = color.red;
++ render_color->green = color.green;
++ render_color->blue = color.blue;
++ }
++ else /* Not worth warning, just use black */
++ {
++ render_color->alpha = 0xffff;
++ render_color->red = 0;
++ render_color->green = 0;
++ render_color->blue = 0;
++ }
++}
++
++/**
++ * _gdk_x11_gc_get_fg_picture:
++ * @gc: a #GdkGC
++ *
++ * Gets a Xrender Picture object suitable for being the source
++ * drawable for drawing with the foreground the graphics context.
++ *
++ * Return value: a Picture, owned by the GC; this cannot be
++ * used over subsequent modification of the GC.
++ **/
++Picture
++_gdk_x11_gc_get_fg_picture (GdkGC *gc)
++{
++ GdkGCX11 *x11_gc;
++ gboolean new = FALSE;
++ XftColor xftcolor;
++ GdkFill fill;
++ int width, height;
++
++ g_return_val_if_fail (GDK_IS_GC_X11 (gc), None);
++
++ if (!_gdk_x11_have_render (GDK_GC_DISPLAY (gc)))
++ return None;
++
++ x11_gc = GDK_GC_X11 (gc);
++
++ fill = GDK_SOLID;
++ width = 1;
++ height = 1;
++
++ switch (_gdk_gc_get_fill (gc))
++ {
++ case GDK_SOLID:
++ break;
++ case GDK_TILED:
++ if (_gdk_gc_get_tile (gc))
++ {
++ if (!x11_gc->fg_picture)
++ x11_gc->fg_picture = make_fg_tile_picture (gc);
++
++ if (x11_gc->fg_picture != None)
++ return x11_gc->fg_picture;
++ }
++ break;
++ case GDK_STIPPLED:
++ case GDK_OPAQUE_STIPPLED:
++ if (_gdk_gc_get_stipple (gc))
++ {
++ gdk_drawable_get_size (_gdk_gc_get_stipple (gc), &width, &height);
++ fill = _gdk_gc_get_fill (gc);
++ }
++ break;
++ }
++
++ if (x11_gc->fg_picture == None)
++ {
++ XRenderPictureAttributes pa;
++ XRenderPictFormat *pix_format = foreground_format (gc);
++ Pixmap pix;
++
++ if (!pix_format)
++ return None;
++
++ pix = XCreatePixmap (GDK_GC_XDISPLAY (gc),
++ GDK_SCREEN_XROOTWIN (x11_gc->screen),
++ width, height, pix_format->depth);
++ pa.repeat = True;
++ x11_gc->fg_picture = XRenderCreatePicture (GDK_GC_XDISPLAY (gc),
++ pix,
++ pix_format,
++ CPRepeat, &pa);
++ XFreePixmap (GDK_GC_XDISPLAY (gc), pix);
++
++ new = TRUE;
++ }
++
++ _gdk_gc_x11_get_fg_xft_color (gc, &xftcolor);
++
++ if (x11_gc->fg_picture_color.alpha != 0xffff ||
++ x11_gc->fg_picture_color.red != xftcolor.color.red ||
++ x11_gc->fg_picture_color.green != xftcolor.color.green ||
++ x11_gc->fg_picture_color.blue != xftcolor.color.blue)
++ {
++ x11_gc->fg_picture_color.alpha = 0xffff;
++ x11_gc->fg_picture_color.red = xftcolor.color.red;
++ x11_gc->fg_picture_color.green = xftcolor.color.green;
++ x11_gc->fg_picture_color.blue = xftcolor.color.blue;
++
++ new = TRUE;
++ }
++
++ switch (fill)
++ {
++ case GDK_SOLID:
++ XRenderFillRectangle (GDK_GC_XDISPLAY (gc), PictOpSrc,
++ x11_gc->fg_picture, &x11_gc->fg_picture_color,
++ 0, 0, width, height);
++ break;
++ case GDK_STIPPLED:
++ {
++ Picture stipple_picture = make_stipple_picture (gc);
++
++ XRenderFillRectangle (GDK_GC_XDISPLAY (gc), PictOpSrc,
++ x11_gc->fg_picture, &x11_gc->fg_picture_color,
++ 0, 0, width, height);
++ XRenderComposite (GDK_GC_XDISPLAY (gc),
++ PictOpInReverse,
++ stipple_picture, None, x11_gc->fg_picture,
++ 0, 0, 0, 0, 0, 0, width, height);
++
++ XRenderFreePicture (GDK_GC_XDISPLAY (x11_gc), stipple_picture);
++ }
++ break;
++ case GDK_OPAQUE_STIPPLED:
++ {
++ XRenderColor bg_color;
++
++ Picture stipple_picture = make_stipple_picture (gc);
++ Picture fg_picture = make_color_picture (gc, &x11_gc->fg_picture_color);
++
++ get_bg_color (gc, &bg_color);
++
++ XRenderFillRectangle (GDK_GC_XDISPLAY (gc), PictOpSrc,
++ x11_gc->fg_picture, &bg_color,
++ 0, 0, width, height);
++ XRenderComposite (GDK_GC_XDISPLAY (gc),
++ PictOpOver,
++ fg_picture, stipple_picture, x11_gc->fg_picture,
++ 0, 0, 0, 0, 0, 0, width, height);
++
++ XRenderFreePicture (GDK_GC_XDISPLAY (x11_gc), stipple_picture);
++ XRenderFreePicture (GDK_GC_XDISPLAY (x11_gc), fg_picture);
++ }
++ break;
++ case GDK_TILED:
++ g_assert_not_reached (); /* handled above */
++ break;
++ }
++
++ return x11_gc->fg_picture;
++}
++
++/**
++ * _gdk_gc_x11_get_fg_xft_color:
++ * @gc: a #GdkGC
++ * @xftcolor: location to store the color
++ *
++ * Gets the foreground color of the GC as a XftColor.
++ **/
++void
++_gdk_gc_x11_get_fg_xft_color (GdkGC *gc,
++ XftColor *xftcolor)
++{
++ GdkGCX11 *x11_gc;
++ GdkColormap *cmap;
++ GdkColor color;
++
++ g_return_if_fail (GDK_IS_GC_X11 (gc));
++
++ x11_gc = GDK_GC_X11 (gc);
++
++ cmap = gdk_gc_get_colormap (gc);
++
++ xftcolor->pixel = _gdk_gc_get_fg_pixel (gc);
++
++ if (cmap)
++ {
++ gdk_colormap_query_color (cmap, xftcolor->pixel, &color);
++ xftcolor->color.alpha = 0xffff;
++ xftcolor->color.red = color.red;
++ xftcolor->color.green = color.green;
++ xftcolor->color.blue = color.blue;
++ }
++ else if (x11_gc->depth == 1)
++ {
++ /* Drawing with Xft on a bitmap is a bit bizzare; it
++ * takes alpha >= 0x8000 to mean 'set to 1' and
++ * alpha < 0x8000 to mean 'set to 0'.
++ */
++ if (xftcolor->pixel)
++ {
++ xftcolor->color.red = 0xffff;
++ xftcolor->color.green = 0xffff;
++ xftcolor->color.blue = 0xffff;
++ xftcolor->color.alpha = 0xffff;
++ }
++ else
++ {
++ xftcolor->color.red = 0;
++ xftcolor->color.green = 0;
++ xftcolor->color.blue = 0;
++ xftcolor->color.alpha = 0;
++ }
++ }
++ else
++ {
++ g_warning ("Using Xft rendering requires the GC argument to have a\n"
++ "specified colormap. If the GC was created for a drawable\n"
++ "with a colormap, the colormap will be set on the GC\n"
++ "automatically. Otherwise, a colormap must be set on it with"
++ "gdk_gc_set_colormap");
++ }
++}
++
++void
++_gdk_windowing_gc_get_foreground (GdkGC *gc,
++ GdkColor *color)
++{
++ GdkColormap *cmap;
++
++ g_return_if_fail (GDK_IS_GC_X11 (gc));
++
++ color->pixel = _gdk_gc_get_fg_pixel (gc);
++
++ cmap = gdk_gc_get_colormap (gc);
++
++ if (cmap)
++ gdk_colormap_query_color (cmap, _gdk_gc_get_fg_pixel (gc), color);
++ else
++ g_warning ("No colormap in _gdk_windowing_gc_get_foreground");
++}
+ #define __GDK_GC_X11_C__
+ #include "gdkaliasdef.c"
+Index: gtk+-2.10.6/gdk/x11/gdkprivate-x11.h
+===================================================================
+--- gtk+-2.10.6.orig/gdk/x11/gdkprivate-x11.h 2006-10-30 12:58:30.000000000 +0000
++++ gtk+-2.10.6/gdk/x11/gdkprivate-x11.h 2006-10-30 12:59:30.000000000 +0000
+@@ -63,6 +63,9 @@
+ guint have_clip_region : 1;
+ guint have_clip_mask : 1;
+ guint depth : 8;
++
++ Picture fg_picture;
++ XRenderColor fg_picture_color;
+ };
+
+ struct _GdkGCX11Class
+@@ -102,6 +105,11 @@
+ GType _gdk_gc_x11_get_type (void);
+
+ gboolean _gdk_x11_have_render (GdkDisplay *display);
++gboolean _gdk_x11_have_render_with_trapezoids (GdkDisplay *display);
++
++Picture _gdk_x11_gc_get_fg_picture (GdkGC *gc);
++void _gdk_gc_x11_get_fg_xft_color (GdkGC *gc,
++ XftColor *xftcolor);
+
+ GdkGC *_gdk_x11_gc_new (GdkDrawable *drawable,
+ GdkGCValues *values,
+Index: gtk+-2.10.6/gdk/x11/gdkwindow-x11.c
+===================================================================
+--- gtk+-2.10.6.orig/gdk/x11/gdkwindow-x11.c 2006-10-30 12:58:30.000000000 +0000
++++ gtk+-2.10.6/gdk/x11/gdkwindow-x11.c 2006-10-30 12:59:30.000000000 +0000
+@@ -1114,7 +1114,8 @@
+ {
+ GdkWindowObject *private = (GdkWindowObject *)window;
+ GdkToplevelX11 *toplevel;
+-
++ GdkDrawableImplX11 *draw_impl;
++
+ g_return_if_fail (GDK_IS_WINDOW (window));
+
+ _gdk_selection_window_destroyed (window);
+@@ -1126,6 +1127,11 @@
+ if (toplevel)
+ gdk_toplevel_x11_free_contents (GDK_WINDOW_DISPLAY (window), toplevel);
+
++ draw_impl = GDK_DRAWABLE_IMPL_X11 (private->impl);
++
++ if (draw_impl->xft_draw)
++ XftDrawDestroy (draw_impl->xft_draw);
++
+ _gdk_x11_drawable_finish (private->impl);
+
+ if (!recursing && !foreign_destroy)
+Index: gtk+-2.10.6/gdk/x11/Makefile.am
+===================================================================
+--- gtk+-2.10.6.orig/gdk/x11/Makefile.am 2006-10-30 12:58:30.000000000 +0000
++++ gtk+-2.10.6/gdk/x11/Makefile.am 2006-10-30 12:59:30.000000000 +0000
+@@ -37,6 +37,7 @@
+ gdkinput.c \
+ gdkkeys-x11.c \
+ gdkmain-x11.c \
++ gdkpango-x11.c \
+ gdkpixmap-x11.c \
+ gdkpixmap-x11.h \
+ gdkproperty-x11.c \
+Index: gtk+-2.10.6/gtk/gtkcalendar.c
+===================================================================
+--- gtk+-2.10.6.orig/gtk/gtkcalendar.c 2006-10-30 12:58:30.000000000 +0000
++++ gtk+-2.10.6/gtk/gtkcalendar.c 2006-10-30 12:59:30.000000000 +0000
+@@ -1821,7 +1821,7 @@
+ }
+ }
+
+-
++
+ /****************************************
+ * Repainting *
+ ****************************************/
+@@ -1831,7 +1831,7 @@
+ {
+ GtkWidget *widget = GTK_WIDGET (calendar);
+ GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
+- cairo_t *cr;
++ GdkGC *gc;
+ char buffer[255];
+ int x, y;
+ gint header_width;
+@@ -1849,7 +1849,7 @@
+ else
+ year_left = !priv->year_before;
+
+- cr = gdk_cairo_create (priv->header_win);
++ gc = calendar->gc;
+
+ header_width = widget->allocation.width - 2 * widget->style->xthickness;
+
+@@ -1902,9 +1902,9 @@
+ - (max_year_width - logical_rect.width)/2);
+
+
+- gdk_cairo_set_source_color (cr, HEADER_FG_COLOR (GTK_WIDGET (calendar)));
+- cairo_move_to (cr, x, y);
+- pango_cairo_show_layout (cr, layout);
++ gdk_gc_set_foreground (gc, HEADER_FG_COLOR (GTK_WIDGET (calendar)));
++ gdk_draw_layout (priv->header_win, gc, x, y, layout);
++
+
+ /* Draw month */
+ g_snprintf (buffer, sizeof (buffer), "%s", default_monthname[calendar->month]);
+@@ -1924,19 +1924,19 @@
+ else
+ x = 3 + priv->arrow_width + (max_month_width - logical_rect.width)/2;
+
+- cairo_move_to (cr, x, y);
+- pango_cairo_show_layout (cr, layout);
+-
++ gdk_draw_layout (priv->header_win, gc, x, y, layout);
++
++ gdk_gc_set_foreground (gc, BACKGROUND_COLOR (GTK_WIDGET (calendar)));
++
+ g_object_unref (layout);
+- cairo_destroy (cr);
+ }
+
+ static void
+ calendar_paint_day_names (GtkCalendar *calendar)
+ {
+ GtkWidget *widget = GTK_WIDGET (calendar);
++ GdkGC *gc;
+ GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
+- cairo_t *cr;
+ char buffer[255];
+ int day,i;
+ int day_width, cal_width;
+@@ -1946,8 +1946,7 @@
+ gint focus_padding;
+ gint focus_width;
+
+- cr = gdk_cairo_create (priv->day_name_win);
+-
++ gc = calendar->gc;
+ gtk_widget_style_get (GTK_WIDGET (widget),
+ "focus-line-width", &focus_width,
+ "focus-padding", &focus_padding,
+@@ -1961,22 +1960,19 @@
+ * Draw rectangles as inverted background for the labels.
+ */
+
+- gdk_cairo_set_source_color (cr, SELECTED_BG_COLOR (widget));
+- cairo_rectangle (cr,
+- CALENDAR_MARGIN, CALENDAR_MARGIN,
+- cal_width-CALENDAR_MARGIN * 2,
+- priv->day_name_h - CALENDAR_MARGIN);
+- cairo_fill (cr);
+-
++ gdk_gc_set_foreground (gc, SELECTED_BG_COLOR (widget));
++ gdk_draw_rectangle (priv->day_name_win, gc, TRUE,
++ CALENDAR_MARGIN, CALENDAR_MARGIN,
++ cal_width-CALENDAR_MARGIN * 2,
++ priv->day_name_h - CALENDAR_MARGIN);
++
+ if (calendar->display_flags & GTK_CALENDAR_SHOW_WEEK_NUMBERS)
+- {
+- cairo_rectangle (cr,
+- CALENDAR_MARGIN,
+- priv->day_name_h - CALENDAR_YSEP,
+- priv->week_width - CALENDAR_YSEP - CALENDAR_MARGIN,
+- CALENDAR_YSEP);
+- cairo_fill (cr);
+- }
++ gdk_draw_rectangle (priv->day_name_win, gc, TRUE,
++ CALENDAR_MARGIN,
++ priv->day_name_h - CALENDAR_YSEP,
++ priv->week_width - CALENDAR_YSEP - CALENDAR_MARGIN,
++ CALENDAR_YSEP);
++
+
+ /*
+ * Write the labels
+@@ -1984,7 +1980,7 @@
+
+ layout = gtk_widget_create_pango_layout (widget, NULL);
+
+- gdk_cairo_set_source_color (cr, SELECTED_FG_COLOR (widget));
++ gdk_gc_set_foreground (gc, SELECTED_FG_COLOR (widget));
+ for (i = 0; i < 7; i++)
+ {
+ if (gtk_widget_get_direction (GTK_WIDGET (calendar)) == GTK_TEXT_DIR_RTL)
+@@ -1997,19 +1993,18 @@
+ pango_layout_set_text (layout, buffer, -1);
+ pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
+
+- cairo_move_to (cr,
+- (CALENDAR_MARGIN +
+- + (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR ?
+- (priv->week_width + (priv->week_width ? CALENDAR_XSEP : 0))
+- : 0)
+- + day_wid_sep * i
+- + (day_width - logical_rect.width)/2),
+- CALENDAR_MARGIN + focus_width + focus_padding + logical_rect.y);
+- pango_cairo_show_layout (cr, layout);
++ gdk_draw_layout (priv->day_name_win, gc,
++ (CALENDAR_MARGIN +
++ + (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR ?
++ (priv->week_width + (priv->week_width ? CALENDAR_XSEP : 0))
++ : 0)
++ + day_wid_sep * i
++ + (day_width - logical_rect.width)/2),
++ CALENDAR_MARGIN + focus_width + focus_padding + logical_rect.y,
++ layout);
+ }
+
+ g_object_unref (layout);
+- cairo_destroy (cr);
+ }
+
+ static void
+@@ -2017,7 +2012,7 @@
+ {
+ GtkWidget *widget = GTK_WIDGET (calendar);
+ GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
+- cairo_t *cr;
++ GdkGC *gc;
+ gint row, week = 0, year;
+ gint x_loc;
+ char buffer[32];
+@@ -2027,7 +2022,7 @@
+ gint focus_padding;
+ gint focus_width;
+
+- cr = gdk_cairo_create (priv->week_win);
++ gc = calendar->gc;
+
+ gtk_widget_style_get (GTK_WIDGET (widget),
+ "focus-line-width", &focus_width,
+@@ -2038,20 +2033,20 @@
+ * Draw a rectangle as inverted background for the labels.
+ */
+
+- gdk_cairo_set_source_color (cr, SELECTED_BG_COLOR (widget));
++ gdk_gc_set_foreground (gc, SELECTED_BG_COLOR (widget));
+ if (priv->day_name_win)
+- cairo_rectangle (cr,
+- CALENDAR_MARGIN,
+- 0,
+- priv->week_width - CALENDAR_MARGIN,
+- priv->main_h - CALENDAR_MARGIN);
++ gdk_draw_rectangle (priv->week_win, gc, TRUE,
++ CALENDAR_MARGIN,
++ 0,
++ priv->week_width - CALENDAR_MARGIN,
++ priv->main_h - CALENDAR_MARGIN);
+ else
+- cairo_rectangle (cr,
+- CALENDAR_MARGIN,
+- CALENDAR_MARGIN,
+- priv->week_width - CALENDAR_MARGIN,
+- priv->main_h - 2 * CALENDAR_MARGIN);
+- cairo_fill (cr);
++ gdk_draw_rectangle (priv->week_win, gc, TRUE,
++ CALENDAR_MARGIN,
++ CALENDAR_MARGIN,
++ priv->week_width - CALENDAR_MARGIN,
++ priv->main_h - 2 * CALENDAR_MARGIN);
++
+
+ /*
+ * Write the labels
+@@ -2059,7 +2054,7 @@
+
+ layout = gtk_widget_create_pango_layout (widget, NULL);
+
+- gdk_cairo_set_source_color (cr, SELECTED_FG_COLOR (widget));
++ gdk_gc_set_foreground (gc, SELECTED_FG_COLOR (widget));
+ day_height = calendar_row_height (calendar);
+ for (row = 0; row < 6; row++)
+ {
+@@ -2095,12 +2090,10 @@
+ - logical_rect.width
+ - CALENDAR_XSEP - focus_padding - focus_width);
+
+- cairo_move_to (cr, x_loc, y_loc);
+- pango_cairo_show_layout (cr, layout);
++ gdk_draw_layout (priv->week_win, gc, x_loc, y_loc, layout);
+ }
+
+ g_object_unref (layout);
+- cairo_destroy (cr);
+ }
+
+ static void
+@@ -2149,7 +2142,7 @@
+ {
+ GtkWidget *widget = GTK_WIDGET (calendar);
+ GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
+- cairo_t *cr;
++ GdkGC *gc;
+ GdkColor *text_color;
+ gchar buffer[32];
+ gint day;
+@@ -2162,7 +2155,7 @@
+ g_return_if_fail (row < 6);
+ g_return_if_fail (col < 7);
+
+- cr = gdk_cairo_create (priv->main_win);
++ gc = calendar->gc;
+
+ day = calendar->day[row][col];
+
+@@ -2170,11 +2163,11 @@
+
+ if (calendar->day_month[row][col] == MONTH_PREV)
+ {
+- text_color = PREV_MONTH_COLOR (widget);
++ gdk_gc_set_foreground (gc, PREV_MONTH_COLOR (GTK_WIDGET (calendar)));
+ }
+ else if (calendar->day_month[row][col] == MONTH_NEXT)
+ {
+- text_color = NEXT_MONTH_COLOR (widget);
++ gdk_gc_set_foreground (gc, NEXT_MONTH_COLOR (GTK_WIDGET (calendar)));
+ }
+ else
+ {
+@@ -2188,16 +2181,16 @@
+ #endif
+ if (calendar->selected_day == day)
+ {
+- gdk_cairo_set_source_color (cr, SELECTED_BG_COLOR (widget));
+- gdk_cairo_rectangle (cr, &day_rect);
+- cairo_fill (cr);
++ gdk_gc_set_foreground (gc, SELECTED_BG_COLOR (GTK_WIDGET (calendar)));
++ gdk_draw_rectangle (priv->main_win, gc, TRUE, day_rect.x, day_rect.y,
++ day_rect.width, day_rect.height);
+ }
+ if (calendar->selected_day == day)
+- text_color = SELECTED_FG_COLOR (widget);
++ gdk_gc_set_foreground (gc, SELECTED_FG_COLOR (GTK_WIDGET (calendar)));
+ else if (calendar->marked_date[day-1])
+- text_color = MARKED_COLOR (widget);
++ gdk_gc_set_foreground (gc, MARKED_COLOR (GTK_WIDGET (calendar)));
+ else
+- text_color = NORMAL_DAY_COLOR (widget);
++ gdk_gc_set_foreground (gc, NORMAL_DAY_COLOR (GTK_WIDGET (calendar)));
+ }
+
+ /* Translators: this defines whether the day numbers should use
+@@ -2219,16 +2212,13 @@
+ x_loc -= logical_rect.width;
+ y_loc = day_rect.y + (day_rect.height - logical_rect.height) / 2;
+
+- gdk_cairo_set_source_color (cr, text_color);
+- cairo_move_to (cr, x_loc, y_loc);
+- pango_cairo_show_layout (cr, layout);
++ gdk_draw_layout (priv->main_win, gc,
++ x_loc, y_loc, layout);
+
+ if (calendar->marked_date[day-1]
+ && calendar->day_month[row][col] == MONTH_CURRENT)
+- {
+- cairo_move_to (cr, x_loc - 1, y_loc);
+- pango_cairo_show_layout (cr, layout);
+- }
++ gdk_draw_layout (priv->main_win, gc,
++ x_loc-1, y_loc, layout);
+
+ if (GTK_WIDGET_HAS_FOCUS (calendar)
+ && calendar->focus_row == row && calendar->focus_col == col)
+@@ -2253,7 +2243,6 @@
+ }
+
+ g_object_unref (layout);
+- cairo_destroy (cr);
+ }
+
+ static void
+Index: gtk+-2.10.6/gtk/gtkentry.c
+===================================================================
+--- gtk+-2.10.6.orig/gtk/gtkentry.c 2006-10-30 12:58:30.000000000 +0000
++++ gtk+-2.10.6/gtk/gtkentry.c 2006-10-30 12:59:30.000000000 +0000
+@@ -3333,7 +3333,6 @@
+ if (GTK_WIDGET_DRAWABLE (entry))
+ {
+ PangoLayout *layout = gtk_entry_ensure_layout (entry, TRUE);
+- cairo_t *cr;
+ gint x, y;
+ gint start_pos, end_pos;
+
+@@ -3341,56 +3340,60 @@
+
+ get_layout_position (entry, &x, &y);
+
+- 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);
+-
++ gdk_draw_layout (entry->text_area, widget->style->text_gc [widget->state],
++ x, y,
++ layout);
++
+ 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;
++ GdkGC *selection_gc, *text_gc;
+ GtkBorder inner_border;
+-
++ GdkRegion *clip_region;
++
+ pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
+ gtk_entry_get_pixel_ranges (entry, &ranges, &n_ranges);
+
+ if (GTK_WIDGET_HAS_FOCUS (entry))
+ {
+- selection_color = &widget->style->base [GTK_STATE_SELECTED];
+- text_color = &widget->style->text [GTK_STATE_SELECTED];
++ selection_gc = widget->style->base_gc [GTK_STATE_SELECTED];
++ text_gc = widget->style->text_gc [GTK_STATE_SELECTED];
+ }
+ else
+ {
+- selection_color = &widget->style->base [GTK_STATE_ACTIVE];
+- text_color = &widget->style->text [GTK_STATE_ACTIVE];
++ selection_gc = widget->style->base_gc [GTK_STATE_ACTIVE];
++ text_gc = widget->style->text_gc [GTK_STATE_ACTIVE];
+ }
+-
++
++ clip_region = gdk_region_new ();
+ _gtk_entry_effective_inner_border (entry, &inner_border);
+
+ for (i = 0; i < n_ranges; ++i)
+- cairo_rectangle (cr,
+- inner_border.left - entry->scroll_offset + ranges[2 * i],
+- y,
+- ranges[2 * i + 1],
+- logical_rect.height);
++ {
++ GdkRectangle rect;
+
+- cairo_clip (cr);
+-
+- gdk_cairo_set_source_color (cr, selection_color);
+- cairo_paint (cr);
++ 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);
+
+- cairo_move_to (cr, x, y);
+- gdk_cairo_set_source_color (cr, text_color);
+- pango_cairo_show_layout (cr, layout);
++ 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);
+ g_free (ranges);
+ }
+-
+- cairo_destroy (cr);
+ }
+ }
+
+Index: gtk+-2.10.6/gtk/gtkwidget.c
+===================================================================
+--- gtk+-2.10.6.orig/gtk/gtkwidget.c 2006-10-30 12:58:30.000000000 +0000
++++ gtk+-2.10.6/gtk/gtkwidget.c 2006-10-30 12:59:30.000000000 +0000
+@@ -5445,7 +5445,8 @@
+ GdkScreen *screen;
+
+ update_pango_context (widget, context);
+-
++/* TODO: Figure out the proper way to handle this in a pangoxft setting
++
+ screen = gtk_widget_get_screen_unchecked (widget);
+ if (screen)
+ {
+@@ -5453,7 +5454,7 @@
+ gdk_screen_get_resolution (screen));
+ pango_cairo_context_set_font_options (context,
+ gdk_screen_get_font_options (screen));
+- }
++ }*/
+ }
+ }
+
+Index: gtk+-2.10.6/gdk/x11/gdkpango-x11.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ gtk+-2.10.6/gdk/x11/gdkpango-x11.c 2006-10-30 12:59:30.000000000 +0000
+@@ -0,0 +1,174 @@
++/* GDK - The GIMP Drawing Kit
++ * Copyright (C) 2000 Red Hat, Inc.
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; if not, write to the
++ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++ * Boston, MA 02111-1307, USA.
++ */
++
++#include <config.h>
++#include <stdlib.h>
++
++#include "gdkx.h"
++#include "gdkdisplay-x11.h"
++#include "gdkpango.h"
++#include <pango/pangoxft.h>
++#include <pango/pangoxft-render.h>
++#include "gdkalias.h"
++
++#include <math.h>
++
++typedef struct _GdkX11Renderer GdkX11Renderer;
++typedef struct _GdkX11RendererClass GdkX11RendererClass;
++
++#define GDK_TYPE_X11_RENDERER (_gdk_x11_renderer_get_type())
++#define GDK_X11_RENDERER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_X11_RENDERER, GdkX11Renderer))
++#define GDK_IS_X11_RENDERER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_X11_RENDERER))
++#define GDK_X11_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_X11_RENDERER, GdkX11RendererClass))
++#define GDK_IS_X11_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_X11_RENDERER))
++#define GDK_X11_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_X11_RENDERER, GdkX11RendererClass))
++
++#define MAX_RENDER_PART PANGO_RENDER_PART_STRIKETHROUGH
++
++struct _GdkX11Renderer
++{
++ PangoXftRenderer parent_instance;
++
++ XRenderPictFormat *mask_format;
++
++ GdkDrawable *drawable;
++ GdkGC *gc;
++};
++
++struct _GdkX11RendererClass
++{
++ PangoXftRendererClass parent_class;
++};
++
++G_DEFINE_TYPE (GdkX11Renderer, _gdk_x11_renderer, PANGO_TYPE_XFT_RENDERER)
++
++static void
++gdk_x11_renderer_finalize (GObject *object)
++{
++ G_OBJECT_CLASS (_gdk_x11_renderer_parent_class)->finalize (object);
++}
++
++static void
++gdk_x11_renderer_composite_trapezoids (PangoXftRenderer *xftrenderer,
++ PangoRenderPart part,
++ XTrapezoid *trapezoids,
++ int n_trapezoids)
++{
++ /* Because we only use this renderer for "draw_glyphs()" calls, we
++ * won't hit this code path much. However, it is hit for drawing
++ * the "unknown glyph" hex squares. We can safely ignore the part,
++ */
++ GdkX11Renderer *x11_renderer = GDK_X11_RENDERER (xftrenderer);
++
++ _gdk_x11_drawable_draw_xtrapezoids (x11_renderer->drawable,
++ x11_renderer->gc,
++ trapezoids, n_trapezoids);
++
++}
++
++static void
++gdk_x11_renderer_composite_glyphs (PangoXftRenderer *xftrenderer,
++ XftFont *xft_font,
++ XftGlyphSpec *glyphs,
++ gint n_glyphs)
++{
++ GdkX11Renderer *x11_renderer = GDK_X11_RENDERER (xftrenderer);
++
++ _gdk_x11_drawable_draw_xft_glyphs (x11_renderer->drawable,
++ x11_renderer->gc,
++ xft_font, glyphs, n_glyphs);
++}
++
++static void
++_gdk_x11_renderer_init (GdkX11Renderer *renderer)
++{
++}
++
++static void
++_gdk_x11_renderer_class_init (GdkX11RendererClass *klass)
++{
++ PangoXftRendererClass *xftrenderer_class = PANGO_XFT_RENDERER_CLASS (klass);
++ GObjectClass *object_class = G_OBJECT_CLASS (klass);
++
++ xftrenderer_class->composite_glyphs = gdk_x11_renderer_composite_glyphs;
++ xftrenderer_class->composite_trapezoids = gdk_x11_renderer_composite_trapezoids;
++
++ object_class->finalize = gdk_x11_renderer_finalize;
++}
++
++PangoRenderer *
++_gdk_x11_renderer_get (GdkDrawable *drawable,
++ GdkGC *gc)
++{
++ GdkScreen *screen = GDK_DRAWABLE_IMPL_X11 (drawable)->screen;
++ GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (screen);
++ GdkX11Renderer *x11_renderer;
++
++ if (!screen_x11->renderer)
++ {
++ screen_x11->renderer = g_object_new (GDK_TYPE_X11_RENDERER,
++ "display", GDK_SCREEN_XDISPLAY (screen),
++ "screen", GDK_SCREEN_XNUMBER (screen),
++ NULL);
++ }
++
++ x11_renderer = GDK_X11_RENDERER (screen_x11->renderer);
++
++ x11_renderer->drawable = drawable;
++ x11_renderer->gc = gc;
++
++ return screen_x11->renderer;
++}
++
++/**
++ * 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.
++ *
++ * Return value: a new #PangoContext for @screen
++ *
++ * Since: 2.2
++ **/
++PangoContext *
++gdk_pango_context_get_for_screen (GdkScreen *screen)
++{
++ PangoContext *context;
++
++ g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
++
++ if (screen->closed)
++ return NULL;
++
++ context = pango_xft_get_context (GDK_SCREEN_XDISPLAY (screen),
++ GDK_SCREEN_X11 (screen)->screen_num);
++
++ g_object_set_data (G_OBJECT (context), "gdk-pango-screen", screen);
++
++ return context;
++}
++
++#define __GDK_PANGO_X11_C__
++#include "gdkaliasdef.c"
+Index: gtk+-2.10.6/gdk/x11/gdkpixmap-x11.c
+===================================================================
+--- gtk+-2.10.6.orig/gdk/x11/gdkpixmap-x11.c 2006-10-30 12:58:30.000000000 +0000
++++ gtk+-2.10.6/gdk/x11/gdkpixmap-x11.c 2006-10-30 12:59:30.000000000 +0000
+@@ -119,6 +119,9 @@
+ {
+ GdkDrawableImplX11 *draw_impl = GDK_DRAWABLE_IMPL_X11 (impl);
+
++ if (draw_impl->xft_draw)
++ XftDrawDestroy (draw_impl->xft_draw);
++
+ _gdk_x11_drawable_finish (GDK_DRAWABLE (draw_impl));
+ }
+
+--- gtk+-2.10.6.orig/gtk/gtkcalendar.c.orig 2006-11-14 14:39:34.000000000 -0800
++++ gtk+-2.10.6/gtk/gtkcalendar.c 2006-11-14 14:37:34.000000000 -0800
+@@ -1495,6 +1495,10 @@ gtk_calendar_realize (GtkWidget *widget)
+ BACKGROUND_COLOR ( GTK_WIDGET ( calendar)));
+ gdk_window_show (priv->main_win);
+ gdk_window_set_user_data (priv->main_win, widget);
++
++ /* Set widgets gc */
++ calendar->gc = gdk_gc_new (widget->window);
++
+ gdk_window_set_background (widget->window, BACKGROUND_COLOR (widget));
+ gdk_window_show (widget->window);
+ gdk_window_set_user_data (widget->window, widget);
diff --git a/recipes/gtk+/gtk+-2.12.3/range-no-redraw.patch b/recipes/gtk+/gtk+-2.12.3/range-no-redraw.patch
new file mode 100644
index 0000000000..14387b8a2e
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.3/range-no-redraw.patch
@@ -0,0 +1,127 @@
+5f084ea0849d5967a3c22821542ecaaa8accb398
+diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
+index bd95351..64e0e59 100644
+--- gtk/gtkrange.c
++++ gtk/gtkrange.c
+@@ -109,6 +109,8 @@ struct _GtkRangeLayout
+ GtkSensitivityType upper_sensitivity;
+
+ gdouble fill_level;
++
++ guint motion_idle_id;
+ };
+
+
+@@ -205,6 +207,8 @@ static gboolean gtk_range_real_change_value (GtkRange *range,
+ static void gtk_range_update_value (GtkRange *range);
+ static gboolean gtk_range_key_press (GtkWidget *range,
+ GdkEventKey *event);
++static void gtk_range_add_motion_idle (GtkRange *range);
++static void gtk_range_remove_motion_idle (GtkRange *range);
+
+
+ static guint signals[LAST_SIGNAL];
+@@ -1167,6 +1171,7 @@ gtk_range_destroy (GtkObject *object)
+
+ gtk_range_remove_step_timer (range);
+ gtk_range_remove_update_timer (range);
++ gtk_range_remove_motion_idle (range);
+
+ if (range->adjustment)
+ {
+@@ -1276,6 +1281,7 @@ gtk_range_unrealize (GtkWidget *widget)
+
+ gtk_range_remove_step_timer (range);
+ gtk_range_remove_update_timer (range);
++ gtk_range_remove_motion_idle (range);
+
+ gdk_window_set_user_data (range->event_window, NULL);
+ gdk_window_destroy (range->event_window);
+@@ -2165,7 +2171,7 @@ gtk_range_motion_notify (GtkWidget *widget,
+ gtk_widget_queue_draw (widget);
+
+ if (range->layout->grab_location == MOUSE_SLIDER)
+- update_slider_position (range, x, y);
++ gtk_range_add_motion_idle (range);
+
+ /* We handled the event if the mouse was in the range_rect */
+ return range->layout->mouse_location != MOUSE_OUTSIDE;
+@@ -3335,9 +3341,10 @@ initial_timeout (gpointer data)
+ g_object_get (settings, "gtk-timeout-repeat", &timeout, NULL);
+
+ range = GTK_RANGE (data);
+- range->timer->timeout_id = gdk_threads_add_timeout (timeout * SCROLL_DELAY_FACTOR,
+- second_timeout,
+- range);
++ range->timer->timeout_id =
++ gdk_threads_add_timeout (timeout * SCROLL_DELAY_FACTOR,
++ second_timeout,
++ range);
+ /* remove self */
+ return FALSE;
+ }
+@@ -3357,9 +3364,8 @@ gtk_range_add_step_timer (GtkRange *range,
+
+ range->timer = g_new (GtkRangeStepTimer, 1);
+
+- range->timer->timeout_id = gdk_threads_add_timeout (timeout,
+- initial_timeout,
+- range);
++ range->timer->timeout_id =
++ gdk_threads_add_timeout (timeout, initial_timeout, range);
+ range->timer->step = step;
+
+ gtk_range_scroll (range, range->timer->step);
+@@ -3397,9 +3403,8 @@ gtk_range_reset_update_timer (GtkRange *range)
+ {
+ gtk_range_remove_update_timer (range);
+
+- range->update_timeout_id = gdk_threads_add_timeout (UPDATE_DELAY,
+- update_timeout,
+- range);
++ range->update_timeout_id =
++ gdk_threads_add_timeout (UPDATE_DELAY, update_timeout, range);
+ }
+
+ static void
+@@ -3412,5 +3417,40 @@ gtk_range_remove_update_timer (GtkRange *range)
+ }
+ }
+
++static gboolean
++motion_idle (gpointer data)
++{
++ GtkRange *range = data;
++ GtkRangeLayout *layout = range->layout;
++
++ update_slider_position (range, layout->mouse_x, layout->mouse_y);
++
++ layout->motion_idle_id = 0;
++
++ return FALSE;
++}
++
++static void
++gtk_range_add_motion_idle (GtkRange *range)
++{
++ if (!range->layout->motion_idle_id)
++ {
++ range->layout->motion_idle_id =
++ gdk_threads_add_idle_full (GDK_PRIORITY_REDRAW,
++ motion_idle, range,
++ NULL);
++ }
++}
++
++static void
++gtk_range_remove_motion_idle (GtkRange *range)
++{
++ if (range->layout->motion_idle_id != 0)
++ {
++ g_source_remove (range->layout->motion_idle_id);
++ range->layout->motion_idle_id = 0;
++ }
++}
++
+ #define __GTK_RANGE_C__
+ #include "gtkaliasdef.c"
diff --git a/recipes/gtk+/gtk+-2.12.3/run-iconcache.patch b/recipes/gtk+/gtk+-2.12.3/run-iconcache.patch
new file mode 100644
index 0000000000..ac15e9ab24
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.3/run-iconcache.patch
@@ -0,0 +1,19 @@
+--- /tmp/Makefile.am 2007-01-08 17:44:47.000000000 +0100
++++ gtk+-2.10.7/gtk/Makefile.am 2007-01-08 17:45:17.025251000 +0100
+@@ -1128,11 +1128,11 @@
+ ./gtk-update-icon-cache
+ endif
+
+-gtkbuiltincache.h: @REBUILD@ stamp-icons
+- $(MAKE) $(AM_MAKEFLAGS) gtk-update-icon-cache$(EXEEXT)
+- $(gtk_update_icon_cache_program) --force --ignore-theme-index \
+- --source builtin_icons stock-icons > gtkbuiltincache.h.tmp && \
+- mv gtkbuiltincache.h.tmp gtkbuiltincache.h
++#gtkbuiltincache.h: @REBUILD@ stamp-icons
++# $(MAKE) $(AM_MAKEFLAGS) gtk-update-icon-cache$(EXEEXT)
++# $(gtk_update_icon_cache_program) --force --ignore-theme-index \
++# --source builtin_icons stock-icons > gtkbuiltincache.h.tmp && \
++# mv gtkbuiltincache.h.tmp gtkbuiltincache.h
+
+ EXTRA_DIST += \
+ $(STOCK_ICONS) \
diff --git a/recipes/gtk+/gtk+-2.12.3/scrolled-placement.patch b/recipes/gtk+/gtk+-2.12.3/scrolled-placement.patch
new file mode 100644
index 0000000000..a0b50c8cac
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.3/scrolled-placement.patch
@@ -0,0 +1,22 @@
+Index: gdk/x11/gdksettings.c
+===================================================================
+--- gdk/x11/gdksettings.c (revision 18493)
++++ gdk/x11/gdksettings.c (working copy)
+@@ -65,7 +65,8 @@
+ "Xft/RGBA\0" "gtk-xft-rgba\0"
+ "Xft/DPI\0" "gtk-xft-dpi\0"
+ "Net/FallbackIconTheme\0" "gtk-fallback-icon-theme\0"
+- "Gtk/TouchscreenMode\0" "gtk-touchscreen-mode\0";
++ "Gtk/TouchscreenMode\0" "gtk-touchscreen-mode\0"
++ "Gtk/ScrolledWindowPlacement\0" "gtk-scrolled-window-placement\0";
+
+ static const struct
+ {
+@@ -107,5 +108,6 @@
+ { 1197, 1206 },
+ { 1219, 1227 },
+ { 1239, 1261 },
+- { 1285, 1305 }
++ { 1285, 1305 },
++ { 1326, 1354 }
+ };
diff --git a/recipes/gtk+/gtk+-2.12.3/toggle-font.diff b/recipes/gtk+/gtk+-2.12.3/toggle-font.diff
new file mode 100644
index 0000000000..59ad150b2f
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.12.3/toggle-font.diff
@@ -0,0 +1,100 @@
+Index: gtk/gtkcellrenderertoggle.c
+===================================================================
+--- gtk/gtkcellrenderertoggle.c (revision 18523)
++++ gtk/gtkcellrenderertoggle.c (working copy)
+@@ -71,6 +71,8 @@
+ PROP_INDICATOR_SIZE
+ };
+
++/* This is a hard-coded default which promptly gets overridden by a size
++ calculated from the font size. */
+ #define TOGGLE_WIDTH 13
+
+ static guint toggle_cell_signals[LAST_SIGNAL] = { 0 };
+@@ -80,8 +82,9 @@
+ typedef struct _GtkCellRendererTogglePrivate GtkCellRendererTogglePrivate;
+ struct _GtkCellRendererTogglePrivate
+ {
+- gint indicator_size;
+-
++ gint indicator_size; /* This is the real size */
++ gint override_size; /* This is the size set from the indicator-size property */
++ GtkWidget *cached_widget;
+ guint inconsistent : 1;
+ };
+
+@@ -104,6 +107,7 @@
+ GTK_CELL_RENDERER (celltoggle)->ypad = 2;
+
+ priv->indicator_size = TOGGLE_WIDTH;
++ priv->override_size = 0;
+ priv->inconsistent = FALSE;
+ }
+
+@@ -210,7 +214,7 @@
+ g_value_set_boolean (value, celltoggle->radio);
+ break;
+ case PROP_INDICATOR_SIZE:
+- g_value_set_int (value, priv->indicator_size);
++ g_value_set_int (value, priv->override_size ? priv->override_size : priv->indicator_size);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+@@ -245,7 +249,7 @@
+ celltoggle->radio = g_value_get_boolean (value);
+ break;
+ case PROP_INDICATOR_SIZE:
+- priv->indicator_size = g_value_get_int (value);
++ priv->override_size = g_value_get_int (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+@@ -273,6 +277,27 @@
+ }
+
+ static void
++on_widget_style_set (GtkWidget *widget, GtkStyle *previous, gpointer user_data)
++{
++ GtkCellRendererTogglePrivate *priv = user_data;
++ PangoContext *context;
++ PangoFontMetrics *metrics;
++ int height;
++
++ context = gtk_widget_get_pango_context (widget);
++ metrics = pango_context_get_metrics (context,
++ widget->style->font_desc,
++ pango_context_get_language (context));
++
++ height = pango_font_metrics_get_ascent (metrics) +
++ pango_font_metrics_get_descent (metrics);
++
++ pango_font_metrics_unref (metrics);
++
++ priv->indicator_size = PANGO_PIXELS (height * 0.85);
++}
++
++static void
+ gtk_cell_renderer_toggle_get_size (GtkCellRenderer *cell,
+ GtkWidget *widget,
+ GdkRectangle *cell_area,
+@@ -287,6 +312,20 @@
+
+ priv = GTK_CELL_RENDERER_TOGGLE_GET_PRIVATE (cell);
+
++ if (priv->override_size) {
++ priv->indicator_size = priv->override_size;
++ } else if (priv->cached_widget != widget) {
++ if (priv->cached_widget) {
++ g_object_remove_weak_pointer (widget, &priv->cached_widget);
++ g_signal_handlers_disconnect_by_func (priv->cached_widget, on_widget_style_set, priv);
++ }
++ priv->cached_widget = widget;
++ g_object_add_weak_pointer (widget, &priv->cached_widget);
++ g_signal_connect (widget, "style-set", on_widget_style_set, priv);
++
++ on_widget_style_set (widget, NULL, priv);
++ }
++
+ calc_width = (gint) cell->xpad * 2 + priv->indicator_size;
+ calc_height = (gint) cell->ypad * 2 + priv->indicator_size;
+
diff --git a/recipes/gtk+/gtk+-2.14.1/hardcoded_libtool.patch b/recipes/gtk+/gtk+-2.14.1/hardcoded_libtool.patch
new file mode 100644
index 0000000000..1c2cd0576d
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.14.1/hardcoded_libtool.patch
@@ -0,0 +1,29 @@
+--- /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/recipes/gtk+/gtk+-2.14.1/no-demos.patch b/recipes/gtk+/gtk+-2.14.1/no-demos.patch
new file mode 100644
index 0000000000..0fc4c48d1a
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.14.1/no-demos.patch
@@ -0,0 +1,10 @@
+--- 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/recipes/gtk+/gtk+-2.14.1/run-iconcache.patch b/recipes/gtk+/gtk+-2.14.1/run-iconcache.patch
new file mode 100644
index 0000000000..ac15e9ab24
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.14.1/run-iconcache.patch
@@ -0,0 +1,19 @@
+--- /tmp/Makefile.am 2007-01-08 17:44:47.000000000 +0100
++++ gtk+-2.10.7/gtk/Makefile.am 2007-01-08 17:45:17.025251000 +0100
+@@ -1128,11 +1128,11 @@
+ ./gtk-update-icon-cache
+ endif
+
+-gtkbuiltincache.h: @REBUILD@ stamp-icons
+- $(MAKE) $(AM_MAKEFLAGS) gtk-update-icon-cache$(EXEEXT)
+- $(gtk_update_icon_cache_program) --force --ignore-theme-index \
+- --source builtin_icons stock-icons > gtkbuiltincache.h.tmp && \
+- mv gtkbuiltincache.h.tmp gtkbuiltincache.h
++#gtkbuiltincache.h: @REBUILD@ stamp-icons
++# $(MAKE) $(AM_MAKEFLAGS) gtk-update-icon-cache$(EXEEXT)
++# $(gtk_update_icon_cache_program) --force --ignore-theme-index \
++# --source builtin_icons stock-icons > gtkbuiltincache.h.tmp && \
++# mv gtkbuiltincache.h.tmp gtkbuiltincache.h
+
+ EXTRA_DIST += \
+ $(STOCK_ICONS) \
diff --git a/recipes/gtk+/gtk+-2.14.1/toggle-font.diff b/recipes/gtk+/gtk+-2.14.1/toggle-font.diff
new file mode 100644
index 0000000000..59ad150b2f
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.14.1/toggle-font.diff
@@ -0,0 +1,100 @@
+Index: gtk/gtkcellrenderertoggle.c
+===================================================================
+--- gtk/gtkcellrenderertoggle.c (revision 18523)
++++ gtk/gtkcellrenderertoggle.c (working copy)
+@@ -71,6 +71,8 @@
+ PROP_INDICATOR_SIZE
+ };
+
++/* This is a hard-coded default which promptly gets overridden by a size
++ calculated from the font size. */
+ #define TOGGLE_WIDTH 13
+
+ static guint toggle_cell_signals[LAST_SIGNAL] = { 0 };
+@@ -80,8 +82,9 @@
+ typedef struct _GtkCellRendererTogglePrivate GtkCellRendererTogglePrivate;
+ struct _GtkCellRendererTogglePrivate
+ {
+- gint indicator_size;
+-
++ gint indicator_size; /* This is the real size */
++ gint override_size; /* This is the size set from the indicator-size property */
++ GtkWidget *cached_widget;
+ guint inconsistent : 1;
+ };
+
+@@ -104,6 +107,7 @@
+ GTK_CELL_RENDERER (celltoggle)->ypad = 2;
+
+ priv->indicator_size = TOGGLE_WIDTH;
++ priv->override_size = 0;
+ priv->inconsistent = FALSE;
+ }
+
+@@ -210,7 +214,7 @@
+ g_value_set_boolean (value, celltoggle->radio);
+ break;
+ case PROP_INDICATOR_SIZE:
+- g_value_set_int (value, priv->indicator_size);
++ g_value_set_int (value, priv->override_size ? priv->override_size : priv->indicator_size);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+@@ -245,7 +249,7 @@
+ celltoggle->radio = g_value_get_boolean (value);
+ break;
+ case PROP_INDICATOR_SIZE:
+- priv->indicator_size = g_value_get_int (value);
++ priv->override_size = g_value_get_int (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+@@ -273,6 +277,27 @@
+ }
+
+ static void
++on_widget_style_set (GtkWidget *widget, GtkStyle *previous, gpointer user_data)
++{
++ GtkCellRendererTogglePrivate *priv = user_data;
++ PangoContext *context;
++ PangoFontMetrics *metrics;
++ int height;
++
++ context = gtk_widget_get_pango_context (widget);
++ metrics = pango_context_get_metrics (context,
++ widget->style->font_desc,
++ pango_context_get_language (context));
++
++ height = pango_font_metrics_get_ascent (metrics) +
++ pango_font_metrics_get_descent (metrics);
++
++ pango_font_metrics_unref (metrics);
++
++ priv->indicator_size = PANGO_PIXELS (height * 0.85);
++}
++
++static void
+ gtk_cell_renderer_toggle_get_size (GtkCellRenderer *cell,
+ GtkWidget *widget,
+ GdkRectangle *cell_area,
+@@ -287,6 +312,20 @@
+
+ priv = GTK_CELL_RENDERER_TOGGLE_GET_PRIVATE (cell);
+
++ if (priv->override_size) {
++ priv->indicator_size = priv->override_size;
++ } else if (priv->cached_widget != widget) {
++ if (priv->cached_widget) {
++ g_object_remove_weak_pointer (widget, &priv->cached_widget);
++ g_signal_handlers_disconnect_by_func (priv->cached_widget, on_widget_style_set, priv);
++ }
++ priv->cached_widget = widget;
++ g_object_add_weak_pointer (widget, &priv->cached_widget);
++ g_signal_connect (widget, "style-set", on_widget_style_set, priv);
++
++ on_widget_style_set (widget, NULL, priv);
++ }
++
+ calc_width = (gint) cell->xpad * 2 + priv->indicator_size;
+ calc_height = (gint) cell->ypad * 2 + priv->indicator_size;
+
diff --git a/recipes/gtk+/gtk+-2.14.2/hardcoded_libtool.patch b/recipes/gtk+/gtk+-2.14.2/hardcoded_libtool.patch
new file mode 100644
index 0000000000..82fbbac8d7
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.14.2/hardcoded_libtool.patch
@@ -0,0 +1,31 @@
+Index: gtk+-2.14.2/configure.in
+===================================================================
+--- gtk+-2.14.2.orig/configure.in 2008-09-23 15:52:44.000000000 +0100
++++ gtk+-2.14.2/configure.in 2008-09-23 15:53:51.000000000 +0100
+@@ -401,7 +401,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
+@@ -759,7 +759,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/'`
+@@ -1893,7 +1893,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/recipes/gtk+/gtk+-2.14.2/no-demos.patch b/recipes/gtk+/gtk+-2.14.2/no-demos.patch
new file mode 100644
index 0000000000..0fc4c48d1a
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.14.2/no-demos.patch
@@ -0,0 +1,10 @@
+--- 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/recipes/gtk+/gtk+-2.14.2/run-iconcache.patch b/recipes/gtk+/gtk+-2.14.2/run-iconcache.patch
new file mode 100644
index 0000000000..ac15e9ab24
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.14.2/run-iconcache.patch
@@ -0,0 +1,19 @@
+--- /tmp/Makefile.am 2007-01-08 17:44:47.000000000 +0100
++++ gtk+-2.10.7/gtk/Makefile.am 2007-01-08 17:45:17.025251000 +0100
+@@ -1128,11 +1128,11 @@
+ ./gtk-update-icon-cache
+ endif
+
+-gtkbuiltincache.h: @REBUILD@ stamp-icons
+- $(MAKE) $(AM_MAKEFLAGS) gtk-update-icon-cache$(EXEEXT)
+- $(gtk_update_icon_cache_program) --force --ignore-theme-index \
+- --source builtin_icons stock-icons > gtkbuiltincache.h.tmp && \
+- mv gtkbuiltincache.h.tmp gtkbuiltincache.h
++#gtkbuiltincache.h: @REBUILD@ stamp-icons
++# $(MAKE) $(AM_MAKEFLAGS) gtk-update-icon-cache$(EXEEXT)
++# $(gtk_update_icon_cache_program) --force --ignore-theme-index \
++# --source builtin_icons stock-icons > gtkbuiltincache.h.tmp && \
++# mv gtkbuiltincache.h.tmp gtkbuiltincache.h
+
+ EXTRA_DIST += \
+ $(STOCK_ICONS) \
diff --git a/recipes/gtk+/gtk+-2.14.2/smallscreen_filechooser.patch b/recipes/gtk+/gtk+-2.14.2/smallscreen_filechooser.patch
new file mode 100644
index 0000000000..2d3b2aa8fb
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.14.2/smallscreen_filechooser.patch
@@ -0,0 +1,235 @@
+diff -Naur gtk+-2.14.3.orig/gtk/gtkfilechooserdefault.c gtk+-2.14.3/gtk/gtkfilechooserdefault.c
+--- gtk+-2.14.3.orig/gtk/gtkfilechooserdefault.c 2008-09-22 22:33:15.000000000 +0400
++++ gtk+-2.14.3/gtk/gtkfilechooserdefault.c 2008-10-06 00:42:01.000000000 +0400
+@@ -252,7 +252,9 @@
+ /* Icon size for if we can't get it from the theme */
+ #define FALLBACK_ICON_SIZE 16
+
+-#define PREVIEW_HBOX_SPACING 12
++#define PREVIEW_HBOX_SPACING 2
++#define NORMAL_SPACING 2
++#define DOUBLE_SPACING 2
+ #define NUM_LINES 45
+ #define NUM_CHARS 60
+
+@@ -460,6 +462,17 @@
+
+
+
++int
++_gtk_is_pda_mode()
++{
++ /* PDA mode is when we have small screen width, plus small overall screen area
++ too. What we want to do when it is active is to prefer vertical packing over
++ horizontal (so we can show user filenames of as long length as possible), yet
++ still layout vertical space in such way so user can be able to see as many
++ files as possible. And of course, we save space overall - no big spacings and
++ borders. */
++ return gdk_screen_width() < 490;
++}
+
+
+ /* Drag and drop interface declarations */
+@@ -803,7 +816,7 @@
+ impl->operation_mode = OPERATION_MODE_BROWSE;
+ impl->recent_manager = gtk_recent_manager_get_default ();
+
+- gtk_box_set_spacing (GTK_BOX (impl), 12);
++ gtk_box_set_spacing (GTK_BOX (impl), DOUBLE_SPACING);
+
+ set_file_system_backend (impl);
+
+@@ -3969,8 +3982,9 @@
+ GtkWidget *vbox;
+ GtkWidget *hbox;
+ GtkWidget *widget;
++ gboolean is_pda = _gtk_is_pda_mode();
+
+- vbox = gtk_vbox_new (FALSE, 6);
++ vbox = (is_pda?gtk_hbox_new:gtk_vbox_new) (FALSE, NORMAL_SPACING);
+ gtk_widget_show (vbox);
+
+ /* Shortcuts tree */
+@@ -3980,7 +3994,7 @@
+
+ /* Box for buttons */
+
+- hbox = gtk_hbox_new (TRUE, 6);
++ hbox = (is_pda?gtk_vbox_new:gtk_hbox_new) (TRUE, NORMAL_SPACING);
+ gtk_size_group_add_widget (size_group, hbox);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
+ gtk_widget_show (hbox);
+@@ -3988,7 +4002,7 @@
+ /* Add bookmark button */
+
+ impl->browse_shortcuts_add_button = button_new (impl,
+- _("_Add"),
++ "",
+ GTK_STOCK_ADD,
+ FALSE,
+ TRUE,
+@@ -4000,15 +4014,25 @@
+ /* Remove bookmark button */
+
+ impl->browse_shortcuts_remove_button = button_new (impl,
+- _("_Remove"),
++ "",
+ GTK_STOCK_REMOVE,
+ FALSE,
+ TRUE,
+ G_CALLBACK (remove_bookmark_button_clicked_cb));
++ if (!is_pda) {
++/* Remove button is pretty reduntant, as that choice is available from popup
++ * menu (and would be intuitively expected to be there; compare that with
++ * the "Add to shortucts" in popup in files pane - most users would never
++ * try that and never new what shortcuts are).
++ * If we suspect we can be short of screen space (PDA device is what often
++ * has portrait layout), don't pack it, to allow more visually pleasing
++ * layout when minimizing location pane. Note that we still instantiate it,
++ * as it is referenced thruout the code. */
++
+ gtk_box_pack_start (GTK_BOX (hbox), impl->browse_shortcuts_remove_button, TRUE, TRUE, 0);
+ gtk_widget_set_tooltip_text (impl->browse_shortcuts_remove_button,
+ _("Remove the selected bookmark"));
+-
++ }
+ return vbox;
+ }
+
+@@ -4661,7 +4685,7 @@
+ GtkWidget *hbox;
+ GtkWidget *widget;
+
+- vbox = gtk_vbox_new (FALSE, 6);
++ vbox = gtk_vbox_new (FALSE, NORMAL_SPACING);
+ gtk_widget_show (vbox);
+
+ /* Box for lists and preview */
+@@ -4677,13 +4701,13 @@
+
+ /* Preview */
+
+- impl->preview_box = gtk_vbox_new (FALSE, 12);
++ impl->preview_box = gtk_vbox_new (FALSE, DOUBLE_SPACING);
+ gtk_box_pack_start (GTK_BOX (hbox), impl->preview_box, FALSE, FALSE, 0);
+ /* Don't show preview box initially */
+
+ /* Filter combo */
+
+- impl->filter_combo_hbox = gtk_hbox_new (FALSE, 12);
++ impl->filter_combo_hbox = gtk_hbox_new (FALSE, DOUBLE_SPACING);
+
+ widget = filter_create (impl);
+
+@@ -4835,13 +4859,13 @@
+
+ location_switch_to_path_bar (impl);
+
+- vbox = gtk_vbox_new (FALSE, 12);
++ vbox = gtk_vbox_new (FALSE, DOUBLE_SPACING);
+
+ table = gtk_table_new (2, 2, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
+ gtk_widget_show (table);
+- gtk_table_set_row_spacings (GTK_TABLE (table), 12);
+- gtk_table_set_col_spacings (GTK_TABLE (table), 12);
++ gtk_table_set_row_spacings (GTK_TABLE (table), DOUBLE_SPACING);
++ gtk_table_set_col_spacings (GTK_TABLE (table), DOUBLE_SPACING);
+
+ /* Label */
+
+@@ -5175,10 +5199,10 @@
+
+ /* size group is used by the [+][-] buttons and the filter combo */
+ size_group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
+- vbox = gtk_vbox_new (FALSE, 12);
++ vbox = gtk_vbox_new (FALSE, DOUBLE_SPACING);
+
+ /* Location widgets */
+- hbox = gtk_hbox_new (FALSE, 12);
++ hbox = gtk_hbox_new (FALSE, DOUBLE_SPACING);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
+ gtk_widget_show (hbox);
+ impl->browse_path_bar_hbox = hbox;
+@@ -5201,7 +5225,7 @@
+
+ /* Box for the location label and entry */
+
+- impl->location_entry_box = gtk_hbox_new (FALSE, 12);
++ impl->location_entry_box = gtk_hbox_new (FALSE, DOUBLE_SPACING);
+ gtk_box_pack_start (GTK_BOX (vbox), impl->location_entry_box, FALSE, FALSE, 0);
+
+ impl->location_label = gtk_label_new_with_mnemonic (_("_Location:"));
+@@ -5209,12 +5233,16 @@
+ gtk_box_pack_start (GTK_BOX (impl->location_entry_box), impl->location_label, FALSE, FALSE, 0);
+
+ /* Paned widget */
+- hpaned = gtk_hpaned_new ();
++ if (_gtk_is_pda_mode())
++ hpaned = gtk_vpaned_new ();
++ else
++ hpaned = gtk_hpaned_new ();
++
+ gtk_widget_show (hpaned);
+ gtk_box_pack_start (GTK_BOX (vbox), hpaned, TRUE, TRUE, 0);
+
+ widget = shortcuts_pane_create (impl, size_group);
+- gtk_paned_pack1 (GTK_PANED (hpaned), widget, FALSE, FALSE);
++ gtk_paned_pack1 (GTK_PANED (hpaned), widget, FALSE, TRUE); /* Shortcuts can shrink beyond requested size */
+ widget = file_pane_create (impl, size_group);
+ gtk_paned_pack2 (GTK_PANED (hpaned), widget, TRUE, FALSE);
+
+diff -Naur gtk+-2.14.3.orig/gtk/gtkfilechooserdialog.c gtk+-2.14.3/gtk/gtkfilechooserdialog.c
+--- gtk+-2.14.3.orig/gtk/gtkfilechooserdialog.c 2008-09-19 08:44:03.000000000 +0400
++++ gtk+-2.14.3/gtk/gtkfilechooserdialog.c 2008-10-10 12:37:38.000000000 +0400
+@@ -32,8 +32,12 @@
+
+ #include <stdarg.h>
+
++#define NORMAL_SPACING 1
++#define DOUBLE_SPACING 2
++
+ #define GTK_FILE_CHOOSER_DIALOG_GET_PRIVATE(o) (GTK_FILE_CHOOSER_DIALOG (o)->priv)
+
++extern int _gtk_is_pda_mode(void);
+ static void gtk_file_chooser_dialog_finalize (GObject *object);
+
+ static GObject* gtk_file_chooser_dialog_constructor (GType type,
+@@ -89,9 +93,9 @@
+ dialog->priv->response_requested = FALSE;
+
+ gtk_dialog_set_has_separator (fc_dialog, FALSE);
+- gtk_container_set_border_width (GTK_CONTAINER (fc_dialog), 5);
+- gtk_box_set_spacing (GTK_BOX (fc_dialog->vbox), 2); /* 2 * 5 + 2 = 12 */
+- gtk_container_set_border_width (GTK_CONTAINER (fc_dialog->action_area), 5);
++ gtk_container_set_border_width (GTK_CONTAINER (fc_dialog), NORMAL_SPACING);
++ gtk_box_set_spacing (GTK_BOX (fc_dialog->vbox), NORMAL_SPACING);
++ gtk_container_set_border_width (GTK_CONTAINER (fc_dialog->action_area), NORMAL_SPACING);
+
+ /* We do a signal connection here rather than overriding the method in
+ * class_init because GtkDialog::response is a RUN_LAST signal. We want *our*
+@@ -170,8 +174,13 @@
+
+ gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
+
+- if (width)
+- *width = MIN (*width, (monitor.width * 3) / 4);
++ if (width) {
++ if (_gtk_is_pda_mode())
++ /* If width is physically small, use it all */
++ *width = monitor.width;
++ else
++ *width = MIN (*width, (monitor.width * 3) / 4);
++ }
+
+ if (height)
+ *height = MIN (*height, (monitor.height * 3) / 4);
+@@ -279,7 +288,7 @@
+ g_signal_connect (priv->widget, "response-requested",
+ G_CALLBACK (file_chooser_widget_response_requested), object);
+
+- gtk_container_set_border_width (GTK_CONTAINER (priv->widget), 5);
++ gtk_container_set_border_width (GTK_CONTAINER (priv->widget), NORMAL_SPACING);
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (object)->vbox), priv->widget, TRUE, TRUE, 0);
+
+ gtk_widget_show (priv->widget);
diff --git a/recipes/gtk+/gtk+-2.14.2/toggle-font.diff b/recipes/gtk+/gtk+-2.14.2/toggle-font.diff
new file mode 100644
index 0000000000..59ad150b2f
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.14.2/toggle-font.diff
@@ -0,0 +1,100 @@
+Index: gtk/gtkcellrenderertoggle.c
+===================================================================
+--- gtk/gtkcellrenderertoggle.c (revision 18523)
++++ gtk/gtkcellrenderertoggle.c (working copy)
+@@ -71,6 +71,8 @@
+ PROP_INDICATOR_SIZE
+ };
+
++/* This is a hard-coded default which promptly gets overridden by a size
++ calculated from the font size. */
+ #define TOGGLE_WIDTH 13
+
+ static guint toggle_cell_signals[LAST_SIGNAL] = { 0 };
+@@ -80,8 +82,9 @@
+ typedef struct _GtkCellRendererTogglePrivate GtkCellRendererTogglePrivate;
+ struct _GtkCellRendererTogglePrivate
+ {
+- gint indicator_size;
+-
++ gint indicator_size; /* This is the real size */
++ gint override_size; /* This is the size set from the indicator-size property */
++ GtkWidget *cached_widget;
+ guint inconsistent : 1;
+ };
+
+@@ -104,6 +107,7 @@
+ GTK_CELL_RENDERER (celltoggle)->ypad = 2;
+
+ priv->indicator_size = TOGGLE_WIDTH;
++ priv->override_size = 0;
+ priv->inconsistent = FALSE;
+ }
+
+@@ -210,7 +214,7 @@
+ g_value_set_boolean (value, celltoggle->radio);
+ break;
+ case PROP_INDICATOR_SIZE:
+- g_value_set_int (value, priv->indicator_size);
++ g_value_set_int (value, priv->override_size ? priv->override_size : priv->indicator_size);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+@@ -245,7 +249,7 @@
+ celltoggle->radio = g_value_get_boolean (value);
+ break;
+ case PROP_INDICATOR_SIZE:
+- priv->indicator_size = g_value_get_int (value);
++ priv->override_size = g_value_get_int (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+@@ -273,6 +277,27 @@
+ }
+
+ static void
++on_widget_style_set (GtkWidget *widget, GtkStyle *previous, gpointer user_data)
++{
++ GtkCellRendererTogglePrivate *priv = user_data;
++ PangoContext *context;
++ PangoFontMetrics *metrics;
++ int height;
++
++ context = gtk_widget_get_pango_context (widget);
++ metrics = pango_context_get_metrics (context,
++ widget->style->font_desc,
++ pango_context_get_language (context));
++
++ height = pango_font_metrics_get_ascent (metrics) +
++ pango_font_metrics_get_descent (metrics);
++
++ pango_font_metrics_unref (metrics);
++
++ priv->indicator_size = PANGO_PIXELS (height * 0.85);
++}
++
++static void
+ gtk_cell_renderer_toggle_get_size (GtkCellRenderer *cell,
+ GtkWidget *widget,
+ GdkRectangle *cell_area,
+@@ -287,6 +312,20 @@
+
+ priv = GTK_CELL_RENDERER_TOGGLE_GET_PRIVATE (cell);
+
++ if (priv->override_size) {
++ priv->indicator_size = priv->override_size;
++ } else if (priv->cached_widget != widget) {
++ if (priv->cached_widget) {
++ g_object_remove_weak_pointer (widget, &priv->cached_widget);
++ g_signal_handlers_disconnect_by_func (priv->cached_widget, on_widget_style_set, priv);
++ }
++ priv->cached_widget = widget;
++ g_object_add_weak_pointer (widget, &priv->cached_widget);
++ g_signal_connect (widget, "style-set", on_widget_style_set, priv);
++
++ on_widget_style_set (widget, NULL, priv);
++ }
++
+ calc_width = (gint) cell->xpad * 2 + priv->indicator_size;
+ calc_height = (gint) cell->ypad * 2 + priv->indicator_size;
+
diff --git a/recipes/gtk+/gtk+-2.6.10/automake-lossage.patch b/recipes/gtk+/gtk+-2.6.10/automake-lossage.patch
new file mode 100644
index 0000000000..0d423ddbb9
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.6.10/automake-lossage.patch
@@ -0,0 +1,24 @@
+--- gtk+-2.4.1/docs/tutorial/Makefile.am~ 2003-05-06 22:54:20.000000000 +0100
++++ gtk+-2.4.1/docs/tutorial/Makefile.am 2004-05-08 12:31:41.000000000 +0100
+@@ -52,21 +52,5 @@
+
+ dist-hook: html
+ cp -Rp $(srcdir)/html $(distdir)
+-else
+-html:
+- echo "***"
+- echo "*** Warning: Tutorial not built"
+- echo "***"
+-
+-pdf:
+- echo "***"
+- echo "*** Warning: Tutorial not built"
+- echo "***"
+-
+-dist-hook:
+- echo "***"
+- echo "*** Warning: Tutorial not built"
+- echo "*** DISTRIBUTION IS INCOMPLETE"
+- echo "***"
+ endif
+
diff --git a/recipes/gtk+/gtk+-2.6.10/compile-against-newer-glib.patch b/recipes/gtk+/gtk+-2.6.10/compile-against-newer-glib.patch
new file mode 100644
index 0000000000..3d8f3f614b
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.6.10/compile-against-newer-glib.patch
@@ -0,0 +1,49 @@
+--- gtk+-2.6.10/gtk/gtkstatusbar.h 2005/03/20 07:01:22 1.17
++++ gtk+-2.6.10/gtk/gtkstatusbar.h 2005/12/06 14:25:30 1.17.2.1
+@@ -65,7 +65,7 @@
+ {
+ GtkHBoxClass parent_class;
+
+- GMemChunk *messages_mem_chunk;
++ gpointer messages_mem_chunk;
+
+ void (*text_pushed) (GtkStatusbar *statusbar,
+ guint context_id,
+--- gtk+-2.6.10/gtk/gtkstatusbar.c 2005/07/21 19:10:48 1.56
++++ gtk+-2.6.10/gtk/gtkstatusbar.c 2005/12/06 14:25:30 1.56.2.1
+@@ -302,7 +302,7 @@
+ g_return_val_if_fail (text != NULL, 0);
+
+ class = GTK_STATUSBAR_GET_CLASS (statusbar);
+- msg = g_chunk_new (GtkStatusbarMsg, class->messages_mem_chunk);
++ msg = g_chunk_new (GtkStatusbarMsg, (GMemChunk *)class->messages_mem_chunk);
+ msg->text = g_strdup (text);
+ msg->context_id = context_id;
+ msg->message_id = statusbar->seq_message_id++;
+@@ -343,7 +343,7 @@
+ statusbar->messages = g_slist_remove_link (statusbar->messages,
+ list);
+ g_free (msg->text);
+- g_mem_chunk_free (class->messages_mem_chunk, msg);
++ g_mem_chunk_free ((GMemChunk *)class->messages_mem_chunk, msg);
+ g_slist_free_1 (list);
+ break;
+ }
+@@ -394,7 +394,7 @@
+ class = GTK_STATUSBAR_GET_CLASS (statusbar);
+ statusbar->messages = g_slist_remove_link (statusbar->messages, list);
+ g_free (msg->text);
+- g_mem_chunk_free (class->messages_mem_chunk, msg);
++ g_mem_chunk_free ((GMemChunk *)class->messages_mem_chunk, msg);
+ g_slist_free_1 (list);
+
+ break;
+@@ -459,7 +459,7 @@
+
+ msg = list->data;
+ g_free (msg->text);
+- g_mem_chunk_free (class->messages_mem_chunk, msg);
++ g_mem_chunk_free ((GMemChunk *)class->messages_mem_chunk, msg);
+ }
+ g_slist_free (statusbar->messages);
+ statusbar->messages = NULL;
diff --git a/recipes/gtk+/gtk+-2.6.10/disable-tooltips.patch b/recipes/gtk+/gtk+-2.6.10/disable-tooltips.patch
new file mode 100644
index 0000000000..d71d839c3c
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.6.10/disable-tooltips.patch
@@ -0,0 +1,11 @@
+--- gtk+-2.4.3/gtk/gtktooltips.c.old 2004-07-04 18:52:04.000000000 +0100
++++ gtk+-2.4.3/gtk/gtktooltips.c 2004-07-04 18:52:08.000000000 +0100
+@@ -118,7 +118,7 @@
+ tooltips->tips_data_list = NULL;
+
+ tooltips->delay = DEFAULT_DELAY;
+- tooltips->enabled = TRUE;
++ tooltips->enabled = FALSE;
+ tooltips->timer_tag = 0;
+ tooltips->use_sticky_delay = FALSE;
+ tooltips->last_popdown.tv_sec = -1;
diff --git a/recipes/gtk+/gtk+-2.6.10/gtk+-2.6.10-bg.patch b/recipes/gtk+/gtk+-2.6.10/gtk+-2.6.10-bg.patch
new file mode 100644
index 0000000000..039440f933
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.6.10/gtk+-2.6.10-bg.patch
@@ -0,0 +1,20 @@
+diff -ur gtk+-2.8.20/gtk/gtkiconview.c gtk+-2.8.20-new/gtk/gtkiconview.c
+--- gtk+-2.8.20/gtk/gtkiconview.c 2006-04-11 20:44:15.000000000 +0200
++++ gtk+-2.8.20-new/gtk/gtkiconview.c 2007-01-03 20:20:26.000000000 +0100
+@@ -899,9 +899,14 @@
+ gdk_window_set_user_data (icon_view->priv->bin_window, widget);
+
+ widget->style = gtk_style_attach (widget->style, widget->window);
+- gdk_window_set_background (icon_view->priv->bin_window, &widget->style->base[widget->state]);
++/* gdk_window_set_background (icon_view->priv->bin_window, &widget->style->base[widget->state]);
+ gdk_window_set_background (widget->window, &widget->style->base[widget->state]);
+-
++*/
++printf("realize iconview\n");
++// gdk_window_set_back_pixmap(widget->window, NULL, FALSE);
++// gdk_window_set_back_pixmap(icon_view->priv->bin_window, NULL, FALSE);
++ gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
++ gtk_style_set_background (widget->style, icon_view->priv->bin_window, GTK_STATE_NORMAL);
+ gdk_window_show (icon_view->priv->bin_window);
+ }
+
diff --git a/recipes/gtk+/gtk+-2.6.10/gtk+-handhelds.patch b/recipes/gtk+/gtk+-2.6.10/gtk+-handhelds.patch
new file mode 100644
index 0000000000..20481f059b
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.6.10/gtk+-handhelds.patch
@@ -0,0 +1,236 @@
+--- gtk+-2.4.1/gtk/gtkarrow.c 2004-03-13 09:51:13.000000000 +1100
++++ gtk+-2.4.1/gtk/gtkarrow.c 2004-05-26 14:52:17.000000000 +1000
+@@ -29,7 +29,7 @@
+ #include "gtkarrow.h"
+ #include "gtkintl.h"
+
+-#define MIN_ARROW_SIZE 15
++#define MIN_ARROW_SIZE 7
+
+ enum {
+ PROP_0,
+@@ -53,6 +53,8 @@
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec);
++static void gtk_arrow_size_request (GtkWidget *arrow,
++ GtkRequisition *requisition);
+
+ GType
+ gtk_arrow_get_type (void)
+@@ -111,6 +113,7 @@
+ G_PARAM_READABLE | G_PARAM_WRITABLE));
+
+ widget_class->expose_event = gtk_arrow_expose;
++ widget_class->size_request = gtk_arrow_size_request;
+ }
+
+ static void
+@@ -166,13 +169,18 @@
+ }
+
+ static void
++gtk_arrow_size_request (GtkWidget *arrow,
++ GtkRequisition *requisition)
++{
++ requisition->width = MIN_ARROW_SIZE + GTK_MISC (arrow)->xpad * 2;
++ requisition->height = MIN_ARROW_SIZE + GTK_MISC (arrow)->ypad * 2;
++}
++
++static void
+ gtk_arrow_init (GtkArrow *arrow)
+ {
+ GTK_WIDGET_SET_FLAGS (arrow, GTK_NO_WINDOW);
+
+- GTK_WIDGET (arrow)->requisition.width = MIN_ARROW_SIZE + GTK_MISC (arrow)->xpad * 2;
+- GTK_WIDGET (arrow)->requisition.height = MIN_ARROW_SIZE + GTK_MISC (arrow)->ypad * 2;
+-
+ arrow->arrow_type = GTK_ARROW_RIGHT;
+ arrow->shadow_type = GTK_SHADOW_OUT;
+ }
+--- gtk+-2.4.1/gtk/gtkcalendar.c 2004-03-06 14:37:26.000000000 +1100
++++ gtk+-2.4.1/gtk/gtkcalendar.c 2004-05-26 14:58:57.000000000 +1000
+@@ -340,6 +340,9 @@
+ static void gtk_calendar_select_and_focus_day (GtkCalendar *calendar,
+ guint day);
+
++static void gtk_calendar_do_select_day (GtkCalendar *calendar,
++ guint day);
++
+ static void gtk_calendar_paint_arrow (GtkWidget *widget,
+ guint arrow);
+ static void gtk_calendar_paint_day_num (GtkWidget *widget,
+@@ -861,13 +864,13 @@
+ if (month_len < calendar->selected_day)
+ {
+ calendar->selected_day = 0;
+- gtk_calendar_select_day (calendar, month_len);
++ gtk_calendar_do_select_day (calendar, month_len);
+ }
+ else
+ {
+ if (calendar->selected_day < 0)
+ calendar->selected_day = calendar->selected_day + 1 + month_length[leap (calendar->year)][calendar->month + 1];
+- gtk_calendar_select_day (calendar, calendar->selected_day);
++ gtk_calendar_do_select_day (calendar, calendar->selected_day);
+ }
+
+ gtk_widget_queue_draw (GTK_WIDGET (calendar));
+@@ -908,10 +911,10 @@
+ if (month_len < calendar->selected_day)
+ {
+ calendar->selected_day = 0;
+- gtk_calendar_select_day (calendar, month_len);
++ gtk_calendar_do_select_day (calendar, month_len);
+ }
+ else
+- gtk_calendar_select_day (calendar, calendar->selected_day);
++ gtk_calendar_do_select_day (calendar, calendar->selected_day);
+
+ gtk_widget_queue_draw (GTK_WIDGET (calendar));
+ gtk_calendar_thaw (calendar);
+@@ -939,10 +942,10 @@
+ if (month_len < calendar->selected_day)
+ {
+ calendar->selected_day = 0;
+- gtk_calendar_select_day (calendar, month_len);
++ gtk_calendar_do_select_day (calendar, month_len);
+ }
+ else
+- gtk_calendar_select_day (calendar, calendar->selected_day);
++ gtk_calendar_do_select_day (calendar, calendar->selected_day);
+
+ gtk_widget_queue_draw (GTK_WIDGET (calendar));
+ gtk_calendar_thaw (calendar);
+@@ -974,10 +977,10 @@
+ if (month_len < calendar->selected_day)
+ {
+ calendar->selected_day = 0;
+- gtk_calendar_select_day (calendar, month_len);
++ gtk_calendar_do_select_day (calendar, month_len);
+ }
+ else
+- gtk_calendar_select_day (calendar, calendar->selected_day);
++ gtk_calendar_do_select_day (calendar, calendar->selected_day);
+
+ gtk_widget_queue_draw (GTK_WIDGET (calendar));
+ gtk_calendar_thaw (calendar);
+@@ -2480,9 +2483,9 @@
+ return TRUE;
+ }
+
+-void
+-gtk_calendar_select_day (GtkCalendar *calendar,
+- guint day)
++static void
++gtk_calendar_do_select_day (GtkCalendar *calendar,
++ guint day)
+ {
+ g_return_if_fail (GTK_IS_CALENDAR (calendar));
+ g_return_if_fail (day <= 31);
+@@ -2499,6 +2502,13 @@
+ if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar)))
+ gtk_calendar_paint_day_num (GTK_WIDGET (calendar), selected_day);
+ }
++}
++
++void
++gtk_calendar_select_day (GtkCalendar *calendar,
++ guint day)
++{
++ gtk_calendar_do_select_day (calendar, day);
+
+ calendar->selected_day = day;
+
+--- gtk+-2.4.1/gtk/gtkentry.c 2004-04-22 08:08:08.000000000 +1000
++++ gtk+-2.4.1/gtk/gtkentry.c 2004-05-26 14:52:17.000000000 +1000
+@@ -557,6 +557,15 @@
+ 0.0,
+ G_PARAM_READABLE | G_PARAM_WRITABLE));
+
++ gtk_widget_class_install_style_property (widget_class,
++ g_param_spec_int ("min_width",
++ _("Minimum width"),
++ _("Minimum width of the entry field"),
++ 0,
++ G_MAXINT,
++ MIN_ENTRY_WIDTH,
++ G_PARAM_READABLE));
++
+ signals[POPULATE_POPUP] =
+ g_signal_new ("populate_popup",
+ G_OBJECT_CLASS_TYPE (gobject_class),
+@@ -1124,7 +1133,7 @@
+ {
+ GtkEntry *entry = GTK_ENTRY (widget);
+ PangoFontMetrics *metrics;
+- gint xborder, yborder;
++ gint xborder, yborder, min_width;
+ PangoContext *context;
+
+ gtk_widget_ensure_style (widget);
+@@ -1140,9 +1149,11 @@
+
+ xborder += INNER_BORDER;
+ yborder += INNER_BORDER;
+-
++
++ gtk_widget_style_get (widget, "min_width", &min_width, NULL);
++
+ if (entry->width_chars < 0)
+- requisition->width = MIN_ENTRY_WIDTH + xborder * 2;
++ requisition->width = min_width + xborder * 2;
+ else
+ {
+ gint char_width = pango_font_metrics_get_approximate_char_width (metrics);
+--- gtk+-2.4.1/gtk/gtkrange.c 2004-03-06 14:38:08.000000000 +1100
++++ gtk+-2.4.1/gtk/gtkrange.c 2004-05-26 14:52:17.000000000 +1000
+@@ -180,6 +180,7 @@
+ static GtkWidgetClass *parent_class = NULL;
+ static guint signals[LAST_SIGNAL];
+
++static GdkAtom recognize_protocols_atom, atom_atom;
+
+ GType
+ gtk_range_get_type (void)
+@@ -220,6 +221,9 @@
+ object_class = (GtkObjectClass*) class;
+ widget_class = (GtkWidgetClass*) class;
+
++ recognize_protocols_atom = gdk_atom_intern ("RECOGNIZE_PROTOCOLS", FALSE);
++ atom_atom = gdk_atom_intern ("ATOM", FALSE);
++
+ parent_class = g_type_class_peek_parent (class);
+
+ gobject_class->set_property = gtk_range_set_property;
+@@ -815,6 +819,12 @@
+ &attributes, attributes_mask);
+ gdk_window_set_user_data (range->event_window, range);
+
++ gdk_property_change (range->event_window,
++ recognize_protocols_atom,
++ atom_atom,
++ 32, GDK_PROP_MODE_REPLACE,
++ NULL, 0);
++
+ widget->style = gtk_style_attach (widget->style, widget->window);
+ }
+
+@@ -1186,7 +1196,7 @@
+
+ /* ignore presses when we're already doing something else. */
+ if (range->layout->grab_location != MOUSE_OUTSIDE)
+- return FALSE;
++ return TRUE;
+
+ range->layout->mouse_x = event->x;
+ range->layout->mouse_y = event->y;
+@@ -1364,7 +1374,7 @@
+ return TRUE;
+ }
+
+- return FALSE;
++ return TRUE;
+ }
+
+ /**
diff --git a/recipes/gtk+/gtk+-2.6.10/gtk.keynav.gtkcombobox.patch b/recipes/gtk+/gtk+-2.6.10/gtk.keynav.gtkcombobox.patch
new file mode 100755
index 0000000000..6363ecd23a
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.6.10/gtk.keynav.gtkcombobox.patch
@@ -0,0 +1,238 @@
+--- /data/zzz/gtk-2.6/gtk+-2.6.10/gtk/gtkcombobox.c 2005-08-18 22:10:57.000000000 +0800
++++ gtk/gtkcombobox.c 2006-06-22 11:24:32.000000000 +0800
+@@ -54,6 +54,11 @@
+
+ /* WELCOME, to THE house of evil code */
+
++#define HILDON_MENU_COMBO_MAX_WIDTH 406
++#define HILDON_MENU_COMBO_MIN_WIDTH 66
++#define HILDON_MENU_COMBO_MAX_HEIGHT 305
++#define HILDON_MENU_COMBO_MIN_HEIGHT 70
++
+ typedef struct _ComboCellInfo ComboCellInfo;
+ struct _ComboCellInfo
+ {
+@@ -1199,6 +1204,8 @@ gtk_combo_box_menu_position_below (GtkMe
+ gint monitor_num;
+ GdkRectangle monitor;
+
++ g_message ("%s", __FUNCTION__);
++
+ /* FIXME: is using the size request here broken? */
+ child = GTK_BIN (combo_box)->child;
+
+@@ -1240,6 +1247,7 @@ gtk_combo_box_menu_position_below (GtkMe
+ *push_in = FALSE;
+ }
+
++
+ static void
+ gtk_combo_box_menu_position_over (GtkMenu *menu,
+ gint *x,
+@@ -1247,69 +1255,119 @@ gtk_combo_box_menu_position_over (GtkMen
+ gboolean *push_in,
+ gpointer user_data)
+ {
+- GtkComboBox *combo_box;
+- GtkWidget *active;
+ GtkWidget *child;
+ GtkWidget *widget;
++ GtkWidget *active;
+ GtkRequisition requisition;
+- GList *children;
+- gint screen_width;
++ gint screen_width, screen_height;
+ gint menu_xpos;
+ gint menu_ypos;
+- gint menu_width;
++ gint menu_width, menu_height;
++ gint menu_ypad;
++ gint full_menu_height;
++ gint total_y_padding;
+
+ g_return_if_fail (GTK_IS_COMBO_BOX (user_data));
+-
+- combo_box = GTK_COMBO_BOX (user_data);
+- widget = GTK_WIDGET (combo_box);
+
+- gtk_widget_get_child_requisition (GTK_WIDGET (menu), &requisition);
++ widget = GTK_WIDGET (user_data);
++ child = GTK_BIN (user_data)->child;
++
++ /* We need to realize the menu, as we are playing with menu item coordinates
++ * inside. */
++ gtk_widget_realize (GTK_WIDGET (menu));
++
++ gtk_widget_get_child_requisition (menu->toplevel, &requisition);
+ menu_width = requisition.width;
++ menu_height = requisition.height;
++
++ gtk_widget_get_child_requisition (GTK_WIDGET (menu), &requisition);
++ full_menu_height = requisition.height;
++
++ screen_width = gdk_screen_get_width (gtk_widget_get_screen (widget));
++ screen_height = gdk_screen_get_height (gtk_widget_get_screen (widget));
++
++ active = gtk_menu_get_active (menu);
+
+- active = gtk_menu_get_active (GTK_MENU (combo_box->priv->popup_widget));
+ gdk_window_get_origin (widget->window, &menu_xpos, &menu_ypos);
+
+ menu_xpos += widget->allocation.x;
+- menu_ypos += widget->allocation.y + widget->allocation.height / 2 - 2;
++ menu_ypos += widget->allocation.y;
+
+- if (active != NULL)
+- {
+- gtk_widget_get_child_requisition (active, &requisition);
+- menu_ypos -= requisition.height / 2;
+- }
++ /* RTL */
++ if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
++ menu_xpos = menu_xpos + widget->allocation.width - menu_width;
++
++ /* Substract borders */
++ gtk_widget_style_get (GTK_WIDGET (menu),
++ "vertical-padding", &menu_ypad,
++ NULL);
+
+- children = GTK_MENU_SHELL (combo_box->priv->popup_widget)->children;
+- while (children)
++ total_y_padding = menu_ypad + GTK_CONTAINER (menu)->border_width +
++ GTK_WIDGET (menu)->style->ythickness;
++
++ /* Substract scroll arrow height if needed, and calculate
++ * scroll_offset. */
++ if (full_menu_height > HILDON_MENU_COMBO_MAX_HEIGHT)
+ {
+- child = children->data;
++ GList *child;
++ int pos;
+
+- if (active == child)
+- break;
++ child = GTK_MENU_SHELL (menu)->children;
++ pos = 0;
+
+- if (GTK_WIDGET_VISIBLE (child))
+- {
+- gtk_widget_get_child_requisition (child, &requisition);
+- menu_ypos -= requisition.height;
+- }
++ while (child)
++ {
++ GtkWidget *child_widget = GTK_WIDGET (child->data);
++
++ if (active == child_widget)
++ break;
+
+- children = children->next;
++ if (GTK_WIDGET_VISIBLE (child))
++ {
++ pos += child_widget->allocation.height;
++
++ if (pos > HILDON_MENU_COMBO_MAX_HEIGHT)
++ menu->scroll_offset += child_widget->allocation.height;
++ }
++
++ child = child->next;
++ }
+ }
+
+- if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
+- menu_xpos = menu_xpos + widget->allocation.width - menu_width;
++ /* Try to get active item and widget lined up */
++ if (active != NULL)
++ {
++ gint new_menu_ypos;
++
++ new_menu_ypos = menu_ypos - active->allocation.y - total_y_padding +
++ menu->scroll_offset;
++ if (new_menu_ypos < 0 || (new_menu_ypos + menu_height) > screen_height)
++ {
++ /* Menu doesn't fit - try to get the last item lined up. */
++ new_menu_ypos = menu_ypos - menu_height + total_y_padding +
++ active->allocation.height;
++ }
++
++ menu_ypos = new_menu_ypos;
++ }
++ else
++ menu_ypos -= total_y_padding; /* Line up with first item */
+
+ /* Clamp the position on screen */
+- screen_width = gdk_screen_get_width (gtk_widget_get_screen (widget));
+-
+ if (menu_xpos < 0)
+ menu_xpos = 0;
+ else if ((menu_xpos + menu_width) > screen_width)
+ menu_xpos -= ((menu_xpos + menu_width) - screen_width);
+
++ if (menu_ypos < 0)
++ menu_ypos = 0;
++ else if ((menu_ypos + menu_height) > screen_height)
++ menu_ypos -= ((menu_ypos + menu_height) - screen_height);
++
+ *x = menu_xpos;
+ *y = menu_ypos;
+
+- *push_in = TRUE;
++ *push_in = FALSE;
+ }
+
+ static void
+@@ -3481,14 +3539,18 @@ gtk_combo_box_key_press (GtkWidget *wi
+
+ switch (event->keyval)
+ {
++ case GDK_Return:
++ case GDK_KP_Enter:
++ gtk_combo_box_popup (combo_box);
++ return TRUE;
+ case GDK_Down:
+ case GDK_KP_Down:
+- if (gtk_combo_box_get_active_iter (combo_box, &iter))
+- {
+- found = tree_next (combo_box, combo_box->priv->model,
+- &iter, &new_iter, FALSE);
+- break;
+- }
++ if (!gtk_widget_keynav_failed (GTK_WIDGET(combo_box), GTK_DIR_RIGHT))
++ {
++ found = FALSE;
++ gtk_widget_child_focus (gtk_widget_get_toplevel (GTK_WIDGET(combo_box)), GTK_DIR_TAB_FORWARD);
++ }
++ break;
+ /* else fall through */
+ case GDK_Page_Up:
+ case GDK_KP_Page_Up:
+@@ -3496,22 +3558,21 @@ gtk_combo_box_key_press (GtkWidget *wi
+ case GDK_KP_Home:
+ found = tree_first (combo_box, combo_box->priv->model, &new_iter, FALSE);
+ break;
+-
+ case GDK_Up:
+ case GDK_KP_Up:
+- if (gtk_combo_box_get_active_iter (combo_box, &iter))
+- {
+- found = tree_prev (combo_box, combo_box->priv->model,
+- &iter, &new_iter, FALSE);
+- break;
+- }
++ if (!gtk_widget_keynav_failed (GTK_WIDGET(combo_box), GTK_DIR_LEFT))
++ {
++ found = FALSE;
++ gtk_widget_child_focus (gtk_widget_get_toplevel (GTK_WIDGET(combo_box)), GTK_DIR_TAB_BACKWARD);
++ }
++ break;
+ /* else fall through */
+ case GDK_Page_Down:
+ case GDK_KP_Page_Down:
+ case GDK_End:
+ case GDK_KP_End:
+ found = tree_last (combo_box, combo_box->priv->model, &new_iter, FALSE);
+- break;
++ break;
+ default:
+ return FALSE;
+ }
diff --git a/recipes/gtk+/gtk+-2.6.10/gtk.keynav.gtkentry.patch b/recipes/gtk+/gtk+-2.6.10/gtk.keynav.gtkentry.patch
new file mode 100755
index 0000000000..def741af5d
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.6.10/gtk.keynav.gtkentry.patch
@@ -0,0 +1,16 @@
+--- gtk/gtkentry.c 2005-08-18 22:10:57.000000000 +0800
++++ gtk/gtkentry.c 2006-05-29 14:42:55.980731414 +0800
+@@ -2386,6 +2386,13 @@ gtk_entry_move_cursor (GtkEntry *e
+ break;
+ case GTK_MOVEMENT_VISUAL_POSITIONS:
+ new_pos = gtk_entry_move_visually (entry, new_pos, count);
++ if (entry->current_pos == new_pos && !extend_selection)
++ {
++ if (!gtk_widget_keynav_failed (GTK_WIDGET(entry), count > 0 ? GTK_DIR_RIGHT : GTK_DIR_LEFT))
++ {
++ gtk_widget_child_focus (gtk_widget_get_toplevel (GTK_WIDGET(entry)), count > 0 ? GTK_DIR_TAB_FORWARD : GTK_DIR_TAB_BACKWARD);
++ }
++ }
+ break;
+ case GTK_MOVEMENT_WORDS:
+ while (count > 0)
diff --git a/recipes/gtk+/gtk+-2.6.10/gtk.keynav.gtkiconview.patch b/recipes/gtk+/gtk+-2.6.10/gtk.keynav.gtkiconview.patch
new file mode 100755
index 0000000000..6ac9629767
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.6.10/gtk.keynav.gtkiconview.patch
@@ -0,0 +1,91 @@
+--- /data/zzz/gtk-2.6/gtk+-2.6.10/gtk/gtkiconview.c 2005-08-18 22:10:58.000000000 +0800
++++ gtk/gtkiconview.c 2006-05-31 18:12:34.423427466 +0800
+@@ -2678,10 +2678,73 @@ find_item (GtkIconView *icon_view,
+
+ /* FIXME: this could be more efficient
+ */
+- row = current->row + row_ofs;
+- col = current->col + col_ofs;
++ int columns = (icon_view->priv->width - icon_view->priv->margin * 2 + icon_view->priv->column_spacing) / (icon_view->priv->column_spacing + current->width);
++ int rows = g_list_length (icon_view->priv->items) / columns;
++ if (g_list_length (icon_view->priv->items) % columns > 0)
++ rows++;
+
+- for (items = icon_view->priv->items; items; items = items->next)
++ items = g_list_last(icon_view->priv->items);
++ item = items->data;
++ if (col_ofs == 1) //right is pressed
++ {
++ if (current->col == item->col && current->row == (rows - 1)) //the current item is the last one, wrap to the first item
++ {
++ row = 0;
++ col = 0;
++ }
++ else if (current->col == (columns - 1)) //the current item is the rightmost one
++ {
++ row = current->row + row_ofs + 1;
++ col = 0;
++ }
++ else
++ {
++ row = current->row + row_ofs;
++ col = current->col + col_ofs;
++ }
++ }
++ else if (col_ofs == -1) //left is pressed
++ {
++ if (current->col == 0) //the current item is the leftmost one
++ {
++ if (current->row == 0) //the current item is the first one, wrap to the last item
++ {
++ row = rows - 1;
++ col = item->col;
++ }
++ else
++ {
++ row = current->row + row_ofs - 1;
++ col = columns - 1;
++ }
++ }
++ else
++ {
++ row = current->row + row_ofs;
++ col = current->col + col_ofs;
++ }
++ }
++ else if (row_ofs == 1) //down is pressed
++ {
++ if (current->row == (rows - 2) && item->col < current->col)// at the second last row
++ {
++ row = current->row + row_ofs;
++ col = 0;
++ }
++ else
++ {
++ row = current->row + row_ofs;
++ col = current->col + col_ofs;
++ }
++ }
++ else //up is pressed
++ {
++ row = current->row + row_ofs;
++ col = current->col + col_ofs;
++ }
++
++ g_message ("row:%d, col:%d", row, col);
++ for (items = icon_view->priv->items; items; items = items->next)
+ {
+ item = items->data;
+ if (item->row == row && item->col == col)
+@@ -2819,8 +2882,10 @@ gtk_icon_view_move_cursor_up_down (GtkIc
+ count, 0);
+
+ if (!item)
++ {
++ gtk_widget_child_focus (gtk_widget_get_toplevel (GTK_WIDGET(icon_view)), count > 0 ? GTK_DIR_TAB_FORWARD : GTK_DIR_TAB_BACKWARD);
+ return;
+-
++ }
+ if (icon_view->priv->ctrl_pressed ||
+ !icon_view->priv->shift_pressed ||
+ !icon_view->priv->anchor_item ||
diff --git a/recipes/gtk+/gtk+-2.6.10/gtk.keynav.gtkradiobutton.patch b/recipes/gtk+/gtk+-2.6.10/gtk.keynav.gtkradiobutton.patch
new file mode 100755
index 0000000000..4497261ec6
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.6.10/gtk.keynav.gtkradiobutton.patch
@@ -0,0 +1,32 @@
+--- /data/zzz/gtk-2.6/gtk+-2.6.10/gtk/gtkradiobutton.c 2005-08-18 22:10:58.000000000 +0800
++++ gtk/gtkradiobutton.c 2006-05-26 17:12:35.000000000 +0800
+@@ -522,6 +522,12 @@ gtk_radio_button_focus (GtkWidget
+
+ if (!new_focus)
+ {
++ if (!gtk_widget_keynav_failed (widget, direction))
++ {
++ g_slist_free (focus_list);
++ return FALSE;
++ }
++
+ tmp_list = focus_list;
+
+ while (tmp_list)
+@@ -542,8 +548,15 @@ gtk_radio_button_focus (GtkWidget
+
+ if (new_focus)
+ {
++ GtkSettings *settings = gtk_widget_get_settings (widget);
++ gboolean cursor_only_focus;
++
++ g_object_get (settings,
++ "gtk-cursor-only-focus", &cursor_only_focus,
++ NULL);
+ gtk_widget_grab_focus (new_focus);
+- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (new_focus), TRUE);
++ if (!cursor_only_focus)
++ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (new_focus), TRUE);
+ }
+
+ return TRUE;
diff --git a/recipes/gtk+/gtk+-2.6.10/gtk.keynav.gtksettings.patch b/recipes/gtk+/gtk+-2.6.10/gtk.keynav.gtksettings.patch
new file mode 100755
index 0000000000..0c3beeec49
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.6.10/gtk.keynav.gtksettings.patch
@@ -0,0 +1,38 @@
+--- /data/zzz/gtk-2.6/gtk+-2.6.10/gtk/gtksettings.c 2005-08-18 22:10:59.000000000 +0800
++++ gtk/gtksettings.c 2006-05-29 10:29:35.000000000 +0800
+@@ -72,7 +72,8 @@ enum {
+ PROP_XFT_RGBA,
+ PROP_XFT_DPI,
+ #endif
+- PROP_ALTERNATIVE_BUTTON_ORDER
++ PROP_ALTERNATIVE_BUTTON_ORDER,
++ PROP_CURSOR_ONLY_FOCUS
+ };
+
+
+@@ -435,6 +436,25 @@ gtk_settings_class_init (GtkSettingsClas
+ G_PARAM_READWRITE),
+ NULL);
+ g_assert (result == PROP_ALTERNATIVE_BUTTON_ORDER);
++
++ /**
++ * GtkSettings:gtk-cursor-only-focus:
++ *
++ * When TRUE, keyboard navigation should be able to reach all widgets
++ * by using the cursor keys only. Tab, Shift etc. keys can't be expected
++ * to be present on the used input device.
++ *
++ * Since: 2.10
++ */
++ result = settings_install_property_parser (class,
++ g_param_spec_boolean ("gtk-cursor-only-focus",
++ P_("Cursor Only Focus"),
++ P_("When TRUE, there are only cursor keys available to navigate widgets"),
++ FALSE,
++ G_PARAM_READWRITE),
++ NULL);
++
++ g_assert (result == PROP_CURSOR_ONLY_FOCUS);
+ }
+
+ static void
diff --git a/recipes/gtk+/gtk+-2.6.10/gtk.keynav.gtktextview.patch b/recipes/gtk+/gtk+-2.6.10/gtk.keynav.gtktextview.patch
new file mode 100755
index 0000000000..e3231b38d0
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.6.10/gtk.keynav.gtktextview.patch
@@ -0,0 +1,25 @@
+--- /data/zzz/gtk-2.6/gtk+-2.6.10/gtk/gtktextview.c 2005-08-18 22:10:59.000000000 +0800
++++ gtk/gtktextview.c 2006-07-03 15:34:19.880257250 +0800
+@@ -3855,6 +3855,22 @@ gtk_text_view_key_press_event (GtkWidget
+
+ insert = gtk_text_buffer_get_insert (get_buffer (text_view));
+ gtk_text_buffer_get_iter_at_mark (get_buffer (text_view), &iter, insert);
++
++ int lineCount = gtk_text_buffer_get_line_count (get_buffer (text_view));
++ int curLine = gtk_text_iter_get_line (&iter);
++ if (curLine == 0 && (event->keyval == GDK_Up || event->keyval == GDK_KP_Up)
++ && (!gtk_widget_keynav_failed (GTK_WIDGET(text_view), GTK_DIR_UP)))
++ {
++ gtk_text_view_move_focus (text_view,GTK_DIR_TAB_BACKWARD);
++ return TRUE;
++ }
++ else if (curLine == (lineCount - 1) && (event->keyval == GDK_Down || event->keyval == GDK_KP_Down)
++ && (!gtk_widget_keynav_failed (GTK_WIDGET(text_view), GTK_DIR_DOWN)))
++ {
++ gtk_text_view_move_focus (text_view,GTK_DIR_TAB_FORWARD);
++ return TRUE;
++ }
++
+ can_insert = gtk_text_iter_can_insert (&iter, text_view->editable);
+ if (can_insert &&
+ gtk_im_context_filter_keypress (text_view->im_context, event))
diff --git a/recipes/gtk+/gtk+-2.6.10/gtk.keynav.gtktreeview.patch b/recipes/gtk+/gtk+-2.6.10/gtk.keynav.gtktreeview.patch
new file mode 100755
index 0000000000..f83558d879
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.6.10/gtk.keynav.gtktreeview.patch
@@ -0,0 +1,121 @@
+--- /data/zzz/gtk-2.6/gtk+-2.6.10/gtk/gtktreeview.c 2006-06-29 14:06:27.099142881 +0800
++++ gtk/gtktreeview.c 2006-06-29 14:06:53.746305635 +0800
+@@ -4198,6 +4198,118 @@ gtk_tree_view_key_press (GtkWidget *wi
+ return TRUE;
+ }
+
++ GtkTreeViewColumn *focus_column;
++ GtkTreePath *tree_path;
++ gtk_tree_view_get_cursor (tree_view, &tree_path, &focus_column);
++ GtkTreeModel *tree_model = gtk_tree_view_get_model (tree_view);
++
++ if (tree_model && tree_path
++ && (event->keyval == GDK_Up || event->keyval == GDK_KP_Up
++ || event->keyval == GDK_Down || event->keyval == GDK_KP_Down))
++ {
++ GtkTreeIter cur_iter;
++ if (gtk_tree_model_get_iter (tree_model, &cur_iter, tree_path))
++ {
++ GtkTreeIter iter;
++ GtkTreePath *path;
++ if ((event->keyval == GDK_Up || event->keyval == GDK_KP_Up)
++ && !gtk_widget_keynav_failed (GTK_WIDGET(tree_view), GTK_DIR_UP))
++ {
++ gtk_tree_model_get_iter_first (tree_model, &iter);
++ path = gtk_tree_model_get_path (tree_model, &iter);
++ if (gtk_tree_path_compare (tree_path, path) == 0)
++ {
++ gtk_widget_child_focus (gtk_widget_get_toplevel (GTK_WIDGET(tree_view)), GTK_DIR_TAB_BACKWARD);
++ gtk_tree_path_free (tree_path);
++ gtk_tree_path_free (path);
++ return TRUE;
++ }
++ gtk_tree_path_free (path);
++ }
++ if ((event->keyval == GDK_Down || event->keyval == GDK_KP_Down)
++ && !gtk_widget_keynav_failed (GTK_WIDGET(tree_view), GTK_DIR_DOWN))
++ {
++ if (!gtk_tree_model_iter_next (tree_model, &cur_iter))//cur_iter is the last one at its level
++ {
++ gtk_tree_model_get_iter (tree_model, &cur_iter, tree_path);
++
++ if (!gtk_tree_model_iter_parent (tree_model, &iter, &cur_iter))//cur_iter is at toplevel
++ {
++ if (!gtk_tree_model_iter_has_child (tree_model, &cur_iter) || !gtk_tree_view_row_expanded (tree_view, tree_path))
++ {
++ gtk_widget_child_focus (gtk_widget_get_toplevel (GTK_WIDGET(tree_view)), GTK_DIR_TAB_FORWARD);
++ gtk_tree_path_free (tree_path);
++ return TRUE;
++ }
++ }
++ else//check if every ancestor of cur_iter is the last one at its level
++ {
++ path = gtk_tree_model_get_path (tree_model, &iter);
++ int depth = gtk_tree_path_get_depth (path);
++ int i;
++ for (i = 0; i < depth; i++)
++ {
++ if (!gtk_tree_model_iter_next (tree_model, &iter))
++ {
++ gtk_tree_path_up (path);
++ if (gtk_tree_path_to_string (path))
++ gtk_tree_model_get_iter (tree_model, &iter, path);
++ }
++ else
++ break;
++ }
++ if (i == depth)
++ {
++ if (!gtk_tree_model_iter_has_child (tree_model, &cur_iter) || !gtk_tree_view_row_expanded (tree_view, tree_path))
++ {
++ gtk_widget_child_focus (gtk_widget_get_toplevel (GTK_WIDGET(tree_view)), GTK_DIR_TAB_FORWARD);
++ gtk_tree_path_free (path);
++ gtk_tree_path_free (tree_path);
++ return TRUE;
++ }
++ }
++ gtk_tree_path_free (path);
++ }
++ }
++ }
++ }
++ }
++
++ if (tree_view->priv->columns && tree_path
++ && (event->keyval == GDK_Left || event->keyval == GDK_KP_Left
++ || event->keyval == GDK_Right || event->keyval == GDK_KP_Right))
++ {
++ list = tree_view->priv->columns;
++ guint length = g_list_length (list);
++ guint i = 0;
++ while (list)
++ {
++ GtkTreeViewColumn *column = GTK_TREE_VIEW_COLUMN (list->data);
++
++ if (column == focus_column)
++ {
++ if (i == 0 && (event->keyval == GDK_Left || event->keyval == GDK_KP_Left))
++ {
++ list = g_list_last (list);
++ gtk_tree_view_set_cursor (tree_view, tree_path, GTK_TREE_VIEW_COLUMN (list->data), FALSE);
++ gtk_tree_path_free (tree_path);
++ return TRUE;
++ }
++ if (i == length - 1 && (event->keyval == GDK_Right || event->keyval == GDK_KP_Right))
++ {
++ list = g_list_first (list);
++ gtk_tree_view_set_cursor (tree_view, tree_path, GTK_TREE_VIEW_COLUMN (list->data), FALSE);
++ gtk_tree_path_free (tree_path);
++ return TRUE;
++ }
++ }
++ list = list->next;
++ i++;
++ }
++ }
++
++ gtk_tree_path_free (tree_path);
++
+ if (tree_view->priv->columns && (event->state & GDK_SHIFT_MASK)
+ && (event->keyval == GDK_Left || event->keyval == GDK_KP_Left
+ || event->keyval == GDK_Right || event->keyval == GDK_KP_Right))
diff --git a/recipes/gtk+/gtk+-2.6.10/gtk.keynav.gtkwidget.patch b/recipes/gtk+/gtk+-2.6.10/gtk.keynav.gtkwidget.patch
new file mode 100755
index 0000000000..7cf4e13cf6
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.6.10/gtk.keynav.gtkwidget.patch
@@ -0,0 +1,127 @@
+diff -r -u -p /data/zzz/gtk-2.6/gtk+-2.6.10/gtk/widget/gtkwidget.c gtk/widget/gtkwidget.c
+--- /data/zzz/gtk-2.6/gtk+-2.6.10/gtk/widget/gtkwidget.c 2006-05-30 13:57:49.732943065 +0800
++++ gtk/gtkwidget.c 2006-05-30 13:57:24.716589268 +0800
+@@ -120,6 +120,7 @@ enum {
+ ACCEL_CLOSURES_CHANGED,
+ SCREEN_CHANGED,
+ CAN_ACTIVATE_ACCEL,
++ KEYNAV_FAILED,
+ LAST_SIGNAL
+ };
+
+@@ -202,6 +203,8 @@ static gboolean gtk_widget_real_focus_o
+ GdkEventFocus *event);
+ static gboolean gtk_widget_real_focus (GtkWidget *widget,
+ GtkDirectionType direction);
++static gboolean gtk_widget_real_keynav_failed (GtkWidget *widget,
++ GtkDirectionType direction);
+ static PangoContext* gtk_widget_peek_pango_context (GtkWidget *widget);
+ static void gtk_widget_propagate_state (GtkWidget *widget,
+ GtkStateData *data);
+@@ -363,6 +366,7 @@ gtk_widget_class_init (GtkWidgetClass *k
+ klass->mnemonic_activate = gtk_widget_real_mnemonic_activate;
+ klass->grab_focus = gtk_widget_real_grab_focus;
+ klass->focus = gtk_widget_real_focus;
++ klass->keynav_failed = gtk_widget_real_keynav_failed;
+ klass->event = NULL;
+ klass->button_press_event = NULL;
+ klass->button_release_event = NULL;
+@@ -1368,6 +1372,16 @@ gtk_widget_class_init (GtkWidgetClass *k
+ _gtk_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ GDK_TYPE_SCREEN);
++
++ widget_signals[KEYNAV_FAILED] =
++ g_signal_new (("keynav_failed"),
++ G_TYPE_FROM_CLASS (object_class),
++ G_SIGNAL_RUN_LAST,
++ G_STRUCT_OFFSET (GtkWidgetClass, keynav_failed),
++ _gtk_boolean_handled_accumulator, NULL,
++ _gtk_marshal_BOOLEAN__ENUM,
++ G_TYPE_BOOLEAN, 1,
++ GTK_TYPE_DIRECTION_TYPE);
+ /**
+ * GtkWidget::can-activate-accel:
+ * @widget: the object which received the signal
+@@ -4044,6 +4058,34 @@ gtk_widget_real_focus (GtkWidget
+ return FALSE;
+ }
+
++static gboolean
++gtk_widget_real_keynav_failed (GtkWidget *widget,
++ GtkDirectionType direction)
++{
++ GtkSettings *settings = gtk_widget_get_settings (widget);
++ gboolean cursor_only_focus;
++
++ g_object_get (settings, "gtk-cursor-only-focus", &cursor_only_focus, NULL);
++
++ switch (direction)
++ {
++ case GTK_DIR_TAB_FORWARD:
++ case GTK_DIR_TAB_BACKWARD:
++ return FALSE;
++
++ case GTK_DIR_UP:
++ case GTK_DIR_DOWN:
++ case GTK_DIR_LEFT:
++ case GTK_DIR_RIGHT:
++ if (cursor_only_focus)
++ return FALSE;
++ }
++
++ gdk_beep ();
++
++ return TRUE;
++}
++
+ /**
+ * gtk_widget_is_focus:
+ * @widget: a #GtkWidget
+@@ -5500,6 +5542,20 @@ gtk_widget_child_focus (GtkWidget
+ return return_val;
+ }
+
++gboolean
++gtk_widget_keynav_failed (GtkWidget *widget,
++ GtkDirectionType direction)
++{
++ gboolean return_val;
++
++ g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
++
++ g_signal_emit (widget, widget_signals[KEYNAV_FAILED], 0,
++ direction, &return_val);
++
++ return return_val;
++}
++
+ /**
+ * gtk_widget_set_uposition:
+ * @widget: a #GtkWidget
+diff -r -u -p /data/zzz/gtk-2.6/gtk+-2.6.10/gtk/widget/gtkwidget.h gtk/widget/gtkwidget.h
+--- /data/zzz/gtk-2.6/gtk+-2.6.10/gtk/widget/gtkwidget.h 2006-05-30 13:57:49.736942642 +0800
++++ gtk/gtkwidget.h 2006-05-30 13:57:24.716589268 +0800
+@@ -406,8 +406,9 @@ struct _GtkWidgetClass
+ gboolean (*can_activate_accel) (GtkWidget *widget,
+ guint signal_id);
+
++ gboolean (* keynav_failed) (GtkWidget *widget,
++ GtkDirectionType direction);
+ /* Padding for future expansion */
+- void (*_gtk_reserved2) (void);
+ void (*_gtk_reserved3) (void);
+ void (*_gtk_reserved4) (void);
+ void (*_gtk_reserved5) (void);
+@@ -562,7 +563,8 @@ GdkWindow *gtk_widget_get_parent_window
+
+ gboolean gtk_widget_child_focus (GtkWidget *widget,
+ GtkDirectionType direction);
+-
++gboolean gtk_widget_keynav_failed (GtkWidget *widget,
++ GtkDirectionType direction);
+ void gtk_widget_set_size_request (GtkWidget *widget,
+ gint width,
+ gint height);
+Only in gtk/widget: gtkwidget.h.bak
+Only in gtk/widget: gtkwidget.lo
diff --git a/recipes/gtk+/gtk+-2.6.10/hardcoded_libtool.patch b/recipes/gtk+/gtk+-2.6.10/hardcoded_libtool.patch
new file mode 100644
index 0000000000..b2afddcc61
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.6.10/hardcoded_libtool.patch
@@ -0,0 +1,29 @@
+--- gtk+-2.6.0/configure.in.old 2005-01-01 16:23:45.000000000 +0000
++++ gtk+-2.6.0/configure.in 2005-01-01 16:24:03.000000000 +0000
+@@ -360,7 +360,7 @@
+ AC_MSG_CHECKING([Whether to write dependencies into .pc files])
+ case $enable_explicit_deps in
+ auto)
+- deplib_check_method=`(./libtool --config; echo eval echo \\$deplib_check_method) | sh`
++ deplib_check_method=`($host_alias-libtool --config; echo eval echo \\$deplib_check_method) | sh`
+ if test "X$deplib_check_method" = Xnone || test "x$enable_static" = xyes ; then
+ enable_explicit_deps=yes
+ else
+@@ -688,7 +688,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/'`
+@@ -1512,7 +1512,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_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/recipes/gtk+/gtk+-2.6.10/help.patch b/recipes/gtk+/gtk+-2.6.10/help.patch
new file mode 100644
index 0000000000..268b3dd9e2
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.6.10/help.patch
@@ -0,0 +1,158 @@
+diff -NaurBb gtk+-2.6.10.old/gtk/Makefile.am gtk+-2.6.10/gtk/Makefile.am
+--- gtk+-2.6.10.old/gtk/Makefile.am 2005-08-18 16:10:56.000000000 +0200
++++ gtk+-2.6.10/gtk/Makefile.am 2005-12-29 01:23:52.000000000 +0100
+@@ -520,6 +520,7 @@
+ gtkwidget.c \
+ gtkwindow-decorate.c \
+ gtkwindow.c \
++ gpe-what.c \
+ xembed.h
+
+ if OS_UNIX
+diff -NaurBb gtk+-2.6.10.old/gtk/gpe-what.c gtk+-2.6.10/gtk/gpe-what.c
+--- gtk+-2.6.10.old/gtk/gpe-what.c 1970-01-01 01:00:00.000000000 +0100
++++ gtk+-2.6.10/gtk/gpe-what.c 2005-12-29 00:59:26.000000000 +0100
+@@ -0,0 +1,130 @@
++/*
++ * Copyright (C) 2002, 2003 Philip Blundell <philb@gnu.org>
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; if not, write to the
++ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++ * Boston, MA 02111-1307, USA.
++ */
++
++#include <stdio.h>
++#include <string.h>
++#include <stdlib.h>
++
++#include <X11/Xlib.h>
++#include <X11/Xatom.h>
++
++#ifdef GDK_WINDOWING_X11
++#error X11 required
++#endif
++
++#include "gtkwidget.h"
++#include "gtktooltips.h"
++#include "x11/gdkx.h"
++#include "config.h"
++
++#include <libintl.h>
++
++#define _(x) dgettext(GETTEXT_PACKAGE, x)
++
++static GdkAtom help_atom;
++static gboolean gpe_what_initialised;
++
++static GSList *widgets;
++
++static void
++send_text (Display *dpy, Window w, char *text)
++{
++ Atom help_xatom = gdk_x11_atom_to_xatom (help_atom);
++
++ gdk_error_trap_push ();
++
++ XChangeProperty (dpy, w, help_xatom, XA_STRING, 8, PropModeReplace, text, strlen (text));
++
++ XFlush (dpy);
++
++ gdk_error_trap_pop ();
++}
++
++static GdkFilterReturn
++filter_func (GdkXEvent *xev, GdkEvent *ev, gpointer p)
++{
++ XClientMessageEvent *xc = (XClientMessageEvent *)xev;
++ GSList *list;
++ Window sender = xc->data.l[0];
++
++ for (list = widgets; list; list = list->next)
++ {
++ GtkWidget *widget = GTK_WIDGET (list->data);
++ int x = xc->data.l[1], y = xc->data.l[2];
++ int ax, ay;
++
++ if (!GTK_WIDGET_DRAWABLE (widget)) continue;
++
++ if (GTK_WIDGET_NO_WINDOW (widget))
++ {
++ ax = widget->allocation.x;
++ ay = widget->allocation.y;
++ }
++ else
++ {
++ ax = 0;
++ ay = 0;
++ }
++
++ if (widget->window == ev->any.window
++ && x >= ax && x < ax + widget->allocation.width
++ && y >= ay && y < ay + widget->allocation.height)
++ {
++ GtkTooltipsData *data = gtk_tooltips_data_get (widget);
++ if (data)
++ {
++ send_text (GDK_WINDOW_XDISPLAY (widget->window), sender,
++ data->tip_private ? data->tip_private : data->tip_text);
++ return GDK_FILTER_CONTINUE;
++ }
++ }
++ }
++
++ send_text (GDK_WINDOW_XDISPLAY (ev->any.window), sender, _("No help available."));
++
++ return GDK_FILTER_CONTINUE;
++}
++
++void
++gpe_what_mark_widget (GtkWidget *widget)
++{
++ if (!gpe_what_initialised)
++ {
++ help_atom = gdk_atom_intern ("_GPE_INTERACTIVE_HELP", FALSE);
++
++ gdk_add_client_message_filter (help_atom, filter_func, NULL);
++
++ gpe_what_initialised = TRUE;
++ }
++
++ if (widget->window)
++ {
++ widgets = g_slist_prepend (widgets, widget);
++
++ gdk_property_change (widget->window,
++ help_atom,
++ help_atom,
++ 8,
++ GDK_PROP_MODE_REPLACE,
++ NULL,
++ 0);
++ }
++ else
++ abort ();
++}
+diff -NaurBb gtk+-2.6.10.old/gtk/gtkwidget.c gtk+-2.6.10/gtk/gtkwidget.c
+--- gtk+-2.6.10.old/gtk/gtkwidget.c 2005-08-18 16:10:59.000000000 +0200
++++ gtk+-2.6.10/gtk/gtkwidget.c 2005-12-29 00:59:26.000000000 +0100
+@@ -2285,6 +2285,9 @@
+
+ g_signal_emit (widget, widget_signals[REALIZE], 0);
+
++ extern void gpe_what_mark_widget (GtkWidget *widget);
++ gpe_what_mark_widget (widget);
++
+ if (GTK_WIDGET_HAS_SHAPE_MASK (widget))
+ {
+ shape_info = g_object_get_qdata (G_OBJECT (widget), quark_shape_info);
diff --git a/recipes/gtk+/gtk+-2.6.10/menu-deactivate.patch b/recipes/gtk+/gtk+-2.6.10/menu-deactivate.patch
new file mode 100644
index 0000000000..29e665fbf3
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.6.10/menu-deactivate.patch
@@ -0,0 +1,50 @@
+--- gtk+-2.4.4/gtk/gtkmenushell.c.old Thu Aug 26 23:45:28 2004
++++ gtk+-2.4.4/gtk/gtkmenushell.c Fri Aug 27 00:13:33 2004
+@@ -37,7 +37,7 @@
+ #include "gtktearoffmenuitem.h"
+ #include "gtkwindow.h"
+
+-#define MENU_SHELL_TIMEOUT 500
++#define MENU_SHELL_TIMEOUT 2000
+
+ enum {
+ DEACTIVATE,
+@@ -156,6 +156,7 @@
+ static GtkContainerClass *parent_class = NULL;
+ static guint menu_shell_signals[LAST_SIGNAL] = { 0 };
+
++static int last_crossing_time;
+
+ GType
+ gtk_menu_shell_get_type (void)
+@@ -418,6 +419,7 @@
+ gtk_grab_add (GTK_WIDGET (menu_shell));
+ menu_shell->have_grab = TRUE;
+ menu_shell->active = TRUE;
++ last_crossing_time = 0;
+ }
+ }
+
+@@ -545,6 +547,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)
+ {
+@@ -597,6 +606,8 @@
+ if (menu_shell->active)
+ {
+ menu_item = gtk_get_event_widget ((GdkEvent*) event);
++
++ last_crossing_time = event->time;
+
+ if (!menu_item ||
+ (GTK_IS_MENU_ITEM (menu_item) &&
diff --git a/recipes/gtk+/gtk+-2.6.10/menu-styling.patch b/recipes/gtk+/gtk+-2.6.10/menu-styling.patch
new file mode 100644
index 0000000000..8f792df190
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.6.10/menu-styling.patch
@@ -0,0 +1,22 @@
+#
+# This patch improves menu styling (based on version in 2.7.0
+# which features a background pixmap for the menu). ---Mickey.
+#
+--- gtk+-2.6.10/gtk/gtkmenu.c 2005-08-18 16:10:58.000000000 +0200
++++ gtk+-2.7.0/gtk/gtkmenu.c 2005-04-07 21:56:57.000000000 +0200
+@@ -2490,6 +2495,15 @@
+ arrow_size, arrow_size);
+ }
+ }
++ else if (event->window == menu->bin_window)
++ {
++ gtk_paint_box (widget->style,
++ menu->bin_window,
++ GTK_STATE_NORMAL,
++ GTK_SHADOW_OUT,
++ NULL, widget, "menu",
++ -border_x, -border_y, width, height);
++ }
+ }
+
+ static gboolean
diff --git a/recipes/gtk+/gtk+-2.6.10/no-demos.patch b/recipes/gtk+/gtk+-2.6.10/no-demos.patch
new file mode 100644
index 0000000000..2f10a30dda
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.6.10/no-demos.patch
@@ -0,0 +1,10 @@
+--- gtk+-2.4.1/Makefile.am~ 2004-01-17 22:15:56.000000000 +0000
++++ gtk+-2.4.1/Makefile.am 2004-05-08 12:25:32.000000000 +0100
+@@ -1,6 +1,6 @@
+ ## Makefile.am for GTK+
+
+-SRC_SUBDIRS = gdk-pixbuf gdk gtk modules demos tests contrib
++SRC_SUBDIRS = gdk-pixbuf gdk gtk modules tests contrib
+ SUBDIRS = po po-properties $(SRC_SUBDIRS) docs build m4macros
+
+ # require automake 1.4
diff --git a/recipes/gtk+/gtk+-2.6.10/no-xwc.patch b/recipes/gtk+/gtk+-2.6.10/no-xwc.patch
new file mode 100644
index 0000000000..affb4a303e
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.6.10/no-xwc.patch
@@ -0,0 +1,151 @@
+diff -urNd ../gtk+-2.6.0-r2/gtk+-2.6.0/gdk/x11/gdkdrawable-x11.c gtk+-2.6.0/gdk/x11/gdkdrawable-x11.c
+--- ../gtk+-2.6.0-r2/gtk+-2.6.0/gdk/x11/gdkdrawable-x11.c 2004-11-30 14:57:14 +00:00
++++ gtk+-2.6.0/gdk/x11/gdkdrawable-x11.c 2005-01-02 15:38:06 +00:00
+@@ -576,12 +576,14 @@
+ GDK_GC_GET_XGC (gc), x, y, (XChar2b *) text, text_length / 2);
+ }
+ }
++#ifdef HAVE_XWC
+ else if (font->type == GDK_FONT_FONTSET)
+ {
+ XFontSet fontset = (XFontSet) GDK_FONT_XFONT (font);
+ XmbDrawString (xdisplay, impl->xid,
+ fontset, GDK_GC_GET_XGC (gc), x, y, text, text_length);
+ }
++#endif
+ else
+ g_error("undefined font type\n");
+ }
+@@ -613,6 +615,7 @@
+ GDK_GC_GET_XGC (gc), x, y, text_8bit, text_length);
+ g_free (text_8bit);
+ }
++#ifdef HAVE_XWC
+ else if (font->type == GDK_FONT_FONTSET)
+ {
+ if (sizeof(GdkWChar) == sizeof(wchar_t))
+@@ -633,6 +636,7 @@
+ g_free (text_wchar);
+ }
+ }
++#endif
+ else
+ g_error("undefined font type\n");
+ }
+diff -urNd ../gtk+-2.6.0-r2/gtk+-2.6.0/gdk/x11/gdkfont-x11.c gtk+-2.6.0/gdk/x11/gdkfont-x11.c
+--- ../gtk+-2.6.0-r2/gtk+-2.6.0/gdk/x11/gdkfont-x11.c 2004-08-26 01:23:46 +01:00
++++ gtk+-2.6.0/gdk/x11/gdkfont-x11.c 2005-01-02 15:45:39 +00:00
+@@ -525,10 +525,12 @@
+ width = XTextWidth16 (xfont, (XChar2b *) text, text_length / 2);
+ }
+ break;
++#ifdef HAVE_XWC
+ case GDK_FONT_FONTSET:
+ fontset = (XFontSet) private->xfont;
+ width = XmbTextEscapement (fontset, text, text_length);
+ break;
++#endif
+ default:
+ width = 0;
+ }
+@@ -578,6 +580,7 @@
+ width = 0;
+ }
+ break;
++#ifdef HAVE_XWC
+ case GDK_FONT_FONTSET:
+ if (sizeof(GdkWChar) == sizeof(wchar_t))
+ {
+@@ -595,6 +598,7 @@
+ g_free (text_wchar);
+ }
+ break;
++#endif
+ default:
+ width = 0;
+ }
+@@ -667,6 +671,7 @@
+ if (descent)
+ *descent = overall.descent;
+ break;
++#ifdef HAVE_XWC
+ case GDK_FONT_FONTSET:
+ fontset = (XFontSet) private->xfont;
+ XmbTextExtents (fontset, text, text_length, &ink, &logical);
+@@ -681,6 +686,7 @@
+ if (descent)
+ *descent = ink.y + ink.height;
+ break;
++#endif
+ }
+
+ }
+@@ -753,6 +759,7 @@
+ *descent = overall.descent;
+ break;
+ }
++#ifdef HAVE_XWC
+ case GDK_FONT_FONTSET:
+ fontset = (XFontSet) private->xfont;
+
+@@ -780,6 +787,7 @@
+ if (descent)
+ *descent = ink.y + ink.height;
+ break;
++#endif
+ }
+
+ }
+diff -urNd ../gtk+-2.6.0-r2/gtk+-2.6.0/gdk/x11/gdkim-x11.c gtk+-2.6.0/gdk/x11/gdkim-x11.c
+--- ../gtk+-2.6.0-r2/gtk+-2.6.0/gdk/x11/gdkim-x11.c 2004-11-17 00:55:10 +00:00
++++ gtk+-2.6.0/gdk/x11/gdkim-x11.c 2005-01-02 15:42:04 +00:00
+@@ -48,6 +48,7 @@
+ void
+ _gdk_x11_initialize_locale (void)
+ {
++#ifdef HAVE_XWC
+ wchar_t result;
+ gchar *current_locale;
+ static char *last_locale = NULL;
+@@ -93,7 +94,8 @@
+ GDK_NOTE (XIM,
+ g_message ("%s multi-byte string functions.",
+ gdk_use_mb ? "Using" : "Not using"));
+-
++#endif
++
+ return;
+ }
+
+@@ -136,6 +138,7 @@
+ {
+ gchar *mbstr;
+
++#ifdef HAVE_XWC
+ if (gdk_use_mb)
+ {
+ GdkDisplay *display = find_a_display ();
+@@ -178,6 +181,7 @@
+ XFree (tpr.value);
+ }
+ else
++#endif
+ {
+ gint length = 0;
+ gint i;
+@@ -210,6 +214,7 @@
+ gint
+ gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max)
+ {
++#ifdef HAVE_XWC
+ if (gdk_use_mb)
+ {
+ GdkDisplay *display = find_a_display ();
+@@ -242,6 +247,7 @@
+ return len_cpy;
+ }
+ else
++#endif
+ {
+ gint i;
+
diff --git a/recipes/gtk+/gtk+-2.6.10/scroll-timings.patch b/recipes/gtk+/gtk+-2.6.10/scroll-timings.patch
new file mode 100644
index 0000000000..a38b21dcc2
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.6.10/scroll-timings.patch
@@ -0,0 +1,15 @@
+--- gtk+-2.4.4/gtk/gtkrange.c~ 2004-08-23 01:50:22.000000000 +0100
++++ gtk+-2.4.4/gtk/gtkrange.c 2004-08-27 15:48:49.000000000 +0100
+@@ -35,9 +35,9 @@
+ #include "gtkintl.h"
+ #include "gtkscrollbar.h"
+
+-#define SCROLL_INITIAL_DELAY 250 /* must hold button this long before ... */
+-#define SCROLL_LATER_DELAY 100 /* ... it starts repeating at this rate */
+-#define UPDATE_DELAY 300 /* Delay for queued update */
++#define SCROLL_INITIAL_DELAY 500 /* must hold button this long before ... */
++#define SCROLL_LATER_DELAY 200 /* ... it starts repeating at this rate */
++#define UPDATE_DELAY 1000 /* Delay for queued update */
+
+ enum {
+ PROP_0,
diff --git a/recipes/gtk+/gtk+-2.6.10/single-click.patch b/recipes/gtk+/gtk+-2.6.10/single-click.patch
new file mode 100644
index 0000000000..3bb208d4d6
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.6.10/single-click.patch
@@ -0,0 +1,54 @@
+diff -urNd ../gtk+-2.6.3-r0.old/gtk+-2.6.3/gtk/gtkcalendar.c gtk+-2.6.3/gtk/gtkcalendar.c
+--- ../gtk+-2.6.3-r0.old/gtk+-2.6.3/gtk/gtkcalendar.c 2005-04-06 16:57:04 +01:00
++++ gtk+-2.6.3/gtk/gtkcalendar.c 2005-04-06 20:05:18 +01:00
+@@ -1023,9 +1023,11 @@
+ }
+
+ gtk_calendar_select_and_focus_day (calendar, day);
+- }
++
++ // This change causes the calendar to disappear after choosing a day
++/* }
+ else if (event->type == GDK_2BUTTON_PRESS)
+- {
++ {*/
+ private_data->in_drag = 0;
+ if (day_month == MONTH_CURRENT)
+ g_signal_emit (calendar,
+diff -urNd ../gtk+-2.6.3-r0.old/gtk+-2.6.3/gtk/gtkfilesel.c gtk+-2.6.3/gtk/gtkfilesel.c
+--- ../gtk+-2.6.3-r0.old/gtk+-2.6.3/gtk/gtkfilesel.c 2005-04-06 16:57:07 +01:00
++++ gtk+-2.6.3/gtk/gtkfilesel.c 2005-04-07 13:40:32 +01:00
+@@ -2468,6 +2468,33 @@
+ if (fs->last_selected != NULL)
+ g_free (fs->last_selected);
+
++ // Single-click directory entry
++ if (new_names->len == 1)
++ {
++ GtkTreeView *tree_view;
++ GtkTreeModel *model;
++ GtkTreePath *path;
++ GtkTreeIter iter;
++ gboolean is_file;
++
++ tree_view = gtk_tree_selection_get_tree_view (selection);
++
++ if (gtk_tree_selection_get_selected (selection, &model, &iter))
++ {
++ path = gtk_tree_model_get_path (model, &iter);
++ gtk_tree_model_get (model, &iter, ISFILE_COLUMN, &is_file, -1);
++
++ if (!is_file)
++ {
++ gtk_file_selection_dir_activate (tree_view, path,
++ gtk_tree_view_get_column (tree_view, DIR_COLUMN),
++ user_data);
++ }
++
++ gtk_tree_path_free (path);
++ }
++ }
++
+ fs->last_selected = g_strdup (g_ptr_array_index (new_names, index));
+ filename = get_real_filename (fs->last_selected, FALSE);
+
diff --git a/recipes/gtk+/gtk+-2.6.10/small-gtkfilesel.patch b/recipes/gtk+/gtk+-2.6.10/small-gtkfilesel.patch
new file mode 100644
index 0000000000..20bf4cf366
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.6.10/small-gtkfilesel.patch
@@ -0,0 +1,267 @@
+diff -urNd ../gtk+-2.4.4-r5/gtk+-2.4.4/gtk/gtkfilesel.c gtk+-2.4.4/gtk/gtkfilesel.c
+--- ../gtk+-2.4.4-r5/gtk+-2.4.4/gtk/gtkfilesel.c 2004-07-10 05:02:10.000000000 +0100
++++ gtk+-2.4.4/gtk/gtkfilesel.c 2004-09-13 13:40:09.000000000 +0100
+@@ -68,6 +68,7 @@
+ #include "gtkprivate.h"
+ #include "gtkscrolledwindow.h"
+ #include "gtkstock.h"
++#include "gtksignal.h"
+ #include "gtktreeselection.h"
+ #include "gtktreeview.h"
+ #include "gtkvbox.h"
+@@ -77,6 +78,7 @@
+ #include "gtkmessagedialog.h"
+ #include "gtkdnd.h"
+ #include "gtkeventbox.h"
++#include "gtkimage.h"
+
+ #undef GTK_DISABLE_DEPRECATED
+ #include "gtkoptionmenu.h"
+@@ -245,7 +247,8 @@
+ };
+
+ enum {
+- DIR_COLUMN
++ DIR_COLUMN,
++ ISFILE_COLUMN
+ };
+
+ enum {
+@@ -400,6 +403,12 @@
+ GtkTreePath *path,
+ GtkTreeViewColumn *column,
+ gpointer user_data);
++
++static void gtk_file_selection_activate (GtkTreeView *tree_view,
++ GtkTreePath *path,
++ GtkTreeViewColumn *column,
++ gpointer user_data);
++
+ static void gtk_file_selection_file_changed (GtkTreeSelection *selection,
+ gpointer user_data);
+ static void gtk_file_selection_dir_activate (GtkTreeView *tree_view,
+@@ -419,6 +428,7 @@
+ static void gtk_file_selection_create_dir (GtkWidget *widget, gpointer data);
+ static void gtk_file_selection_delete_file (GtkWidget *widget, gpointer data);
+ static void gtk_file_selection_rename_file (GtkWidget *widget, gpointer data);
++static void gtk_file_selection_style_set (GtkWidget *widget, GtkStyle *prev_style);
+
+ static void free_selected_names (GPtrArray *names);
+
+@@ -578,6 +588,23 @@
+ G_PARAM_WRITABLE));
+ object_class->destroy = gtk_file_selection_destroy;
+ widget_class->map = gtk_file_selection_map;
++ widget_class->style_set = gtk_file_selection_style_set;
++
++ gtk_widget_class_install_style_property (widget_class,
++ g_param_spec_boolean ("show_fileops_default",
++ _("Show fileop buttons by default"),
++ _("Whether file operation buttons are shown by default"),
++ TRUE,
++ G_PARAM_READABLE));
++
++ gtk_widget_class_install_style_property (widget_class,
++ g_param_spec_int ("border_width",
++ _("Border width"),
++ _("Width of border around the main dialog area"),
++ 0,
++ G_MAXINT,
++ 10,
++ G_PARAM_READABLE));
+ }
+
+ static void gtk_file_selection_set_property (GObject *object,
+@@ -649,7 +676,29 @@
+ gtk_widget_grab_default (widget);
+ return FALSE;
+ }
+-
++
++static void
++gtk_file_selection_style_set (GtkWidget *filesel,
++ GtkStyle *prev_style)
++{
++ gboolean show_fileops;
++ gint border_width;
++
++ gtk_widget_style_get (filesel,
++ "show_fileops_default",
++ &show_fileops,
++ "border_width",
++ &border_width,
++ NULL);
++
++ gtk_container_set_border_width (GTK_CONTAINER (filesel), border_width);
++
++ if (show_fileops)
++ gtk_file_selection_show_fileop_buttons (GTK_FILE_SELECTION (filesel));
++ else
++ gtk_file_selection_hide_fileop_buttons (GTK_FILE_SELECTION (filesel));
++}
++
+ static void
+ gtk_file_selection_init (GtkFileSelection *filesel)
+ {
+@@ -674,17 +723,15 @@
+
+ /* The dialog-sized vertical box */
+ filesel->main_vbox = dialog->vbox;
+- gtk_container_set_border_width (GTK_CONTAINER (filesel), 10);
+
+ /* The horizontal box containing create, rename etc. buttons */
+ filesel->button_area = gtk_hbutton_box_new ();
+ gtk_button_box_set_layout (GTK_BUTTON_BOX (filesel->button_area), GTK_BUTTONBOX_START);
+- gtk_box_set_spacing (GTK_BOX (filesel->button_area), 0);
+ gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->button_area,
+ FALSE, FALSE, 0);
+ gtk_widget_show (filesel->button_area);
+
+- gtk_file_selection_show_fileop_buttons (filesel);
++ gtk_file_selection_style_set (GTK_WIDGET (filesel), NULL);
+
+ /* hbox for pulldown menu */
+ pulldown_hbox = gtk_hbox_new (TRUE, 5);
+@@ -723,25 +770,32 @@
+
+ /* The directories list */
+
+- model = gtk_list_store_new (1, G_TYPE_STRING);
++ model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_BOOLEAN); /* MA */
+ filesel->dir_list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
+ g_object_unref (model);
+
+- column = gtk_tree_view_column_new_with_attributes (_("Folders"),
++ column = gtk_tree_view_column_new_with_attributes (/*_("Folders")*/ NULL,
+ gtk_cell_renderer_text_new (),
+ "text", DIR_COLUMN,
+ NULL);
+ label = gtk_label_new_with_mnemonic (_("Fol_ders"));
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), filesel->dir_list);
+ gtk_widget_show (label);
+- gtk_tree_view_column_set_widget (column, label);
++
++ /* gtk_tree_view_column_set_widget (column, label); */
++ gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (filesel->dir_list), FALSE);
++
+ gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
+ gtk_tree_view_append_column (GTK_TREE_VIEW (filesel->dir_list), column);
+
+ gtk_widget_set_size_request (filesel->dir_list,
+ DIR_LIST_WIDTH, DIR_LIST_HEIGHT);
+ g_signal_connect (filesel->dir_list, "row_activated",
+- G_CALLBACK (gtk_file_selection_dir_activate), filesel);
++ G_CALLBACK (gtk_file_selection_activate), filesel);
++
++ g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (filesel->dir_list)), "changed",
++ G_CALLBACK (gtk_file_selection_file_changed), filesel);
++
+
+ /* gtk_clist_column_titles_passive (GTK_CLIST (filesel->dir_list)); */
+
+@@ -758,41 +812,6 @@
+ gtk_widget_show (filesel->dir_list);
+ gtk_widget_show (scrolled_win);
+
+- /* The files list */
+- model = gtk_list_store_new (1, G_TYPE_STRING);
+- filesel->file_list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
+- g_object_unref (model);
+-
+- column = gtk_tree_view_column_new_with_attributes (_("Files"),
+- gtk_cell_renderer_text_new (),
+- "text", FILE_COLUMN,
+- NULL);
+- label = gtk_label_new_with_mnemonic (_("_Files"));
+- gtk_label_set_mnemonic_widget (GTK_LABEL (label), filesel->file_list);
+- gtk_widget_show (label);
+- gtk_tree_view_column_set_widget (column, label);
+- gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
+- gtk_tree_view_append_column (GTK_TREE_VIEW (filesel->file_list), column);
+-
+- gtk_widget_set_size_request (filesel->file_list,
+- FILE_LIST_WIDTH, FILE_LIST_HEIGHT);
+- g_signal_connect (filesel->file_list, "row_activated",
+- G_CALLBACK (gtk_file_selection_file_activate), filesel);
+- g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (filesel->file_list)), "changed",
+- G_CALLBACK (gtk_file_selection_file_changed), filesel);
+-
+- /* gtk_clist_column_titles_passive (GTK_CLIST (filesel->file_list)); */
+-
+- scrolled_win = gtk_scrolled_window_new (NULL, NULL);
+- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN);
+- gtk_container_add (GTK_CONTAINER (scrolled_win), filesel->file_list);
+- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
+- GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
+- gtk_container_set_border_width (GTK_CONTAINER (scrolled_win), 0);
+- gtk_container_add (GTK_CONTAINER (list_container), scrolled_win);
+- gtk_widget_show (filesel->file_list);
+- gtk_widget_show (scrolled_win);
+-
+ /* action area for packing buttons into. */
+ filesel->action_area = gtk_hbox_new (TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->action_area,
+@@ -2008,6 +2027,23 @@
+ }
+
+ static void
++gtk_file_selection_activate (GtkTreeView *tree_view,
++ GtkTreePath *path,
++ GtkTreeViewColumn *column,
++ gpointer user_data)
++{
++ GtkTreeModel *model = gtk_tree_view_get_model (tree_view);
++ GtkTreeIter iter;
++ gboolean is_file;
++
++ gtk_tree_model_get_iter (model, &iter, path);
++ gtk_tree_model_get (model, &iter, ISFILE_COLUMN, &is_file, -1);
++
++ if (! is_file)
++ gtk_file_selection_dir_activate (tree_view, path, column, user_data);
++}
++
++static void
+ gtk_file_selection_file_activate (GtkTreeView *tree_view,
+ GtkTreePath *path,
+ GtkTreeViewColumn *column,
+@@ -2103,7 +2139,6 @@
+ PossibleCompletion* poss;
+ GtkTreeIter iter;
+ GtkListStore *dir_model;
+- GtkListStore *file_model;
+ gchar* filename;
+ gchar* rem_path = rel_path;
+ gchar* sel_text;
+@@ -2125,10 +2160,8 @@
+ g_assert (cmpl_state->reference_dir);
+
+ dir_model = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (fs->dir_list)));
+- file_model = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (fs->file_list)));
+
+ gtk_list_store_clear (dir_model);
+- gtk_list_store_clear (file_model);
+
+ /* Set the dir list to include ./ and ../ */
+ gtk_list_store_append (dir_model, &iter);
+@@ -2150,13 +2183,17 @@
+ strcmp (filename, ".." G_DIR_SEPARATOR_S) != 0)
+ {
+ gtk_list_store_append (dir_model, &iter);
+- gtk_list_store_set (dir_model, &iter, DIR_COLUMN, filename, -1);
++ gtk_list_store_set (dir_model, &iter,
++ DIR_COLUMN, filename,
++ ISFILE_COLUMN, FALSE, -1);
+ }
+ }
+ else
+ {
+- gtk_list_store_append (file_model, &iter);
+- gtk_list_store_set (file_model, &iter, DIR_COLUMN, filename, -1);
++ gtk_list_store_append (dir_model, &iter);
++ gtk_list_store_set (dir_model, &iter,
++ DIR_COLUMN, filename,
++ ISFILE_COLUMN, TRUE, -1);
+ }
+ }
+
diff --git a/recipes/gtk+/gtk+-2.6.10/spinbutton.patch b/recipes/gtk+/gtk+-2.6.10/spinbutton.patch
new file mode 100644
index 0000000000..8ad7507af0
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.6.10/spinbutton.patch
@@ -0,0 +1,128 @@
+--- gtk+-2.4.3/gtk/gtkspinbutton.c.old 2004-04-22 14:49:27.000000000 +0100
++++ gtk+-2.4.3/gtk/gtkspinbutton.c 2004-06-30 21:48:18.000000000 +0100
+@@ -733,7 +733,7 @@
+
+ spin = GTK_SPIN_BUTTON (widget);
+ arrow_size = spin_button_get_arrow_size (spin);
+- panel_width = arrow_size + 2 * widget->style->xthickness;
++ panel_width = (2 * arrow_size) + 4 * widget->style->xthickness;
+
+ widget->allocation = *allocation;
+
+@@ -866,19 +866,16 @@
+ {
+ width = spin_button_get_arrow_size (spin_button) + 2 * widget->style->xthickness;
+
++ y = widget->style->ythickness;
++ height = widget->requisition.height - (2 * y);
++
+ if (arrow_type == GTK_ARROW_UP)
+ {
+ x = 0;
+- y = 0;
+-
+- height = widget->requisition.height / 2;
+ }
+ else
+ {
+- x = 0;
+- y = widget->requisition.height / 2;
+-
+- height = (widget->requisition.height + 1) / 2;
++ x = width;
+ }
+
+ if (spin_button_at_limit (spin_button, arrow_type))
+@@ -908,32 +905,17 @@
+ shadow_type = GTK_SHADOW_OUT;
+ }
+ }
+-
++
+ gtk_paint_box (widget->style, spin_button->panel,
+ state_type, shadow_type,
+ NULL, widget,
+- (arrow_type == GTK_ARROW_UP)? "spinbutton_up" : "spinbutton_down",
++ NULL,
+ x, y, width, height);
+
+ height = widget->requisition.height;
+
+- if (arrow_type == GTK_ARROW_DOWN)
+- {
+- y = height / 2;
+- height = height - y - 2;
+- }
+- else
+- {
+- y = 2;
+- height = height / 2 - 2;
+- }
+-
+ width -= 3;
+-
+- if (widget && gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
+- x = 2;
+- else
+- x = 1;
++ height -= 3;
+
+ w = width / 2;
+ w -= w % 2 - 1; /* force odd */
+@@ -1108,7 +1090,7 @@
+ if (GTK_ENTRY (widget)->editable)
+ gtk_spin_button_update (spin);
+
+- if (event->y <= widget->requisition.height / 2)
++ if (event->x <= (spin_button_get_arrow_size (spin) + widget->style->xthickness))
+ {
+ if (event->button == 1)
+ start_spinning (spin, GTK_ARROW_UP, spin->adjustment->step_increment);
+@@ -1143,44 +1125,11 @@
+
+ arrow_size = spin_button_get_arrow_size (spin);
+
+- if (event->button == spin->button)
+- {
+- int click_child = spin->click_child;
++ gtk_spin_button_stop_spinning (spin);
+
+- gtk_spin_button_stop_spinning (spin);
+-
+- if (event->button == 3)
+- {
+- if (event->y >= 0 && event->x >= 0 &&
+- event->y <= widget->requisition.height &&
+- event->x <= arrow_size + 2 * widget->style->xthickness)
+- {
+- if (click_child == GTK_ARROW_UP &&
+- event->y <= widget->requisition.height / 2)
+- {
+- gdouble diff;
+-
+- diff = spin->adjustment->upper - spin->adjustment->value;
+- if (diff > EPSILON)
+- gtk_spin_button_real_spin (spin, diff);
+- }
+- else if (click_child == GTK_ARROW_DOWN &&
+- event->y > widget->requisition.height / 2)
+- {
+- gdouble diff;
+-
+- diff = spin->adjustment->value - spin->adjustment->lower;
+- if (diff > EPSILON)
+- gtk_spin_button_real_spin (spin, -diff);
+- }
+- }
+- }
+- spin_button_redraw (spin);
++ spin_button_redraw (spin);
+
+- return TRUE;
+- }
+- else
+- return GTK_WIDGET_CLASS (parent_class)->button_release_event (widget, event);
++ return TRUE;
+ }
+
+ static gint
diff --git a/recipes/gtk+/gtk+-2.8.16/automake-lossage.patch b/recipes/gtk+/gtk+-2.8.16/automake-lossage.patch
new file mode 100644
index 0000000000..0d423ddbb9
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.8.16/automake-lossage.patch
@@ -0,0 +1,24 @@
+--- gtk+-2.4.1/docs/tutorial/Makefile.am~ 2003-05-06 22:54:20.000000000 +0100
++++ gtk+-2.4.1/docs/tutorial/Makefile.am 2004-05-08 12:31:41.000000000 +0100
+@@ -52,21 +52,5 @@
+
+ dist-hook: html
+ cp -Rp $(srcdir)/html $(distdir)
+-else
+-html:
+- echo "***"
+- echo "*** Warning: Tutorial not built"
+- echo "***"
+-
+-pdf:
+- echo "***"
+- echo "*** Warning: Tutorial not built"
+- echo "***"
+-
+-dist-hook:
+- echo "***"
+- echo "*** Warning: Tutorial not built"
+- echo "*** DISTRIBUTION IS INCOMPLETE"
+- echo "***"
+ endif
+
diff --git a/recipes/gtk+/gtk+-2.8.16/disable-tooltips.patch b/recipes/gtk+/gtk+-2.8.16/disable-tooltips.patch
new file mode 100644
index 0000000000..d71d839c3c
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.8.16/disable-tooltips.patch
@@ -0,0 +1,11 @@
+--- gtk+-2.4.3/gtk/gtktooltips.c.old 2004-07-04 18:52:04.000000000 +0100
++++ gtk+-2.4.3/gtk/gtktooltips.c 2004-07-04 18:52:08.000000000 +0100
+@@ -118,7 +118,7 @@
+ tooltips->tips_data_list = NULL;
+
+ tooltips->delay = DEFAULT_DELAY;
+- tooltips->enabled = TRUE;
++ tooltips->enabled = FALSE;
+ tooltips->timer_tag = 0;
+ tooltips->use_sticky_delay = FALSE;
+ tooltips->last_popdown.tv_sec = -1;
diff --git a/recipes/gtk+/gtk+-2.8.16/gtk+-handhelds.patch b/recipes/gtk+/gtk+-2.8.16/gtk+-handhelds.patch
new file mode 100644
index 0000000000..4b97373f32
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.8.16/gtk+-handhelds.patch
@@ -0,0 +1,264 @@
+--- gtk+-2.8.6/gtk/gtkrange.c.orig 2005-12-07 21:13:33 +0100
++++ gtk+-2.8.6/gtk/gtkrange.c 2005-12-07 21:21:12 +0100
+@@ -186,6 +186,7 @@
+ static GtkWidgetClass *parent_class = NULL;
+ static guint signals[LAST_SIGNAL];
+
++static GdkAtom recognize_protocols_atom, atom_atom;
+
+ GType
+ gtk_range_get_type (void)
+@@ -226,6 +227,9 @@
+ object_class = (GtkObjectClass*) class;
+ widget_class = (GtkWidgetClass*) class;
+
++ recognize_protocols_atom = gdk_atom_intern ("RECOGNIZE_PROTOCOLS", FALSE);
++ atom_atom = gdk_atom_intern ("ATOM", FALSE);
++
+ parent_class = g_type_class_peek_parent (class);
+
+ gobject_class->set_property = gtk_range_set_property;
+@@ -860,6 +864,12 @@
+ &attributes, attributes_mask);
+ gdk_window_set_user_data (range->event_window, range);
+
++ gdk_property_change (range->event_window,
++ recognize_protocols_atom,
++ atom_atom,
++ 32, GDK_PROP_MODE_REPLACE,
++ NULL, 0);
++
+ widget->style = gtk_style_attach (widget->style, widget->window);
+ }
+
+@@ -1229,7 +1239,7 @@
+
+ /* ignore presses when we're already doing something else. */
+ if (range->layout->grab_location != MOUSE_OUTSIDE)
+- return FALSE;
++ return TRUE;
+
+ range->layout->mouse_x = event->x;
+ range->layout->mouse_y = event->y;
+@@ -1429,7 +1439,7 @@
+ return TRUE;
+ }
+
+- return FALSE;
++ return TRUE;
+ }
+
+ /**
+--- gtk+-2.8.6/gtk/gtkentry.c.orig 2005-09-02 21:51:06 +0200
++++ gtk+-2.8.6/gtk/gtkentry.c 2005-12-07 21:21:12 +0100
+@@ -597,6 +597,15 @@
+ 0.0,
+ GTK_PARAM_READWRITE));
+
++ gtk_widget_class_install_style_property (widget_class,
++ g_param_spec_int ("min_width",
++ _("Minimum width"),
++ _("Minimum width of the entry field"),
++ 0,
++ G_MAXINT,
++ MIN_ENTRY_WIDTH,
++ G_PARAM_READABLE));
++
+ signals[POPULATE_POPUP] =
+ g_signal_new ("populate_popup",
+ G_OBJECT_CLASS_TYPE (gobject_class),
+@@ -1227,7 +1236,7 @@
+ {
+ GtkEntry *entry = GTK_ENTRY (widget);
+ PangoFontMetrics *metrics;
+- gint xborder, yborder;
++ gint xborder, yborder, min_width;
+ PangoContext *context;
+
+ gtk_widget_ensure_style (widget);
+@@ -1243,9 +1252,11 @@
+
+ xborder += INNER_BORDER;
+ yborder += INNER_BORDER;
+-
++
++ gtk_widget_style_get (widget, "min_width", &min_width, NULL);
++
+ if (entry->width_chars < 0)
+- requisition->width = MIN_ENTRY_WIDTH + xborder * 2;
++ requisition->width = min_width + xborder * 2;
+ else
+ {
+ gint char_width = pango_font_metrics_get_approximate_char_width (metrics);
+--- gtk+-2.8.6/gtk/gtkarrow.c.orig 2005-06-21 17:38:39 +0200
++++ gtk+-2.8.6/gtk/gtkarrow.c 2005-12-07 21:21:12 +0100
+@@ -31,7 +31,7 @@
+ #include "gtkintl.h"
+ #include "gtkalias.h"
+
+-#define MIN_ARROW_SIZE 15
++#define MIN_ARROW_SIZE 7
+
+ enum {
+ PROP_0,
+@@ -55,6 +55,8 @@
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec);
++static void gtk_arrow_size_request (GtkWidget *arrow,
++ GtkRequisition *requisition);
+
+ GType
+ gtk_arrow_get_type (void)
+@@ -113,6 +115,7 @@
+ GTK_PARAM_READWRITE));
+
+ widget_class->expose_event = gtk_arrow_expose;
++ widget_class->size_request = gtk_arrow_size_request;
+ }
+
+ static void
+@@ -168,13 +171,18 @@
+ }
+
+ static void
++gtk_arrow_size_request (GtkWidget *arrow,
++ GtkRequisition *requisition)
++{
++ requisition->width = MIN_ARROW_SIZE + GTK_MISC (arrow)->xpad * 2;
++ requisition->height = MIN_ARROW_SIZE + GTK_MISC (arrow)->ypad * 2;
++}
++
++static void
+ gtk_arrow_init (GtkArrow *arrow)
+ {
+ GTK_WIDGET_SET_FLAGS (arrow, GTK_NO_WINDOW);
+
+- GTK_WIDGET (arrow)->requisition.width = MIN_ARROW_SIZE + GTK_MISC (arrow)->xpad * 2;
+- GTK_WIDGET (arrow)->requisition.height = MIN_ARROW_SIZE + GTK_MISC (arrow)->ypad * 2;
+-
+ arrow->arrow_type = GTK_ARROW_RIGHT;
+ arrow->shadow_type = GTK_SHADOW_OUT;
+ }
+--- gtk+-2.8.6/gtk/gtkcalendar.c.orig 2005-12-07 21:36:14 +0100
++++ gtk+-2.8.6/gtk/gtkcalendar.c 2005-12-07 21:49:21 +0100
+@@ -692,6 +692,35 @@
+ ****************************************/
+
+ static void
++calendar_select_day (GtkCalendar *calendar, guint day)
++{
++ g_return_if_fail (GTK_IS_CALENDAR (calendar));
++ g_return_if_fail (day <= 31);
++
++ /* Deselect the old day */
++ if (calendar->selected_day > 0)
++ {
++ gint selected_day;
++
++ selected_day = calendar->selected_day;
++ calendar->selected_day = 0;
++ if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar)))
++ calendar_invalidate_day_num (calendar, selected_day);
++ }
++
++ calendar->selected_day = day;
++
++ /* Select the new day */
++ if (day != 0)
++ {
++ if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar)))
++ calendar_invalidate_day_num (calendar, day);
++ }
++
++ g_object_notify (G_OBJECT (calendar), "day");
++}
++
++static void
+ calendar_set_month_next (GtkCalendar *calendar)
+ {
+ gint month_len;
+@@ -723,10 +752,10 @@
+ if (month_len < calendar->selected_day)
+ {
+ calendar->selected_day = 0;
+- gtk_calendar_select_day (calendar, month_len);
++ calendar_select_day (calendar, month_len);
+ }
+ else
+- gtk_calendar_select_day (calendar, calendar->selected_day);
++ calendar_select_day (calendar, calendar->selected_day);
+
+ gtk_widget_queue_draw (GTK_WIDGET (calendar));
+ }
+@@ -752,10 +781,10 @@
+ if (month_len < calendar->selected_day)
+ {
+ calendar->selected_day = 0;
+- gtk_calendar_select_day (calendar, month_len);
++ calendar_select_day (calendar, month_len);
+ }
+ else
+- gtk_calendar_select_day (calendar, calendar->selected_day);
++ calendar_select_day (calendar, calendar->selected_day);
+
+ gtk_widget_queue_draw (GTK_WIDGET (calendar));
+ }
+@@ -784,10 +813,10 @@
+ if (month_len < calendar->selected_day)
+ {
+ calendar->selected_day = 0;
+- gtk_calendar_select_day (calendar, month_len);
++ calendar_select_day (calendar, month_len);
+ }
+ else
+- gtk_calendar_select_day (calendar, calendar->selected_day);
++ calendar_select_day (calendar, calendar->selected_day);
+
+ gtk_widget_queue_draw (GTK_WIDGET (calendar));
+ }
+@@ -1088,13 +1117,13 @@
+ if (month_len < calendar->selected_day)
+ {
+ calendar->selected_day = 0;
+- gtk_calendar_select_day (calendar, month_len);
++ calendar_select_day (calendar, month_len);
+ }
+ else
+ {
+ if (calendar->selected_day < 0)
+ calendar->selected_day = calendar->selected_day + 1 + month_length[leap (calendar->year)][calendar->month + 1];
+- gtk_calendar_select_day (calendar, calendar->selected_day);
++ calendar_select_day (calendar, calendar->selected_day);
+ }
+
+ gtk_widget_queue_draw (GTK_WIDGET (calendar));
+@@ -3285,27 +3314,7 @@
+ g_return_if_fail (GTK_IS_CALENDAR (calendar));
+ g_return_if_fail (day <= 31);
+
+- /* Deselect the old day */
+- if (calendar->selected_day > 0)
+- {
+- gint selected_day;
+-
+- selected_day = calendar->selected_day;
+- calendar->selected_day = 0;
+- if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar)))
+- calendar_invalidate_day_num (calendar, selected_day);
+- }
+-
+- calendar->selected_day = day;
+-
+- /* Select the new day */
+- if (day != 0)
+- {
+- if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar)))
+- calendar_invalidate_day_num (calendar, day);
+- }
+-
+- g_object_notify (G_OBJECT (calendar), "day");
++ calendar_select_day (calendar, day);
+
+ g_signal_emit (calendar,
+ gtk_calendar_signals[DAY_SELECTED_SIGNAL],
diff --git a/recipes/gtk+/gtk+-2.8.16/gtktreeview-316689.patch b/recipes/gtk+/gtk+-2.8.16/gtktreeview-316689.patch
new file mode 100644
index 0000000000..4e77ddf9f9
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.8.16/gtktreeview-316689.patch
@@ -0,0 +1,25 @@
+diff -u -p -r1.498 gtktreeview.c
+--- gtk+-2.8.9/gtk/gtktreeview.c 22 Oct 2005 21:08:23 -0000 1.498
++++ gtk+-2.8.9/gtk/gtktreeview.c 24 Oct 2005 22:30:27 -0000
+@@ -2098,6 +2098,9 @@ gtk_tree_view_size_allocate (GtkWidget
+ /* now the adjustments and window sizes are in sync, we can sync toprow/dy again */
+ if (tree_view->priv->height <= tree_view->priv->vadjustment->page_size)
+ gtk_adjustment_set_value (GTK_ADJUSTMENT (tree_view->priv->vadjustment), 0);
++ else if (tree_view->priv->vadjustment->value + tree_view->priv->vadjustment->page_size > tree_view->priv->height)
++ gtk_adjustment_set_value (GTK_ADJUSTMENT (tree_view->priv->vadjustment),
++ tree_view->priv->height - tree_view->priv->vadjustment->page_size);
+ else if (gtk_tree_row_reference_valid (tree_view->priv->top_row))
+ gtk_tree_view_top_row_to_dy (tree_view);
+ else
+@ -5031,6 +5034,11 @@ validate_visible_area (GtkTreeView *tree
+ * else than zero. we update top_row to be in sync with dy = 0.
+ */
+ gtk_adjustment_set_value (GTK_ADJUSTMENT (tree_view->priv->vadjustment), 0);
++ gtk_tree_view_dy_to_top_row (tree_view);
++ }
++ else if (tree_view->priv->vadjustment->value + tree_view->priv->vadjustment->page_size > tree_view->priv->height)
++ {
++ gtk_adjustment_set_value (GTK_ADJUSTMENT (tree_view->priv->vadjustment), tree_view->priv->height - tree_view->priv->vadjustment->page_size);
+ gtk_tree_view_dy_to_top_row (tree_view);
+ }
+ else
diff --git a/recipes/gtk+/gtk+-2.8.16/hardcoded_libtool.patch b/recipes/gtk+/gtk+-2.8.16/hardcoded_libtool.patch
new file mode 100644
index 0000000000..b2afddcc61
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.8.16/hardcoded_libtool.patch
@@ -0,0 +1,29 @@
+--- gtk+-2.6.0/configure.in.old 2005-01-01 16:23:45.000000000 +0000
++++ gtk+-2.6.0/configure.in 2005-01-01 16:24:03.000000000 +0000
+@@ -360,7 +360,7 @@
+ AC_MSG_CHECKING([Whether to write dependencies into .pc files])
+ case $enable_explicit_deps in
+ auto)
+- deplib_check_method=`(./libtool --config; echo eval echo \\$deplib_check_method) | sh`
++ deplib_check_method=`($host_alias-libtool --config; echo eval echo \\$deplib_check_method) | sh`
+ if test "X$deplib_check_method" = Xnone || test "x$enable_static" = xyes ; then
+ enable_explicit_deps=yes
+ else
+@@ -688,7 +688,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/'`
+@@ -1512,7 +1512,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_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/recipes/gtk+/gtk+-2.8.16/menu-deactivate.patch b/recipes/gtk+/gtk+-2.8.16/menu-deactivate.patch
new file mode 100644
index 0000000000..29e665fbf3
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.8.16/menu-deactivate.patch
@@ -0,0 +1,50 @@
+--- gtk+-2.4.4/gtk/gtkmenushell.c.old Thu Aug 26 23:45:28 2004
++++ gtk+-2.4.4/gtk/gtkmenushell.c Fri Aug 27 00:13:33 2004
+@@ -37,7 +37,7 @@
+ #include "gtktearoffmenuitem.h"
+ #include "gtkwindow.h"
+
+-#define MENU_SHELL_TIMEOUT 500
++#define MENU_SHELL_TIMEOUT 2000
+
+ enum {
+ DEACTIVATE,
+@@ -156,6 +156,7 @@
+ static GtkContainerClass *parent_class = NULL;
+ static guint menu_shell_signals[LAST_SIGNAL] = { 0 };
+
++static int last_crossing_time;
+
+ GType
+ gtk_menu_shell_get_type (void)
+@@ -418,6 +419,7 @@
+ gtk_grab_add (GTK_WIDGET (menu_shell));
+ menu_shell->have_grab = TRUE;
+ menu_shell->active = TRUE;
++ last_crossing_time = 0;
+ }
+ }
+
+@@ -545,6 +547,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)
+ {
+@@ -597,6 +606,8 @@
+ if (menu_shell->active)
+ {
+ menu_item = gtk_get_event_widget ((GdkEvent*) event);
++
++ last_crossing_time = event->time;
+
+ if (!menu_item ||
+ (GTK_IS_MENU_ITEM (menu_item) &&
diff --git a/recipes/gtk+/gtk+-2.8.16/no-demos.patch b/recipes/gtk+/gtk+-2.8.16/no-demos.patch
new file mode 100644
index 0000000000..0145067ad5
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.8.16/no-demos.patch
@@ -0,0 +1,10 @@
+--- gtk+-2.8.6/Makefile.am.orig 2005-12-07 21:30:56 +0100
++++ gtk+-2.8.6/Makefile.am 2005-12-07 21:31:10 +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/recipes/gtk+/gtk+-2.8.16/no-xwc.patch b/recipes/gtk+/gtk+-2.8.16/no-xwc.patch
new file mode 100644
index 0000000000..318b150359
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.8.16/no-xwc.patch
@@ -0,0 +1,179 @@
+Index: configure.in
+===================================================================
+RCS file: /cvs/gnome/gtk+/configure.in,v
+retrieving revision 1.469.2.22
+diff -u -r1.469.2.22 configure.in
+--- gtk/configure.in 16 Mar 2006 16:39:45 -0000 1.469.2.22
++++ gtk/configure.in 20 Mar 2006 12:07:11 -0000
+@@ -1115,6 +1115,8 @@
+
+ AC_CHECK_FUNCS(XConvertCase XInternAtoms)
+
++ AC_CHECK_FUNCS(XmbDrawString)
++
+ # Generic X11R6 check needed for XIM support; we could
+ # probably use this to replace the above, but we'll
+ # leave the separate checks for XConvertCase and XInternAtoms
+Index: gdk/x11/gdkdrawable-x11.c
+===================================================================
+RCS file: /cvs/gnome/gtk+/gdk/x11/gdkdrawable-x11.c,v
+retrieving revision 1.58
+diff -u -r1.58 gdkdrawable-x11.c
+--- gtk/gdk/x11/gdkdrawable-x11.c 15 Aug 2005 19:04:54 -0000 1.58
++++ gtk/gdk/x11/gdkdrawable-x11.c 20 Mar 2006 12:07:12 -0000
+@@ -579,12 +579,14 @@
+ GDK_GC_GET_XGC (gc), x, y, (XChar2b *) text, text_length / 2);
+ }
+ }
++#ifdef HAVE_XMBDRAWSTRING
+ else if (font->type == GDK_FONT_FONTSET)
+ {
+ XFontSet fontset = (XFontSet) GDK_FONT_XFONT (font);
+ XmbDrawString (xdisplay, impl->xid,
+ fontset, GDK_GC_GET_XGC (gc), x, y, text, text_length);
+ }
++#endif
+ else
+ g_error("undefined font type\n");
+ }
+@@ -616,6 +618,7 @@
+ GDK_GC_GET_XGC (gc), x, y, text_8bit, text_length);
+ g_free (text_8bit);
+ }
++#ifdef HAVE_XMBDRAWSTRING
+ else if (font->type == GDK_FONT_FONTSET)
+ {
+ if (sizeof(GdkWChar) == sizeof(wchar_t))
+@@ -636,6 +639,7 @@
+ g_free (text_wchar);
+ }
+ }
++#endif
+ else
+ g_error("undefined font type\n");
+ }
+Index: gdk/x11/gdkfont-x11.c
+===================================================================
+RCS file: /cvs/gnome/gtk+/gdk/x11/gdkfont-x11.c,v
+retrieving revision 1.48.2.1
+diff -u -r1.48.2.1 gdkfont-x11.c
+--- gtk/gdk/x11/gdkfont-x11.c 20 Jan 2006 04:39:43 -0000 1.48.2.1
++++ gtk/gdk/x11/gdkfont-x11.c 20 Mar 2006 12:07:12 -0000
+@@ -527,10 +527,12 @@
+ width = XTextWidth16 (xfont, (XChar2b *) text, text_length / 2);
+ }
+ break;
++#ifdef HAVE_XMBDRAWSTRING
+ case GDK_FONT_FONTSET:
+ fontset = (XFontSet) private->xfont;
+ width = XmbTextEscapement (fontset, text, text_length);
+ break;
++#endif
+ default:
+ width = 0;
+ }
+@@ -580,6 +582,7 @@
+ width = 0;
+ }
+ break;
++#ifdef HAVE_XMBDRAWSTRING
+ case GDK_FONT_FONTSET:
+ if (sizeof(GdkWChar) == sizeof(wchar_t))
+ {
+@@ -597,6 +600,7 @@
+ g_free (text_wchar);
+ }
+ break;
++#endif
+ default:
+ width = 0;
+ }
+@@ -669,6 +673,7 @@
+ if (descent)
+ *descent = overall.descent;
+ break;
++#ifdef HAVE_XMBDRAWSTRING
+ case GDK_FONT_FONTSET:
+ fontset = (XFontSet) private->xfont;
+ XmbTextExtents (fontset, text, text_length, &ink, &logical);
+@@ -683,6 +688,7 @@
+ if (descent)
+ *descent = ink.y + ink.height;
+ break;
++#endif
+ }
+
+ }
+@@ -755,6 +761,7 @@
+ *descent = overall.descent;
+ break;
+ }
++#ifdef HAVE_XMBDRAWSTRING
+ case GDK_FONT_FONTSET:
+ fontset = (XFontSet) private->xfont;
+
+@@ -782,6 +789,7 @@
+ if (descent)
+ *descent = ink.y + ink.height;
+ break;
++#endif
+ }
+
+ }
+Index: gdk/x11/gdkim-x11.c
+===================================================================
+RCS file: /cvs/gnome/gtk+/gdk/x11/gdkim-x11.c,v
+retrieving revision 1.38
+diff -u -r1.38 gdkim-x11.c
+--- gtk/gdk/x11/gdkim-x11.c 16 Mar 2005 03:17:27 -0000 1.38
++++ gtk/gdk/x11/gdkim-x11.c 20 Mar 2006 12:07:12 -0000
+@@ -48,6 +48,7 @@
+ void
+ _gdk_x11_initialize_locale (void)
+ {
++#ifdef HAVE_XMBDRAWSTRING
+ wchar_t result;
+ gchar *current_locale;
+ static char *last_locale = NULL;
+@@ -93,7 +94,8 @@
+ GDK_NOTE (XIM,
+ g_message ("%s multi-byte string functions.",
+ gdk_use_mb ? "Using" : "Not using"));
+-
++#endif
++
+ return;
+ }
+
+@@ -136,6 +138,7 @@
+ {
+ gchar *mbstr;
+
++#ifdef HAVE_XMBDRAWSTRING
+ if (gdk_use_mb)
+ {
+ GdkDisplay *display = find_a_display ();
+@@ -178,6 +181,7 @@
+ XFree (tpr.value);
+ }
+ else
++#endif
+ {
+ gint length = 0;
+ gint i;
+@@ -210,6 +214,7 @@
+ gint
+ gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max)
+ {
++#ifdef HAVE_XMBDRAWSTRING
+ if (gdk_use_mb)
+ {
+ GdkDisplay *display = find_a_display ();
+@@ -242,6 +247,7 @@
+ return len_cpy;
+ }
+ else
++#endif
+ {
+ gint i;
+
diff --git a/recipes/gtk+/gtk+-2.8.16/scroll-timings.patch b/recipes/gtk+/gtk+-2.8.16/scroll-timings.patch
new file mode 100644
index 0000000000..a38b21dcc2
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.8.16/scroll-timings.patch
@@ -0,0 +1,15 @@
+--- gtk+-2.4.4/gtk/gtkrange.c~ 2004-08-23 01:50:22.000000000 +0100
++++ gtk+-2.4.4/gtk/gtkrange.c 2004-08-27 15:48:49.000000000 +0100
+@@ -35,9 +35,9 @@
+ #include "gtkintl.h"
+ #include "gtkscrollbar.h"
+
+-#define SCROLL_INITIAL_DELAY 250 /* must hold button this long before ... */
+-#define SCROLL_LATER_DELAY 100 /* ... it starts repeating at this rate */
+-#define UPDATE_DELAY 300 /* Delay for queued update */
++#define SCROLL_INITIAL_DELAY 500 /* must hold button this long before ... */
++#define SCROLL_LATER_DELAY 200 /* ... it starts repeating at this rate */
++#define UPDATE_DELAY 1000 /* Delay for queued update */
+
+ enum {
+ PROP_0,
diff --git a/recipes/gtk+/gtk+-2.8.16/single-click.patch b/recipes/gtk+/gtk+-2.8.16/single-click.patch
new file mode 100644
index 0000000000..1bf0db12a8
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.8.16/single-click.patch
@@ -0,0 +1,36 @@
+--- gtk+-2.8.6/gtk/gtkfilesel.c.orig 2005-12-07 21:13:33 +0100
++++ gtk+-2.8.6/gtk/gtkfilesel.c 2005-12-07 21:14:56 +0100
+@@ -2461,6 +2461,33 @@
+ if (fs->last_selected != NULL)
+ g_free (fs->last_selected);
+
++ // Single-click directory entry
++ if (new_names->len == 1)
++ {
++ GtkTreeView *tree_view;
++ GtkTreeModel *model;
++ GtkTreePath *path;
++ GtkTreeIter iter;
++ gboolean is_file;
++
++ tree_view = gtk_tree_selection_get_tree_view (selection);
++
++ if (gtk_tree_selection_get_selected (selection, &model, &iter))
++ {
++ path = gtk_tree_model_get_path (model, &iter);
++ gtk_tree_model_get (model, &iter, ISFILE_COLUMN, &is_file, -1);
++
++ if (!is_file)
++ {
++ gtk_file_selection_dir_activate (tree_view, path,
++ gtk_tree_view_get_column (tree_view, DIR_COLUMN),
++ user_data);
++ }
++
++ gtk_tree_path_free (path);
++ }
++ }
++
+ fs->last_selected = g_strdup (g_ptr_array_index (new_names, index));
+ filename = get_real_filename (fs->last_selected, FALSE);
+
diff --git a/recipes/gtk+/gtk+-2.8.16/small-gtkfilesel.patch b/recipes/gtk+/gtk+-2.8.16/small-gtkfilesel.patch
new file mode 100644
index 0000000000..20bf4cf366
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.8.16/small-gtkfilesel.patch
@@ -0,0 +1,267 @@
+diff -urNd ../gtk+-2.4.4-r5/gtk+-2.4.4/gtk/gtkfilesel.c gtk+-2.4.4/gtk/gtkfilesel.c
+--- ../gtk+-2.4.4-r5/gtk+-2.4.4/gtk/gtkfilesel.c 2004-07-10 05:02:10.000000000 +0100
++++ gtk+-2.4.4/gtk/gtkfilesel.c 2004-09-13 13:40:09.000000000 +0100
+@@ -68,6 +68,7 @@
+ #include "gtkprivate.h"
+ #include "gtkscrolledwindow.h"
+ #include "gtkstock.h"
++#include "gtksignal.h"
+ #include "gtktreeselection.h"
+ #include "gtktreeview.h"
+ #include "gtkvbox.h"
+@@ -77,6 +78,7 @@
+ #include "gtkmessagedialog.h"
+ #include "gtkdnd.h"
+ #include "gtkeventbox.h"
++#include "gtkimage.h"
+
+ #undef GTK_DISABLE_DEPRECATED
+ #include "gtkoptionmenu.h"
+@@ -245,7 +247,8 @@
+ };
+
+ enum {
+- DIR_COLUMN
++ DIR_COLUMN,
++ ISFILE_COLUMN
+ };
+
+ enum {
+@@ -400,6 +403,12 @@
+ GtkTreePath *path,
+ GtkTreeViewColumn *column,
+ gpointer user_data);
++
++static void gtk_file_selection_activate (GtkTreeView *tree_view,
++ GtkTreePath *path,
++ GtkTreeViewColumn *column,
++ gpointer user_data);
++
+ static void gtk_file_selection_file_changed (GtkTreeSelection *selection,
+ gpointer user_data);
+ static void gtk_file_selection_dir_activate (GtkTreeView *tree_view,
+@@ -419,6 +428,7 @@
+ static void gtk_file_selection_create_dir (GtkWidget *widget, gpointer data);
+ static void gtk_file_selection_delete_file (GtkWidget *widget, gpointer data);
+ static void gtk_file_selection_rename_file (GtkWidget *widget, gpointer data);
++static void gtk_file_selection_style_set (GtkWidget *widget, GtkStyle *prev_style);
+
+ static void free_selected_names (GPtrArray *names);
+
+@@ -578,6 +588,23 @@
+ G_PARAM_WRITABLE));
+ object_class->destroy = gtk_file_selection_destroy;
+ widget_class->map = gtk_file_selection_map;
++ widget_class->style_set = gtk_file_selection_style_set;
++
++ gtk_widget_class_install_style_property (widget_class,
++ g_param_spec_boolean ("show_fileops_default",
++ _("Show fileop buttons by default"),
++ _("Whether file operation buttons are shown by default"),
++ TRUE,
++ G_PARAM_READABLE));
++
++ gtk_widget_class_install_style_property (widget_class,
++ g_param_spec_int ("border_width",
++ _("Border width"),
++ _("Width of border around the main dialog area"),
++ 0,
++ G_MAXINT,
++ 10,
++ G_PARAM_READABLE));
+ }
+
+ static void gtk_file_selection_set_property (GObject *object,
+@@ -649,7 +676,29 @@
+ gtk_widget_grab_default (widget);
+ return FALSE;
+ }
+-
++
++static void
++gtk_file_selection_style_set (GtkWidget *filesel,
++ GtkStyle *prev_style)
++{
++ gboolean show_fileops;
++ gint border_width;
++
++ gtk_widget_style_get (filesel,
++ "show_fileops_default",
++ &show_fileops,
++ "border_width",
++ &border_width,
++ NULL);
++
++ gtk_container_set_border_width (GTK_CONTAINER (filesel), border_width);
++
++ if (show_fileops)
++ gtk_file_selection_show_fileop_buttons (GTK_FILE_SELECTION (filesel));
++ else
++ gtk_file_selection_hide_fileop_buttons (GTK_FILE_SELECTION (filesel));
++}
++
+ static void
+ gtk_file_selection_init (GtkFileSelection *filesel)
+ {
+@@ -674,17 +723,15 @@
+
+ /* The dialog-sized vertical box */
+ filesel->main_vbox = dialog->vbox;
+- gtk_container_set_border_width (GTK_CONTAINER (filesel), 10);
+
+ /* The horizontal box containing create, rename etc. buttons */
+ filesel->button_area = gtk_hbutton_box_new ();
+ gtk_button_box_set_layout (GTK_BUTTON_BOX (filesel->button_area), GTK_BUTTONBOX_START);
+- gtk_box_set_spacing (GTK_BOX (filesel->button_area), 0);
+ gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->button_area,
+ FALSE, FALSE, 0);
+ gtk_widget_show (filesel->button_area);
+
+- gtk_file_selection_show_fileop_buttons (filesel);
++ gtk_file_selection_style_set (GTK_WIDGET (filesel), NULL);
+
+ /* hbox for pulldown menu */
+ pulldown_hbox = gtk_hbox_new (TRUE, 5);
+@@ -723,25 +770,32 @@
+
+ /* The directories list */
+
+- model = gtk_list_store_new (1, G_TYPE_STRING);
++ model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_BOOLEAN); /* MA */
+ filesel->dir_list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
+ g_object_unref (model);
+
+- column = gtk_tree_view_column_new_with_attributes (_("Folders"),
++ column = gtk_tree_view_column_new_with_attributes (/*_("Folders")*/ NULL,
+ gtk_cell_renderer_text_new (),
+ "text", DIR_COLUMN,
+ NULL);
+ label = gtk_label_new_with_mnemonic (_("Fol_ders"));
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), filesel->dir_list);
+ gtk_widget_show (label);
+- gtk_tree_view_column_set_widget (column, label);
++
++ /* gtk_tree_view_column_set_widget (column, label); */
++ gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (filesel->dir_list), FALSE);
++
+ gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
+ gtk_tree_view_append_column (GTK_TREE_VIEW (filesel->dir_list), column);
+
+ gtk_widget_set_size_request (filesel->dir_list,
+ DIR_LIST_WIDTH, DIR_LIST_HEIGHT);
+ g_signal_connect (filesel->dir_list, "row_activated",
+- G_CALLBACK (gtk_file_selection_dir_activate), filesel);
++ G_CALLBACK (gtk_file_selection_activate), filesel);
++
++ g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (filesel->dir_list)), "changed",
++ G_CALLBACK (gtk_file_selection_file_changed), filesel);
++
+
+ /* gtk_clist_column_titles_passive (GTK_CLIST (filesel->dir_list)); */
+
+@@ -758,41 +812,6 @@
+ gtk_widget_show (filesel->dir_list);
+ gtk_widget_show (scrolled_win);
+
+- /* The files list */
+- model = gtk_list_store_new (1, G_TYPE_STRING);
+- filesel->file_list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
+- g_object_unref (model);
+-
+- column = gtk_tree_view_column_new_with_attributes (_("Files"),
+- gtk_cell_renderer_text_new (),
+- "text", FILE_COLUMN,
+- NULL);
+- label = gtk_label_new_with_mnemonic (_("_Files"));
+- gtk_label_set_mnemonic_widget (GTK_LABEL (label), filesel->file_list);
+- gtk_widget_show (label);
+- gtk_tree_view_column_set_widget (column, label);
+- gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
+- gtk_tree_view_append_column (GTK_TREE_VIEW (filesel->file_list), column);
+-
+- gtk_widget_set_size_request (filesel->file_list,
+- FILE_LIST_WIDTH, FILE_LIST_HEIGHT);
+- g_signal_connect (filesel->file_list, "row_activated",
+- G_CALLBACK (gtk_file_selection_file_activate), filesel);
+- g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (filesel->file_list)), "changed",
+- G_CALLBACK (gtk_file_selection_file_changed), filesel);
+-
+- /* gtk_clist_column_titles_passive (GTK_CLIST (filesel->file_list)); */
+-
+- scrolled_win = gtk_scrolled_window_new (NULL, NULL);
+- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN);
+- gtk_container_add (GTK_CONTAINER (scrolled_win), filesel->file_list);
+- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
+- GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
+- gtk_container_set_border_width (GTK_CONTAINER (scrolled_win), 0);
+- gtk_container_add (GTK_CONTAINER (list_container), scrolled_win);
+- gtk_widget_show (filesel->file_list);
+- gtk_widget_show (scrolled_win);
+-
+ /* action area for packing buttons into. */
+ filesel->action_area = gtk_hbox_new (TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->action_area,
+@@ -2008,6 +2027,23 @@
+ }
+
+ static void
++gtk_file_selection_activate (GtkTreeView *tree_view,
++ GtkTreePath *path,
++ GtkTreeViewColumn *column,
++ gpointer user_data)
++{
++ GtkTreeModel *model = gtk_tree_view_get_model (tree_view);
++ GtkTreeIter iter;
++ gboolean is_file;
++
++ gtk_tree_model_get_iter (model, &iter, path);
++ gtk_tree_model_get (model, &iter, ISFILE_COLUMN, &is_file, -1);
++
++ if (! is_file)
++ gtk_file_selection_dir_activate (tree_view, path, column, user_data);
++}
++
++static void
+ gtk_file_selection_file_activate (GtkTreeView *tree_view,
+ GtkTreePath *path,
+ GtkTreeViewColumn *column,
+@@ -2103,7 +2139,6 @@
+ PossibleCompletion* poss;
+ GtkTreeIter iter;
+ GtkListStore *dir_model;
+- GtkListStore *file_model;
+ gchar* filename;
+ gchar* rem_path = rel_path;
+ gchar* sel_text;
+@@ -2125,10 +2160,8 @@
+ g_assert (cmpl_state->reference_dir);
+
+ dir_model = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (fs->dir_list)));
+- file_model = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (fs->file_list)));
+
+ gtk_list_store_clear (dir_model);
+- gtk_list_store_clear (file_model);
+
+ /* Set the dir list to include ./ and ../ */
+ gtk_list_store_append (dir_model, &iter);
+@@ -2150,13 +2183,17 @@
+ strcmp (filename, ".." G_DIR_SEPARATOR_S) != 0)
+ {
+ gtk_list_store_append (dir_model, &iter);
+- gtk_list_store_set (dir_model, &iter, DIR_COLUMN, filename, -1);
++ gtk_list_store_set (dir_model, &iter,
++ DIR_COLUMN, filename,
++ ISFILE_COLUMN, FALSE, -1);
+ }
+ }
+ else
+ {
+- gtk_list_store_append (file_model, &iter);
+- gtk_list_store_set (file_model, &iter, DIR_COLUMN, filename, -1);
++ gtk_list_store_append (dir_model, &iter);
++ gtk_list_store_set (dir_model, &iter,
++ DIR_COLUMN, filename,
++ ISFILE_COLUMN, TRUE, -1);
+ }
+ }
+
diff --git a/recipes/gtk+/gtk+-2.8.16/spinbutton.patch b/recipes/gtk+/gtk+-2.8.16/spinbutton.patch
new file mode 100644
index 0000000000..8ad7507af0
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.8.16/spinbutton.patch
@@ -0,0 +1,128 @@
+--- gtk+-2.4.3/gtk/gtkspinbutton.c.old 2004-04-22 14:49:27.000000000 +0100
++++ gtk+-2.4.3/gtk/gtkspinbutton.c 2004-06-30 21:48:18.000000000 +0100
+@@ -733,7 +733,7 @@
+
+ spin = GTK_SPIN_BUTTON (widget);
+ arrow_size = spin_button_get_arrow_size (spin);
+- panel_width = arrow_size + 2 * widget->style->xthickness;
++ panel_width = (2 * arrow_size) + 4 * widget->style->xthickness;
+
+ widget->allocation = *allocation;
+
+@@ -866,19 +866,16 @@
+ {
+ width = spin_button_get_arrow_size (spin_button) + 2 * widget->style->xthickness;
+
++ y = widget->style->ythickness;
++ height = widget->requisition.height - (2 * y);
++
+ if (arrow_type == GTK_ARROW_UP)
+ {
+ x = 0;
+- y = 0;
+-
+- height = widget->requisition.height / 2;
+ }
+ else
+ {
+- x = 0;
+- y = widget->requisition.height / 2;
+-
+- height = (widget->requisition.height + 1) / 2;
++ x = width;
+ }
+
+ if (spin_button_at_limit (spin_button, arrow_type))
+@@ -908,32 +905,17 @@
+ shadow_type = GTK_SHADOW_OUT;
+ }
+ }
+-
++
+ gtk_paint_box (widget->style, spin_button->panel,
+ state_type, shadow_type,
+ NULL, widget,
+- (arrow_type == GTK_ARROW_UP)? "spinbutton_up" : "spinbutton_down",
++ NULL,
+ x, y, width, height);
+
+ height = widget->requisition.height;
+
+- if (arrow_type == GTK_ARROW_DOWN)
+- {
+- y = height / 2;
+- height = height - y - 2;
+- }
+- else
+- {
+- y = 2;
+- height = height / 2 - 2;
+- }
+-
+ width -= 3;
+-
+- if (widget && gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
+- x = 2;
+- else
+- x = 1;
++ height -= 3;
+
+ w = width / 2;
+ w -= w % 2 - 1; /* force odd */
+@@ -1108,7 +1090,7 @@
+ if (GTK_ENTRY (widget)->editable)
+ gtk_spin_button_update (spin);
+
+- if (event->y <= widget->requisition.height / 2)
++ if (event->x <= (spin_button_get_arrow_size (spin) + widget->style->xthickness))
+ {
+ if (event->button == 1)
+ start_spinning (spin, GTK_ARROW_UP, spin->adjustment->step_increment);
+@@ -1143,44 +1125,11 @@
+
+ arrow_size = spin_button_get_arrow_size (spin);
+
+- if (event->button == spin->button)
+- {
+- int click_child = spin->click_child;
++ gtk_spin_button_stop_spinning (spin);
+
+- gtk_spin_button_stop_spinning (spin);
+-
+- if (event->button == 3)
+- {
+- if (event->y >= 0 && event->x >= 0 &&
+- event->y <= widget->requisition.height &&
+- event->x <= arrow_size + 2 * widget->style->xthickness)
+- {
+- if (click_child == GTK_ARROW_UP &&
+- event->y <= widget->requisition.height / 2)
+- {
+- gdouble diff;
+-
+- diff = spin->adjustment->upper - spin->adjustment->value;
+- if (diff > EPSILON)
+- gtk_spin_button_real_spin (spin, diff);
+- }
+- else if (click_child == GTK_ARROW_DOWN &&
+- event->y > widget->requisition.height / 2)
+- {
+- gdouble diff;
+-
+- diff = spin->adjustment->value - spin->adjustment->lower;
+- if (diff > EPSILON)
+- gtk_spin_button_real_spin (spin, -diff);
+- }
+- }
+- }
+- spin_button_redraw (spin);
++ spin_button_redraw (spin);
+
+- return TRUE;
+- }
+- else
+- return GTK_WIDGET_CLASS (parent_class)->button_release_event (widget, event);
++ return TRUE;
+ }
+
+ static gint
diff --git a/recipes/gtk+/gtk+-2.8.9/automake-lossage.patch b/recipes/gtk+/gtk+-2.8.9/automake-lossage.patch
new file mode 100644
index 0000000000..0d423ddbb9
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.8.9/automake-lossage.patch
@@ -0,0 +1,24 @@
+--- gtk+-2.4.1/docs/tutorial/Makefile.am~ 2003-05-06 22:54:20.000000000 +0100
++++ gtk+-2.4.1/docs/tutorial/Makefile.am 2004-05-08 12:31:41.000000000 +0100
+@@ -52,21 +52,5 @@
+
+ dist-hook: html
+ cp -Rp $(srcdir)/html $(distdir)
+-else
+-html:
+- echo "***"
+- echo "*** Warning: Tutorial not built"
+- echo "***"
+-
+-pdf:
+- echo "***"
+- echo "*** Warning: Tutorial not built"
+- echo "***"
+-
+-dist-hook:
+- echo "***"
+- echo "*** Warning: Tutorial not built"
+- echo "*** DISTRIBUTION IS INCOMPLETE"
+- echo "***"
+ endif
+
diff --git a/recipes/gtk+/gtk+-2.8.9/disable-tooltips.patch b/recipes/gtk+/gtk+-2.8.9/disable-tooltips.patch
new file mode 100644
index 0000000000..d71d839c3c
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.8.9/disable-tooltips.patch
@@ -0,0 +1,11 @@
+--- gtk+-2.4.3/gtk/gtktooltips.c.old 2004-07-04 18:52:04.000000000 +0100
++++ gtk+-2.4.3/gtk/gtktooltips.c 2004-07-04 18:52:08.000000000 +0100
+@@ -118,7 +118,7 @@
+ tooltips->tips_data_list = NULL;
+
+ tooltips->delay = DEFAULT_DELAY;
+- tooltips->enabled = TRUE;
++ tooltips->enabled = FALSE;
+ tooltips->timer_tag = 0;
+ tooltips->use_sticky_delay = FALSE;
+ tooltips->last_popdown.tv_sec = -1;
diff --git a/recipes/gtk+/gtk+-2.8.9/gtk+-handhelds.patch b/recipes/gtk+/gtk+-2.8.9/gtk+-handhelds.patch
new file mode 100644
index 0000000000..4b97373f32
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.8.9/gtk+-handhelds.patch
@@ -0,0 +1,264 @@
+--- gtk+-2.8.6/gtk/gtkrange.c.orig 2005-12-07 21:13:33 +0100
++++ gtk+-2.8.6/gtk/gtkrange.c 2005-12-07 21:21:12 +0100
+@@ -186,6 +186,7 @@
+ static GtkWidgetClass *parent_class = NULL;
+ static guint signals[LAST_SIGNAL];
+
++static GdkAtom recognize_protocols_atom, atom_atom;
+
+ GType
+ gtk_range_get_type (void)
+@@ -226,6 +227,9 @@
+ object_class = (GtkObjectClass*) class;
+ widget_class = (GtkWidgetClass*) class;
+
++ recognize_protocols_atom = gdk_atom_intern ("RECOGNIZE_PROTOCOLS", FALSE);
++ atom_atom = gdk_atom_intern ("ATOM", FALSE);
++
+ parent_class = g_type_class_peek_parent (class);
+
+ gobject_class->set_property = gtk_range_set_property;
+@@ -860,6 +864,12 @@
+ &attributes, attributes_mask);
+ gdk_window_set_user_data (range->event_window, range);
+
++ gdk_property_change (range->event_window,
++ recognize_protocols_atom,
++ atom_atom,
++ 32, GDK_PROP_MODE_REPLACE,
++ NULL, 0);
++
+ widget->style = gtk_style_attach (widget->style, widget->window);
+ }
+
+@@ -1229,7 +1239,7 @@
+
+ /* ignore presses when we're already doing something else. */
+ if (range->layout->grab_location != MOUSE_OUTSIDE)
+- return FALSE;
++ return TRUE;
+
+ range->layout->mouse_x = event->x;
+ range->layout->mouse_y = event->y;
+@@ -1429,7 +1439,7 @@
+ return TRUE;
+ }
+
+- return FALSE;
++ return TRUE;
+ }
+
+ /**
+--- gtk+-2.8.6/gtk/gtkentry.c.orig 2005-09-02 21:51:06 +0200
++++ gtk+-2.8.6/gtk/gtkentry.c 2005-12-07 21:21:12 +0100
+@@ -597,6 +597,15 @@
+ 0.0,
+ GTK_PARAM_READWRITE));
+
++ gtk_widget_class_install_style_property (widget_class,
++ g_param_spec_int ("min_width",
++ _("Minimum width"),
++ _("Minimum width of the entry field"),
++ 0,
++ G_MAXINT,
++ MIN_ENTRY_WIDTH,
++ G_PARAM_READABLE));
++
+ signals[POPULATE_POPUP] =
+ g_signal_new ("populate_popup",
+ G_OBJECT_CLASS_TYPE (gobject_class),
+@@ -1227,7 +1236,7 @@
+ {
+ GtkEntry *entry = GTK_ENTRY (widget);
+ PangoFontMetrics *metrics;
+- gint xborder, yborder;
++ gint xborder, yborder, min_width;
+ PangoContext *context;
+
+ gtk_widget_ensure_style (widget);
+@@ -1243,9 +1252,11 @@
+
+ xborder += INNER_BORDER;
+ yborder += INNER_BORDER;
+-
++
++ gtk_widget_style_get (widget, "min_width", &min_width, NULL);
++
+ if (entry->width_chars < 0)
+- requisition->width = MIN_ENTRY_WIDTH + xborder * 2;
++ requisition->width = min_width + xborder * 2;
+ else
+ {
+ gint char_width = pango_font_metrics_get_approximate_char_width (metrics);
+--- gtk+-2.8.6/gtk/gtkarrow.c.orig 2005-06-21 17:38:39 +0200
++++ gtk+-2.8.6/gtk/gtkarrow.c 2005-12-07 21:21:12 +0100
+@@ -31,7 +31,7 @@
+ #include "gtkintl.h"
+ #include "gtkalias.h"
+
+-#define MIN_ARROW_SIZE 15
++#define MIN_ARROW_SIZE 7
+
+ enum {
+ PROP_0,
+@@ -55,6 +55,8 @@
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec);
++static void gtk_arrow_size_request (GtkWidget *arrow,
++ GtkRequisition *requisition);
+
+ GType
+ gtk_arrow_get_type (void)
+@@ -113,6 +115,7 @@
+ GTK_PARAM_READWRITE));
+
+ widget_class->expose_event = gtk_arrow_expose;
++ widget_class->size_request = gtk_arrow_size_request;
+ }
+
+ static void
+@@ -168,13 +171,18 @@
+ }
+
+ static void
++gtk_arrow_size_request (GtkWidget *arrow,
++ GtkRequisition *requisition)
++{
++ requisition->width = MIN_ARROW_SIZE + GTK_MISC (arrow)->xpad * 2;
++ requisition->height = MIN_ARROW_SIZE + GTK_MISC (arrow)->ypad * 2;
++}
++
++static void
+ gtk_arrow_init (GtkArrow *arrow)
+ {
+ GTK_WIDGET_SET_FLAGS (arrow, GTK_NO_WINDOW);
+
+- GTK_WIDGET (arrow)->requisition.width = MIN_ARROW_SIZE + GTK_MISC (arrow)->xpad * 2;
+- GTK_WIDGET (arrow)->requisition.height = MIN_ARROW_SIZE + GTK_MISC (arrow)->ypad * 2;
+-
+ arrow->arrow_type = GTK_ARROW_RIGHT;
+ arrow->shadow_type = GTK_SHADOW_OUT;
+ }
+--- gtk+-2.8.6/gtk/gtkcalendar.c.orig 2005-12-07 21:36:14 +0100
++++ gtk+-2.8.6/gtk/gtkcalendar.c 2005-12-07 21:49:21 +0100
+@@ -692,6 +692,35 @@
+ ****************************************/
+
+ static void
++calendar_select_day (GtkCalendar *calendar, guint day)
++{
++ g_return_if_fail (GTK_IS_CALENDAR (calendar));
++ g_return_if_fail (day <= 31);
++
++ /* Deselect the old day */
++ if (calendar->selected_day > 0)
++ {
++ gint selected_day;
++
++ selected_day = calendar->selected_day;
++ calendar->selected_day = 0;
++ if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar)))
++ calendar_invalidate_day_num (calendar, selected_day);
++ }
++
++ calendar->selected_day = day;
++
++ /* Select the new day */
++ if (day != 0)
++ {
++ if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar)))
++ calendar_invalidate_day_num (calendar, day);
++ }
++
++ g_object_notify (G_OBJECT (calendar), "day");
++}
++
++static void
+ calendar_set_month_next (GtkCalendar *calendar)
+ {
+ gint month_len;
+@@ -723,10 +752,10 @@
+ if (month_len < calendar->selected_day)
+ {
+ calendar->selected_day = 0;
+- gtk_calendar_select_day (calendar, month_len);
++ calendar_select_day (calendar, month_len);
+ }
+ else
+- gtk_calendar_select_day (calendar, calendar->selected_day);
++ calendar_select_day (calendar, calendar->selected_day);
+
+ gtk_widget_queue_draw (GTK_WIDGET (calendar));
+ }
+@@ -752,10 +781,10 @@
+ if (month_len < calendar->selected_day)
+ {
+ calendar->selected_day = 0;
+- gtk_calendar_select_day (calendar, month_len);
++ calendar_select_day (calendar, month_len);
+ }
+ else
+- gtk_calendar_select_day (calendar, calendar->selected_day);
++ calendar_select_day (calendar, calendar->selected_day);
+
+ gtk_widget_queue_draw (GTK_WIDGET (calendar));
+ }
+@@ -784,10 +813,10 @@
+ if (month_len < calendar->selected_day)
+ {
+ calendar->selected_day = 0;
+- gtk_calendar_select_day (calendar, month_len);
++ calendar_select_day (calendar, month_len);
+ }
+ else
+- gtk_calendar_select_day (calendar, calendar->selected_day);
++ calendar_select_day (calendar, calendar->selected_day);
+
+ gtk_widget_queue_draw (GTK_WIDGET (calendar));
+ }
+@@ -1088,13 +1117,13 @@
+ if (month_len < calendar->selected_day)
+ {
+ calendar->selected_day = 0;
+- gtk_calendar_select_day (calendar, month_len);
++ calendar_select_day (calendar, month_len);
+ }
+ else
+ {
+ if (calendar->selected_day < 0)
+ calendar->selected_day = calendar->selected_day + 1 + month_length[leap (calendar->year)][calendar->month + 1];
+- gtk_calendar_select_day (calendar, calendar->selected_day);
++ calendar_select_day (calendar, calendar->selected_day);
+ }
+
+ gtk_widget_queue_draw (GTK_WIDGET (calendar));
+@@ -3285,27 +3314,7 @@
+ g_return_if_fail (GTK_IS_CALENDAR (calendar));
+ g_return_if_fail (day <= 31);
+
+- /* Deselect the old day */
+- if (calendar->selected_day > 0)
+- {
+- gint selected_day;
+-
+- selected_day = calendar->selected_day;
+- calendar->selected_day = 0;
+- if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar)))
+- calendar_invalidate_day_num (calendar, selected_day);
+- }
+-
+- calendar->selected_day = day;
+-
+- /* Select the new day */
+- if (day != 0)
+- {
+- if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar)))
+- calendar_invalidate_day_num (calendar, day);
+- }
+-
+- g_object_notify (G_OBJECT (calendar), "day");
++ calendar_select_day (calendar, day);
+
+ g_signal_emit (calendar,
+ gtk_calendar_signals[DAY_SELECTED_SIGNAL],
diff --git a/recipes/gtk+/gtk+-2.8.9/hardcoded_libtool.patch b/recipes/gtk+/gtk+-2.8.9/hardcoded_libtool.patch
new file mode 100644
index 0000000000..b2afddcc61
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.8.9/hardcoded_libtool.patch
@@ -0,0 +1,29 @@
+--- gtk+-2.6.0/configure.in.old 2005-01-01 16:23:45.000000000 +0000
++++ gtk+-2.6.0/configure.in 2005-01-01 16:24:03.000000000 +0000
+@@ -360,7 +360,7 @@
+ AC_MSG_CHECKING([Whether to write dependencies into .pc files])
+ case $enable_explicit_deps in
+ auto)
+- deplib_check_method=`(./libtool --config; echo eval echo \\$deplib_check_method) | sh`
++ deplib_check_method=`($host_alias-libtool --config; echo eval echo \\$deplib_check_method) | sh`
+ if test "X$deplib_check_method" = Xnone || test "x$enable_static" = xyes ; then
+ enable_explicit_deps=yes
+ else
+@@ -688,7 +688,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/'`
+@@ -1512,7 +1512,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_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/recipes/gtk+/gtk+-2.8.9/menu-deactivate.patch b/recipes/gtk+/gtk+-2.8.9/menu-deactivate.patch
new file mode 100644
index 0000000000..29e665fbf3
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.8.9/menu-deactivate.patch
@@ -0,0 +1,50 @@
+--- gtk+-2.4.4/gtk/gtkmenushell.c.old Thu Aug 26 23:45:28 2004
++++ gtk+-2.4.4/gtk/gtkmenushell.c Fri Aug 27 00:13:33 2004
+@@ -37,7 +37,7 @@
+ #include "gtktearoffmenuitem.h"
+ #include "gtkwindow.h"
+
+-#define MENU_SHELL_TIMEOUT 500
++#define MENU_SHELL_TIMEOUT 2000
+
+ enum {
+ DEACTIVATE,
+@@ -156,6 +156,7 @@
+ static GtkContainerClass *parent_class = NULL;
+ static guint menu_shell_signals[LAST_SIGNAL] = { 0 };
+
++static int last_crossing_time;
+
+ GType
+ gtk_menu_shell_get_type (void)
+@@ -418,6 +419,7 @@
+ gtk_grab_add (GTK_WIDGET (menu_shell));
+ menu_shell->have_grab = TRUE;
+ menu_shell->active = TRUE;
++ last_crossing_time = 0;
+ }
+ }
+
+@@ -545,6 +547,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)
+ {
+@@ -597,6 +606,8 @@
+ if (menu_shell->active)
+ {
+ menu_item = gtk_get_event_widget ((GdkEvent*) event);
++
++ last_crossing_time = event->time;
+
+ if (!menu_item ||
+ (GTK_IS_MENU_ITEM (menu_item) &&
diff --git a/recipes/gtk+/gtk+-2.8.9/no-demos.patch b/recipes/gtk+/gtk+-2.8.9/no-demos.patch
new file mode 100644
index 0000000000..0145067ad5
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.8.9/no-demos.patch
@@ -0,0 +1,10 @@
+--- gtk+-2.8.6/Makefile.am.orig 2005-12-07 21:30:56 +0100
++++ gtk+-2.8.6/Makefile.am 2005-12-07 21:31:10 +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/recipes/gtk+/gtk+-2.8.9/no-xwc.patch b/recipes/gtk+/gtk+-2.8.9/no-xwc.patch
new file mode 100644
index 0000000000..affb4a303e
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.8.9/no-xwc.patch
@@ -0,0 +1,151 @@
+diff -urNd ../gtk+-2.6.0-r2/gtk+-2.6.0/gdk/x11/gdkdrawable-x11.c gtk+-2.6.0/gdk/x11/gdkdrawable-x11.c
+--- ../gtk+-2.6.0-r2/gtk+-2.6.0/gdk/x11/gdkdrawable-x11.c 2004-11-30 14:57:14 +00:00
++++ gtk+-2.6.0/gdk/x11/gdkdrawable-x11.c 2005-01-02 15:38:06 +00:00
+@@ -576,12 +576,14 @@
+ GDK_GC_GET_XGC (gc), x, y, (XChar2b *) text, text_length / 2);
+ }
+ }
++#ifdef HAVE_XWC
+ else if (font->type == GDK_FONT_FONTSET)
+ {
+ XFontSet fontset = (XFontSet) GDK_FONT_XFONT (font);
+ XmbDrawString (xdisplay, impl->xid,
+ fontset, GDK_GC_GET_XGC (gc), x, y, text, text_length);
+ }
++#endif
+ else
+ g_error("undefined font type\n");
+ }
+@@ -613,6 +615,7 @@
+ GDK_GC_GET_XGC (gc), x, y, text_8bit, text_length);
+ g_free (text_8bit);
+ }
++#ifdef HAVE_XWC
+ else if (font->type == GDK_FONT_FONTSET)
+ {
+ if (sizeof(GdkWChar) == sizeof(wchar_t))
+@@ -633,6 +636,7 @@
+ g_free (text_wchar);
+ }
+ }
++#endif
+ else
+ g_error("undefined font type\n");
+ }
+diff -urNd ../gtk+-2.6.0-r2/gtk+-2.6.0/gdk/x11/gdkfont-x11.c gtk+-2.6.0/gdk/x11/gdkfont-x11.c
+--- ../gtk+-2.6.0-r2/gtk+-2.6.0/gdk/x11/gdkfont-x11.c 2004-08-26 01:23:46 +01:00
++++ gtk+-2.6.0/gdk/x11/gdkfont-x11.c 2005-01-02 15:45:39 +00:00
+@@ -525,10 +525,12 @@
+ width = XTextWidth16 (xfont, (XChar2b *) text, text_length / 2);
+ }
+ break;
++#ifdef HAVE_XWC
+ case GDK_FONT_FONTSET:
+ fontset = (XFontSet) private->xfont;
+ width = XmbTextEscapement (fontset, text, text_length);
+ break;
++#endif
+ default:
+ width = 0;
+ }
+@@ -578,6 +580,7 @@
+ width = 0;
+ }
+ break;
++#ifdef HAVE_XWC
+ case GDK_FONT_FONTSET:
+ if (sizeof(GdkWChar) == sizeof(wchar_t))
+ {
+@@ -595,6 +598,7 @@
+ g_free (text_wchar);
+ }
+ break;
++#endif
+ default:
+ width = 0;
+ }
+@@ -667,6 +671,7 @@
+ if (descent)
+ *descent = overall.descent;
+ break;
++#ifdef HAVE_XWC
+ case GDK_FONT_FONTSET:
+ fontset = (XFontSet) private->xfont;
+ XmbTextExtents (fontset, text, text_length, &ink, &logical);
+@@ -681,6 +686,7 @@
+ if (descent)
+ *descent = ink.y + ink.height;
+ break;
++#endif
+ }
+
+ }
+@@ -753,6 +759,7 @@
+ *descent = overall.descent;
+ break;
+ }
++#ifdef HAVE_XWC
+ case GDK_FONT_FONTSET:
+ fontset = (XFontSet) private->xfont;
+
+@@ -780,6 +787,7 @@
+ if (descent)
+ *descent = ink.y + ink.height;
+ break;
++#endif
+ }
+
+ }
+diff -urNd ../gtk+-2.6.0-r2/gtk+-2.6.0/gdk/x11/gdkim-x11.c gtk+-2.6.0/gdk/x11/gdkim-x11.c
+--- ../gtk+-2.6.0-r2/gtk+-2.6.0/gdk/x11/gdkim-x11.c 2004-11-17 00:55:10 +00:00
++++ gtk+-2.6.0/gdk/x11/gdkim-x11.c 2005-01-02 15:42:04 +00:00
+@@ -48,6 +48,7 @@
+ void
+ _gdk_x11_initialize_locale (void)
+ {
++#ifdef HAVE_XWC
+ wchar_t result;
+ gchar *current_locale;
+ static char *last_locale = NULL;
+@@ -93,7 +94,8 @@
+ GDK_NOTE (XIM,
+ g_message ("%s multi-byte string functions.",
+ gdk_use_mb ? "Using" : "Not using"));
+-
++#endif
++
+ return;
+ }
+
+@@ -136,6 +138,7 @@
+ {
+ gchar *mbstr;
+
++#ifdef HAVE_XWC
+ if (gdk_use_mb)
+ {
+ GdkDisplay *display = find_a_display ();
+@@ -178,6 +181,7 @@
+ XFree (tpr.value);
+ }
+ else
++#endif
+ {
+ gint length = 0;
+ gint i;
+@@ -210,6 +214,7 @@
+ gint
+ gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max)
+ {
++#ifdef HAVE_XWC
+ if (gdk_use_mb)
+ {
+ GdkDisplay *display = find_a_display ();
+@@ -242,6 +247,7 @@
+ return len_cpy;
+ }
+ else
++#endif
+ {
+ gint i;
+
diff --git a/recipes/gtk+/gtk+-2.8.9/scroll-timings.patch b/recipes/gtk+/gtk+-2.8.9/scroll-timings.patch
new file mode 100644
index 0000000000..a38b21dcc2
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.8.9/scroll-timings.patch
@@ -0,0 +1,15 @@
+--- gtk+-2.4.4/gtk/gtkrange.c~ 2004-08-23 01:50:22.000000000 +0100
++++ gtk+-2.4.4/gtk/gtkrange.c 2004-08-27 15:48:49.000000000 +0100
+@@ -35,9 +35,9 @@
+ #include "gtkintl.h"
+ #include "gtkscrollbar.h"
+
+-#define SCROLL_INITIAL_DELAY 250 /* must hold button this long before ... */
+-#define SCROLL_LATER_DELAY 100 /* ... it starts repeating at this rate */
+-#define UPDATE_DELAY 300 /* Delay for queued update */
++#define SCROLL_INITIAL_DELAY 500 /* must hold button this long before ... */
++#define SCROLL_LATER_DELAY 200 /* ... it starts repeating at this rate */
++#define UPDATE_DELAY 1000 /* Delay for queued update */
+
+ enum {
+ PROP_0,
diff --git a/recipes/gtk+/gtk+-2.8.9/single-click.patch b/recipes/gtk+/gtk+-2.8.9/single-click.patch
new file mode 100644
index 0000000000..1bf0db12a8
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.8.9/single-click.patch
@@ -0,0 +1,36 @@
+--- gtk+-2.8.6/gtk/gtkfilesel.c.orig 2005-12-07 21:13:33 +0100
++++ gtk+-2.8.6/gtk/gtkfilesel.c 2005-12-07 21:14:56 +0100
+@@ -2461,6 +2461,33 @@
+ if (fs->last_selected != NULL)
+ g_free (fs->last_selected);
+
++ // Single-click directory entry
++ if (new_names->len == 1)
++ {
++ GtkTreeView *tree_view;
++ GtkTreeModel *model;
++ GtkTreePath *path;
++ GtkTreeIter iter;
++ gboolean is_file;
++
++ tree_view = gtk_tree_selection_get_tree_view (selection);
++
++ if (gtk_tree_selection_get_selected (selection, &model, &iter))
++ {
++ path = gtk_tree_model_get_path (model, &iter);
++ gtk_tree_model_get (model, &iter, ISFILE_COLUMN, &is_file, -1);
++
++ if (!is_file)
++ {
++ gtk_file_selection_dir_activate (tree_view, path,
++ gtk_tree_view_get_column (tree_view, DIR_COLUMN),
++ user_data);
++ }
++
++ gtk_tree_path_free (path);
++ }
++ }
++
+ fs->last_selected = g_strdup (g_ptr_array_index (new_names, index));
+ filename = get_real_filename (fs->last_selected, FALSE);
+
diff --git a/recipes/gtk+/gtk+-2.8.9/small-gtkfilesel.patch b/recipes/gtk+/gtk+-2.8.9/small-gtkfilesel.patch
new file mode 100644
index 0000000000..20bf4cf366
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.8.9/small-gtkfilesel.patch
@@ -0,0 +1,267 @@
+diff -urNd ../gtk+-2.4.4-r5/gtk+-2.4.4/gtk/gtkfilesel.c gtk+-2.4.4/gtk/gtkfilesel.c
+--- ../gtk+-2.4.4-r5/gtk+-2.4.4/gtk/gtkfilesel.c 2004-07-10 05:02:10.000000000 +0100
++++ gtk+-2.4.4/gtk/gtkfilesel.c 2004-09-13 13:40:09.000000000 +0100
+@@ -68,6 +68,7 @@
+ #include "gtkprivate.h"
+ #include "gtkscrolledwindow.h"
+ #include "gtkstock.h"
++#include "gtksignal.h"
+ #include "gtktreeselection.h"
+ #include "gtktreeview.h"
+ #include "gtkvbox.h"
+@@ -77,6 +78,7 @@
+ #include "gtkmessagedialog.h"
+ #include "gtkdnd.h"
+ #include "gtkeventbox.h"
++#include "gtkimage.h"
+
+ #undef GTK_DISABLE_DEPRECATED
+ #include "gtkoptionmenu.h"
+@@ -245,7 +247,8 @@
+ };
+
+ enum {
+- DIR_COLUMN
++ DIR_COLUMN,
++ ISFILE_COLUMN
+ };
+
+ enum {
+@@ -400,6 +403,12 @@
+ GtkTreePath *path,
+ GtkTreeViewColumn *column,
+ gpointer user_data);
++
++static void gtk_file_selection_activate (GtkTreeView *tree_view,
++ GtkTreePath *path,
++ GtkTreeViewColumn *column,
++ gpointer user_data);
++
+ static void gtk_file_selection_file_changed (GtkTreeSelection *selection,
+ gpointer user_data);
+ static void gtk_file_selection_dir_activate (GtkTreeView *tree_view,
+@@ -419,6 +428,7 @@
+ static void gtk_file_selection_create_dir (GtkWidget *widget, gpointer data);
+ static void gtk_file_selection_delete_file (GtkWidget *widget, gpointer data);
+ static void gtk_file_selection_rename_file (GtkWidget *widget, gpointer data);
++static void gtk_file_selection_style_set (GtkWidget *widget, GtkStyle *prev_style);
+
+ static void free_selected_names (GPtrArray *names);
+
+@@ -578,6 +588,23 @@
+ G_PARAM_WRITABLE));
+ object_class->destroy = gtk_file_selection_destroy;
+ widget_class->map = gtk_file_selection_map;
++ widget_class->style_set = gtk_file_selection_style_set;
++
++ gtk_widget_class_install_style_property (widget_class,
++ g_param_spec_boolean ("show_fileops_default",
++ _("Show fileop buttons by default"),
++ _("Whether file operation buttons are shown by default"),
++ TRUE,
++ G_PARAM_READABLE));
++
++ gtk_widget_class_install_style_property (widget_class,
++ g_param_spec_int ("border_width",
++ _("Border width"),
++ _("Width of border around the main dialog area"),
++ 0,
++ G_MAXINT,
++ 10,
++ G_PARAM_READABLE));
+ }
+
+ static void gtk_file_selection_set_property (GObject *object,
+@@ -649,7 +676,29 @@
+ gtk_widget_grab_default (widget);
+ return FALSE;
+ }
+-
++
++static void
++gtk_file_selection_style_set (GtkWidget *filesel,
++ GtkStyle *prev_style)
++{
++ gboolean show_fileops;
++ gint border_width;
++
++ gtk_widget_style_get (filesel,
++ "show_fileops_default",
++ &show_fileops,
++ "border_width",
++ &border_width,
++ NULL);
++
++ gtk_container_set_border_width (GTK_CONTAINER (filesel), border_width);
++
++ if (show_fileops)
++ gtk_file_selection_show_fileop_buttons (GTK_FILE_SELECTION (filesel));
++ else
++ gtk_file_selection_hide_fileop_buttons (GTK_FILE_SELECTION (filesel));
++}
++
+ static void
+ gtk_file_selection_init (GtkFileSelection *filesel)
+ {
+@@ -674,17 +723,15 @@
+
+ /* The dialog-sized vertical box */
+ filesel->main_vbox = dialog->vbox;
+- gtk_container_set_border_width (GTK_CONTAINER (filesel), 10);
+
+ /* The horizontal box containing create, rename etc. buttons */
+ filesel->button_area = gtk_hbutton_box_new ();
+ gtk_button_box_set_layout (GTK_BUTTON_BOX (filesel->button_area), GTK_BUTTONBOX_START);
+- gtk_box_set_spacing (GTK_BOX (filesel->button_area), 0);
+ gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->button_area,
+ FALSE, FALSE, 0);
+ gtk_widget_show (filesel->button_area);
+
+- gtk_file_selection_show_fileop_buttons (filesel);
++ gtk_file_selection_style_set (GTK_WIDGET (filesel), NULL);
+
+ /* hbox for pulldown menu */
+ pulldown_hbox = gtk_hbox_new (TRUE, 5);
+@@ -723,25 +770,32 @@
+
+ /* The directories list */
+
+- model = gtk_list_store_new (1, G_TYPE_STRING);
++ model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_BOOLEAN); /* MA */
+ filesel->dir_list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
+ g_object_unref (model);
+
+- column = gtk_tree_view_column_new_with_attributes (_("Folders"),
++ column = gtk_tree_view_column_new_with_attributes (/*_("Folders")*/ NULL,
+ gtk_cell_renderer_text_new (),
+ "text", DIR_COLUMN,
+ NULL);
+ label = gtk_label_new_with_mnemonic (_("Fol_ders"));
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), filesel->dir_list);
+ gtk_widget_show (label);
+- gtk_tree_view_column_set_widget (column, label);
++
++ /* gtk_tree_view_column_set_widget (column, label); */
++ gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (filesel->dir_list), FALSE);
++
+ gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
+ gtk_tree_view_append_column (GTK_TREE_VIEW (filesel->dir_list), column);
+
+ gtk_widget_set_size_request (filesel->dir_list,
+ DIR_LIST_WIDTH, DIR_LIST_HEIGHT);
+ g_signal_connect (filesel->dir_list, "row_activated",
+- G_CALLBACK (gtk_file_selection_dir_activate), filesel);
++ G_CALLBACK (gtk_file_selection_activate), filesel);
++
++ g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (filesel->dir_list)), "changed",
++ G_CALLBACK (gtk_file_selection_file_changed), filesel);
++
+
+ /* gtk_clist_column_titles_passive (GTK_CLIST (filesel->dir_list)); */
+
+@@ -758,41 +812,6 @@
+ gtk_widget_show (filesel->dir_list);
+ gtk_widget_show (scrolled_win);
+
+- /* The files list */
+- model = gtk_list_store_new (1, G_TYPE_STRING);
+- filesel->file_list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
+- g_object_unref (model);
+-
+- column = gtk_tree_view_column_new_with_attributes (_("Files"),
+- gtk_cell_renderer_text_new (),
+- "text", FILE_COLUMN,
+- NULL);
+- label = gtk_label_new_with_mnemonic (_("_Files"));
+- gtk_label_set_mnemonic_widget (GTK_LABEL (label), filesel->file_list);
+- gtk_widget_show (label);
+- gtk_tree_view_column_set_widget (column, label);
+- gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
+- gtk_tree_view_append_column (GTK_TREE_VIEW (filesel->file_list), column);
+-
+- gtk_widget_set_size_request (filesel->file_list,
+- FILE_LIST_WIDTH, FILE_LIST_HEIGHT);
+- g_signal_connect (filesel->file_list, "row_activated",
+- G_CALLBACK (gtk_file_selection_file_activate), filesel);
+- g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (filesel->file_list)), "changed",
+- G_CALLBACK (gtk_file_selection_file_changed), filesel);
+-
+- /* gtk_clist_column_titles_passive (GTK_CLIST (filesel->file_list)); */
+-
+- scrolled_win = gtk_scrolled_window_new (NULL, NULL);
+- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN);
+- gtk_container_add (GTK_CONTAINER (scrolled_win), filesel->file_list);
+- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
+- GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
+- gtk_container_set_border_width (GTK_CONTAINER (scrolled_win), 0);
+- gtk_container_add (GTK_CONTAINER (list_container), scrolled_win);
+- gtk_widget_show (filesel->file_list);
+- gtk_widget_show (scrolled_win);
+-
+ /* action area for packing buttons into. */
+ filesel->action_area = gtk_hbox_new (TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->action_area,
+@@ -2008,6 +2027,23 @@
+ }
+
+ static void
++gtk_file_selection_activate (GtkTreeView *tree_view,
++ GtkTreePath *path,
++ GtkTreeViewColumn *column,
++ gpointer user_data)
++{
++ GtkTreeModel *model = gtk_tree_view_get_model (tree_view);
++ GtkTreeIter iter;
++ gboolean is_file;
++
++ gtk_tree_model_get_iter (model, &iter, path);
++ gtk_tree_model_get (model, &iter, ISFILE_COLUMN, &is_file, -1);
++
++ if (! is_file)
++ gtk_file_selection_dir_activate (tree_view, path, column, user_data);
++}
++
++static void
+ gtk_file_selection_file_activate (GtkTreeView *tree_view,
+ GtkTreePath *path,
+ GtkTreeViewColumn *column,
+@@ -2103,7 +2139,6 @@
+ PossibleCompletion* poss;
+ GtkTreeIter iter;
+ GtkListStore *dir_model;
+- GtkListStore *file_model;
+ gchar* filename;
+ gchar* rem_path = rel_path;
+ gchar* sel_text;
+@@ -2125,10 +2160,8 @@
+ g_assert (cmpl_state->reference_dir);
+
+ dir_model = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (fs->dir_list)));
+- file_model = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (fs->file_list)));
+
+ gtk_list_store_clear (dir_model);
+- gtk_list_store_clear (file_model);
+
+ /* Set the dir list to include ./ and ../ */
+ gtk_list_store_append (dir_model, &iter);
+@@ -2150,13 +2183,17 @@
+ strcmp (filename, ".." G_DIR_SEPARATOR_S) != 0)
+ {
+ gtk_list_store_append (dir_model, &iter);
+- gtk_list_store_set (dir_model, &iter, DIR_COLUMN, filename, -1);
++ gtk_list_store_set (dir_model, &iter,
++ DIR_COLUMN, filename,
++ ISFILE_COLUMN, FALSE, -1);
+ }
+ }
+ else
+ {
+- gtk_list_store_append (file_model, &iter);
+- gtk_list_store_set (file_model, &iter, DIR_COLUMN, filename, -1);
++ gtk_list_store_append (dir_model, &iter);
++ gtk_list_store_set (dir_model, &iter,
++ DIR_COLUMN, filename,
++ ISFILE_COLUMN, TRUE, -1);
+ }
+ }
+
diff --git a/recipes/gtk+/gtk+-2.8.9/spinbutton.patch b/recipes/gtk+/gtk+-2.8.9/spinbutton.patch
new file mode 100644
index 0000000000..8ad7507af0
--- /dev/null
+++ b/recipes/gtk+/gtk+-2.8.9/spinbutton.patch
@@ -0,0 +1,128 @@
+--- gtk+-2.4.3/gtk/gtkspinbutton.c.old 2004-04-22 14:49:27.000000000 +0100
++++ gtk+-2.4.3/gtk/gtkspinbutton.c 2004-06-30 21:48:18.000000000 +0100
+@@ -733,7 +733,7 @@
+
+ spin = GTK_SPIN_BUTTON (widget);
+ arrow_size = spin_button_get_arrow_size (spin);
+- panel_width = arrow_size + 2 * widget->style->xthickness;
++ panel_width = (2 * arrow_size) + 4 * widget->style->xthickness;
+
+ widget->allocation = *allocation;
+
+@@ -866,19 +866,16 @@
+ {
+ width = spin_button_get_arrow_size (spin_button) + 2 * widget->style->xthickness;
+
++ y = widget->style->ythickness;
++ height = widget->requisition.height - (2 * y);
++
+ if (arrow_type == GTK_ARROW_UP)
+ {
+ x = 0;
+- y = 0;
+-
+- height = widget->requisition.height / 2;
+ }
+ else
+ {
+- x = 0;
+- y = widget->requisition.height / 2;
+-
+- height = (widget->requisition.height + 1) / 2;
++ x = width;
+ }
+
+ if (spin_button_at_limit (spin_button, arrow_type))
+@@ -908,32 +905,17 @@
+ shadow_type = GTK_SHADOW_OUT;
+ }
+ }
+-
++
+ gtk_paint_box (widget->style, spin_button->panel,
+ state_type, shadow_type,
+ NULL, widget,
+- (arrow_type == GTK_ARROW_UP)? "spinbutton_up" : "spinbutton_down",
++ NULL,
+ x, y, width, height);
+
+ height = widget->requisition.height;
+
+- if (arrow_type == GTK_ARROW_DOWN)
+- {
+- y = height / 2;
+- height = height - y - 2;
+- }
+- else
+- {
+- y = 2;
+- height = height / 2 - 2;
+- }
+-
+ width -= 3;
+-
+- if (widget && gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
+- x = 2;
+- else
+- x = 1;
++ height -= 3;
+
+ w = width / 2;
+ w -= w % 2 - 1; /* force odd */
+@@ -1108,7 +1090,7 @@
+ if (GTK_ENTRY (widget)->editable)
+ gtk_spin_button_update (spin);
+
+- if (event->y <= widget->requisition.height / 2)
++ if (event->x <= (spin_button_get_arrow_size (spin) + widget->style->xthickness))
+ {
+ if (event->button == 1)
+ start_spinning (spin, GTK_ARROW_UP, spin->adjustment->step_increment);
+@@ -1143,44 +1125,11 @@
+
+ arrow_size = spin_button_get_arrow_size (spin);
+
+- if (event->button == spin->button)
+- {
+- int click_child = spin->click_child;
++ gtk_spin_button_stop_spinning (spin);
+
+- gtk_spin_button_stop_spinning (spin);
+-
+- if (event->button == 3)
+- {
+- if (event->y >= 0 && event->x >= 0 &&
+- event->y <= widget->requisition.height &&
+- event->x <= arrow_size + 2 * widget->style->xthickness)
+- {
+- if (click_child == GTK_ARROW_UP &&
+- event->y <= widget->requisition.height / 2)
+- {
+- gdouble diff;
+-
+- diff = spin->adjustment->upper - spin->adjustment->value;
+- if (diff > EPSILON)
+- gtk_spin_button_real_spin (spin, diff);
+- }
+- else if (click_child == GTK_ARROW_DOWN &&
+- event->y > widget->requisition.height / 2)
+- {
+- gdouble diff;
+-
+- diff = spin->adjustment->value - spin->adjustment->lower;
+- if (diff > EPSILON)
+- gtk_spin_button_real_spin (spin, -diff);
+- }
+- }
+- }
+- spin_button_redraw (spin);
++ spin_button_redraw (spin);
+
+- return TRUE;
+- }
+- else
+- return GTK_WIDGET_CLASS (parent_class)->button_release_event (widget, event);
++ return TRUE;
+ }
+
+ static gint
diff --git a/recipes/gtk+/gtk+-fastscaling_2.10.14.bb b/recipes/gtk+/gtk+-fastscaling_2.10.14.bb
new file mode 100644
index 0000000000..cb79d66301
--- /dev/null
+++ b/recipes/gtk+/gtk+-fastscaling_2.10.14.bb
@@ -0,0 +1,14 @@
+require gtk+_${PV}.bb
+
+FILESPATH_prepend = "${FILE_DIRNAME}/gtk+-${PV}:"
+
+DEFAULT_PREFERENCE = "-1"
+
+PROVIDES = "gtk+"
+RPROVIDES_${PN} = "gtk+"
+PR = "r2"
+
+SRC_URI += "file://lower-quality-scaling-in-pixbuf-engine.patch;patch=1"
+
+S = "${WORKDIR}/gtk+-${PV}"
+
diff --git a/recipes/gtk+/gtk+-native-1.2_1.2.10.bb b/recipes/gtk+/gtk+-native-1.2_1.2.10.bb
new file mode 100644
index 0000000000..f5ad1a58ab
--- /dev/null
+++ b/recipes/gtk+/gtk+-native-1.2_1.2.10.bb
@@ -0,0 +1,58 @@
+DESCRIPTION = "GTK+1.2 is a deprecated library provided for running programs not yet converted to GTK+2.0"
+HOMEPAGE = "http://www.gtk.org"
+SECTION = "libs"
+LICENSE = "LGPL"
+PRIORITY = "optional"
+DEPENDS = "glib-1.2 jpeg libpng libxext"
+
+PR = "r1"
+
+FILESPATH =+ "${FILE_DIRNAME}/gtk+-1.2-1.2.10:"
+SRC_URI = "ftp://ftp.gtk.org/pub/gtk/v1.2/gtk+-${PV}.tar.gz \
+ file://gtk+1.2-reconf-fix;patch=1 \
+ file://no-xwc;patch=1"
+S = "${WORKDIR}/gtk+-${PV}"
+
+inherit autotools pkgconfig flow-lossage
+
+do_configure_prepend() {
+ install -d m4
+ rm -f ltconfig libtool ltmain.sh
+ libtoolize --force
+}
+
+FILES_${PN} += "${datadir}/themes"
+FILES_${PN}-dev += "${datadir}/gtk-1.2/include ${libdir}/gtk-1.2/include"
+
+
+EXTRA_OECONF = "--enable-debug=no --disable-glibtest --disable-xim"
+# --disable-cruft
+
+LIBV = "1.2.10"
+
+gtk_include = "fnmatch.h gtk.h gtkaccelgroup.h gtkaccellabel.h gtkadjustment.h gtkalignment.h gtkarg.h gtkarrow.h gtkaspectframe.h gtkbbox.h gtkbin.h gtkbindings.h gtkbox.h gtkbutton.h gtkcalendar.h gtkcheckbutton.h gtkcheckmenuitem.h gtkclist.h gtkcolorsel.h gtkcombo.h gtkcompat.h gtkcontainer.h gtkctree.h gtkcurve.h gtkdata.h gtkdebug.h gtkdialog.h gtkdnd.h gtkdrawingarea.h gtkeditable.h gtkentry.h gtkenums.h gtkeventbox.h gtkfeatures.h gtkfilesel.h gtkfixed.h gtkfontsel.h gtkframe.h gtkgamma.h gtkgc.h gtkhandlebox.h gtkhbbox.h gtkhbox.h gtkhpaned.h gtkhruler.h gtkhscale.h gtkhscrollbar.h gtkhseparator.h gtkimage.h gtkinputdialog.h gtkintl.h gtkinvisible.h gtkitem.h gtkitemfactory.h gtklabel.h gtklayout.h gtklist.h gtklistitem.h gtkmain.h gtkmarshal.h gtkmenu.h gtkmenubar.h gtkmenufactory.h gtkmenuitem.h gtkmenushell.h gtkmisc.h gtknotebook.h gtkobject.h gtkoptionmenu.h gtkpacker.h gtkpaned.h gtkpixmap.h gtkplug.h gtkpreview.h gtkprivate.h gtkprogress.h gtkprogressbar.h gtkradiobutton.h gtkradiomenuitem.h gtkrange.h gtkrc.h gtkruler.h gtkscale.h gtkscrollbar.h gtkscrolledwindow.h gtkselection.h gtkseparator.h gtksignal.h gtksocket.h gtkspinbutton.h gtkstatusbar.h gtkstyle.h gtktable.h gtktearoffmenuitem.h gtktext.h gtkthemes.h gtktipsquery.h gtktogglebutton.h gtktoolbar.h gtktooltips.h gtktree.h gtktreeitem.h gtktypebuiltins.h gtktypeutils.h gtkvbbox.h gtkvbox.h gtkviewport.h gtkvpaned.h gtkvruler.h gtkvscale.h gtkvscrollbar.h gtkvseparator.h gtkwidget.h gtkwindow.h makeenums.h stamp-gtkmarshal.h stamp-gtktypebuiltins.h"
+gdk_include = "MwmUtil.h gdk.h gdkcursors.h gdki18n.h gdkinput.h gdkinputcommon.h gdkinputgxi.h gdkinputnone.h gdkinputxfree.h gdkkeysyms.h gdkprivate.h gdkrgb.h gdktypes.h gdkx.h gxid_lib.h gxid_proto.h"
+
+do_stage () {
+ oe_libinstall -so -C gtk libgtk-1.2 ${STAGING_LIBDIR}
+ oe_libinstall -so -C gdk libgdk-1.2 ${STAGING_LIBDIR}
+
+ mkdir -p ${STAGING_INCDIR}/gtk-1.2/gtk
+ for i in ${gtk_include}; do
+ install -m 0644 gtk/$i ${STAGING_INCDIR}/gtk-1.2/gtk/$i
+ done
+
+ mkdir -p ${STAGING_INCDIR}/gtk-1.2/gdk
+ for i in ${gdk_include}; do
+ install -m 0644 gdk/$i ${STAGING_INCDIR}/gtk-1.2/gdk/$i
+ done
+
+ mkdir -p ${STAGING_LIBDIR}/gtk-1.2/include
+
+ install -m 0644 gtk.m4 ${STAGING_DATADIR}/aclocal/
+}
+
+do_install_append () {
+ install -d ${D}${sysconfdir}/gtk-1.2
+}
+
diff --git a/recipes/gtk+/gtk+.inc b/recipes/gtk+/gtk+.inc
new file mode 100644
index 0000000000..0e7dcf7299
--- /dev/null
+++ b/recipes/gtk+/gtk+.inc
@@ -0,0 +1,70 @@
+DESCRIPTION = "GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete \
+set of widgets, GTK+ is suitable for projects ranging from small one-off projects to complete application suites."
+HOMEPAGE = "http://www.gtk.org"
+SECTION = "libs"
+LICENSE = "LGPL"
+PRIORITY = "optional"
+DEPENDS = "glib-2.0 tiff pango atk jpeg libpng libxext libxcursor gtk-doc libgcrypt cups \
+ libxrandr libxdamage libxrender libxcomposite"
+
+inherit autotools pkgconfig
+
+LEAD_SONAME = "libgtk-x11-2.0.so"
+
+FILES_${PN} = "${bindir}/gdk-pixbuf-query-loaders \
+ ${bindir}/gtk-update-icon-cache \
+ ${bindir}/gtk-query-immodules-2.0 \
+ ${libdir}/lib*.so.* \
+ ${datadir}/themes ${sysconfdir} \
+ ${libdir}/gtk-2.0/${LIBV}/engines/libpixmap.so"
+
+FILES_${PN}-dev += " \
+ ${datadir}/gtk-2.0/include \
+ ${libdir}/gtk-2.0/include \
+ ${libdir}/gtk-2.0/${LIBV}/loaders/*.la \
+ ${libdir}/gtk-2.0/${LIBV}/immodules/*.la \
+ ${libdir}/gtk-2.0/${LIBV}/engines/*.la \
+ ${libdir}/gtk-2.0/${LIBV}/printbackends/*.la \
+ ${bindir}/gdk-pixbuf-csource \
+ ${bindir}/gtk-builder-convert"
+
+FILES_${PN}-dbg += " \
+ ${libdir}/gtk-2.0/${LIBV}/loaders/.debug/* \
+ ${libdir}/gtk-2.0/${LIBV}/immodules/.debug/* \
+ ${libdir}/gtk-2.0/${LIBV}/engines/.debug/* \
+ ${libdir}/gtk-2.0/${LIBV}/printbackends/.debug/*"
+
+NEATSTUFF = " ttf-dejavu-sans gdk-pixbuf-loader-png gdk-pixbuf-loader-jpeg gdk-pixbuf-loader-gif gdk-pixbuf-loader-xpm "
+
+RRECOMMENDS_${PN} = " ${NEATSTUFF} "
+RRECOMMENDS_${PN}_linux = " ${NEATSTUFF} glibc-gconv-iso8859-1 "
+RRECOMMENDS_${PN}_linux-gnueabi = " ${NEATSTUFF} glibc-gconv-iso8859-1"
+
+
+
+do_stage () {
+ oe_libinstall -so -C gtk libgtk-x11-2.0 ${STAGING_LIBDIR}
+ oe_libinstall -so -C gdk libgdk-x11-2.0 ${STAGING_LIBDIR}
+ oe_libinstall -so -C contrib/gdk-pixbuf-xlib libgdk_pixbuf_xlib-2.0 ${STAGING_LIBDIR}
+ oe_libinstall -so -C gdk-pixbuf libgdk_pixbuf-2.0 ${STAGING_LIBDIR}
+
+ autotools_stage_includes
+
+ mkdir -p ${STAGING_LIBDIR}/gtk-2.0/include
+ install -m 0644 gdk/gdkconfig.h ${STAGING_LIBDIR}/gtk-2.0/include/gdkconfig.h
+ # Copy over all headers, since the maemo stuff needs access to the private api. *sigh*
+ cp gtk/*.h ${STAGING_INCDIR}/gtk-2.0/gtk/
+
+ install -m 0644 m4macros/gtk-2.0.m4 ${STAGING_DATADIR}/aclocal/
+}
+
+do_install_append () {
+ install -d ${D}${sysconfdir}/gtk-2.0
+}
+
+postinst_prologue() {
+if [ "x$D" != "x" ]; then
+ exit 1
+fi
+
+}
diff --git a/recipes/gtk+/gtk+_2.10.14.bb b/recipes/gtk+/gtk+_2.10.14.bb
new file mode 100644
index 0000000000..c9b98a1897
--- /dev/null
+++ b/recipes/gtk+/gtk+_2.10.14.bb
@@ -0,0 +1,33 @@
+require gtk-2.10.inc
+
+PR = "r9"
+
+SRC_URI = "ftp://ftp.gtk.org/pub/gtk/v2.10/gtk+-${PV}.tar.bz2 \
+ file://no-xwc.patch;patch=1 \
+ file://automake-lossage.patch;patch=1 \
+ file://disable-tooltips.patch;patch=1 \
+ file://gtklabel-resize-patch;patch=1 \
+ file://menu-deactivate.patch;patch=1 \
+ file://xsettings.patch;patch=1 \
+ file://scroll-timings.patch;patch=1 \
+ file://small-gtkfilesel.patch;patch=1 \
+ file://small-gtkfilechooser.patch;patch=1 \
+# file://migration.patch;patch=1;pnum=0 \
+ file://run-iconcache.patch;patch=1 \
+ file://hardcoded_libtool.patch;patch=1 \
+ file://no-demos.patch;patch=1 \
+ file://single-click.patch;patch=1 \
+ file://spinbutton.patch;patch=1 \
+ file://gtk+-handhelds.patch;patch=1 \
+ file://filesel-fix-segfault.patch;patch=1 \
+ file://combo-arrow-size.patch;patch=1;pnum=0 \
+ file://range-no-redraw.patch;patch=1;pnum=0 \
+ file://scrolled-placement.patch;patch=1;pnum=0 \
+ file://treeview-checkbox-size.patch;patch=1;pnum=0 \
+ file://cell-renderer-edit-focus.patch;patch=1;pnum=0 \
+ "
+
+# check for TARGET_FPU=soft and inform configure of the result so it can disable some floating points
+require gtk-fpu.inc
+EXTRA_OECONF += "${@get_gtk_fpu_setting(bb, d)}"
+
diff --git a/recipes/gtk+/gtk+_2.12.0.bb b/recipes/gtk+/gtk+_2.12.0.bb
new file mode 100644
index 0000000000..3d4dcde40f
--- /dev/null
+++ b/recipes/gtk+/gtk+_2.12.0.bb
@@ -0,0 +1,49 @@
+require gtk+.inc
+
+PR = "r3"
+
+DEPENDS += "cairo"
+
+# disable per default - untested and not all patches included.
+DEFAULT_PREFERENCE = "-1"
+
+SRC_URI = "http://download.gnome.org/sources/gtk+/2.12/gtk+-${PV}.tar.bz2 \
+ file://xsettings.patch;patch=1 \
+ file://run-iconcache.patch;patch=1 \
+ file://disable-print.patch;patch=1 \
+ file://hardcoded_libtool.patch;patch=1 \
+ file://no-demos.patch;patch=1 \
+ file://cellrenderer-cairo.patch;patch=1;pnum=0 \
+ file://entry-cairo.patch;patch=1;pnum=0 \
+ file://toggle-font.diff;patch=1;pnum=0 \
+ file://scrolled-placement.patch;patch=1;pnum=0"
+# temporary
+# file://gtklabel-resize-patch;patch=1 \
+# file://menu-deactivate.patch;patch=1 \
+# file://combo-arrow-size.patch;patch=1;pnum=0 \
+# die die die
+# file://pangoxft2.10.6.diff;patch=1"
+
+EXTRA_OECONF = "--with-libtiff --disable-xkb --disable-glibtest --enable-display-migration"
+
+LIBV = "2.10.0"
+
+PACKAGES_DYNAMIC = "gdk-pixbuf-loader-* gtk-immodule-* gtk-printbackend-*"
+
+python populate_packages_prepend () {
+ import os.path
+
+ prologue = bb.data.getVar("postinst_prologue", d, 1)
+
+ gtk_libdir = bb.data.expand('${libdir}/gtk-2.0/${LIBV}', d)
+ loaders_root = os.path.join(gtk_libdir, 'loaders')
+ immodules_root = os.path.join(gtk_libdir, 'immodules')
+ printmodules_root = os.path.join(gtk_libdir, 'printbackends');
+
+ do_split_packages(d, loaders_root, '^libpixbufloader-(.*)\.so$', 'gdk-pixbuf-loader-%s', 'GDK pixbuf loader for %s', prologue + 'gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders')
+ do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk-immodule-%s', 'GTK input module for %s', prologue + 'gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules')
+ do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk-printbackend-%s', 'GTK printbackend module for %s')
+
+ if (bb.data.getVar('DEBIAN_NAMES', d, 1)):
+ bb.data.setVar('PKG_${PN}', 'libgtk-2.0', d)
+}
diff --git a/recipes/gtk+/gtk+_2.12.11.bb b/recipes/gtk+/gtk+_2.12.11.bb
new file mode 100644
index 0000000000..d246eb8de9
--- /dev/null
+++ b/recipes/gtk+/gtk+_2.12.11.bb
@@ -0,0 +1,48 @@
+require gtk+.inc
+
+PR = "r4"
+
+DEPENDS += "cairo"
+
+# disable per default - untested and not all patches included.
+DEFAULT_PREFERENCE = "-1"
+
+SRC_URI = "http://download.gnome.org/sources/gtk+/2.12/gtk+-${PV}.tar.bz2 \
+ file://xsettings.patch;patch=1 \
+ file://run-iconcache.patch;patch=1 \
+ file://hardcoded_libtool.patch;patch=1 \
+ file://no-demos.patch;patch=1 \
+ file://cellrenderer-cairo.patch;patch=1;pnum=0 \
+ file://entry-cairo.patch;patch=1;pnum=0 \
+ file://toggle-font.diff;patch=1;pnum=0 \
+ file://scrolled-placement.patch;patch=1;pnum=0"
+# temporary
+# file://gtklabel-resize-patch;patch=1 \
+# file://menu-deactivate.patch;patch=1 \
+# file://combo-arrow-size.patch;patch=1;pnum=0 \
+# die die die
+# file://pangoxft2.10.6.diff;patch=1"
+
+EXTRA_OECONF = "--with-libtiff --disable-xkb --disable-glibtest --enable-display-migration"
+
+LIBV = "2.10.0"
+
+PACKAGES_DYNAMIC = "gdk-pixbuf-loader-* gtk-immodule-* gtk-printbackend-*"
+
+python populate_packages_prepend () {
+ import os.path
+
+ prologue = bb.data.getVar("postinst_prologue", d, 1)
+
+ gtk_libdir = bb.data.expand('${libdir}/gtk-2.0/${LIBV}', d)
+ loaders_root = os.path.join(gtk_libdir, 'loaders')
+ immodules_root = os.path.join(gtk_libdir, 'immodules')
+ printmodules_root = os.path.join(gtk_libdir, 'printbackends');
+
+ do_split_packages(d, loaders_root, '^libpixbufloader-(.*)\.so$', 'gdk-pixbuf-loader-%s', 'GDK pixbuf loader for %s', prologue + 'gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders')
+ do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk-immodule-%s', 'GTK input module for %s', prologue + 'gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules')
+ do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk-printbackend-%s', 'GTK printbackend module for %s')
+
+ if (bb.data.getVar('DEBIAN_NAMES', d, 1)):
+ bb.data.setVar('PKG_${PN}', 'libgtk-2.0', d)
+}
diff --git a/recipes/gtk+/gtk+_2.12.3.bb b/recipes/gtk+/gtk+_2.12.3.bb
new file mode 100644
index 0000000000..642154b207
--- /dev/null
+++ b/recipes/gtk+/gtk+_2.12.3.bb
@@ -0,0 +1,48 @@
+require gtk+.inc
+
+PR = "r3"
+
+DEPENDS += "cairo"
+
+# disable per default - untested and not all patches included.
+DEFAULT_PREFERENCE = "-1"
+
+SRC_URI = "http://download.gnome.org/sources/gtk+/2.12/gtk+-${PV}.tar.bz2 \
+ file://xsettings.patch;patch=1 \
+ file://run-iconcache.patch;patch=1 \
+ file://hardcoded_libtool.patch;patch=1 \
+ file://no-demos.patch;patch=1 \
+ file://cellrenderer-cairo.patch;patch=1;pnum=0 \
+ file://entry-cairo.patch;patch=1;pnum=0 \
+ file://toggle-font.diff;patch=1;pnum=0 \
+ file://scrolled-placement.patch;patch=1;pnum=0"
+# temporary
+# file://gtklabel-resize-patch;patch=1 \
+# file://menu-deactivate.patch;patch=1 \
+# file://combo-arrow-size.patch;patch=1;pnum=0 \
+# die die die
+# file://pangoxft2.10.6.diff;patch=1"
+
+EXTRA_OECONF = "--with-libtiff --disable-xkb --disable-glibtest --enable-display-migration"
+
+LIBV = "2.10.0"
+
+PACKAGES_DYNAMIC = "gdk-pixbuf-loader-* gtk-immodule-* gtk-printbackend-*"
+
+python populate_packages_prepend () {
+ import os.path
+
+ prologue = bb.data.getVar("postinst_prologue", d, 1)
+
+ gtk_libdir = bb.data.expand('${libdir}/gtk-2.0/${LIBV}', d)
+ loaders_root = os.path.join(gtk_libdir, 'loaders')
+ immodules_root = os.path.join(gtk_libdir, 'immodules')
+ printmodules_root = os.path.join(gtk_libdir, 'printbackends');
+
+ do_split_packages(d, loaders_root, '^libpixbufloader-(.*)\.so$', 'gdk-pixbuf-loader-%s', 'GDK pixbuf loader for %s', prologue + 'gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders')
+ do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk-immodule-%s', 'GTK input module for %s', prologue + 'gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules')
+ do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk-printbackend-%s', 'GTK printbackend module for %s')
+
+ if (bb.data.getVar('DEBIAN_NAMES', d, 1)):
+ bb.data.setVar('PKG_${PN}', 'libgtk-2.0', d)
+}
diff --git a/recipes/gtk+/gtk+_2.14.1.bb b/recipes/gtk+/gtk+_2.14.1.bb
new file mode 100644
index 0000000000..627a1750c0
--- /dev/null
+++ b/recipes/gtk+/gtk+_2.14.1.bb
@@ -0,0 +1,42 @@
+require gtk+.inc
+
+PR = "r1"
+
+DEPENDS += "cairo jasper"
+
+# disable per default - this uses as little patches as possible
+DEFAULT_PREFERENCE = "-1"
+
+SRC_URI = "http://download.gnome.org/sources/gtk+/2.14/gtk+-${PV}.tar.bz2 \
+ file://xsettings.patch;patch=1 \
+ file://run-iconcache.patch;patch=1 \
+ file://hardcoded_libtool.patch;patch=1 \
+ file://no-demos.patch;patch=1 \
+ file://toggle-font.diff;patch=1;pnum=0 \
+ "
+
+EXTRA_OECONF = "--with-libtiff --disable-xkb --disable-glibtest --enable-display-migration gio_can_sniff=yes"
+
+LIBV = "2.10.0"
+
+PACKAGES_DYNAMIC = "gtk-module-* gdk-pixbuf-loader-* gtk-immodule-* gtk-printbackend-*"
+
+python populate_packages_prepend () {
+ import os.path
+
+ prologue = bb.data.getVar("postinst_prologue", d, 1)
+
+ gtk_libdir = bb.data.expand('${libdir}/gtk-2.0/${LIBV}', d)
+ loaders_root = os.path.join(gtk_libdir, 'loaders')
+ immodules_root = os.path.join(gtk_libdir, 'immodules')
+ printmodules_root = os.path.join(gtk_libdir, 'printbackends');
+ modules_root = bb.data.expand('${libdir}/gtk-2.0/modules/',d)
+
+ do_split_packages(d, loaders_root, '^libpixbufloader-(.*)\.so$', 'gdk-pixbuf-loader-%s', 'GDK pixbuf loader for %s', prologue + 'gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders', extra_depends='')
+ do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk-immodule-%s', 'GTK input module for %s', prologue + 'gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules', extra_depends='')
+ do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk-printbackend-%s', 'GTK printbackend module for %s', extra_depends='')
+ do_split_packages(d, modules_root, '^lib(.*)\.so$', 'gtk-module-%s', 'GTK module for %s', extra_depends='')
+
+ if (bb.data.getVar('DEBIAN_NAMES', d, 1)):
+ bb.data.setVar('PKG_${PN}', 'libgtk-2.0', d)
+}
diff --git a/recipes/gtk+/gtk+_2.14.2.bb b/recipes/gtk+/gtk+_2.14.2.bb
new file mode 100644
index 0000000000..38dd3a411d
--- /dev/null
+++ b/recipes/gtk+/gtk+_2.14.2.bb
@@ -0,0 +1,48 @@
+require gtk+.inc
+
+PR = "r3"
+
+DEPENDS += "cairo jasper"
+
+# disabled per default - this uses as little patches as possible
+DEFAULT_PREFERENCE = "-1"
+
+SRC_URI = "http://download.gnome.org/sources/gtk+/2.14/gtk+-${PV}.tar.bz2 \
+ file://xsettings.patch;patch=1 \
+ file://run-iconcache.patch;patch=1 \
+ file://hardcoded_libtool.patch;patch=1 \
+ file://no-demos.patch;patch=1 \
+ file://toggle-font.diff;patch=1;pnum=0 \
+ file://smallscreen_filechooser.patch;patch=1 \
+ "
+
+EXTRA_OECONF = "--with-libtiff --disable-xkb --disable-glibtest --enable-display-migration gio_can_sniff=yes"
+
+LIBV = "2.10.0"
+
+PACKAGES_DYNAMIC = "gtk-module-* gdk-pixbuf-loader-* gtk-immodule-* gtk-printbackend-*"
+
+python populate_packages_prepend () {
+ import os.path
+
+ prologue = bb.data.getVar("postinst_prologue", d, 1)
+
+ gtk_libdir = bb.data.expand('${libdir}/gtk-2.0/${LIBV}', d)
+ loaders_root = os.path.join(gtk_libdir, 'loaders')
+ immodules_root = os.path.join(gtk_libdir, 'immodules')
+ printmodules_root = os.path.join(gtk_libdir, 'printbackends');
+ modules_root = bb.data.expand('${libdir}/gtk-2.0/modules/',d)
+
+ do_split_packages(d, loaders_root, '^libpixbufloader-(.*)\.so$', 'gdk-pixbuf-loader-%s', 'GDK pixbuf loader for %s', prologue + 'gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders', extra_depends='')
+ do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk-immodule-%s', 'GTK input module for %s', prologue + 'gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules', extra_depends='')
+ do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk-printbackend-%s', 'GTK printbackend module for %s', extra_depends='')
+ do_split_packages(d, modules_root, '^lib(.*)\.so$', 'gtk-module-%s', 'GTK module for %s', extra_depends='')
+
+ if (bb.data.getVar('DEBIAN_NAMES', d, 1)):
+ bb.data.setVar('PKG_${PN}', 'libgtk-2.0', d)
+}
+
+RPROVIDES_${PN} = "libgailutil18"
+RCONFLICTS_${PN} = "libgailutil18"
+RREPLACES_${PN} = "libgailutil18"
+
diff --git a/recipes/gtk+/gtk+_2.6.10.bb b/recipes/gtk+/gtk+_2.6.10.bb
new file mode 100644
index 0000000000..cab18db85c
--- /dev/null
+++ b/recipes/gtk+/gtk+_2.6.10.bb
@@ -0,0 +1,115 @@
+DESCRIPTION = "GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete \
+set of widgets, GTK+ is suitable for projects ranging from small one-off projects to complete application suites."
+HOMEPAGE = "http://www.gtk.org"
+SECTION = "libs"
+LICENSE = "LGPL"
+PRIORITY = "optional"
+DEPENDS = "glib-2.0 pango atk jpeg libpng libxext libxcursor gtk-doc libgcrypt"
+PR = "r11"
+
+SRC_URI = "ftp://ftp.gtk.org/pub/gtk/v2.6/gtk+-${PV}.tar.bz2 \
+ file://help.patch;patch=1 \
+ file://no-demos.patch;patch=1 \
+ file://no-xwc.patch;patch=1 \
+ file://automake-lossage.patch;patch=1 \
+ file://gtk+-handhelds.patch;patch=1 \
+ file://spinbutton.patch;patch=1 \
+ file://hardcoded_libtool.patch;patch=1 \
+ file://disable-tooltips.patch;patch=1 \
+ file://gtklabel-resize-patch;patch=1 \
+ file://menu-deactivate.patch;patch=1 \
+ file://xsettings.patch;patch=1 \
+ file://scroll-timings.patch;patch=1 \
+ file://small-gtkfilesel.patch;patch=1 \
+ file://migration.patch;patch=1;pnum=0 \
+ file://single-click.patch;patch=1 \
+ file://menu-styling.patch;patch=1 \
+ file://compile-against-newer-glib.patch;patch=1 \
+ file://gtk.keynav.gtkcombobox.patch;patch=1;pnum=0 \
+ file://gtk.keynav.gtkentry.patch;patch=1;pnum=0 \
+ file://gtk.keynav.gtkiconview.patch;patch=1;pnum=0 \
+ file://gtk.keynav.gtkradiobutton.patch;patch=1;pnum=0 \
+ file://gtk.keynav.gtksettings.patch;patch=1;pnum=0 \
+ file://gtk.keynav.gtktextview.patch;patch=1;pnum=0 \
+ file://gtk.keynav.gtktreeview.patch;patch=1;pnum=0 \
+ file://gtk.keynav.gtkwidget.patch;patch=1;pnum=0 \
+ file://gtk+-2.6.10-bg.patch;patch=1 \
+ file://filesel-fix-segfault.patch;patch=1 \
+ "
+
+inherit autotools pkgconfig
+
+FILES_${PN} = "${bindir}/gdk-pixbuf-query-loaders \
+ ${bindir}/gtk-update-icon-cache \
+ ${bindir}/gtk-query-immodules-2.0 \
+ ${libdir}/lib*.so.* \
+ ${datadir}/themes ${sysconfdir} \
+ ${libdir}/gtk-2.0/${LIBV}/engines/libpixmap.so"
+FILES_${PN}-dev += " \
+ ${datadir}/gtk-2.0/include \
+ ${libdir}/gtk-2.0/include \
+ ${libdir}/gtk-2.0/${LIBV}/loaders/*.la \
+ ${libdir}/gtk-2.0/${LIBV}/immodules/*.la \
+ ${libdir}/gtk-2.0/${LIBV}/engines/*.la \
+ ${bindir}/gdk-pixbuf-csource"
+FILES_${PN}-dbg += " \
+ ${libdir}/gtk-2.0/${LIBV}/loaders/.debug/* \
+ ${libdir}/gtk-2.0/${LIBV}/immodules/.debug/* \
+ ${libdir}/gtk-2.0/${LIBV}/engines/.debug/*"
+
+
+RRECOMMENDS_${PN} = "glibc-gconv-iso8859-1 ttf-dejavu-sans"
+
+EXTRA_OECONF = "--without-libtiff --disable-xkb --disable-glibtest --enable-display-migration"
+# --disable-cruft
+
+LIBV = "2.4.0"
+do_configure_prepend() {
+ for i in `find . -name "Makefile.am"`
+ do
+ sed -i -e s,-DG_DISABLE_DEPRECATED,-DSED_ROCKS_DUDES, $i
+ done
+}
+
+do_stage () {
+ oe_libinstall -so -C gtk libgtk-x11-2.0 ${STAGING_LIBDIR}
+ oe_libinstall -so -C gdk libgdk-x11-2.0 ${STAGING_LIBDIR}
+ oe_libinstall -so -C contrib/gdk-pixbuf-xlib libgdk_pixbuf_xlib-2.0 ${STAGING_LIBDIR}
+ oe_libinstall -so -C gdk-pixbuf libgdk_pixbuf-2.0 ${STAGING_LIBDIR}
+
+ autotools_stage_includes
+
+ mkdir -p ${STAGING_LIBDIR}/gtk-2.0/include
+ install -m 0644 gdk/gdkconfig.h ${STAGING_LIBDIR}/gtk-2.0/include/gdkconfig.h
+
+ install -m 0644 m4macros/gtk-2.0.m4 ${STAGING_DATADIR}/aclocal/
+}
+
+do_install_append () {
+ install -d ${D}${sysconfdir}/gtk-2.0
+}
+
+postinst_prologue() {
+if [ "x$D" != "x" ]; then
+ exit 1
+fi
+
+}
+
+PACKAGES_DYNAMIC = "gdk-pixbuf-loader-* gtk-immodule-*"
+
+python populate_packages_prepend () {
+ import os.path
+
+ prologue = bb.data.getVar("postinst_prologue", d, 1)
+
+ gtk_libdir = bb.data.expand('${libdir}/gtk-2.0/${LIBV}', d)
+ loaders_root = os.path.join(gtk_libdir, 'loaders')
+ immodules_root = os.path.join(gtk_libdir, 'immodules')
+
+ do_split_packages(d, loaders_root, '^libpixbufloader-(.*)\.so$', 'gdk-pixbuf-loader-%s', 'GDK pixbuf loader for %s', prologue + 'gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders')
+ do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk-immodule-%s', 'GTK input module for %s', prologue + 'gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules')
+
+ if (bb.data.getVar('DEBIAN_NAMES', d, 1)):
+ bb.data.setVar('PKG_${PN}', 'libgtk-2.0', d)
+}
diff --git a/recipes/gtk+/gtk+_2.8.16.bb b/recipes/gtk+/gtk+_2.8.16.bb
new file mode 100644
index 0000000000..fd25122d5c
--- /dev/null
+++ b/recipes/gtk+/gtk+_2.8.16.bb
@@ -0,0 +1,99 @@
+LICENSE = "LGPL"
+DESCRIPTION = "GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete \
+set of widgets, GTK+ is suitable for projects ranging from small one-off projects to complete application suites."
+HOMEPAGE = "http://www.gtk.org"
+SECTION = "libs"
+PRIORITY = "optional"
+DEPENDS = "glib-2.0 pango atk jpeg libpng libxext libxcursor gtk-doc libgcrypt cairo"
+PR = "r5"
+
+DEFAULT_PREFERENCE = "-1"
+
+SRC_URI = "ftp://ftp.gtk.org/pub/gtk/v2.8/gtk+-${PV}.tar.bz2 \
+ file://no-xwc.patch;patch=1 \
+ file://automake-lossage.patch;patch=1 \
+ file://spinbutton.patch;patch=1 \
+ file://hardcoded_libtool.patch;patch=1 \
+ file://disable-tooltips.patch;patch=1 \
+ file://gtklabel-resize-patch;patch=1 \
+ file://gtktreeview-316689.patch;patch=1 \
+ file://menu-deactivate.patch;patch=1 \
+ file://xsettings.patch;patch=1 \
+ file://scroll-timings.patch;patch=1 \
+ file://small-gtkfilesel.patch;patch=1 \
+ file://migration.patch;patch=1;pnum=0 \
+ file://no-demos.patch;patch=1" \
+ file://gtk+-handhelds.patch;patch=1 \
+ file://single-click.patch;patch=1"
+
+inherit autotools pkgconfig
+
+CFLAGS += " -lz "
+
+FILES_${PN} = "${bindir}/gdk-pixbuf-query-loaders \
+ ${bindir}/gtk-query-immodules-2.0 \
+ ${bindir}/gtk-update-icon-cache \
+ ${libdir}/lib*.so.* \
+ ${datadir}/themes ${sysconfdir} \
+ ${libdir}/gtk-2.0/${LIBV}/engines/libpixmap.so"
+FILES_${PN}-dev += " \
+ ${datadir}/gtk-2.0/include \
+ ${libdir}/gtk-2.0/include \
+ ${libdir}/gtk-2.0/${LIBV}/loaders/*.la \
+ ${libdir}/gtk-2.0/${LIBV}/immodules/*.la \
+ ${libdir}/gtk-2.0/${LIBV}/engines/*.la \
+ ${bindir}/gdk-pixbuf-csource"
+FILES_${PN}-dbg += " \
+ ${libdir}/gtk-2.0/${LIBV}/loaders/.debug/* \
+ ${libdir}/gtk-2.0/${LIBV}/immodules/.debug/* \
+ ${libdir}/gtk-2.0/${LIBV}/engines/.debug/*"
+
+RRECOMMENDS_${PN} = "glibc-gconv-iso8859-1 ttf-dejavu-sans"
+
+EXTRA_OECONF = "--without-libtiff --disable-xkb --disable-glibtest --enable-display-migration"
+# --disable-cruft
+
+LIBV = "2.4.0"
+
+do_stage () {
+ oe_libinstall -so -C gtk libgtk-x11-2.0 ${STAGING_LIBDIR}
+ oe_libinstall -so -C gdk libgdk-x11-2.0 ${STAGING_LIBDIR}
+ oe_libinstall -so -C contrib/gdk-pixbuf-xlib libgdk_pixbuf_xlib-2.0 ${STAGING_LIBDIR}
+ oe_libinstall -so -C gdk-pixbuf libgdk_pixbuf-2.0 ${STAGING_LIBDIR}
+
+ autotools_stage_includes
+
+ mkdir -p ${STAGING_LIBDIR}/gtk-2.0/include
+ install -m 0644 gdk/gdkconfig.h ${STAGING_LIBDIR}/gtk-2.0/include/gdkconfig.h
+
+ install -m 0644 m4macros/gtk-2.0.m4 ${STAGING_DATADIR}/aclocal/
+}
+
+do_install_append () {
+ install -d ${D}${sysconfdir}/gtk-2.0
+}
+
+postinst_prologue() {
+if [ "x$D" != "x" ]; then
+ exit 1
+fi
+
+}
+
+PACKAGES_DYNAMIC = "gdk-pixbuf-loader-* gtk-immodule-*"
+
+python populate_packages_prepend () {
+ import os.path
+
+ prologue = bb.data.getVar("postinst_prologue", d, 1)
+
+ gtk_libdir = bb.data.expand('${libdir}/gtk-2.0/${LIBV}', d)
+ loaders_root = os.path.join(gtk_libdir, 'loaders')
+ immodules_root = os.path.join(gtk_libdir, 'immodules')
+
+ do_split_packages(d, loaders_root, '^libpixbufloader-(.*)\.so$', 'gdk-pixbuf-loader-%s', 'GDK pixbuf loader for %s', prologue + 'gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders')
+ do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk-immodule-%s', 'GTK input module for %s', prologue + 'gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules')
+
+ if (bb.data.getVar('DEBIAN_NAMES', d, 1)):
+ bb.data.setVar('PKG_${PN}', 'libgtk-2.0', d)
+}
diff --git a/recipes/gtk+/gtk+_2.8.9.bb b/recipes/gtk+/gtk+_2.8.9.bb
new file mode 100644
index 0000000000..91b6b3dce9
--- /dev/null
+++ b/recipes/gtk+/gtk+_2.8.9.bb
@@ -0,0 +1,96 @@
+LICENSE = "LGPL"
+DESCRIPTION = "GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete \
+set of widgets, GTK+ is suitable for projects ranging from small one-off projects to complete application suites."
+HOMEPAGE = "http://www.gtk.org"
+SECTION = "libs"
+PRIORITY = "optional"
+DEPENDS = "glib-2.0 pango atk jpeg libpng libxext libxcursor gtk-doc libgcrypt cairo"
+PR = "r7"
+
+SRC_URI = "ftp://ftp.gtk.org/pub/gtk/v2.8/gtk+-${PV}.tar.bz2 \
+ file://no-xwc.patch;patch=1 \
+ file://automake-lossage.patch;patch=1 \
+ file://spinbutton.patch;patch=1 \
+ file://hardcoded_libtool.patch;patch=1 \
+ file://disable-tooltips.patch;patch=1 \
+ file://gtklabel-resize-patch;patch=1 \
+ file://menu-deactivate.patch;patch=1 \
+ file://xsettings.patch;patch=1 \
+ file://scroll-timings.patch;patch=1 \
+ file://small-gtkfilesel.patch;patch=1 \
+ file://migration.patch;patch=1;pnum=0 \
+ file://no-demos.patch;patch=1 \
+ file://gtk+-handhelds.patch;patch=1 \
+ file://single-click.patch;patch=1"
+
+inherit autotools pkgconfig
+
+FILES_${PN} = "${bindir}/gdk-pixbuf-query-loaders \
+ ${bindir}/gtk-query-immodules-2.0 \
+ ${libdir}/lib*.so.* \
+ ${datadir}/themes ${sysconfdir} \
+ ${libdir}/gtk-2.0/${LIBV}/engines/libpixmap.so \
+ ${bindir}/gtk-update-icon-cache"
+FILES_${PN}-dev += " \
+ ${datadir}/gtk-2.0/include \
+ ${libdir}/gtk-2.0/include \
+ ${libdir}/gtk-2.0/${LIBV}/loaders/*.la \
+ ${libdir}/gtk-2.0/${LIBV}/immodules/*.la \
+ ${libdir}/gtk-2.0/${LIBV}/engines/*.la \
+ ${bindir}/gdk-pixbuf-csource"
+FILES_${PN}-dbg += " \
+ ${libdir}/gtk-2.0/${LIBV}/loaders/.debug/* \
+ ${libdir}/gtk-2.0/${LIBV}/immodules/.debug/* \
+ ${libdir}/gtk-2.0/${LIBV}/engines/.debug/*"
+
+
+RRECOMMENDS_${PN} = "glibc-gconv-iso8859-1 ttf-dejavu-sans"
+RRECOMMENDS_${PN}_angstrom = "glibc-gconv-iso8859-1 ttf-dejavu-sans gdk-pixbuf-loader-png gdk-pixbuf-loader-jpeg gdk-pixbuf-loader-gif gdk-pixbuf-loader-xpm"
+
+EXTRA_OECONF = "--without-libtiff --disable-xkb --disable-glibtest --enable-display-migration"
+# --disable-cruft
+
+LIBV = "2.4.0"
+
+do_stage () {
+ oe_libinstall -so -C gtk libgtk-x11-2.0 ${STAGING_LIBDIR}
+ oe_libinstall -so -C gdk libgdk-x11-2.0 ${STAGING_LIBDIR}
+ oe_libinstall -so -C contrib/gdk-pixbuf-xlib libgdk_pixbuf_xlib-2.0 ${STAGING_LIBDIR}
+ oe_libinstall -so -C gdk-pixbuf libgdk_pixbuf-2.0 ${STAGING_LIBDIR}
+
+ autotools_stage_includes
+
+ mkdir -p ${STAGING_LIBDIR}/gtk-2.0/include
+ install -m 0644 gdk/gdkconfig.h ${STAGING_LIBDIR}/gtk-2.0/include/gdkconfig.h
+
+ install -m 0644 m4macros/gtk-2.0.m4 ${STAGING_DATADIR}/aclocal/
+}
+
+do_install_append () {
+ install -d ${D}${sysconfdir}/gtk-2.0
+}
+
+postinst_prologue() {
+if [ "x$D" != "x" ]; then
+ exit 1
+fi
+
+}
+
+PACKAGES_DYNAMIC = "gdk-pixbuf-loader-* gtk-immodule-*"
+
+python populate_packages_prepend () {
+ import os.path
+
+ prologue = bb.data.getVar("postinst_prologue", d, 1)
+
+ gtk_libdir = bb.data.expand('${libdir}/gtk-2.0/${LIBV}', d)
+ loaders_root = os.path.join(gtk_libdir, 'loaders')
+ immodules_root = os.path.join(gtk_libdir, 'immodules')
+
+ do_split_packages(d, loaders_root, '^libpixbufloader-(.*)\.so$', 'gdk-pixbuf-loader-%s', 'GDK pixbuf loader for %s', prologue + 'gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders')
+ do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk-immodule-%s', 'GTK input module for %s', prologue + 'gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules')
+
+ if (bb.data.getVar('DEBIAN_NAMES', d, 1)):
+ bb.data.setVar('PKG_${PN}', 'libgtk-2.0', d)
+}
diff --git a/recipes/gtk+/gtk-2.10.inc b/recipes/gtk+/gtk-2.10.inc
new file mode 100644
index 0000000000..3fa5d22a71
--- /dev/null
+++ b/recipes/gtk+/gtk-2.10.inc
@@ -0,0 +1,89 @@
+LICENSE = "LGPL"
+DESCRIPTION = "GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete \
+set of widgets, GTK+ is suitable for projects ranging from small one-off projects to complete application suites."
+HOMEPAGE = "http://www.gtk.org"
+SECTION = "libs"
+PRIORITY = "optional"
+DEPENDS = "glib-2.0 pango atk jpeg libpng libxext libxcursor gtk-doc libgcrypt cairo cups"
+
+inherit autotools pkgconfig
+
+FILES_${PN} = "${bindir}/gdk-pixbuf-query-loaders \
+ ${bindir}/gtk-update-icon-cache \
+ ${bindir}/gtk-query-immodules-2.0 \
+ ${libdir}/lib*.so.* \
+ ${datadir}/themes ${sysconfdir} \
+ ${libdir}/gtk-2.0/${LIBV}/engines/libpixmap.so \
+"
+FILES_${PN}-dev += " \
+ ${datadir}/gtk-2.0/include \
+ ${libdir}/gtk-2.0/include \
+ ${libdir}/gtk-2.0/${LIBV}/loaders/*.la \
+ ${libdir}/gtk-2.0/${LIBV}/immodules/*.la \
+ ${libdir}/gtk-2.0/${LIBV}/engines/*.la \
+ ${libdir}/gtk-2.0/${LIBV}/printbackends/*.la \
+ ${bindir}/gdk-pixbuf-csource"
+FILES_${PN}-dbg += " \
+ ${libdir}/gtk-2.0/${LIBV}/loaders/.debug/* \
+ ${libdir}/gtk-2.0/${LIBV}/immodules/.debug/* \
+ ${libdir}/gtk-2.0/${LIBV}/engines/.debug/* \
+ ${libdir}/gtk-2.0/${LIBV}/printbackends/.debug/*"
+
+
+NEATSTUFF = " ttf-dejavu-sans gdk-pixbuf-loader-png gdk-pixbuf-loader-jpeg gdk-pixbuf-loader-gif gdk-pixbuf-loader-xpm "
+
+RRECOMMENDS_${PN} = " ${NEATSTUFF} "
+RRECOMMENDS_${PN}_linux = " ${NEATSTUFF} glibc-gconv-iso8859-1 "
+RRECOMMENDS_${PN}_linux-gnueabi = " ${NEATSTUFF} glibc-gconv-iso8859-1"
+
+EXTRA_OECONF = "--without-libtiff --disable-xkb --disable-glibtest --enable-display-migration"
+
+export GDKTARGET="x11"
+
+LIBV = "2.10.0"
+
+do_stage () {
+ oe_libinstall -so -C gtk libgtk-$GDKTARGET-2.0 ${STAGING_LIBDIR}
+ oe_libinstall -so -C gdk libgdk-$GDKTARGET-2.0 ${STAGING_LIBDIR}
+ oe_libinstall -so -C contrib/gdk-pixbuf-xlib libgdk_pixbuf_xlib-2.0 ${STAGING_LIBDIR}
+ oe_libinstall -so -C gdk-pixbuf libgdk_pixbuf-2.0 ${STAGING_LIBDIR}
+
+ autotools_stage_includes
+
+ mkdir -p ${STAGING_LIBDIR}/gtk-2.0/include
+ install -m 0644 gdk/gdkconfig.h ${STAGING_LIBDIR}/gtk-2.0/include/gdkconfig.h
+ # Copy over all headers, since the maemo stuff needs access to the private api. *sigh*
+ cp gtk/*.h ${STAGING_INCDIR}/gtk-2.0/gtk/
+ install -m 0644 m4macros/gtk-2.0.m4 ${STAGING_DATADIR}/aclocal/
+}
+
+do_install_append () {
+ install -d ${D}${sysconfdir}/gtk-2.0
+}
+
+postinst_prologue() {
+if [ "x$D" != "x" ]; then
+ exit 1
+fi
+
+}
+
+PACKAGES_DYNAMIC = "gdk-pixbuf-loader-* gtk-immodule-* gtk-printbackend-*"
+
+python populate_packages_prepend () {
+ import os.path
+
+ prologue = bb.data.getVar("postinst_prologue", d, 1)
+
+ gtk_libdir = bb.data.expand('${libdir}/gtk-2.0/${LIBV}', d)
+ loaders_root = os.path.join(gtk_libdir, 'loaders')
+ immodules_root = os.path.join(gtk_libdir, 'immodules')
+ printmodules_root = os.path.join(gtk_libdir, 'printbackends');
+
+ do_split_packages(d, loaders_root, '^libpixbufloader-(.*)\.so$', 'gdk-pixbuf-loader-%s', 'GDK pixbuf loader for %s', prologue + 'gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders')
+ do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk-immodule-%s', 'GTK input module for %s', prologue + 'gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules')
+ do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk-printbackend-%s', 'GTK printbackend module for %s')
+
+ if (bb.data.getVar('DEBIAN_NAMES', d, 1)):
+ bb.data.setVar('PKG_${PN}', 'libgtk-2.0', d)
+}
diff --git a/recipes/gtk+/gtk-fpu.inc b/recipes/gtk+/gtk-fpu.inc
new file mode 100644
index 0000000000..52cdc3b446
--- /dev/null
+++ b/recipes/gtk+/gtk-fpu.inc
@@ -0,0 +1,6 @@
+
+def get_gtk_fpu_setting(bb, d):
+ if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]:
+ return "--enable-integer-pixops"
+ return ""
+
diff --git a/recipes/gtk+/pixops-test.bb b/recipes/gtk+/pixops-test.bb
new file mode 100644
index 0000000000..79bc33a04f
--- /dev/null
+++ b/recipes/gtk+/pixops-test.bb
@@ -0,0 +1,25 @@
+DESCRIPTION = "Productive gtk+ devel prodder"
+DEPENDS = "gtk+"
+
+PR = "r2"
+
+inherit pkgconfig
+
+SRC_URI = "file://pixops-test.c \
+ file://gtk-logo-rgb.gif"
+
+do_configure() {
+ cp ${WORKDIR}/pixops-test.c ${S}
+ cp ${WORKDIR}/gtk-logo-rgb.gif ${S}
+}
+
+do_compile() {
+ ${CC} `pkg-config gtk+-2.0 --libs --cflags` `pkg-config pango --libs --cflags` -lXfixes -lz -lpangoft2-1.0 -lgpg-error -lXdmcp -lXcursor -lexpat -lXau -lgcrypt -lXext -lXinerama -lXrandr -o pixops-test pixops-test.c
+}
+
+do_install() {
+ install -d ${D}${bindir}
+ install -d ${D}${datadir}/pixops-test
+ install -m 755 pixops-test ${D}${bindir}
+ install -m 644 gtk-logo-rgb.gif ${D}${datadir}/pixops-test
+}
diff --git a/recipes/gtk+/pixops-test/gtk-logo-rgb.gif b/recipes/gtk+/pixops-test/gtk-logo-rgb.gif
new file mode 100644
index 0000000000..f6e934d5e6
--- /dev/null
+++ b/recipes/gtk+/pixops-test/gtk-logo-rgb.gif
Binary files differ
diff --git a/recipes/gtk+/pixops-test/pixops-test.c b/recipes/gtk+/pixops-test/pixops-test.c
new file mode 100644
index 0000000000..f8906dfc42
--- /dev/null
+++ b/recipes/gtk+/pixops-test/pixops-test.c
@@ -0,0 +1,69 @@
+#include <gtk/gtk.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <stdlib.h>
+
+static gdouble total_seconds = 0.0;
+
+/* randomly colour each pixel */
+static void
+fill_pixbuf (GdkPixbuf *buf)
+{
+ int width, height, rowstride, n_channels;
+ int x,y,n;
+ guchar *pixels, *p;
+
+ g_assert (gdk_pixbuf_get_bits_per_sample (buf) == 8);
+
+ n_channels = gdk_pixbuf_get_n_channels (buf);
+ width = gdk_pixbuf_get_width (buf);
+ height = gdk_pixbuf_get_height (buf);
+ rowstride = gdk_pixbuf_get_rowstride (buf);
+ pixels = gdk_pixbuf_get_pixels (buf);
+
+ for (x=0; x<width; x++) {
+ for (y=0; y<height; y++) {
+ p = pixels + (y*rowstride) + (x*n_channels);
+ for (n=0; n<n_channels; n++) {
+ p[n] = (random()*255)/RAND_MAX;
+ }
+ }
+ }
+}
+
+int
+main (int argc, char **argv)
+{
+ GTimer *timer;
+ int i,j;
+
+ gtk_init (&argc, &argv);
+
+
+ GdkPixbuf *pixbuf[4], *ret;
+ pixbuf[0] = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, 400, 600);
+ pixbuf[1] = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, 40, 60);
+ pixbuf[2] = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, 400, 600);
+ pixbuf[3] = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, 40, 60);
+
+ for (j=0; j<4; j++)
+ fill_pixbuf (pixbuf[j]);
+
+ timer = g_timer_new ();
+ g_timer_start (timer);
+
+ for (i = 0; i < 10 ; i++) {
+ for (j=0; j<4; j++) {
+ ret = gdk_pixbuf_scale_simple (pixbuf[j], 700, 900, GDK_INTERP_BILINEAR);
+ gdk_pixbuf_unref (ret);
+ ret = gdk_pixbuf_scale_simple (pixbuf[j], 20, 50, GDK_INTERP_BILINEAR);
+ gdk_pixbuf_unref (ret);
+ }
+ }
+ g_timer_stop (timer);
+
+ total_seconds += g_timer_elapsed (timer, NULL);
+
+ g_print ("time spent scaling (in seconds): %lf\n", total_seconds );
+
+ return 0;
+}