[gtk+/rendering-cleanup: 56/95] API: remove GdkPangoRenderer



commit b2b03054c62e45f78abbaf2fcad5d47ae28341a0
Author: Benjamin Otte <otte redhat com>
Date:   Thu Jul 22 01:56:00 2010 +0200

    API: remove GdkPangoRenderer
    
    Also removes the pango attributes for stipple, emboss and emboss color

 docs/reference/gdk/gdk3-sections.txt           |   27 -
 docs/reference/gdk/gdk3.types                  |    1 -
 docs/reference/gdk/tmpl/pango_interaction.sgml |  144 ----
 gdk/gdk.symbols                                |   10 -
 gdk/gdkgc.c                                    |  222 ------
 gdk/gdkinternals.h                             |    7 -
 gdk/gdkpango.c                                 |  992 ------------------------
 gdk/gdkpango.h                                 |   97 ---
 gtk/tests/defaultvalue.c                       |    6 -
 9 files changed, 0 insertions(+), 1506 deletions(-)
---
diff --git a/docs/reference/gdk/gdk3-sections.txt b/docs/reference/gdk/gdk3-sections.txt
index 331c88d..ec2803d 100644
--- a/docs/reference/gdk/gdk3-sections.txt
+++ b/docs/reference/gdk/gdk3-sections.txt
@@ -716,35 +716,8 @@ GDK_TYPE_PROP_MODE
 <SECTION>
 <TITLE>Pango Interaction</TITLE>
 <FILE>pango_interaction</FILE>
-GdkPangoRenderer
-GdkPangoRendererClass
-gdk_pango_renderer_new
-gdk_pango_renderer_get_default
-gdk_pango_renderer_set_drawable
-gdk_pango_renderer_set_gc
-gdk_pango_renderer_set_stipple
-gdk_pango_renderer_set_override_color
-gdk_pango_context_get
-gdk_pango_context_get_for_screen
-GdkPangoAttrEmbossed
-GdkPangoAttrEmbossColor
-GdkPangoAttrStipple
-gdk_pango_attr_emboss_color_new
-gdk_pango_attr_embossed_new
-gdk_pango_attr_stipple_new
 gdk_pango_layout_get_clip_region
 gdk_pango_layout_line_get_clip_region
-<SUBSECTION Standard>
-GDK_TYPE_PANGO_RENDERER
-GDK_PANGO_RENDERER
-GDK_IS_PANGO_RENDERER
-GDK_PANGO_RENDERER_CLASS
-GDK_IS_PANGO_RENDERER_CLASS
-GDK_PANGO_RENDERER_GET_CLASS
-
-<SUBSECTION Private>
-gdk_pango_renderer_get_type
-GdkPangoRendererPrivate
 </SECTION>
 
 <SECTION>
diff --git a/docs/reference/gdk/gdk3.types b/docs/reference/gdk/gdk3.types
index 8b200f5..1e12976 100644
--- a/docs/reference/gdk/gdk3.types
+++ b/docs/reference/gdk/gdk3.types
@@ -5,7 +5,6 @@ gdk_display_manager_get_type
 gdk_screen_get_type
 gdk_drawable_get_type
 gdk_window_object_get_type
-gdk_pango_renderer_get_type
 gdk_pixmap_get_type
 gdk_gc_get_type
 gdk_keymap_get_type
diff --git a/docs/reference/gdk/tmpl/pango_interaction.sgml b/docs/reference/gdk/tmpl/pango_interaction.sgml
index 82e4c30..67f6d8d 100644
--- a/docs/reference/gdk/tmpl/pango_interaction.sgml
+++ b/docs/reference/gdk/tmpl/pango_interaction.sgml
@@ -134,150 +134,6 @@ g_object_unref (gc);
 <!-- ##### SECTION Image ##### -->
 
 
-<!-- ##### STRUCT GdkPangoRenderer ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### ARG GdkPangoRenderer:screen ##### -->
-<para>
-
-</para>
-
-<!-- ##### STRUCT GdkPangoRendererClass ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### FUNCTION gdk_pango_renderer_new ##### -->
-<para>
-
-</para>
-
- screen: 
- Returns: 
-
-
-<!-- ##### FUNCTION gdk_pango_renderer_get_default ##### -->
-<para>
-
-</para>
-
- screen: 
- Returns: 
-
-
-<!-- ##### FUNCTION gdk_pango_renderer_set_drawable ##### -->
-<para>
-
-</para>
-
- gdk_renderer: 
- drawable: 
-
-
-<!-- ##### FUNCTION gdk_pango_renderer_set_gc ##### -->
-<para>
-
-</para>
-
- gdk_renderer: 
- gc: 
-
-
-<!-- ##### FUNCTION gdk_pango_renderer_set_stipple ##### -->
-<para>
-
-</para>
-
- gdk_renderer: 
- part: 
- stipple: 
-
-
-<!-- ##### FUNCTION gdk_pango_renderer_set_override_color ##### -->
-<para>
-
-</para>
-
- gdk_renderer: 
- part: 
- color: 
-
-
-<!-- ##### FUNCTION gdk_pango_context_get ##### -->
-<para>
-
-</para>
-
- void: 
- Returns: 
-
-
-<!-- ##### FUNCTION gdk_pango_context_get_for_screen ##### -->
-<para>
-
-</para>
-
- screen: 
- Returns: 
-
-
-<!-- ##### STRUCT GdkPangoAttrEmbossed ##### -->
-<para>
-A Pango text attribute containing a embossed bitmap to be used when
-rendering the text.
-</para>
-
- attr: the #PangoAttribute.
- embossed: the embossed bitmap.
-
-<!-- ##### STRUCT GdkPangoAttrEmbossColor ##### -->
-<para>
-A Pango text attribute specifying the color to emboss text with.
-</para>
-
- attr: the #PangoAttribute
- color: the color
-
-<!-- ##### STRUCT GdkPangoAttrStipple ##### -->
-<para>
-A Pango text attribute containing a stipple bitmap to be used when
-rendering the text.
-</para>
-
- attr: the #PangoAttribute.
- stipple: the stipple bitmap.
-
-<!-- ##### FUNCTION gdk_pango_attr_emboss_color_new ##### -->
-<para>
-
-</para>
-
- color: 
- Returns: 
-
-
-<!-- ##### FUNCTION gdk_pango_attr_embossed_new ##### -->
-<para>
-
-</para>
-
- embossed: 
- Returns: 
-
-
-<!-- ##### FUNCTION gdk_pango_attr_stipple_new ##### -->
-<para>
-
-</para>
-
- stipple: 
- Returns: 
-
-
 <!-- ##### FUNCTION gdk_pango_layout_get_clip_region ##### -->
 <para>
 
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index 39d84e6..90c17bc 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -869,20 +869,10 @@ gdk_visual_get_type G_GNUC_CONST
 
 #if IN_HEADER(__GDK_PANGO_H__)
 #if IN_FILE(__GDK_PANGO_C__)
