[gtk+/rendering-cleanup: 50/95] API: remove gdk_draw_layout_*()



commit f4bc5db8fba843e89108de6896147d857c1ca790
Author: Benjamin Otte <otte redhat com>
Date:   Wed Jul 21 14:54:44 2010 +0200

    API: remove gdk_draw_layout_*()

 docs/reference/gdk/gdk3-sections.txt |    6 -
 docs/reference/gdk/tmpl/drawing.sgml |   52 --------
 gdk/gdk.symbols                      |    9 --
 gdk/gdkdrawable.h                    |   26 ----
 gdk/gdkpango.c                       |  228 +---------------------------------
 gdk/gdkpango.h                       |    7 -
 6 files changed, 5 insertions(+), 323 deletions(-)
---
diff --git a/docs/reference/gdk/gdk3-sections.txt b/docs/reference/gdk/gdk3-sections.txt
index 841fbff..91ad2db 100644
--- a/docs/reference/gdk/gdk3-sections.txt
+++ b/docs/reference/gdk/gdk3-sections.txt
@@ -334,12 +334,6 @@ gdk_drawable_get_clip_region
 gdk_drawable_get_visible_region
 
 <SUBSECTION>
-gdk_draw_layout_line
-gdk_draw_layout_line_with_colors
-gdk_draw_layout
-gdk_draw_layout_with_colors
-
-<SUBSECTION>
 gdk_draw_drawable
 
 <SUBSECTION Standard>
diff --git a/docs/reference/gdk/tmpl/drawing.sgml b/docs/reference/gdk/tmpl/drawing.sgml
index 866a7ab..30afc36 100644
--- a/docs/reference/gdk/tmpl/drawing.sgml
+++ b/docs/reference/gdk/tmpl/drawing.sgml
@@ -127,58 +127,6 @@ or a #GdkWindow.
 @Returns: 
 
 
-<!-- ##### FUNCTION gdk_draw_layout_line ##### -->
-<para>
-
-</para>
-
- drawable: 
- gc: 
- x: 
- y: 
- line: 
-
-
-<!-- ##### FUNCTION gdk_draw_layout_line_with_colors ##### -->
-<para>
-
-</para>
-
- drawable: 
- gc: 
- x: 
- y: 
- line: 
- foreground: 
- background: 
-
-
-<!-- ##### FUNCTION gdk_draw_layout ##### -->
-<para>
-
-</para>
-
- drawable: 
- gc: 
- x: 
- y: 
- layout: 
-
-
-<!-- ##### FUNCTION gdk_draw_layout_with_colors ##### -->
-<para>
-
-</para>
-
- drawable: 
- gc: 
- x: 
- y: 
- layout: 
- foreground: 
- background: 
-
-
 <!-- ##### FUNCTION gdk_draw_drawable ##### -->
 <para>
 
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index ceb9753..b244440 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -553,15 +553,6 @@ gdk_draw_drawable
 #endif
 #endif
 
-#if IN_HEADER(__GDK_DRAWABLE_H__)
-#if IN_FILE(__GDK_PANGO_C__)
-gdk_draw_layout
-gdk_draw_layout_line
-gdk_draw_layout_line_with_colors
-gdk_draw_layout_with_colors
-#endif
-#endif
-
 #if IN_HEADER(__GDK_GC_H__)
 #if IN_FILE(__GDK_GC_C__)
 gdk_gc_new
diff --git a/gdk/gdkdrawable.h b/gdk/gdkdrawable.h
index 690d52e..be5fc84 100644
--- a/gdk/gdkdrawable.h
+++ b/gdk/gdkdrawable.h
@@ -153,32 +153,6 @@ void gdk_draw_drawable  (GdkDrawable      *drawable,
 			 gint              width,
 			 gint              height);
 
