[gtk+/rendering-cleanup: 45/113] API: remove gdk_draw_glyphs() and gdk_draw_glyphs_transformed()



commit 4dc7624497428f816cdaeb826b30d969a4e33cfa
Author: Benjamin Otte <otte redhat com>
Date:   Wed Jul 14 16:03:51 2010 +0200

    API: remove gdk_draw_glyphs() and gdk_draw_glyphs_transformed()

 docs/reference/gdk/gdk3-sections.txt           |    2 -
 docs/reference/gdk/tmpl/drawing.sgml           |   27 ------
 docs/reference/gdk/tmpl/pango_interaction.sgml |    9 +-
 gdk/gdk.symbols                                |    2 -
 gdk/gdkdraw.c                                  |  107 ------------------------
 gdk/gdkdrawable.h                              |   29 -------
 gdk/gdkpixmap.c                                |   45 ----------
 gdk/gdkwindow.c                                |   79 -----------------
 8 files changed, 4 insertions(+), 296 deletions(-)
---
diff --git a/docs/reference/gdk/gdk3-sections.txt b/docs/reference/gdk/gdk3-sections.txt
index d1bf6fd..96f934b 100644
--- a/docs/reference/gdk/gdk3-sections.txt
+++ b/docs/reference/gdk/gdk3-sections.txt
@@ -341,8 +341,6 @@ gdk_draw_segments
 GdkSegment
 gdk_draw_rectangle
 gdk_draw_polygon
-gdk_draw_glyphs
-gdk_draw_glyphs_transformed
 gdk_draw_layout_line
 gdk_draw_layout_line_with_colors
 gdk_draw_layout
diff --git a/docs/reference/gdk/tmpl/drawing.sgml b/docs/reference/gdk/tmpl/drawing.sgml
index 3b7b4be..46f63f5 100644
--- a/docs/reference/gdk/tmpl/drawing.sgml
+++ b/docs/reference/gdk/tmpl/drawing.sgml
@@ -219,33 +219,6 @@ function.
 @n_points: 
 
 
-<!-- ##### FUNCTION gdk_draw_glyphs ##### -->
-<para>
-
-</para>
-
- drawable: 
- gc: 
- font: 
- x: 
- y: 
- glyphs: 
-
-
-<!-- ##### FUNCTION gdk_draw_glyphs_transformed ##### -->
-<para>
-
-</para>
-
- drawable: 
- gc: 
- matrix: 
- font: 
- x: 
- y: 
- glyphs: 
-
-
 <!-- ##### FUNCTION gdk_draw_layout_line ##### -->
 <para>
 
diff --git a/docs/reference/gdk/tmpl/pango_interaction.sgml b/docs/reference/gdk/tmpl/pango_interaction.sgml
index b9556a9..82e4c30 100644
--- a/docs/reference/gdk/tmpl/pango_interaction.sgml
+++ b/docs/reference/gdk/tmpl/pango_interaction.sgml
@@ -25,11 +25,10 @@ linkend="PANGO-SCALE-CAPS">PANGO_SCALE</link> or the PANGO_PIXELS() macro.)
 </para>
 <para>
 Rendering a Pango layout is done most simply with gdk_draw_layout();
-you can also draw pieces of the layout with gdk_draw_layout() or
-gdk_draw_glyphs(). #GdkPangoRenderer is a subclass of #PangoRenderer
-that is used internally to implement these functions. Using it
-directly or subclassing it can be useful in some cases. See the
-#GdkPangoRenderer documentation for details.
+you can also draw pieces of the layout with gdk_draw_layout().
+#GdkPangoRenderer is a subclass of #PangoRenderer that is used internally
+to implement these functions. Using it directly or subclassing it can be
+useful in some cases. See the #GdkPangoRenderer documentation for details.
 </para>
 <example id="rotated-example">
 <title>Using #GdkPangoRenderer to draw transformed text</title>
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index 51dad0b..40c55f8 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -548,8 +548,6 @@ gdk_drawable_get_visible_region
 gdk_drawable_get_visual
 gdk_drawable_set_colormap
 gdk_draw_drawable
-gdk_draw_glyphs
-gdk_draw_glyphs_transformed
 gdk_draw_line
 gdk_draw_lines
 gdk_draw_point