-gdk_pango_attr_emboss_color_new
-gdk_pango_attr_embossed_new
-gdk_pango_attr_stipple_new
 gdk_pango_context_get
 gdk_pango_context_get_for_screen
 gdk_pango_layout_get_clip_region
 gdk_pango_layout_line_get_clip_region
-gdk_pango_renderer_get_default
-gdk_pango_renderer_get_type G_GNUC_CONST
-gdk_pango_renderer_new
-gdk_pango_renderer_set_drawable
-gdk_pango_renderer_set_gc
-gdk_pango_renderer_set_override_color
-gdk_pango_renderer_set_stipple
 #endif
 #endif
 
diff --git a/gdk/gdkgc.c b/gdk/gdkgc.c
index 1cc1521..13003b9 100644
--- a/gdk/gdkgc.c
+++ b/gdk/gdkgc.c
@@ -1242,225 +1242,3 @@ gdk_gc_set_rgb_bg_color (GdkGC          *gc,
   gdk_gc_set_background (gc, &tmp_color);
 }
 
-static cairo_surface_t *
-make_stipple_tile_surface (cairo_t   *cr,
-			   GdkBitmap *stipple,
-			   GdkColor  *foreground,
-			   GdkColor  *background)
-{
-  cairo_t *tmp_cr;
-  cairo_surface_t *surface; 
-  cairo_surface_t *alpha_surface;
-  gint width, height;
-
-  gdk_drawable_get_size (stipple,
-			 &width, &height);
-  
-  alpha_surface = _gdk_drawable_ref_cairo_surface (stipple);
-  
-  surface = cairo_surface_create_similar (cairo_get_target (cr),
-					  CAIRO_CONTENT_COLOR_ALPHA,
-					  width, height);
-
-  tmp_cr = cairo_create (surface);
-  
-  cairo_set_operator (tmp_cr, CAIRO_OPERATOR_SOURCE);
- 
-  if (background)
-      gdk_cairo_set_source_color (tmp_cr, background);
-  else
-      cairo_set_source_rgba (tmp_cr, 0, 0, 0 ,0);
-
-  cairo_paint (tmp_cr);
-
-  cairo_set_operator (tmp_cr, CAIRO_OPERATOR_OVER);
-
-  gdk_cairo_set_source_color (tmp_cr, foreground);
-  cairo_mask_surface (tmp_cr, alpha_surface, 0, 0);
-  
-  cairo_destroy (tmp_cr);
-  cairo_surface_destroy (alpha_surface);
-
-  return surface;
-}
-
-static void
-gc_get_foreground (GdkGC    *gc,
-		   GdkColor *color)
-{
-  GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
-  
-  color->pixel = priv->bg_pixel;
-
-  if (gc->colormap)
-    gdk_colormap_query_color (gc->colormap, priv->fg_pixel, color);
-  else
-    g_warning ("No colormap in gc_get_foreground");
-}
-
-static void
-gc_get_background (GdkGC    *gc,
-		   GdkColor *color)
-{
-  GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
-  
-  color->pixel = priv->bg_pixel;
-
-  if (gc->colormap)
-    gdk_colormap_query_color (gc->colormap, priv->bg_pixel, color);
-  else
-    g_warning ("No colormap in gc_get_background");
-}
-
-/**
- * _gdk_gc_update_context:
- * @gc: a #GdkGC
- * @cr: a #cairo_t
- * @override_foreground: a foreground color to use to override the
- *   foreground color of the GC
- * @override_stipple: a stipple pattern to use to override the
- *   stipple from the GC. If this is present and the fill mode
- *   of the GC isn't %GDK_STIPPLED or %GDK_OPAQUE_STIPPLED
- *   the fill mode will be forced to %GDK_STIPPLED
- * @gc_changed: pass %FALSE if the @gc has not changed since the
- *     last call to this function
- * @target_drawable: The drawable you're drawing in. If passed in
- *     this is used for client side window clip emulation.
- * 
- * Set the attributes of a cairo context to match those of a #GdkGC
- * as far as possible. Some aspects of a #GdkGC, such as clip masks
- * and functions other than %GDK_COPY are not currently handled.
- **/
-void
-_gdk_gc_update_context (GdkGC          *gc,
-                        cairo_t        *cr,
-                        const GdkColor *override_foreground,
-                        GdkBitmap      *override_stipple,
-                        gboolean        gc_changed,
-			GdkDrawable    *target_drawable)
-{
-  GdkGCPrivate *priv;
-  GdkFill fill;
-  GdkColor foreground;
-  GdkColor background;
-  cairo_surface_t *tile_surface = NULL;
-  GdkBitmap *stipple = NULL;
-
-  g_return_if_fail (GDK_IS_GC (gc));
-  g_return_if_fail (cr != NULL);
-  g_return_if_fail (override_stipple == NULL || GDK_IS_PIXMAP (override_stipple));
-
-  priv = GDK_GC_GET_PRIVATE (gc);
-
-  _gdk_gc_remove_drawable_clip (gc);
-
-  fill = priv->fill;
-  if (override_stipple && fill != GDK_OPAQUE_STIPPLED)
-    fill = GDK_STIPPLED;
-
-  if (fill != GDK_TILED)
-    {
-      if (override_foreground)
-	foreground = *override_foreground;
-      else
-	gc_get_foreground (gc, &foreground);
-    }
-
-  if (fill == GDK_OPAQUE_STIPPLED)
-    gc_get_background (gc, &background);
-
-
-  switch (fill)
-    {
-    case GDK_SOLID:
-      break;
-    case GDK_TILED:
-      if (!priv->tile)
-	fill = GDK_SOLID;
-      break;
-    case GDK_STIPPLED:
-    case GDK_OPAQUE_STIPPLED:
-      if (override_stipple)
-	stipple = override_stipple;
-      else
-	stipple = priv->stipple;
-      
-      if (!stipple)
-	fill = GDK_SOLID;
-      break;
-    }
-  
-  switch (fill)
-    {
-    case GDK_SOLID:
-      gdk_cairo_set_source_color (cr, &foreground);
-      break;
-    case GDK_TILED:
-      tile_surface = _gdk_drawable_ref_cairo_surface (priv->tile);
-      break;
-    case GDK_STIPPLED:
-      tile_surface = make_stipple_tile_surface (cr, stipple, &foreground, NULL);
-      break;
-    case GDK_OPAQUE_STIPPLED:
-      tile_surface = make_stipple_tile_surface (cr, stipple, &foreground, &background);
-      break;
-    }
-
-  /* Tiles, stipples, and clip regions are all specified in device space,
-   * not user space. For the clip region, we can simply change the matrix,
-   * clip, then clip back, but for the source pattern, we need to
-   * compute the right matrix.
-   *
-   * What we want is:
-   *
-   *     CTM_inverse * Pattern_matrix = Translate(- ts_x, - ts_y)
-   *
-   * (So that ts_x, ts_y in device space is taken to 0,0 in pattern
-   * space). So, pattern_matrix = CTM * Translate(- ts_x, - tx_y);
-   */
-
-  if (tile_surface)
-    {
-      cairo_pattern_t *pattern = cairo_pattern_create_for_surface (tile_surface);
-      cairo_matrix_t user_to_device;
-      cairo_matrix_t user_to_pattern;
-      cairo_matrix_t device_to_pattern;
-
-      cairo_get_matrix (cr, &user_to_device);
-      cairo_matrix_init_translate (&device_to_pattern,
-				   - gc->ts_x_origin, - gc->ts_y_origin);
-      cairo_matrix_multiply (&user_to_pattern,
-			     &user_to_device, &device_to_pattern);
-      
-      cairo_pattern_set_matrix (pattern, &user_to_pattern);
-      cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
-      cairo_set_source (cr, pattern);
-      
-      cairo_surface_destroy (tile_surface);
-      cairo_pattern_destroy (pattern);
-    }
-
-  if (!gc_changed)
-    return;
-
-  cairo_reset_clip (cr);
-  /* The reset above resets the window clip rect, so we want to re-set that */
-  if (target_drawable && GDK_DRAWABLE_GET_CLASS (target_drawable)->set_cairo_clip)
-    GDK_DRAWABLE_GET_CLASS (target_drawable)->set_cairo_clip (target_drawable, cr);
-
-  if (priv->clip_region)
-    {
-      cairo_save (cr);
-
-      cairo_identity_matrix (cr);
-      cairo_translate (cr, gc->clip_x_origin, gc->clip_y_origin);
-
-      cairo_new_path (cr);
-      gdk_cairo_region (cr, priv->clip_region);
-
-      cairo_restore (cr);
-
-      cairo_clip (cr);
-    }
-
-}
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index 2a6c5d4..bfd9775 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -327,13 +327,6 @@ cairo_surface_t * _gdk_drawable_create_cairo_surface (GdkDrawable *drawable,
 /* GC caching */
 GdkGC *_gdk_drawable_get_subwindow_scratch_gc (GdkDrawable *drawable);
 
-void _gdk_gc_update_context (GdkGC          *gc,
-			     cairo_t        *cr,
-			     const GdkColor *override_foreground,
-			     GdkBitmap      *override_stipple,
-			     gboolean        gc_changed,
-			     GdkDrawable    *target_drawable);
-
 /*************************************
  * Interfaces used by windowing code *
  *************************************/
diff --git a/gdk/gdkpango.c b/gdk/gdkpango.c
index 02e695c..678b45b 100644
--- a/gdk/gdkpango.c
+++ b/gdk/gdkpango.c
@@ -20,1002 +20,10 @@
 #include "config.h"
 #include <math.h>
 #include <pango/pangocairo.h>
-#include "gdkcairo.h"
-#include "gdkcolor.h"
-#include "gdkgc.h"
-#include "gdkinternals.h"
 #include "gdkpango.h"
-#include "gdkprivate.h"
 #include "gdkscreen.h"
 #include "gdkintl.h"
 
-
-#define GDK_INFO_KEY "gdk-info"
-
-/* We have various arrays indexed by render part; if PangoRenderPart
- * is extended, we want to make sure not to overwrite the end of
- * those arrays.
- */
-#define MAX_RENDER_PART  PANGO_RENDER_PART_STRIKETHROUGH
-
-struct _GdkPangoRendererPrivate
-{
-  GdkScreen *screen;
-
-  /* GdkPangoRenderer specific state */
-  PangoColor override_color[MAX_RENDER_PART + 1];
-  gboolean override_color_set[MAX_RENDER_PART + 1];
-  
-  GdkBitmap *stipple[MAX_RENDER_PART + 1];
-  PangoColor emboss_color;
-  gboolean embossed;
-
-  cairo_t *cr;
-  PangoRenderPart last_part;
-
-  /* Current target */
-  GdkDrawable *drawable;
-  GdkGC *base_gc;
-
-  gboolean gc_changed;
-};
-
-static PangoAttrType gdk_pango_attr_stipple_type;
-static PangoAttrType gdk_pango_attr_embossed_type;
-static PangoAttrType gdk_pango_attr_emboss_color_type;
-
-enum {
-  PROP_0,
-  PROP_SCREEN
-};
-
-G_DEFINE_TYPE (GdkPangoRenderer, gdk_pango_renderer, PANGO_TYPE_RENDERER)
-
-static void
-gdk_pango_renderer_finalize (GObject *object)
-{
-  GdkPangoRenderer *gdk_renderer = GDK_PANGO_RENDERER (object);
-  GdkPangoRendererPrivate *priv = gdk_renderer->priv;
-  int i;
-
-  if (priv->base_gc)
-    g_object_unref (priv->base_gc);
-  if (priv->drawable)
-    g_object_unref (priv->drawable);
-
-  for (i = 0; i <= MAX_RENDER_PART; i++)
-    if (priv->stipple[i])
-      g_object_unref (priv->stipple[i]);
-
-  G_OBJECT_CLASS (gdk_pango_renderer_parent_class)->finalize (object);
-}
-
-static GObject*
-gdk_pango_renderer_constructor (GType                  type,
-				guint                  n_construct_properties,
-				GObjectConstructParam *construct_params)
-{
-  GObject *object;
-  GdkPangoRenderer *gdk_renderer;
-
-  object = G_OBJECT_CLASS (gdk_pango_renderer_parent_class)->constructor (type,
-                                                                          n_construct_properties,
-                                                                          construct_params);
-
-  gdk_renderer = GDK_PANGO_RENDERER (object);
-  
-  if (!gdk_renderer->priv->screen)
-    {
-      g_warning ("Screen must be specified at construct time for GdkPangoRenderer");
-      gdk_renderer->priv->screen = gdk_screen_get_default ();
-    }
-
-  return object;
-}
-
-/* Adjusts matrix and color for the renderer to draw the secondary
- * "shadow" copy for embossed text */
-static void
-emboss_context (GdkPangoRenderer *renderer, cairo_t *cr)
-{
-  GdkPangoRendererPrivate *priv = renderer->priv;
-  cairo_matrix_t tmp_matrix;
-  double red, green, blue;
-
-  /* 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);
-
-  red = (double) priv->emboss_color.red / 65535.;
-  green = (double) priv->emboss_color.green / 65535.;
-  blue = (double) priv->emboss_color.blue / 65535.;
-
-  cairo_set_source_rgb (cr, red, green, blue);
-}
-
-static inline gboolean
-color_equal (const PangoColor *c1, const PangoColor *c2)
-{
-  if (!c1 && !c2)
-    return TRUE;
-
-  if (c1 && c2 &&
-      c1->red == c2->red &&
-      c1->green == c2->green &&
-      c1->blue == c2->blue)
-    return TRUE;
-
-  return FALSE;
-}
-
-static cairo_t *
-get_cairo_context (GdkPangoRenderer *gdk_renderer,
-		   PangoRenderPart   part)
-{
-  PangoRenderer *renderer = PANGO_RENDERER (gdk_renderer);
-  GdkPangoRendererPrivate *priv = gdk_renderer->priv;
-
-  if (!priv->cr)
-    {
-      const PangoMatrix *matrix;
-      
-      priv->cr = gdk_cairo_create (priv->drawable);
-
-      matrix = pango_renderer_get_matrix (renderer);
-      if (matrix)
-	{
-	  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);
-	}
-    }
-
-  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 (pango_color)
-	    {
-	      tmp_color.red = pango_color->red;
-	      tmp_color.green = pango_color->green;
-	      tmp_color.blue = pango_color->blue;
-	      
-	      color = &tmp_color;
-	    }
-	  else
-	    color = NULL;
-
-	  _gdk_gc_update_context (priv->base_gc,
-				  priv->cr,
-				  color,
-				  priv->stipple[part],
-				  priv->gc_changed,
-				  priv->drawable);
-	}
-
-      priv->last_part = part;
-      priv->gc_changed = FALSE;
-    }
-
-  return priv->cr;
-}
-
-static void
-gdk_pango_renderer_draw_glyphs (PangoRenderer    *renderer,
-				PangoFont        *font,
-				PangoGlyphString *glyphs,
-				int               x,
-				int               y)
-{
-  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);
-
-  if (priv->embossed)
-    {
-      cairo_save (cr);
-      emboss_context (gdk_renderer, 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);
-}
-
-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;
-  cairo_t *cr;
-  
-  cr = get_cairo_context (gdk_renderer, part);
-
-  if (priv->embossed && part != PANGO_RENDER_PART_BACKGROUND)
-    {
-      cairo_save (cr);
-      emboss_context (gdk_renderer, cr);
-      cairo_rectangle (cr,
-		       (double)x / PANGO_SCALE, (double)y / PANGO_SCALE,
-		       (double)width / PANGO_SCALE, (double)height / PANGO_SCALE);
-
-      cairo_fill (cr);
-      cairo_restore (cr);
-    }
-
-  cairo_rectangle (cr,
-		   (double)x / PANGO_SCALE, (double)y / PANGO_SCALE,
-		   (double)width / PANGO_SCALE, (double)height / PANGO_SCALE);
-  cairo_fill (cr);
-}
-
-static void
-gdk_pango_renderer_draw_error_underline (PangoRenderer    *renderer,
-					 int               x,
-					 int               y,
-					 int               width,
-					 int               height)
-{
-  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)
-    {
-      cairo_save (cr);
-      emboss_context (gdk_renderer, cr);
-      pango_cairo_show_error_underline (cr,
-            (double)x / PANGO_SCALE, (double)y / PANGO_SCALE,
-            (double)width / PANGO_SCALE, (double)height / PANGO_SCALE);
-      cairo_restore (cr);
-    }
-
-  pango_cairo_show_error_underline (cr,
-	(double)x / PANGO_SCALE, (double)y / PANGO_SCALE,
-	(double)width / PANGO_SCALE, (double)height / PANGO_SCALE);
-}
-
-static void
-gdk_pango_renderer_draw_shape (PangoRenderer  *renderer,
-			       PangoAttrShape *attr,
-			       int             x,
-			       int             y)
-{
-  GdkPangoRenderer *gdk_renderer = GDK_PANGO_RENDERER (renderer);
-  GdkPangoRendererPrivate *priv = gdk_renderer->priv;
-  PangoLayout *layout;
-  PangoCairoShapeRendererFunc shape_renderer;
-  gpointer                    shape_renderer_data;
-  cairo_t *cr;
-  double dx = (double)x / PANGO_SCALE, dy = (double)y / PANGO_SCALE;
-
-  layout = pango_renderer_get_layout (renderer);
-
-  if (!layout)
-  	return;
-
-  shape_renderer = pango_cairo_context_get_shape_renderer (pango_layout_get_context (layout),
-							   &shape_renderer_data);
-
-  if (!shape_renderer)
-    return;
-
-  cr = get_cairo_context (gdk_renderer, PANGO_RENDER_PART_FOREGROUND);
-  
-  cairo_save (cr);
-
-  if (priv->embossed)
-    {
-      cairo_save (cr);
-      emboss_context (gdk_renderer, cr);
-
-      cairo_move_to (cr, dx, dy);
-      shape_renderer (cr, attr, FALSE, shape_renderer_data);
-
-      cairo_restore (cr);
-    }
-
-  cairo_move_to (cr, dx, dy);
-  shape_renderer (cr, attr, FALSE, shape_renderer_data);
-
-  cairo_restore (cr);
-}
-
-static void
-gdk_pango_renderer_part_changed (PangoRenderer   *renderer,
-				 PangoRenderPart  part)
-{
-  GdkPangoRenderer *gdk_renderer = GDK_PANGO_RENDERER (renderer);
-
-  if (gdk_renderer->priv->last_part == part)
-    gdk_renderer->priv->last_part = (PangoRenderPart)-1;
-}
-
-static void
-gdk_pango_renderer_begin (PangoRenderer *renderer)
-{
-  GdkPangoRenderer *gdk_renderer = GDK_PANGO_RENDERER (renderer);
-  GdkPangoRendererPrivate *priv = gdk_renderer->priv;
-  
-  if (!priv->drawable || !priv->base_gc)
-    {
-      g_warning ("gdk_pango_renderer_set_drawable() and gdk_pango_renderer_set_drawable()"
-		 "must be used to set the target drawable and GC before using the renderer\n");
-    }
-}
-
-static void
-gdk_pango_renderer_end (PangoRenderer *renderer)
-{
-  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;
-}
-
-static void
-gdk_pango_renderer_prepare_run (PangoRenderer  *renderer,
-				PangoLayoutRun *run)
-{
-  GdkPangoRenderer *gdk_renderer = GDK_PANGO_RENDERER (renderer);
-  gboolean embossed = FALSE;
-  GdkBitmap *stipple = NULL;
-  gboolean changed = FALSE;
-  PangoColor emboss_color;
-  GSList *l;
-  int i;
-
-  emboss_color.red = 0xffff;
-  emboss_color.green = 0xffff;
-  emboss_color.blue = 0xffff;
-
-  for (l = run->item->analysis.extra_attrs; l; l = l->next)
-    {
-      PangoAttribute *attr = l->data;
-
-      /* stipple_type and embossed_type aren't necessarily
-       * initialized, but they are 0, which is an
-       * invalid type so won't occur. 
-       */
-      if (attr->klass->type == gdk_pango_attr_stipple_type)
-	{
-	  stipple = ((GdkPangoAttrStipple*)attr)->stipple;
-	}
-      else if (attr->klass->type == gdk_pango_attr_embossed_type)
-	{
-	  embossed = ((GdkPangoAttrEmbossed*)attr)->embossed;
-	}
-      else if (attr->klass->type == gdk_pango_attr_emboss_color_type)
-	{
-	  emboss_color = ((GdkPangoAttrEmbossColor*)attr)->color;
-	}
-    }
-
-  gdk_pango_renderer_set_stipple (gdk_renderer, PANGO_RENDER_PART_FOREGROUND, stipple);
-  gdk_pango_renderer_set_stipple (gdk_renderer, PANGO_RENDER_PART_BACKGROUND, stipple);
-  gdk_pango_renderer_set_stipple (gdk_renderer, PANGO_RENDER_PART_UNDERLINE, stipple);
-  gdk_pango_renderer_set_stipple (gdk_renderer, PANGO_RENDER_PART_STRIKETHROUGH, stipple);
-
-  if (embossed != gdk_renderer->priv->embossed)
-    {
-      gdk_renderer->priv->embossed = embossed;
-      changed = TRUE;
-    }
-
-  if (!color_equal (&gdk_renderer->priv->emboss_color, &emboss_color))
-    {
-      gdk_renderer->priv->emboss_color = emboss_color;
-      changed = TRUE;
-    }
-
-  if (changed)
-    pango_renderer_part_changed (renderer, PANGO_RENDER_PART_FOREGROUND);
-
-  PANGO_RENDERER_CLASS (gdk_pango_renderer_parent_class)->prepare_run (renderer, run);
-
-  for (i = 0; i <= MAX_RENDER_PART; i++)
-    {
-      if (gdk_renderer->priv->override_color_set[i])
-	pango_renderer_set_color (renderer, i, &gdk_renderer->priv->override_color[i]);
-    }
-}
-
-static void
-gdk_pango_renderer_set_property (GObject         *object,
-				 guint            prop_id,
-				 const GValue    *value,
-				 GParamSpec      *pspec)
-{
-  GdkPangoRenderer *gdk_renderer = GDK_PANGO_RENDERER (object);
-
-  switch (prop_id)
-    {
-    case PROP_SCREEN:
-      gdk_renderer->priv->screen = g_value_get_object (value);
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-    }
-}
-
-static void
-gdk_pango_renderer_get_property (GObject    *object,
-				 guint       prop_id,
-				 GValue     *value,
-				 GParamSpec *pspec)
-{
-  GdkPangoRenderer *gdk_renderer = GDK_PANGO_RENDERER (object);
-
-  switch (prop_id)
-    {
-    case PROP_SCREEN:
-      g_value_set_object (value, gdk_renderer->priv->screen);
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-    }
-}
-
-static void
-gdk_pango_renderer_init (GdkPangoRenderer *renderer)
-{
-  renderer->priv = G_TYPE_INSTANCE_GET_PRIVATE (renderer,
-						GDK_TYPE_PANGO_RENDERER,
-						GdkPangoRendererPrivate);
-
-  renderer->priv->last_part = (PangoRenderPart)-1;
-  renderer->priv->gc_changed = TRUE;
-}
-
-static void
-gdk_pango_renderer_class_init (GdkPangoRendererClass *klass)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  
-  PangoRendererClass *renderer_class = PANGO_RENDERER_CLASS (klass);
-  
-  renderer_class->draw_glyphs = gdk_pango_renderer_draw_glyphs;
-  renderer_class->draw_rectangle = gdk_pango_renderer_draw_rectangle;
-  renderer_class->draw_error_underline = gdk_pango_renderer_draw_error_underline;
-  renderer_class->draw_shape = gdk_pango_renderer_draw_shape;
-  renderer_class->part_changed = gdk_pango_renderer_part_changed;
-  renderer_class->begin = gdk_pango_renderer_begin;
-  renderer_class->end = gdk_pango_renderer_end;
-  renderer_class->prepare_run = gdk_pango_renderer_prepare_run;
-
-  object_class->finalize = gdk_pango_renderer_finalize;
-  object_class->constructor = gdk_pango_renderer_constructor;
-  object_class->set_property = gdk_pango_renderer_set_property;
-  object_class->get_property = gdk_pango_renderer_get_property;
-  
-  g_object_class_install_property (object_class,
-                                   PROP_SCREEN,
-                                   g_param_spec_object ("screen",
-                                                        P_("Screen"),
-                                                        P_("the GdkScreen for the renderer"),
-                                                        GDK_TYPE_SCREEN,
-                                                        G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
-							G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | 
-							G_PARAM_STATIC_BLURB));
-
-  g_type_class_add_private (object_class, sizeof (GdkPangoRendererPrivate));  
-}
-
-/**
- * gdk_pango_renderer_new:
- * @screen: a #GdkScreen
- * 
- * Creates a new #PangoRenderer for @screen. Normally you can use the
- * results of gdk_pango_renderer_get_default() rather than creating a new
- * renderer.
- * 
- * Return value: a newly created #PangoRenderer. Free with g_object_unref().
- *
- * Since: 2.6
- **/
-PangoRenderer *
-gdk_pango_renderer_new (GdkScreen *screen)
-{
-  g_return_val_if_fail (screen != NULL, NULL);
-  
-  return g_object_new (GDK_TYPE_PANGO_RENDERER,
-		       "screen", screen,
-		       NULL);
-}
-
-static void
-on_renderer_display_closed (GdkDisplay       *display,
-                            gboolean          is_error,
-			    GdkPangoRenderer *renderer)
-{
-  g_signal_handlers_disconnect_by_func (display,
-					on_renderer_display_closed,
-					renderer);
-  g_object_set_data (G_OBJECT (renderer->priv->screen),
-                     g_intern_static_string ("gdk-pango-renderer"), NULL);
-}
-
-/**
- * gdk_pango_renderer_get_default:
- * @screen: a #GdkScreen
- * 
- * Gets the default #PangoRenderer for a screen. This default renderer
- * is shared by all users of the display, so properties such as the color
- * or transformation matrix set for the renderer may be overwritten.
- *
- * Before using the renderer, you need to call gdk_pango_renderer_set_drawable()
- * and gdk_pango_renderer_set_gc() to set the drawable and graphics context
- * to use for drawing.
- * 
- * Return value: the default #PangoRenderer for @screen. The
- *  renderer is owned by GTK+ and will be kept around until the
- *  screen is closed.
- *
- * Since: 2.6
- **/
-PangoRenderer *
-gdk_pango_renderer_get_default (GdkScreen *screen)
-{
-  PangoRenderer *renderer;
-
-  g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
-  
-  renderer = g_object_get_data (G_OBJECT (screen), "gdk-pango-renderer");
-  if (!renderer)
-    {
-      renderer = gdk_pango_renderer_new (screen);
-      g_object_set_data_full (G_OBJECT (screen), 
-                              g_intern_static_string ("gdk-pango-renderer"), renderer,
-			      (GDestroyNotify)g_object_unref);
-
-      g_signal_connect (gdk_screen_get_display (screen), "closed",
-			G_CALLBACK (on_renderer_display_closed), renderer);
-    }
-
-  return renderer;
-}
-
-/**
- * gdk_pango_renderer_set_drawable:
- * @gdk_renderer: a #GdkPangoRenderer
- * @drawable: (allow-none): the new target drawable, or %NULL
- * 
- * Sets the drawable the renderer draws to.
- *
- * Since: 2.6
- **/
-void
-gdk_pango_renderer_set_drawable (GdkPangoRenderer *gdk_renderer,
-				 GdkDrawable      *drawable)
-{
-  GdkPangoRendererPrivate *priv;
-  
-  g_return_if_fail (GDK_IS_PANGO_RENDERER (gdk_renderer));
-  g_return_if_fail (drawable == NULL || GDK_IS_DRAWABLE (drawable));
-
-  priv = gdk_renderer->priv;
-  
-  if (priv->drawable != drawable)
-    {
-      if (priv->drawable)
-	g_object_unref (priv->drawable);
-      priv->drawable = drawable;
-      if (priv->drawable)
-	g_object_ref (priv->drawable);
-    }
-}
-
-/**
- * gdk_pango_renderer_set_gc:
- * @gdk_renderer: a #GdkPangoRenderer
- * @gc: (allow-none): the new GC to use for drawing, or %NULL
- * 
- * Sets the GC the renderer draws with. Note that the GC must not be
- * modified until it is unset by calling the function again with
- * %NULL for the @gc parameter, since GDK may make internal copies
- * of the GC which won't be updated to follow changes to the
- * original GC.
- *
- * Since: 2.6
- **/
-void
-gdk_pango_renderer_set_gc (GdkPangoRenderer *gdk_renderer,
-			   GdkGC            *gc)
-{
-  GdkPangoRendererPrivate *priv;
-  
-  g_return_if_fail (GDK_IS_PANGO_RENDERER (gdk_renderer));
-  g_return_if_fail (gc == NULL || GDK_IS_GC (gc));
-
-  priv = gdk_renderer->priv;
-  
-  if (priv->base_gc != gc)
-    {
-      if (priv->base_gc)
-	g_object_unref (priv->base_gc);
-      priv->base_gc = gc;
-      if (priv->base_gc)
-	g_object_ref (priv->base_gc);
-
-      priv->gc_changed = TRUE;
-    }
-}
-
-
-/**
- * gdk_pango_renderer_set_stipple:
- * @gdk_renderer: a #GdkPangoRenderer
- * @part: the part to render with the stipple
- * @stipple: the new stipple value.
- * 
- * Sets the stipple for one render part (foreground, background, underline,
- * etc.) Note that this is overwritten when iterating through the individual
- * styled runs of a #PangoLayout or #PangoLayoutLine. This function is thus
- * only useful when you call low level functions like pango_renderer_draw_glyphs()
- * directly, or in the 'prepare_run' virtual function of a subclass of
- * #GdkPangoRenderer.
- *
- * Since: 2.6
- **/
-void
-gdk_pango_renderer_set_stipple (GdkPangoRenderer *gdk_renderer,
-				PangoRenderPart   part,
-				GdkBitmap        *stipple)
-{
-  g_return_if_fail (GDK_IS_PANGO_RENDERER (gdk_renderer));
-
-  if (part > MAX_RENDER_PART)	/* Silently ignore unknown parts */
-    return;
-
-  if (stipple != gdk_renderer->priv->stipple[part])
-    {
-      if (gdk_renderer->priv->stipple[part])
-	g_object_unref (gdk_renderer->priv->stipple[part]);
-
-      gdk_renderer->priv->stipple[part] = stipple;
-      
-      if (gdk_renderer->priv->stipple[part])
-	g_object_ref (gdk_renderer->priv->stipple[part]);
-
-      pango_renderer_part_changed (PANGO_RENDERER (gdk_renderer), part);
-    }
-}
-
-/**
- * gdk_pango_renderer_set_override_color:
- * @gdk_renderer: a #GdkPangoRenderer
- * @part: the part to render to set the color of
- * @color: (allow-none): the color to use, or %NULL to unset a previously
- *         set override color.
- * 
- * Sets the color for a particular render part (foreground,
- * background, underline, etc.), overriding any attributes on the layouts
- * renderered with this renderer.
- * 
- * Since: 2.6
- **/
-void
-gdk_pango_renderer_set_override_color (GdkPangoRenderer *gdk_renderer,
-				       PangoRenderPart   part,
-				       const GdkColor   *color)
-{
-  GdkPangoRendererPrivate *priv;
-  
-  g_return_if_fail (GDK_IS_PANGO_RENDERER (gdk_renderer));
-
-  priv = gdk_renderer->priv;
-  
-  if (part > MAX_RENDER_PART)	/* Silently ignore unknown parts */
-    return;
-
-  if (color)
-    {
-      priv->override_color[part].red = color->red;
-      priv->override_color[part].green = color->green;
-      priv->override_color[part].blue = color->blue;
-      priv->override_color_set[part] = TRUE;
-    }
-  else
-    priv->override_color_set[part] = FALSE;
-}
-
-/* Gets a renderer to draw with, setting the properties of the
- * renderer and activating it. Note that since we activate the
- * renderer here, the implicit setting of the matrix that
- * pango_renderer_draw_layout_[line] normally do when they
- * activate the renderer is suppressed. */
-static PangoRenderer *
-get_renderer (GdkDrawable     *drawable,
-	      GdkGC           *gc,
-	      const GdkColor  *foreground,
-	      const GdkColor  *background)
-{
-  GdkScreen *screen = gdk_drawable_get_screen (drawable);
-  PangoRenderer *renderer = gdk_pango_renderer_get_default (screen);
-  GdkPangoRenderer *gdk_renderer = GDK_PANGO_RENDERER (renderer);
-
-  gdk_pango_renderer_set_drawable (gdk_renderer, drawable);
-  gdk_pango_renderer_set_gc (gdk_renderer, gc);  
-
-  gdk_pango_renderer_set_override_color (gdk_renderer,
-					 PANGO_RENDER_PART_FOREGROUND,
-					 foreground);
-  gdk_pango_renderer_set_override_color (gdk_renderer,
-					 PANGO_RENDER_PART_UNDERLINE,
-					 foreground);
-  gdk_pango_renderer_set_override_color (gdk_renderer,
-					 PANGO_RENDER_PART_STRIKETHROUGH,
-					 foreground);
-
-  gdk_pango_renderer_set_override_color (gdk_renderer,
-					 PANGO_RENDER_PART_BACKGROUND,
-					 background);
-
-  pango_renderer_activate (renderer);
-
-  return renderer;
-}
-
-/* Cleans up the renderer obtained with get_renderer() */
-static void
-release_renderer (PangoRenderer *renderer)
-{
-  GdkPangoRenderer *gdk_renderer = GDK_PANGO_RENDERER (renderer);
-  
-  pango_renderer_deactivate (renderer);
-  
-  gdk_pango_renderer_set_override_color (gdk_renderer,
-					 PANGO_RENDER_PART_FOREGROUND,
-					 NULL);
-  gdk_pango_renderer_set_override_color (gdk_renderer,
-					 PANGO_RENDER_PART_UNDERLINE,
-					 NULL);
-  gdk_pango_renderer_set_override_color (gdk_renderer,
-					 PANGO_RENDER_PART_STRIKETHROUGH,
-					 NULL);
-  gdk_pango_renderer_set_override_color (gdk_renderer,
-					 PANGO_RENDER_PART_BACKGROUND,
-					 NULL);
-  
-  gdk_pango_renderer_set_drawable (gdk_renderer, NULL);
-  gdk_pango_renderer_set_gc (gdk_renderer, NULL);
-}
-
-/* GdkPangoAttrStipple */
-
-static PangoAttribute *
-gdk_pango_attr_stipple_copy (const PangoAttribute *attr)
-{
-  const GdkPangoAttrStipple *src = (const GdkPangoAttrStipple*) attr;
-
-  return gdk_pango_attr_stipple_new (src->stipple);
-}
-
-static void
-gdk_pango_attr_stipple_destroy (PangoAttribute *attr)
-{
-  GdkPangoAttrStipple *st = (GdkPangoAttrStipple*) attr;
-
-  if (st->stipple)
-    g_object_unref (st->stipple);
-  
-  g_free (attr);
-}
-
-static gboolean
-gdk_pango_attr_stipple_compare (const PangoAttribute *attr1,
-                                    const PangoAttribute *attr2)
-{
-  const GdkPangoAttrStipple *a = (const GdkPangoAttrStipple*) attr1;
-  const GdkPangoAttrStipple *b = (const GdkPangoAttrStipple*) attr2;
-
-  return a->stipple == b->stipple;
-}
-
-/**
- * gdk_pango_attr_stipple_new:
- * @stipple: a bitmap to be set as stipple
- *
- * Creates a new attribute containing a stipple bitmap to be used when
- * rendering the text.
- *
- * Return value: new #PangoAttribute
- **/
-
-PangoAttribute *
-gdk_pango_attr_stipple_new (GdkBitmap *stipple)
-{
-  GdkPangoAttrStipple *result;
-  
-  static PangoAttrClass klass = {
-    0,
-    gdk_pango_attr_stipple_copy,
-    gdk_pango_attr_stipple_destroy,
-    gdk_pango_attr_stipple_compare
-  };
-
-  if (!klass.type)
-    klass.type = gdk_pango_attr_stipple_type =
-      pango_attr_type_register ("GdkPangoAttrStipple");
-
-  result = g_new (GdkPangoAttrStipple, 1);
-  result->attr.klass = &klass;
-
-  if (stipple)
-    g_object_ref (stipple);
-  
-  result->stipple = stipple;
-
-  return (PangoAttribute *)result;
-}
-
-/* GdkPangoAttrEmbossed */
-
-static PangoAttribute *
-gdk_pango_attr_embossed_copy (const PangoAttribute *attr)
-{
-  const GdkPangoAttrEmbossed *e = (const GdkPangoAttrEmbossed*) attr;
-
-  return gdk_pango_attr_embossed_new (e->embossed);
-}
-
-static void
-gdk_pango_attr_embossed_destroy (PangoAttribute *attr)
-{
-  g_free (attr);
-}
-
-static gboolean
-gdk_pango_attr_embossed_compare (const PangoAttribute *attr1,
-                                 const PangoAttribute *attr2)
-{
-  const GdkPangoAttrEmbossed *e1 = (const GdkPangoAttrEmbossed*) attr1;
-  const GdkPangoAttrEmbossed *e2 = (const GdkPangoAttrEmbossed*) attr2;
-
-  return e1->embossed == e2->embossed;
-}
-
-/**
- * gdk_pango_attr_embossed_new:
- * @embossed: if the region should be embossed
- *
- * Creates a new attribute flagging a region as embossed or not.
- *
- * Return value: new #PangoAttribute
- **/
-
-PangoAttribute *
-gdk_pango_attr_embossed_new (gboolean embossed)
-{
-  GdkPangoAttrEmbossed *result;
-  
-  static PangoAttrClass klass = {
-    0,
-    gdk_pango_attr_embossed_copy,
-    gdk_pango_attr_embossed_destroy,
-    gdk_pango_attr_embossed_compare
-  };
-
-  if (!klass.type)
-    klass.type = gdk_pango_attr_embossed_type =
-      pango_attr_type_register ("GdkPangoAttrEmbossed");
-
-  result = g_new (GdkPangoAttrEmbossed, 1);
-  result->attr.klass = &klass;
-  result->embossed = embossed;
-  
-  return (PangoAttribute *)result;
-}
-
-/* GdkPangoAttrEmbossColor */
-
-static PangoAttribute *
-gdk_pango_attr_emboss_color_copy (const PangoAttribute *attr)
-{
-  const GdkPangoAttrEmbossColor *old = (const GdkPangoAttrEmbossColor*) attr;
-  GdkPangoAttrEmbossColor *copy;
-
-  copy = g_new (GdkPangoAttrEmbossColor, 1);
-  copy->attr.klass = old->attr.klass;
-  copy->color = old->color;
-
-  return (PangoAttribute *) copy;
-}
-
-static void
-gdk_pango_attr_emboss_color_destroy (PangoAttribute *attr)
-{
-  g_free (attr);
-}
-
-static gboolean
-gdk_pango_attr_emboss_color_compare (const PangoAttribute *attr1,
-                                     const PangoAttribute *attr2)
-{
-  const GdkPangoAttrEmbossColor *c1 = (const GdkPangoAttrEmbossColor*) attr1;
-  const GdkPangoAttrEmbossColor *c2 = (const GdkPangoAttrEmbossColor*) attr2;
-
-  return color_equal (&c1->color, &c2->color);
-}
-
-/**
- * gdk_pango_attr_emboss_color_new:
- * @color: a GdkColor representing the color to emboss with
- *
- * Creates a new attribute specifying the color to emboss text with.
- *
- * Return value: new #PangoAttribute
- *
- * Since: 2.12
- **/
-PangoAttribute *
-gdk_pango_attr_emboss_color_new (const GdkColor *color)
-{
-  GdkPangoAttrEmbossColor *result;
-  
-  static PangoAttrClass klass = {
-    0,
-    gdk_pango_attr_emboss_color_copy,
-    gdk_pango_attr_emboss_color_destroy,
-    gdk_pango_attr_emboss_color_compare
-  };
-
-  if (!klass.type)
-    klass.type = gdk_pango_attr_emboss_color_type =
-      pango_attr_type_register ("GdkPangoAttrEmbossColor");
-
-  result = g_new (GdkPangoAttrEmbossColor, 1);
-  result->attr.klass = &klass;
-  result->color.red = color->red;
-  result->color.green = color->green;
-  result->color.blue = color->blue;
-
-  return (PangoAttribute *) result;
-}
-
 /* Get a clip region to draw only part of a layout. index_ranges
  * contains alternating range starts/stops. The region is the
  * region which contains the given ranges, i.e. if you draw with the
diff --git a/gdk/gdkpango.h b/gdk/gdkpango.h
index c905b57..1aaf269 100644
--- a/gdk/gdkpango.h
+++ b/gdk/gdkpango.h
@@ -28,73 +28,6 @@
 
 G_BEGIN_DECLS
 
-/* Pango interaction */
-
-typedef struct _GdkPangoRenderer        GdkPangoRenderer;
-typedef struct _GdkPangoRendererClass   GdkPangoRendererClass;
-typedef struct _GdkPangoRendererPrivate GdkPangoRendererPrivate;
-
-#define GDK_TYPE_PANGO_RENDERER            (gdk_pango_renderer_get_type())
-#define GDK_PANGO_RENDERER(object)         (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PANGO_RENDERER, GdkPangoRenderer))
-#define GDK_IS_PANGO_RENDERER(object)      (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PANGO_RENDERER))
-#define GDK_PANGO_RENDERER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PANGO_RENDERER, GdkPangoRendererClass))
-#define GDK_IS_PANGO_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PANGO_RENDERER))
-#define GDK_PANGO_RENDERER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PANGO_RENDERER, GdkPangoRendererClass))
-
-/**
- * GdkPangoRenderer:
- *
- * #GdkPangoRenderer is a subclass of #PangoRenderer used for rendering
- * Pango objects into GDK drawables. The default renderer for a particular
- * screen is obtained with gdk_pango_renderer_get_default(); Pango
- * functions like pango_renderer_draw_layout() and
- * pango_renderer_draw_layout_line() are then used to draw objects with
- * the renderer.
- *
- * In certain cases it can be useful to subclass #GdkPangoRenderer. Examples
- * of reasons to do this are to add handling of custom attributes by
- * overriding 'prepare_run' or to do custom drawing of embedded objects
- * by overriding 'draw_shape'.
- *
- * Since: 2.6
- **/
-struct _GdkPangoRenderer
-{
-  /*< private >*/
-  PangoRenderer parent_instance;
-
-  GdkPangoRendererPrivate *priv;
-};
-
-/**
- * GdkPangoRendererClass:
- *
- * #GdkPangoRenderer is the class structure for #GdkPangoRenderer.
- *
- * Since: 2.6
- **/
-struct _GdkPangoRendererClass
-{
-  /*< private >*/
-  PangoRendererClass parent_class;
-};
-
-GType gdk_pango_renderer_get_type (void) G_GNUC_CONST;
-
-PangoRenderer *gdk_pango_renderer_new         (GdkScreen *screen);
-PangoRenderer *gdk_pango_renderer_get_default (GdkScreen *screen);
-
-void gdk_pango_renderer_set_drawable       (GdkPangoRenderer *gdk_renderer,
-					    GdkDrawable      *drawable);
-void gdk_pango_renderer_set_gc             (GdkPangoRenderer *gdk_renderer,
-					    GdkGC            *gc);
-void gdk_pango_renderer_set_stipple        (GdkPangoRenderer *gdk_renderer,
-					    PangoRenderPart   part,
-					    GdkBitmap        *stipple);
-void gdk_pango_renderer_set_override_color (GdkPangoRenderer *gdk_renderer,
-					    PangoRenderPart   part,
-					    const GdkColor   *color);
-
 /************************************************************************/
 
 PangoContext *gdk_pango_context_get_for_screen (GdkScreen    *screen);