-void gdk_draw_layout_line (GdkDrawable      *drawable,
-			   GdkGC            *gc,
-			   gint              x,
-			   gint              y,
-			   PangoLayoutLine  *line);
-void gdk_draw_layout      (GdkDrawable      *drawable,
-			   GdkGC            *gc,
-			   gint              x,
-			   gint              y,
-			   PangoLayout      *layout);
-
-void gdk_draw_layout_line_with_colors (GdkDrawable     *drawable,
-                                       GdkGC           *gc,
-                                       gint             x,
-                                       gint             y,
-                                       PangoLayoutLine *line,
-                                       const GdkColor  *foreground,
-                                       const GdkColor  *background);
-void gdk_draw_layout_with_colors      (GdkDrawable     *drawable,
-                                       GdkGC           *gc,
-                                       gint             x,
-                                       gint             y,
-                                       PangoLayout     *layout,
-                                       const GdkColor  *foreground,
-                                       const GdkColor  *background);
-
 cairo_region_t *gdk_drawable_get_clip_region    (GdkDrawable *drawable);
 cairo_region_t *gdk_drawable_get_visible_region (GdkDrawable *drawable);
 
diff --git a/gdk/gdkpango.c b/gdk/gdkpango.c
index 5ff551f..02e695c 100644
--- a/gdk/gdkpango.c
+++ b/gdk/gdkpango.c
@@ -584,8 +584,7 @@ on_renderer_display_closed (GdkDisplay       *display,
  * 
  * 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
- * by functions such as gdk_draw_layout().
+ * 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
@@ -825,223 +824,6 @@ release_renderer (PangoRenderer *renderer)
   gdk_pango_renderer_set_gc (gdk_renderer, NULL);
 }
 
