Disable xft patch, and instead patch out GTK+ from GtkEntry and GtkCellRenderer
authorRoss Burton <ross@openedhand.com>
Fri, 22 Dec 2006 13:11:47 +0000 (13:11 +0000)
committerRoss Burton <ross@openedhand.com>
Fri, 22 Dec 2006 13:11:47 +0000 (13:11 +0000)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1084 311d38ba-8fff-0310-9ca6-ca027cbcb966

meta/packages/gtk+/gtk+-2.10.6/cellrenderer-cairo.patch [new file with mode: 0644]
meta/packages/gtk+/gtk+-2.10.6/entry-cairo.patch [new file with mode: 0644]
meta/packages/gtk+/gtk+_2.10.6.bb

diff --git a/meta/packages/gtk+/gtk+-2.10.6/cellrenderer-cairo.patch b/meta/packages/gtk+/gtk+-2.10.6/cellrenderer-cairo.patch
new file mode 100644 (file)
index 0000000..4439e69
--- /dev/null
@@ -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/meta/packages/gtk+/gtk+-2.10.6/entry-cairo.patch b/meta/packages/gtk+/gtk+-2.10.6/entry-cairo.patch
new file mode 100644 (file)
index 0000000..3313e7f
--- /dev/null
@@ -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
+     }
+ }
index a414f4d..dc762d4 100644 (file)
@@ -5,7 +5,7 @@ HOMEPAGE = "http://www.gtk.org"
 SECTION = "libs"
 PRIORITY = "optional"
 DEPENDS = "glib-2.0 pango atk jpeg libpng libxext libxcursor gtk-doc libgcrypt cairo"
-PR = "r3"
+PR = "r4"
 
 # disable per default - untested and not all patches included.
 DEFAULT_PREFERENCE = "-1" 
@@ -24,7 +24,9 @@ SRC_URI = "ftp://ftp.gtk.org/pub/gtk/v2.10/gtk+-${PV}.tar.bz2 \
            file://disable-print.patch;patch=1 \
            file://hardcoded_libtool.patch;patch=1 \
            file://no-demos.patch;patch=1 \
-           file://pangoxft2.10.6.diff;patch=1"
+        file://cellrenderer-cairo.patch;patch=1;pnum=0 \
+        file://entry-cairo.patch;patch=1;pnum=0"
+#           file://pangoxft2.10.6.diff;patch=1"
 #           file://gtk+-handhelds.patch;patch=1
 #         file://single-click.patch;patch=1
 #         file://spinbutton.patch;patch=1 \