@@ -120,36 +53,6 @@ cairo_region_t    *gdk_pango_layout_get_clip_region      (PangoLayout     *layou
                                                      const gint      *index_ranges,
                                                      gint             n_ranges);
 
-
-
-/* Attributes use to render insensitive text in GTK+. */
-
-typedef struct _GdkPangoAttrStipple GdkPangoAttrStipple;
-typedef struct _GdkPangoAttrEmbossed GdkPangoAttrEmbossed;
-typedef struct _GdkPangoAttrEmbossColor GdkPangoAttrEmbossColor;
-
-struct _GdkPangoAttrStipple
-{
-  PangoAttribute attr;
-  GdkBitmap *stipple;
-};
-
-struct _GdkPangoAttrEmbossed
-{
-  PangoAttribute attr;
-  gboolean embossed;
-};
-
-struct _GdkPangoAttrEmbossColor
-{
-  PangoAttribute attr;
-  PangoColor color;
-};
-
-PangoAttribute *gdk_pango_attr_stipple_new  (GdkBitmap *stipple);
-PangoAttribute *gdk_pango_attr_embossed_new (gboolean embossed);
-PangoAttribute *gdk_pango_attr_emboss_color_new (const GdkColor *color);
-
 G_END_DECLS
 
 #endif /* __GDK_PANGO_H__ */