-/**
- * gdk_draw_layout_line_with_colors:
- * @drawable:  the drawable on which to draw the line
- * @gc:        base graphics to use
- * @x:         the x position of start of string (in pixels)
- * @y:         the y position of baseline (in pixels)
- * @line:      a #PangoLayoutLine
- * @foreground: (allow-none): foreground override color, or %NULL for none
- * @background: (allow-none): background override color, or %NULL for none
- *
- * Render a #PangoLayoutLine onto a #GdkDrawable, overriding the
- * layout's normal colors with @foreground and/or @background.
- * @foreground and @background need not be allocated.
- *
- * If the layout's #PangoContext has a transformation matrix set, then
- * @x and @y specify the position of the left edge of the baseline
- * (left is in before-tranform user coordinates) in after-transform
- * device coordinates.
- */
-void 
-gdk_draw_layout_line_with_colors (GdkDrawable      *drawable,
-                                  GdkGC            *gc,
-                                  gint              x, 
-                                  gint              y,
-                                  PangoLayoutLine  *line,
-                                  const GdkColor   *foreground,
-                                  const GdkColor   *background)
-{
-  PangoRenderer *renderer;
-  const PangoMatrix *matrix;
-  
-  g_return_if_fail (GDK_IS_DRAWABLE (drawable));
-  g_return_if_fail (GDK_IS_GC (gc));
-  g_return_if_fail (line != NULL);
-
-  renderer = get_renderer (drawable, gc, foreground, background);
-
-  /* When we have a matrix, we do positioning by adjusting the matrix, and
-   * clamp just pass x=0, y=0 to the lower levels. We don't want to introduce
-   * a matrix when the caller didn't provide one, however, since that adds
-   * lots of floating point arithmetic for each glyph.
-   */
-  matrix = pango_context_get_matrix (pango_layout_get_context (line->layout));
-  if (matrix)
-    {
-      PangoMatrix tmp_matrix;
-      
-      tmp_matrix = *matrix;
-      tmp_matrix.x0 += x;
-      tmp_matrix.y0 += y;
-      pango_renderer_set_matrix (renderer, &tmp_matrix);
-
-      x = 0;
-      y = 0;
-    }
-  /* Fall back to introduce a matrix if the coords would scale out of range.
-   * The x and y here will be added to in-layout coordinates.  So we cannot
-   * support the entire range here safely.  So, we just accept the middle half
-   * and use fallback for the rest. */
-  else if (GDK_PANGO_UNITS_OVERFLOWS (x, y))
-    {
-      PangoMatrix tmp_matrix = PANGO_MATRIX_INIT;
-      tmp_matrix.x0 += x;
-      tmp_matrix.y0 += y;
-      pango_renderer_set_matrix (renderer, &tmp_matrix);
-
-      x = 0;
-      y = 0;
-    }
-  else
-    pango_renderer_set_matrix (renderer, NULL);
-
-  pango_renderer_draw_layout_line (renderer, line, x * PANGO_SCALE, y * PANGO_SCALE);
-
-  release_renderer (renderer);
-}
-
-/**
- * gdk_draw_layout_with_colors:
- * @drawable:  the drawable on which to draw string
- * @gc:        base graphics context to use
- * @x:         the X position of the left of the layout (in pixels)
- * @y:         the Y position of the top of the layout (in pixels)
- * @layout:    a #PangoLayout
- * @foreground: (allow-none): foreground override color, or %NULL for none
- * @background: (allow-none): background override color, or %NULL for none
- *
- * Render a #PangoLayout onto a #GdkDrawable, overriding the
- * layout's normal colors with @foreground and/or @background.
- * @foreground and @background need not be allocated.
- *
- * If the layout's #PangoContext has a transformation matrix set, then
- * @x and @y specify the position of the top left corner of the
- * bounding box (in device space) of the transformed layout.
- *
- * If you're using GTK+, the ususal way to obtain a #PangoLayout
- * is gtk_widget_create_pango_layout().
- */
-void 
-gdk_draw_layout_with_colors (GdkDrawable     *drawable,
-                             GdkGC           *gc,
-                             int              x, 
-                             int              y,
-                             PangoLayout     *layout,
-                             const GdkColor  *foreground,
-                             const GdkColor  *background)
-{
-  PangoRenderer *renderer;
-  const PangoMatrix *matrix;
-  
-  g_return_if_fail (GDK_IS_DRAWABLE (drawable));
-  g_return_if_fail (GDK_IS_GC (gc));
-  g_return_if_fail (PANGO_IS_LAYOUT (layout));
-
-  renderer = get_renderer (drawable, gc, foreground, background);
-
-  /* When we have a matrix, we do positioning by adjusting the matrix, and
-   * clamp just pass x=0, y=0 to the lower levels. We don't want to introduce
-   * a matrix when the caller didn't provide one, however, since that adds
-   * lots of floating point arithmetic for each glyph.
-   */
-  matrix = pango_context_get_matrix (pango_layout_get_context (layout));
-  if (matrix)
-    {
-      PangoMatrix tmp_matrix;
-      PangoRectangle rect;
-
-      pango_layout_get_extents (layout, NULL, &rect);
-      pango_matrix_transform_rectangle (matrix, &rect);
-      pango_extents_to_pixels (&rect, NULL);
-      
-      tmp_matrix = *matrix;
-      tmp_matrix.x0 += x - rect.x;
-      tmp_matrix.y0 += y - rect.y;
-      pango_renderer_set_matrix (renderer, &tmp_matrix);
-      
-      x = 0;
-      y = 0;
-    }
-  else if (GDK_PANGO_UNITS_OVERFLOWS (x, y))
-    {
-      PangoMatrix tmp_matrix = PANGO_MATRIX_INIT;
-      tmp_matrix.x0 = x;
-      tmp_matrix.y0 = y;
-      pango_renderer_set_matrix (renderer, &tmp_matrix);
-
-      x = 0;
-      y = 0;
-    }
-  else
-    pango_renderer_set_matrix (renderer, NULL);
-
-  pango_renderer_draw_layout (renderer, layout, x * PANGO_SCALE, y * PANGO_SCALE);
-  
-  release_renderer (renderer);
-}
-
-/**
- * gdk_draw_layout_line:
- * @drawable:  the drawable on which to draw the line
- * @gc:        base graphics to use
- * @x:         the x position of start of string (in pixels)
- * @y:         the y position of baseline (in pixels)
- * @line:      a #PangoLayoutLine
- *
- * Render a #PangoLayoutLine onto an GDK drawable
- *
- * If the layout's #PangoContext has a transformation matrix set, then
- * @x and @y specify the position of the left edge of the baseline
- * (left is in before-tranform user coordinates) in after-transform
- * device coordinates.
- */
-void 
-gdk_draw_layout_line (GdkDrawable      *drawable,
-		      GdkGC            *gc,
-		      gint              x, 
-		      gint              y,
-		      PangoLayoutLine  *line)
-{
-  g_return_if_fail (GDK_IS_DRAWABLE (drawable));
-  g_return_if_fail (GDK_IS_GC (gc));
-  g_return_if_fail (line != NULL);
-  
-  gdk_draw_layout_line_with_colors (drawable, gc, x, y, line, NULL, NULL);
-}
-
-/**
- * gdk_draw_layout:
- * @drawable:  the drawable on which to draw string
- * @gc:        base graphics context to use
- * @x:         the X position of the left of the layout (in pixels)
- * @y:         the Y position of the top of the layout (in pixels)
- * @layout:    a #PangoLayout
- *
- * Render a #PangoLayout onto a GDK drawable
- *
- * If the layout's #PangoContext has a transformation matrix set, then
- * @x and @y specify the position of the top left corner of the
- * bounding box (in device space) of the transformed layout.
- *
- * If you're using GTK+, the usual way to obtain a #PangoLayout
- * is gtk_widget_create_pango_layout().
- */
-void 
-gdk_draw_layout (GdkDrawable     *drawable,
-		 GdkGC           *gc,
-		 int              x, 
-		 int              y,
-		 PangoLayout     *layout)
-{
-  g_return_if_fail (GDK_IS_DRAWABLE (drawable));
-  g_return_if_fail (GDK_IS_GC (gc));
-  g_return_if_fail (PANGO_IS_LAYOUT (layout));
-
-  gdk_draw_layout_with_colors (drawable, gc, x, y, layout, NULL, NULL);
-}
-
 /* GdkPangoAttrStipple */
 
 static PangoAttribute *