diff --git a/gdk/gdkdraw.c b/gdk/gdkdraw.c
index 33181f9..d29ddaf 100644
--- a/gdk/gdkdraw.c
+++ b/gdk/gdkdraw.c
@@ -531,113 +531,6 @@ gdk_draw_lines (GdkDrawable    *drawable,
                                                  (GdkPoint *) points, n_points);
 }
 
-static void
-real_draw_glyphs (GdkDrawable       *drawable,
-		  GdkGC	            *gc,
-		  const PangoMatrix *matrix,
-		  PangoFont         *font,
-		  gdouble            x,
-		  gdouble            y,
-		  PangoGlyphString  *glyphs)
-{
-  cairo_t *cr;
-
-  cr = gdk_cairo_create (drawable);
-  _gdk_gc_update_context (gc, cr, NULL, NULL, TRUE, drawable);
-
-  if (matrix)
-    {
-      cairo_matrix_t cairo_matrix;
-
-      cairo_matrix.xx = matrix->xx;
-      cairo_matrix.yx = matrix->yx;
-      cairo_matrix.xy = matrix->xy;
-      cairo_matrix.yy = matrix->yy;
-      cairo_matrix.x0 = matrix->x0;
-      cairo_matrix.y0 = matrix->y0;
-      
-      cairo_set_matrix (cr, &cairo_matrix);
-    }
-
-  cairo_move_to (cr, x, y);
-  pango_cairo_show_glyph_string (cr, font, glyphs);
-
-  cairo_destroy (cr);
-}
-
-/**
- * gdk_draw_glyphs:
- * @drawable: a #GdkDrawable
- * @gc: a #GdkGC
- * @font: font to be used
- * @x: X coordinate of baseline origin
- * @y: Y coordinate of baseline origin
- * @glyphs: the glyph string to draw
- *
- * This is a low-level function; 99% of text rendering should be done
- * using gdk_draw_layout() instead.
- *
- * A glyph is a single image in a font. This function draws a sequence of
- * glyphs.  To obtain a sequence of glyphs you have to understand a
- * lot about internationalized text handling, which you don't want to
- * understand; thus, use gdk_draw_layout() instead of this function,
- * gdk_draw_layout() handles the details.
- * 
- **/
-void
-gdk_draw_glyphs (GdkDrawable      *drawable,
-		 GdkGC            *gc,
-		 PangoFont        *font,
-		 gint              x,
-		 gint              y,
-		 PangoGlyphString *glyphs)
-{
-  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_draw_glyphs_transformed:
- * @drawable: a #GdkDrawable
- * @gc: a #GdkGC
- * @matrix: (allow-none): a #PangoMatrix, or %NULL to use an identity transformation
- * @font: the font in which to draw the string
- * @x:       the x position of the start of the string (in Pango
- *           units in user space coordinates)
- * @y:       the y position of the baseline (in Pango units
- *           in user space coordinates)
- * @glyphs:  the glyph string to draw
- * 
- * Renders a #PangoGlyphString onto a drawable, possibly
- * transforming the layed-out coordinates through a transformation
- * matrix. Note that the transformation matrix for @font is not
- * changed, so to produce correct rendering results, the @font
- * must have been loaded using a #PangoContext with an identical
- * transformation matrix to that passed in to this function.
- *
- * See also gdk_draw_glyphs(), gdk_draw_layout().
- *
- * Since: 2.6
- **/
-void
-gdk_draw_glyphs_transformed (GdkDrawable       *drawable,
-			     GdkGC	       *gc,
-			     const PangoMatrix *matrix,
-			     PangoFont         *font,
-			     gint               x,
-			     gint               y,
-			     PangoGlyphString  *glyphs)
-{
-  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);
-}
-
 static GdkDrawable *
 gdk_drawable_real_get_composite_drawable (GdkDrawable *drawable,
                                           gint         x,
diff --git a/gdk/gdkdrawable.h b/gdk/gdkdrawable.h
index 5a94f84..93d61c3 100644
--- a/gdk/gdkdrawable.h
+++ b/gdk/gdkdrawable.h
@@ -94,13 +94,6 @@ struct _GdkDrawableClass
 			  GdkPoint     *points,
 			  gint          npoints);
 
-  void (*draw_glyphs)    (GdkDrawable      *drawable,
-			  GdkGC	           *gc,
-			  PangoFont        *font,
-			  gint              x,
-			  gint              y,
-			  PangoGlyphString *glyphs);
-
   gint (*get_depth)      (GdkDrawable  *drawable);
   void (*get_size)       (GdkDrawable  *drawable,
                           gint         *width,
@@ -124,14 +117,6 @@ struct _GdkDrawableClass
                                           gint        *composite_x_offset,
                                           gint        *composite_y_offset);
 