diff --git a/gtk/tests/defaultvalue.c b/gtk/tests/defaultvalue.c
index a647165..5100028 100644
--- a/gtk/tests/defaultvalue.c
+++ b/gtk/tests/defaultvalue.c
@@ -84,8 +84,6 @@ test_type (gconstpointer data)
   
   if (g_type_is_a (type, GTK_TYPE_SETTINGS))
     instance = g_object_ref (gtk_settings_get_default ());
-  else if (g_type_is_a (type, GDK_TYPE_PANGO_RENDERER))
-    instance = g_object_ref (gdk_pango_renderer_get_default (gdk_screen_get_default ()));
   else if (g_type_is_a (type, GDK_TYPE_PIXMAP))
     instance = g_object_ref (gdk_pixmap_new (NULL, 1, 1, 1));
   else if (g_type_is_a (type, GDK_TYPE_COLORMAP))
@@ -121,10 +119,6 @@ test_type (gconstpointer data)
 	  (strcmp (pspec->name, "default-display") == 0))
 	continue;
 
-      if (g_type_is_a (type, GDK_TYPE_PANGO_RENDERER) &&
-	  (strcmp (pspec->name, "screen") == 0))
-	continue;
-
       if (g_type_is_a (type, GTK_TYPE_ABOUT_DIALOG) &&
 	  (strcmp (pspec->name, "program-name") == 0))
 	continue;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]