@@ -1306,8 +1088,8 @@ layout_iter_get_line_clip_region (PangoLayoutIter *iter,
  * @n_ranges: number of ranges in @index_ranges, i.e. half the size of @index_ranges
  * 
  * Obtains a clip region which contains the areas where the given
- * ranges of text would be drawn. @x_origin and @y_origin are the same
- * position you would pass to gdk_draw_layout_line(). @index_ranges
+ * ranges of text would be drawn. @x_origin and @y_origin are the top left
+ * position of the layout. @index_ranges
  * should contain ranges of bytes in the layout's text. The clip
  * region will include space to the left or right of the line (to the
  * layout bounding box) if you have indexes above or below the indexes
@@ -1355,8 +1137,8 @@ gdk_pango_layout_line_get_clip_region (PangoLayoutLine *line,
  * @n_ranges: number of ranges in @index_ranges, i.e. half the size of @index_ranges
  * 
  * Obtains a clip region which contains the areas where the given ranges
- * of text would be drawn. @x_origin and @y_origin are the same position
- * you would pass to gdk_draw_layout_line(). @index_ranges should contain
+ * of text would be drawn. @x_origin and @y_origin are the top left point
+ * to center the layout. @index_ranges should contain
  * ranges of bytes in the layout's text.
  * 
  * Note that the regions returned correspond to logical extents of the text
diff --git a/gdk/gdkpango.h b/gdk/gdkpango.h
index 512552c..c905b57 100644
--- a/gdk/gdkpango.h
+++ b/gdk/gdkpango.h
@@ -51,13 +51,6 @@ typedef struct _GdkPangoRendererPrivate GdkPangoRendererPrivate;
  * pango_renderer_draw_layout_line() are then used to draw objects with
  * the renderer.
  *
- * In most simple cases, applications can just use gdk_draw_layout(), and
- * don't need to directly use #GdkPangoRenderer at all. Using the
- * #GdkPangoRenderer directly is most useful when working with a
- * transformation such as a rotation, because the Pango drawing functions
- * take user space coordinates (coordinates before the transformation)
- * instead of device coordinates.
- *
  * 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



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