-  void (*draw_glyphs_transformed) (GdkDrawable      *drawable,
-				   GdkGC	    *gc,
-				   PangoMatrix      *matrix,
-				   PangoFont        *font,
-				   gint              x,
-				   gint              y,
-				   PangoGlyphString *glyphs);
-
   cairo_surface_t *(*ref_cairo_surface) (GdkDrawable *drawable);
 
   GdkDrawable *(*get_source_drawable) (GdkDrawable *drawable);
@@ -226,12 +211,6 @@ void gdk_draw_lines     (GdkDrawable      *drawable,
 			 const GdkPoint   *points,
 			 gint              n_points);
 
-void gdk_draw_glyphs      (GdkDrawable      *drawable,
-			   GdkGC            *gc,
-			   PangoFont        *font,
-			   gint              x,
-			   gint              y,
-			   PangoGlyphString *glyphs);
 void gdk_draw_layout_line (GdkDrawable      *drawable,
 			   GdkGC            *gc,
 			   gint              x,
@@ -258,14 +237,6 @@ void gdk_draw_layout_with_colors      (GdkDrawable     *drawable,
                                        const GdkColor  *foreground,
                                        const GdkColor  *background);
 
-void gdk_draw_glyphs_transformed (GdkDrawable        *drawable,
-				  GdkGC	             *gc,
-				  const PangoMatrix  *matrix,
-				  PangoFont          *font,
-				  gint                x,
-				  gint                y,
-				  PangoGlyphString   *glyphs);
-
 cairo_region_t *gdk_drawable_get_clip_region    (GdkDrawable *drawable);
 cairo_region_t *gdk_drawable_get_visible_region (GdkDrawable *drawable);
 
diff --git a/gdk/gdkpixmap.c b/gdk/gdkpixmap.c
index 88f6776..b2b966c 100644
--- a/gdk/gdkpixmap.c
+++ b/gdk/gdkpixmap.c
@@ -69,20 +69,6 @@ static void   gdk_pixmap_draw_lines     (GdkDrawable     *drawable,
 					 GdkPoint        *points,
 					 gint             npoints);
 
-static void gdk_pixmap_draw_glyphs             (GdkDrawable      *drawable,
-						GdkGC            *gc,
-						PangoFont        *font,
-						gint              x,
-						gint              y,
-						PangoGlyphString *glyphs);
-static void gdk_pixmap_draw_glyphs_transformed (GdkDrawable      *drawable,
-						GdkGC            *gc,
-						PangoMatrix      *matrix,
-						PangoFont        *font,
-						gint              x,
-						gint              y,
-						PangoGlyphString *glyphs);
-
 static void   gdk_pixmap_real_get_size  (GdkDrawable     *drawable,
                                          gint            *width,
                                          gint            *height);
@@ -146,8 +132,6 @@ gdk_pixmap_class_init (GdkPixmapObjectClass *klass)
   drawable_class->draw_points = gdk_pixmap_draw_points;
   drawable_class->draw_segments = gdk_pixmap_draw_segments;
   drawable_class->draw_lines = gdk_pixmap_draw_lines;
-  drawable_class->draw_glyphs = gdk_pixmap_draw_glyphs;
-  drawable_class->draw_glyphs_transformed = gdk_pixmap_draw_glyphs_transformed;
   drawable_class->get_depth = gdk_pixmap_real_get_depth;
   drawable_class->get_screen = gdk_pixmap_real_get_screen;
   drawable_class->get_size = gdk_pixmap_real_get_size;
@@ -316,35 +300,6 @@ gdk_pixmap_draw_lines (GdkDrawable *drawable,
 }
 
 static void
-gdk_pixmap_draw_glyphs (GdkDrawable      *drawable,
-                        GdkGC            *gc,
-                        PangoFont        *font,
-                        gint              x,
-                        gint              y,
-                        PangoGlyphString *glyphs)
-{
-  GdkPixmapObject *private = (GdkPixmapObject *)drawable;
-
-  _gdk_gc_remove_drawable_clip (gc);  
-  gdk_draw_glyphs (private->impl, gc, font, x, y, glyphs);
-}
-
-static void
-gdk_pixmap_draw_glyphs_transformed (GdkDrawable      *drawable,
-				    GdkGC            *gc,
-				    PangoMatrix      *matrix,
-				    PangoFont        *font,
-				    gint              x,
-				    gint              y,
-				    PangoGlyphString *glyphs)
-{
-  GdkPixmapObject *private = (GdkPixmapObject *)drawable;
-
-  _gdk_gc_remove_drawable_clip (gc);  
-  gdk_draw_glyphs_transformed (private->impl, gc, matrix, font, x, y, glyphs);
-}
-
-static void
 gdk_pixmap_real_get_size (GdkDrawable *drawable,
                           gint *width,
                           gint *height)
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index c8f6868..de42d11 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -264,20 +264,6 @@ static void   gdk_window_draw_lines     (GdkDrawable     *drawable,
 					 GdkPoint        *points,
 					 gint             npoints);
 
-static void gdk_window_draw_glyphs             (GdkDrawable      *drawable,
-						GdkGC            *gc,
-						PangoFont        *font,
-						gint              x,
-						gint              y,
-						PangoGlyphString *glyphs);
-static void gdk_window_draw_glyphs_transformed (GdkDrawable      *drawable,
-						GdkGC            *gc,
-						PangoMatrix      *matrix,
-						PangoFont        *font,
-						gint              x,
-						gint              y,
-						PangoGlyphString *glyphs);
-
 static cairo_surface_t *gdk_window_ref_cairo_surface (GdkDrawable *drawable);
 static cairo_surface_t *gdk_window_create_cairo_surface (GdkDrawable *drawable,
 							 int width,
@@ -461,8 +447,6 @@ gdk_window_class_init (GdkWindowObjectClass *klass)
   drawable_class->draw_points = gdk_window_draw_points;
   drawable_class->draw_segments = gdk_window_draw_segments;
   drawable_class->draw_lines = gdk_window_draw_lines;
-  drawable_class->draw_glyphs = gdk_window_draw_glyphs;
-  drawable_class->draw_glyphs_transformed = gdk_window_draw_glyphs_transformed;
   drawable_class->get_depth = gdk_window_real_get_depth;
   drawable_class->get_screen = gdk_window_real_get_screen;
   drawable_class->get_size = gdk_window_real_get_size;
@@ -4368,69 +4352,6 @@ gdk_window_draw_lines (GdkDrawable *drawable,
   END_DRAW;
 }
 
-static void
-gdk_window_draw_glyphs (GdkDrawable      *drawable,
-			GdkGC            *gc,
-			PangoFont        *font,
-			gint              x,
-			gint              y,
-			PangoGlyphString *glyphs)
-{
-  if (GDK_WINDOW_DESTROYED (drawable))
-    return;
-
-  BEGIN_DRAW;
-  gdk_draw_glyphs (impl, gc, font,
-		   x - x_offset, y - y_offset, glyphs);
-  END_DRAW;
-}
-
-static void
-gdk_window_draw_glyphs_transformed (GdkDrawable      *drawable,
-				    GdkGC            *gc,
-				    PangoMatrix      *matrix,
-				    PangoFont        *font,
-				    gint              x,
-				    gint              y,
-				    PangoGlyphString *glyphs)
-{
-  PangoMatrix tmp_matrix;
-
-  if (GDK_WINDOW_DESTROYED (drawable))
-    return;
-
-  BEGIN_DRAW;
-
-  if (x_offset != 0 || y_offset != 0)
-    {
-      if (matrix)
-	{
-	  tmp_matrix = *matrix;
-	  tmp_matrix.x0 -= x_offset;
-	  tmp_matrix.y0 -= y_offset;
-	  matrix = &tmp_matrix;
-	}
-      else if (GDK_PANGO_UNITS_OVERFLOWS (x_offset, y_offset))
-	{
-	  PangoMatrix identity = PANGO_MATRIX_INIT;
-
-	  tmp_matrix = identity;
-	  tmp_matrix.x0 -= x_offset;
-	  tmp_matrix.y0 -= y_offset;
-	  matrix = &tmp_matrix;
-	}
-      else
-	{
-	  x -= x_offset * PANGO_SCALE;
-	  y -= y_offset * PANGO_SCALE;
-	}
-    }
-
-  gdk_draw_glyphs_transformed (impl, gc, matrix, font, x, y, glyphs);
-
-  END_DRAW;
-}
-
 typedef struct {
   cairo_t *cr; /* if non-null, it means use this cairo context */
   GdkGC *gc;   /* if non-null, it means use this GC instead */



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