[gtk+] Remove deprecated GdkDrawable functions



commit 4cf4470fcdeb4c277edff0f6c773872540a77204
Author: Javier Jardón <jjardon gnome org>
Date:   Sat Jun 19 21:26:47 2010 +0200

    Remove deprecated GdkDrawable functions
    
    Remove gdk_drawable_get_data(), gdk_drawable_set_data(),
    gdk_drawable_ref(), gdk_drawable_unref(),
    gdk_draw_string(), gdk_draw_text(), gdk_draw_text_wc()

 docs/reference/gdk/gdk3-sections.txt |    8 --
 docs/reference/gdk/tmpl/drawing.sgml |   76 --------------
 gdk/directfb/gdkdnd-directfb.c       |   10 +-
 gdk/directfb/gdkdrawable-directfb.c  |   30 ------
 gdk/gdk.symbols                      |    9 --
 gdk/gdkdraw.c                        |  178 ----------------------------------
 gdk/gdkdrawable.h                    |   56 -----------
 gdk/gdkoffscreenwindow.c             |   52 ----------
 gdk/gdkpixmap.c                      |   48 ---------
 gdk/gdkwindow.c                      |   52 ----------
 gdk/quartz/gdkdrawable-quartz.c      |   26 -----
 gdk/win32/gdkdrawable-win32.c        |  139 --------------------------
 gdk/x11/gdkdrawable-x11.c            |  113 ---------------------
 13 files changed, 6 insertions(+), 791 deletions(-)
---
diff --git a/docs/reference/gdk/gdk3-sections.txt b/docs/reference/gdk/gdk3-sections.txt
index 1d4baf2..c4ad2d5 100644
--- a/docs/reference/gdk/gdk3-sections.txt
+++ b/docs/reference/gdk/gdk3-sections.txt
@@ -444,10 +444,6 @@ gdk_font_get_type
 <TITLE>Drawing Primitives</TITLE>
 <FILE>drawing</FILE>
 GdkDrawable
-gdk_drawable_ref
-gdk_drawable_unref
-gdk_drawable_set_data
-gdk_drawable_get_data
 gdk_drawable_get_display
 gdk_drawable_get_screen
 gdk_drawable_get_visual
@@ -477,10 +473,6 @@ gdk_draw_layout_line
 gdk_draw_layout_line_with_colors
 gdk_draw_layout
 gdk_draw_layout_with_colors
-<SUBSECTION>
-gdk_draw_string
-gdk_draw_text
-gdk_draw_text_wc
 
 <SUBSECTION>
 gdk_draw_pixmap
diff --git a/docs/reference/gdk/tmpl/drawing.sgml b/docs/reference/gdk/tmpl/drawing.sgml
index 9cd73f8..0384014 100644
--- a/docs/reference/gdk/tmpl/drawing.sgml
+++ b/docs/reference/gdk/tmpl/drawing.sgml
@@ -45,44 +45,6 @@ or a #GdkWindow.
 </para>
 
 
-<!-- ##### FUNCTION gdk_drawable_ref ##### -->
-<para>
-
-</para>
-
- drawable: 
- Returns: 
-
-
-<!-- ##### FUNCTION gdk_drawable_unref ##### -->
-<para>
-
-</para>
-
- drawable: 
-
-
-<!-- ##### FUNCTION gdk_drawable_set_data ##### -->
-<para>
-
-</para>
-
- drawable: 
- key: 
- data: 
- destroy_func: 
-
-
-<!-- ##### FUNCTION gdk_drawable_get_data ##### -->
-<para>
-
-</para>
-
- drawable: 
- key: 
- Returns: 
-
-
 <!-- ##### FUNCTION gdk_drawable_get_display ##### -->
 <para>
 
@@ -395,44 +357,6 @@ bottom edges.
 @background: 
 
 
-<!-- ##### FUNCTION gdk_draw_string ##### -->
-<para>
-</para>
-
- drawable: 
- font: 
- gc: 
- x: 
- y: 
- string: 
-
-
-<!-- ##### FUNCTION gdk_draw_text ##### -->
-<para>
-</para>
-
- drawable: 
- font: 
- gc: 
- x: 
- y: 
- text: 
- text_length: 
-
-
-<!-- ##### FUNCTION gdk_draw_text_wc ##### -->
-<para>
-</para>
-
- drawable: 
- font: 
- gc: 
- x: 
- y: 
- text: 
- text_length: 
-
-
 <!-- ##### MACRO gdk_draw_pixmap ##### -->
 <para>
 Draws a pixmap, or a part of a pixmap, onto another drawable.
diff --git a/gdk/directfb/gdkdnd-directfb.c b/gdk/directfb/gdkdnd-directfb.c
index 527a817..2c65aab 100644
--- a/gdk/directfb/gdkdnd-directfb.c
+++ b/gdk/directfb/gdkdnd-directfb.c
@@ -338,7 +338,7 @@ gdk_drag_get_protocol_for_display(GdkDisplay *display, guint32          xid,
   window = gdk_window_lookup ((GdkNativeWindow) xid);
 
   if (window &&
-      GPOINTER_TO_INT (gdk_drawable_get_data (window, "gdk-dnd-registered")))
+      g_object_get_data (G_OBJECT (window), "gdk-dnd-registered") != NULL)
     {
       *protocol = GDK_DRAG_PROTO_LOCAL;
       return xid;
@@ -606,11 +606,13 @@ gdk_window_register_dnd (GdkWindow      *window)
 {
   g_return_if_fail (window != NULL);
 
-  if (GPOINTER_TO_INT (gdk_drawable_get_data (window, "gdk-dnd-registered")))
+  if (g_object_get_data (G_OBJECT (window), "gdk-dnd-registered") != NULL)
     return;
 
-  gdk_drawable_set_data (window, "gdk-dnd-registered",
-                         GINT_TO_POINTER (TRUE), NULL);
+  g_object_set_data (G_OBJECT (window),
+                     "gdk-dnd-registered",
+                     GINT_TO_POINTER (TRUE));
+
 }
 
 /*************************************************************
diff --git a/gdk/directfb/gdkdrawable-directfb.c b/gdk/directfb/gdkdrawable-directfb.c
index 3406f08..c142ba5 100644
--- a/gdk/directfb/gdkdrawable-directfb.c
+++ b/gdk/directfb/gdkdrawable-directfb.c
@@ -659,30 +659,6 @@ gdk_directfb_draw_polygon (GdkDrawable *drawable,
 }
 
 static void
-gdk_directfb_draw_text (GdkDrawable *drawable,
-                        GdkFont     *font,
-                        GdkGC       *gc,
-                        gint         x,
-                        gint         y,
-                        const gchar *text,
-                        gint         text_length)
-{
-  D_UNIMPLEMENTED();
-}
-
-static void
-gdk_directfb_draw_text_wc (GdkDrawable    *drawable,
-                           GdkFont        *font,
-                           GdkGC          *gc,
-                           gint            x,
-                           gint            y,
-                           const GdkWChar *text,
-                           gint            text_length)
-{
-  D_UNIMPLEMENTED();
-}
-
-static void
 gdk_directfb_draw_drawable (GdkDrawable *drawable,
                             GdkGC       *gc,
                             GdkDrawable *src,
@@ -1522,16 +1498,10 @@ gdk_drawable_impl_directfb_class_init (GdkDrawableImplDirectFBClass *klass)
   drawable_class->draw_rectangle = gdk_directfb_draw_rectangle;
   drawable_class->draw_arc       = gdk_directfb_draw_arc;
   drawable_class->draw_polygon   = gdk_directfb_draw_polygon;
-  drawable_class->draw_text      = gdk_directfb_draw_text;
-  drawable_class->draw_text_wc   = gdk_directfb_draw_text_wc;
   drawable_class->draw_drawable  = gdk_directfb_draw_drawable;
   drawable_class->draw_points    = gdk_directfb_draw_points;
   drawable_class->draw_segments  = gdk_directfb_draw_segments;
   drawable_class->draw_lines     = gdk_directfb_draw_lines;
-#if 0
-  drawable_class->draw_glyphs    = NULL;
-  drawable_class->draw_glyphs_transformed    = NULL;
-#endif
   drawable_class->draw_image     = gdk_directfb_draw_image;
 
   drawable_class->ref_cairo_surface = gdk_directfb_ref_cairo_surface;
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index d0f8f72..e205ab9 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -601,15 +601,6 @@ gdk_drag_get_protocol
 gdk_drawable_copy_to_image
 gdk_drawable_get_clip_region
 gdk_drawable_get_colormap
-#ifndef GDK_DISABLE_DEPRECATED
-gdk_drawable_get_data
-gdk_drawable_set_data
-gdk_drawable_ref
-gdk_drawable_unref
-gdk_draw_string
-gdk_draw_text
-gdk_draw_text_wc
-#endif
 gdk_drawable_get_depth
 gdk_drawable_get_display
 gdk_drawable_get_image
diff --git a/gdk/gdkdraw.c b/gdk/gdkdraw.c
index 0e6ccc5..65412cc 100644
--- a/gdk/gdkdraw.c
+++ b/gdk/gdkdraw.c
@@ -95,51 +95,6 @@ gdk_drawable_init (GdkDrawable *drawable)
  */
 
 /**
- * gdk_drawable_set_data:
- * @drawable: a #GdkDrawable
- * @key: name to store the data under
- * @data: arbitrary data
- * @destroy_func: (allow-none): function to free @data, or %NULL
- *
- * This function is equivalent to g_object_set_data(),
- * the #GObject variant should be used instead.
- * 
- **/
-void          
-gdk_drawable_set_data (GdkDrawable   *drawable,
-		       const gchar   *key,
-		       gpointer	      data,
-		       GDestroyNotify destroy_func)
-{
-  g_return_if_fail (GDK_IS_DRAWABLE (drawable));
-  
-  g_object_set_qdata_full (G_OBJECT (drawable),
-                           g_quark_from_string (key),
-                           data,
-                           destroy_func);
-}
-
-/**
- * gdk_drawable_get_data:
- * @drawable: a #GdkDrawable
- * @key: name the data was stored under
- * 
- * Equivalent to g_object_get_data(); the #GObject variant should be
- * used instead.
- * 
- * Return value: the data stored at @key
- **/
-gpointer
-gdk_drawable_get_data (GdkDrawable   *drawable,
-		       const gchar   *key)
-{
-  g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
-  
-  return g_object_get_qdata (G_OBJECT (drawable),
-                             g_quark_try_string (key));
-}
-
-/**
  * gdk_drawable_get_size:
  * @drawable: a #GdkDrawable
  * @width: (allow-none): (out): location to store drawable's width, or %NULL
@@ -276,39 +231,6 @@ gdk_drawable_get_colormap (GdkDrawable *drawable)
   return GDK_DRAWABLE_GET_CLASS (drawable)->get_colormap (drawable);
 }
 
-/**
- * gdk_drawable_ref:
- * @drawable: a #GdkDrawable
- * 
- * Deprecated equivalent of calling g_object_ref() on @drawable.
- * (Drawables were not objects in previous versions of GDK.)
- * 
- * Return value: the same @drawable passed in
- *
- * Deprecated: 2.0: Use g_object_ref() instead.
- **/
-GdkDrawable*
-gdk_drawable_ref (GdkDrawable *drawable)
-{
-  return (GdkDrawable *) g_object_ref (drawable);
-}
-
-/**
- * gdk_drawable_unref:
- * @drawable: a #GdkDrawable
- *
- * Deprecated equivalent of calling g_object_unref() on @drawable.
- * 
- * Deprecated: 2.0: Use g_object_unref() instead.
- **/
-void
-gdk_drawable_unref (GdkDrawable *drawable)
-{
-  g_return_if_fail (GDK_IS_DRAWABLE (drawable));
-
-  g_object_unref (drawable);
-}
-
 /* Drawing
  */
 
@@ -498,106 +420,6 @@ gdk_draw_polygon (GdkDrawable    *drawable,
                                                    n_points);
 }
 
-/* gdk_draw_string
- *
- * Modified by Li-Da Lho to draw 16 bits and Multibyte strings
- *
- * Interface changed: add "GdkFont *font" to specify font or fontset explicitely
- */
-/**
- * gdk_draw_string:
- * @drawable: a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
- * @font: a #GdkFont.
- * @gc: a #GdkGC.
- * @x: the x coordinate of the left edge of the text.
- * @y: the y coordinate of the baseline of the text.
- * @string:  the string of characters to draw.
- * 
- * Draws a string of characters in the given font or fontset.
- * 
- * Deprecated: 2.4: Use gdk_draw_layout() instead.
- **/
-void
-gdk_draw_string (GdkDrawable *drawable,
-		 GdkFont     *font,
-		 GdkGC       *gc,
-		 gint         x,
-		 gint         y,
-		 const gchar *string)
-{
-  gdk_draw_text (drawable, font, gc, x, y, string, _gdk_font_strlen (font, string));
-}
-
-/* gdk_draw_text
- *
- * Modified by Li-Da Lho to draw 16 bits and Multibyte strings
- *
- * Interface changed: add "GdkFont *font" to specify font or fontset explicitely
- */
-/**
- * gdk_draw_text:
- * @drawable: a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
- * @font: a #GdkFont.
- * @gc: a #GdkGC.
- * @x: the x coordinate of the left edge of the text.
- * @y: the y coordinate of the baseline of the text.
- * @text:  the characters to draw.
- * @text_length: the number of characters of @text to draw.
- * 
- * Draws a number of characters in the given font or fontset.
- *
- * Deprecated: 2.4: Use gdk_draw_layout() instead.
- **/
-void
-gdk_draw_text (GdkDrawable *drawable,
-	       GdkFont     *font,
-	       GdkGC       *gc,
-	       gint         x,
-	       gint         y,
-	       const gchar *text,
-	       gint         text_length)
-{
-  g_return_if_fail (GDK_IS_DRAWABLE (drawable));
-  g_return_if_fail (font != NULL);
-  g_return_if_fail (GDK_IS_GC (gc));
-  g_return_if_fail (text != NULL);
-
-  GDK_DRAWABLE_GET_CLASS (drawable)->draw_text (drawable, font, gc, x, y, text, text_length);
-}
-
-/**
- * gdk_draw_text_wc:
- * @drawable: a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
- * @font: a #GdkFont.
- * @gc: a #GdkGC.
- * @x: the x coordinate of the left edge of the text.
- * @y: the y coordinate of the baseline of the text.
- * @text: the wide characters to draw.
- * @text_length: the number of characters to draw.
- * 
- * Draws a number of wide characters using the given font of fontset.
- * If the font is a 1-byte font, the string is converted into 1-byte 
- * characters (discarding the high bytes) before output.
- * 
- * Deprecated: 2.4: Use gdk_draw_layout() instead.
- **/
-void
-gdk_draw_text_wc (GdkDrawable	 *drawable,
-		  GdkFont	 *font,
-		  GdkGC		 *gc,
-		  gint		  x,
-		  gint		  y,
-		  const GdkWChar *text,
-		  gint		  text_length)
-{
-  g_return_if_fail (GDK_IS_DRAWABLE (drawable));
-  g_return_if_fail (font != NULL);
-  g_return_if_fail (GDK_IS_GC (gc));
-  g_return_if_fail (text != NULL);
-
-  GDK_DRAWABLE_GET_CLASS (drawable)->draw_text_wc (drawable, font, gc, x, y, text, text_length);
-}
-
 /**
  * gdk_draw_drawable:
  * @drawable: a #GdkDrawable
diff --git a/gdk/gdkdrawable.h b/gdk/gdkdrawable.h
index b8dabb5..0cdad13 100644
--- a/gdk/gdkdrawable.h
+++ b/gdk/gdkdrawable.h
@@ -83,20 +83,6 @@ struct _GdkDrawableClass
 			  gboolean	filled,
 			  GdkPoint     *points,
 			  gint		npoints);
-  void (*draw_text)      (GdkDrawable  *drawable,
-			  GdkFont      *font,
-			  GdkGC	       *gc,
-			  gint		x,
-			  gint		y,
-			  const gchar  *text,
-			  gint		text_length);
-  void (*draw_text_wc)   (GdkDrawable	 *drawable,
-			  GdkFont	 *font,
-			  GdkGC		 *gc,
-			  gint		  x,
-			  gint		  y,
-			  const GdkWChar *text,
-			  gint		  text_length);
   void (*draw_drawable)  (GdkDrawable  *drawable,
 			  GdkGC	       *gc,
 			  GdkDrawable  *src,
@@ -240,16 +226,6 @@ GType           gdk_drawable_get_type     (void) G_GNUC_CONST;
 
 /* Manipulation of drawables
  */
-
-#ifndef GDK_DISABLE_DEPRECATED
-void            gdk_drawable_set_data     (GdkDrawable    *drawable,
-					   const gchar    *key,
-					   gpointer	  data,
-					   GDestroyNotify  destroy_func);
-gpointer        gdk_drawable_get_data     (GdkDrawable    *drawable,
-					   const gchar    *key);
-#endif /* GDK_DISABLE_DEPRECATED */
-
 void            gdk_drawable_get_size     (GdkDrawable	  *drawable,
 					   gint	          *width,
 					   gint  	  *height);
@@ -261,11 +237,6 @@ gint            gdk_drawable_get_depth    (GdkDrawable	  *drawable);
 GdkScreen*	gdk_drawable_get_screen   (GdkDrawable    *drawable);
 GdkDisplay*	gdk_drawable_get_display  (GdkDrawable    *drawable);
 
-#ifndef GDK_DISABLE_DEPRECATED
-GdkDrawable*    gdk_drawable_ref          (GdkDrawable    *drawable);
-void            gdk_drawable_unref        (GdkDrawable    *drawable);
-#endif /* GDK_DISABLE_DEPRECATED */
-
 /* Drawing
  */
 void gdk_draw_point     (GdkDrawable      *drawable,
@@ -299,33 +270,6 @@ void gdk_draw_polygon   (GdkDrawable      *drawable,
 			 gboolean          filled,
 			 const GdkPoint   *points,
 			 gint              n_points);
-#if !defined (GDK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
-/* Used by gtk_default_draw_string () */
-void gdk_draw_string    (GdkDrawable      *drawable,
-			 GdkFont          *font,
-			 GdkGC            *gc,
-			 gint              x,
-			 gint              y,
-			 const gchar      *string);
-#endif /* !GDK_DISABLE_DEPRECATED || GTK_COMPILATION */
-#if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION)
-/* Used by gdk_pixmap_draw_text (), gdk_window_draw_text() */
-void gdk_draw_text      (GdkDrawable      *drawable,
-			 GdkFont          *font,
-			 GdkGC            *gc,
-			 gint              x,
-			 gint              y,
-			 const gchar      *text,
-			 gint              text_length);
-/* Used by gdk_pixmap_draw_text_wc (), gdk_window_draw_text_wc () */
-void gdk_draw_text_wc   (GdkDrawable      *drawable,
-			 GdkFont          *font,
-			 GdkGC            *gc,
-			 gint              x,
-			 gint              y,
-			 const GdkWChar   *text,
-			 gint              text_length);
-#endif /* !GDK_DISABLE_DEPRECATED || GDK_COMPILATION */
 void gdk_draw_drawable  (GdkDrawable      *drawable,
 			 GdkGC            *gc,
 			 GdkDrawable      *src,
diff --git a/gdk/gdkoffscreenwindow.c b/gdk/gdkoffscreenwindow.c
index 2c4113b..88b33fa 100644
--- a/gdk/gdkoffscreenwindow.c
+++ b/gdk/gdkoffscreenwindow.c
@@ -407,56 +407,6 @@ gdk_offscreen_window_draw_polygon (GdkDrawable  *drawable,
 }
 
 static void
-gdk_offscreen_window_draw_text (GdkDrawable  *drawable,
-				GdkFont      *font,
-				GdkGC	       *gc,
-				gint		x,
-				gint		y,
-				const gchar  *text,
-				gint		text_length)
-{
-  GdkOffscreenWindow *offscreen = GDK_OFFSCREEN_WINDOW (drawable);
-  GdkDrawable *real_drawable = get_real_drawable (offscreen);
-  GdkWindowObject *private = GDK_WINDOW_OBJECT (offscreen->wrapper);
-
-  gdk_draw_text (real_drawable,
-		 font,
-		 gc,
-		 x,
-		 y,
-		 text,
-		 text_length);
-
-  /* Hard to compute the minimal size, not that often used anyway. */
-  add_damage (offscreen, 0, 0, private->width, private->height, FALSE);
-}
-
-static void
-gdk_offscreen_window_draw_text_wc (GdkDrawable	 *drawable,
-				   GdkFont	 *font,
-				   GdkGC		 *gc,
-				   gint		  x,
-				   gint		  y,
-				   const GdkWChar *text,
-				   gint		  text_length)
-{
-  GdkOffscreenWindow *offscreen = GDK_OFFSCREEN_WINDOW (drawable);
-  GdkDrawable *real_drawable = get_real_drawable (offscreen);
-  GdkWindowObject *private = GDK_WINDOW_OBJECT (offscreen->wrapper);
-
-  gdk_draw_text_wc (real_drawable,
-		    font,
-		    gc,
-		    x,
-		    y,
-		    text,
-		    text_length);
-
-  /* Hard to compute the minimal size, not that often used anyway. */
-  add_damage (offscreen, 0, 0, private->width, private->height, FALSE);
-}
-
-static void
 gdk_offscreen_window_draw_points (GdkDrawable  *drawable,
 				  GdkGC	       *gc,
 				  GdkPoint     *points,
@@ -1245,8 +1195,6 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
   drawable_class->draw_rectangle = gdk_offscreen_window_draw_rectangle;
   drawable_class->draw_arc = gdk_offscreen_window_draw_arc;
   drawable_class->draw_polygon = gdk_offscreen_window_draw_polygon;
-  drawable_class->draw_text = gdk_offscreen_window_draw_text;
-  drawable_class->draw_text_wc = gdk_offscreen_window_draw_text_wc;
   drawable_class->draw_drawable_with_src = gdk_offscreen_window_draw_drawable;
   drawable_class->draw_points = gdk_offscreen_window_draw_points;
   drawable_class->draw_segments = gdk_offscreen_window_draw_segments;
diff --git a/gdk/gdkpixmap.c b/gdk/gdkpixmap.c
index 79ebd5c..2adb33f 100644
--- a/gdk/gdkpixmap.c
+++ b/gdk/gdkpixmap.c
@@ -55,20 +55,6 @@ static void   gdk_pixmap_draw_polygon   (GdkDrawable     *drawable,
 					 gboolean         filled,
 					 GdkPoint        *points,
 					 gint             npoints);
-static void   gdk_pixmap_draw_text      (GdkDrawable     *drawable,
-					 GdkFont         *font,
-					 GdkGC           *gc,
-					 gint             x,
-					 gint             y,
-					 const gchar     *text,
-					 gint             text_length);
-static void   gdk_pixmap_draw_text_wc   (GdkDrawable     *drawable,
-					 GdkFont         *font,
-					 GdkGC           *gc,
-					 gint             x,
-					 gint             y,
-					 const GdkWChar  *text,
-					 gint             text_length);
 static void   gdk_pixmap_draw_drawable  (GdkDrawable     *drawable,
 					 GdkGC           *gc,
 					 GdkPixmap       *src,
@@ -201,8 +187,6 @@ gdk_pixmap_class_init (GdkPixmapObjectClass *klass)
   drawable_class->draw_rectangle = gdk_pixmap_draw_rectangle;
   drawable_class->draw_arc = gdk_pixmap_draw_arc;
   drawable_class->draw_polygon = gdk_pixmap_draw_polygon;
-  drawable_class->draw_text = gdk_pixmap_draw_text;
-  drawable_class->draw_text_wc = gdk_pixmap_draw_text_wc;
   drawable_class->draw_drawable_with_src = gdk_pixmap_draw_drawable;
   drawable_class->draw_points = gdk_pixmap_draw_points;
   drawable_class->draw_segments = gdk_pixmap_draw_segments;
@@ -340,38 +324,6 @@ gdk_pixmap_draw_polygon (GdkDrawable *drawable,
 }
 
 static void
-gdk_pixmap_draw_text (GdkDrawable *drawable,
-		      GdkFont     *font,
-		      GdkGC       *gc,
-		      gint         x,
-		      gint         y,
-		      const gchar *text,
-		      gint         text_length)
-{
-  GdkPixmapObject *private = (GdkPixmapObject *)drawable;
-
-  _gdk_gc_remove_drawable_clip (gc);  
-  gdk_draw_text (private->impl, font, gc,
-                 x, y, text, text_length);
-}
-
-static void
-gdk_pixmap_draw_text_wc (GdkDrawable    *drawable,
-			 GdkFont        *font,
-			 GdkGC          *gc,
-			 gint            x,
-			 gint            y,
-			 const GdkWChar *text,
-			 gint            text_length)
-{
-  GdkPixmapObject *private = (GdkPixmapObject *)drawable;
-
-  _gdk_gc_remove_drawable_clip (gc);  
-  gdk_draw_text_wc (private->impl, font, gc,
-                    x, y, text, text_length);
-}
-
-static void
 gdk_pixmap_draw_drawable (GdkDrawable *drawable,
 			  GdkGC       *gc,
 			  GdkPixmap   *src,
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index a985ef3..9876575 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -252,20 +252,6 @@ static void   gdk_window_draw_polygon   (GdkDrawable     *drawable,
 					 gboolean         filled,
 					 GdkPoint        *points,
 					 gint             npoints);
-static void   gdk_window_draw_text      (GdkDrawable     *drawable,
-					 GdkFont         *font,
-					 GdkGC           *gc,
-					 gint             x,
-					 gint             y,
-					 const gchar     *text,
-					 gint             text_length);
-static void   gdk_window_draw_text_wc   (GdkDrawable     *drawable,
-					 GdkFont         *font,
-					 GdkGC           *gc,
-					 gint             x,
-					 gint             y,
-					 const GdkWChar  *text,
-					 gint             text_length);
 static void   gdk_window_draw_drawable  (GdkDrawable     *drawable,
 					 GdkGC           *gc,
 					 GdkPixmap       *src,
@@ -520,8 +506,6 @@ gdk_window_class_init (GdkWindowObjectClass *klass)
   drawable_class->draw_rectangle = gdk_window_draw_rectangle;
   drawable_class->draw_arc = gdk_window_draw_arc;
   drawable_class->draw_polygon = gdk_window_draw_polygon;
-  drawable_class->draw_text = gdk_window_draw_text;
-  drawable_class->draw_text_wc = gdk_window_draw_text_wc;
   drawable_class->draw_drawable_with_src = gdk_window_draw_drawable;
   drawable_class->draw_points = gdk_window_draw_points;
   drawable_class->draw_segments = gdk_window_draw_segments;
@@ -4038,42 +4022,6 @@ gdk_window_draw_polygon (GdkDrawable *drawable,
   END_DRAW;
 }
 
-static void
-gdk_window_draw_text (GdkDrawable *drawable,
-		      GdkFont     *font,
-		      GdkGC       *gc,
-		      gint         x,
-		      gint         y,
-		      const gchar *text,
-		      gint         text_length)
-{
-  if (GDK_WINDOW_DESTROYED (drawable))
-    return;
-
-  BEGIN_DRAW;
-  gdk_draw_text (impl, font, gc,
-		 x - x_offset, y - y_offset, text, text_length);
-  END_DRAW;
-}
-
-static void
-gdk_window_draw_text_wc (GdkDrawable    *drawable,
-			 GdkFont        *font,
-			 GdkGC          *gc,
-			 gint            x,
-			 gint            y,
-			 const GdkWChar *text,
-			 gint            text_length)
-{
-  if (GDK_WINDOW_DESTROYED (drawable))
-    return;
-
-  BEGIN_DRAW;
-  gdk_draw_text_wc (impl, font, gc,
-		    x - x_offset, y - y_offset, text, text_length);
-  END_DRAW;
-}
-
 static GdkDrawable *
 gdk_window_get_source_drawable (GdkDrawable *drawable)
 {
diff --git a/gdk/quartz/gdkdrawable-quartz.c b/gdk/quartz/gdkdrawable-quartz.c
index 2f03f2e..918e4bc 100644
--- a/gdk/quartz/gdkdrawable-quartz.c
+++ b/gdk/quartz/gdkdrawable-quartz.c
@@ -299,30 +299,6 @@ gdk_quartz_draw_polygon (GdkDrawable *drawable,
 }
 
 static void
-gdk_quartz_draw_text (GdkDrawable *drawable,
-		      GdkFont     *font,
-		      GdkGC       *gc,
-		      gint         x,
-		      gint         y,
-		      const gchar *text,
-		      gint         text_length)
-{
-  /* FIXME: Implement */
-}
-
-static void
-gdk_quartz_draw_text_wc (GdkDrawable    *drawable,
-			 GdkFont	*font,
-			 GdkGC	        *gc,
-			 gint	         x,
-			 gint	         y,
-			 const GdkWChar *text,
-			 gint	         text_length)
-{
-  /* FIXME: Implement */
-}
-
-static void
 gdk_quartz_draw_drawable (GdkDrawable *drawable,
 			  GdkGC       *gc,
 			  GdkPixmap   *src,
@@ -659,8 +635,6 @@ gdk_drawable_impl_quartz_class_init (GdkDrawableImplQuartzClass *klass)
   drawable_class->draw_rectangle = gdk_quartz_draw_rectangle;
   drawable_class->draw_arc = gdk_quartz_draw_arc;
   drawable_class->draw_polygon = gdk_quartz_draw_polygon;
-  drawable_class->draw_text = gdk_quartz_draw_text;
-  drawable_class->draw_text_wc = gdk_quartz_draw_text_wc;
   drawable_class->draw_drawable_with_src = gdk_quartz_draw_drawable;
   drawable_class->draw_points = gdk_quartz_draw_points;
   drawable_class->draw_segments = gdk_quartz_draw_segments;
diff --git a/gdk/win32/gdkdrawable-win32.c b/gdk/win32/gdkdrawable-win32.c
index 52ab3fb..36bd84a 100644
--- a/gdk/win32/gdkdrawable-win32.c
+++ b/gdk/win32/gdkdrawable-win32.c
@@ -70,20 +70,6 @@ static void gdk_win32_draw_polygon   (GdkDrawable    *drawable,
 				      gboolean        filled,
 				      GdkPoint       *points,
 				      gint            npoints);
-static void gdk_win32_draw_text      (GdkDrawable    *drawable,
-				      GdkFont        *font,
-				      GdkGC          *gc,
-				      gint            x,
-				      gint            y,
-				      const gchar    *text,
-				      gint            text_length);
-static void gdk_win32_draw_text_wc   (GdkDrawable    *drawable,
-				      GdkFont        *font,
-				      GdkGC          *gc,
-				      gint            x,
-				      gint            y,
-				      const GdkWChar *text,
-				      gint            text_length);
 static void gdk_win32_draw_drawable  (GdkDrawable    *drawable,
 				      GdkGC          *gc,
 				      GdkPixmap      *src,
@@ -160,8 +146,6 @@ _gdk_drawable_impl_win32_class_init (GdkDrawableImplWin32Class *klass)
   drawable_class->draw_rectangle = gdk_win32_draw_rectangle;
   drawable_class->draw_arc = gdk_win32_draw_arc;
   drawable_class->draw_polygon = gdk_win32_draw_polygon;
-  drawable_class->draw_text = gdk_win32_draw_text;
-  drawable_class->draw_text_wc = gdk_win32_draw_text_wc;
   drawable_class->draw_drawable_with_src = gdk_win32_draw_drawable;
   drawable_class->draw_points = gdk_win32_draw_points;
   drawable_class->draw_segments = gdk_win32_draw_segments;
@@ -1005,129 +989,6 @@ gdk_win32_draw_polygon (GdkDrawable *drawable,
   g_free (pts);
 }
 
-typedef struct
-{
-  gint x, y;
-  HDC hdc;
-} gdk_draw_text_arg;
-
-static void
-gdk_draw_text_handler (GdkWin32SingleFont *singlefont,
-		       const wchar_t      *wcstr,
-		       int                 wclen,
-		       void               *arg)
-{
-  HGDIOBJ oldfont;
-  SIZE size;
-  gdk_draw_text_arg *argp = (gdk_draw_text_arg *) arg;
-
-  if (!singlefont)
-    return;
-
-  if ((oldfont = SelectObject (argp->hdc, singlefont->hfont)) == NULL)
-    {
-      WIN32_GDI_FAILED ("SelectObject");
-      return;
-    }
-  
-  if (!TextOutW (argp->hdc, argp->x, argp->y, wcstr, wclen))
-    WIN32_GDI_FAILED ("TextOutW");
-  GetTextExtentPoint32W (argp->hdc, wcstr, wclen, &size);
-  argp->x += size.cx;
-
-  SelectObject (argp->hdc, oldfont);
-}
-
-static void
-gdk_win32_draw_text (GdkDrawable *drawable,
-		     GdkFont     *font,
-		     GdkGC       *gc,
-		     gint         x,
-		     gint         y,
-		     const gchar *text,
-		     gint         text_length)
-{
-  const GdkGCValuesMask mask = GDK_GC_FOREGROUND|GDK_GC_FONT;
-  wchar_t *wcstr, wc;
-  glong wlen;
-  gdk_draw_text_arg arg;
-
-  if (text_length == 0)
-    return;
-
-  g_assert (font->type == GDK_FONT_FONT || font->type == GDK_FONT_FONTSET);
-
-  arg.x = x;
-  arg.y = y;
-  arg.hdc = gdk_win32_hdc_get (drawable, gc, mask);
-
-  GDK_NOTE (DRAW, g_print ("gdk_win32_draw_text: %s (%d,%d) \"%.*s\" (len %d)\n",
-			   _gdk_win32_drawable_description (drawable),
-			   x, y,
-			   (text_length > 10 ? 10 : text_length),
-			   text, text_length));
-  
-  if (text_length == 1)
-    {
-      /* For single characters, don't try to interpret as UTF-8. */
-      wc = (guchar) text[0];
-      _gdk_wchar_text_handle (font, &wc, 1, gdk_draw_text_handler, &arg);
-    }
-  else
-    {
-      wcstr = g_utf8_to_utf16 (text, text_length, NULL, &wlen, NULL);
-      _gdk_wchar_text_handle (font, wcstr, wlen, gdk_draw_text_handler, &arg);
-      g_free (wcstr);
-    }
-
-  gdk_win32_hdc_release (drawable, gc, mask);
-}
-
-static void
-gdk_win32_draw_text_wc (GdkDrawable	 *drawable,
-			GdkFont          *font,
-			GdkGC		 *gc,
-			gint		  x,
-			gint		  y,
-			const GdkWChar *text,
-			gint		  text_length)
-{
-  const GdkGCValuesMask mask = GDK_GC_FOREGROUND|GDK_GC_FONT;
-  gint i;
-  wchar_t *wcstr;
-  gdk_draw_text_arg arg;
-
-  if (text_length == 0)
-    return;
-
-  g_assert (font->type == GDK_FONT_FONT || font->type == GDK_FONT_FONTSET);
-
-  arg.x = x;
-  arg.y = y;
-  arg.hdc = gdk_win32_hdc_get (drawable, gc, mask);
-
-  GDK_NOTE (DRAW, g_print ("gdk_win32_draw_text_wc: %s (%d,%d) len: %d\n",
-			   _gdk_win32_drawable_description (drawable),
-			   x, y, text_length));
-      
-  if (sizeof (wchar_t) != sizeof (GdkWChar))
-    {
-      wcstr = g_new (wchar_t, text_length);
-      for (i = 0; i < text_length; i++)
-	wcstr[i] = text[i];
-    }
-  else
-    wcstr = (wchar_t *) text;
-
-  _gdk_wchar_text_handle (font, wcstr, text_length,
-			 gdk_draw_text_handler, &arg);
-
-  if (sizeof (wchar_t) != sizeof (GdkWChar))
-    g_free (wcstr);
-
-  gdk_win32_hdc_release (drawable, gc, mask);
-}
-
 static void
 gdk_win32_draw_drawable (GdkDrawable *drawable,
 			 GdkGC       *gc,
diff --git a/gdk/x11/gdkdrawable-x11.c b/gdk/x11/gdkdrawable-x11.c
index ab98b7f..42073d3 100644
--- a/gdk/x11/gdkdrawable-x11.c
+++ b/gdk/x11/gdkdrawable-x11.c
@@ -71,20 +71,6 @@ static void gdk_x11_draw_polygon   (GdkDrawable    *drawable,
 				    gboolean        filled,
 				    GdkPoint       *points,
 				    gint            npoints);
-static void gdk_x11_draw_text      (GdkDrawable    *drawable,
-				    GdkFont        *font,
-				    GdkGC          *gc,
-				    gint            x,
-				    gint            y,
-				    const gchar    *text,
-				    gint            text_length);
-static void gdk_x11_draw_text_wc   (GdkDrawable    *drawable,
-				    GdkFont        *font,
-				    GdkGC          *gc,
-				    gint            x,
-				    gint            y,
-				    const GdkWChar *text,
-				    gint            text_length);
 static void gdk_x11_draw_drawable  (GdkDrawable    *drawable,
 				    GdkGC          *gc,
 				    GdkPixmap      *src,
@@ -158,8 +144,6 @@ _gdk_drawable_impl_x11_class_init (GdkDrawableImplX11Class *klass)
   drawable_class->draw_rectangle = gdk_x11_draw_rectangle;
   drawable_class->draw_arc = gdk_x11_draw_arc;
   drawable_class->draw_polygon = gdk_x11_draw_polygon;
-  drawable_class->draw_text = gdk_x11_draw_text;
-  drawable_class->draw_text_wc = gdk_x11_draw_text_wc;
   drawable_class->draw_drawable_with_src = gdk_x11_draw_drawable;
   drawable_class->draw_points = gdk_x11_draw_points;
   drawable_class->draw_segments = gdk_x11_draw_segments;
@@ -531,103 +515,6 @@ gdk_x11_draw_polygon (GdkDrawable *drawable,
   g_free (tmp_points);
 }
 
-/* gdk_x11_draw_text
- *
- * Modified by Li-Da Lho to draw 16 bits and Multibyte strings
- *
- * Interface changed: add "GdkFont *font" to specify font or fontset explicitely
- */
-static void
-gdk_x11_draw_text (GdkDrawable *drawable,
-		   GdkFont     *font,
-		   GdkGC       *gc,
-		   gint         x,
-		   gint         y,
-		   const gchar *text,
-		   gint         text_length)
-{
-  GdkDrawableImplX11 *impl;
-  Display *xdisplay;
-
-  impl = GDK_DRAWABLE_IMPL_X11 (drawable);
-  xdisplay = GDK_SCREEN_XDISPLAY (impl->screen);
-  
-  if (font->type == GDK_FONT_FONT)
-    {
-      XFontStruct *xfont = (XFontStruct *) GDK_FONT_XFONT (font);
-      XSetFont(xdisplay, GDK_GC_GET_XGC (gc), xfont->fid);
-      if ((xfont->min_byte1 == 0) && (xfont->max_byte1 == 0))
-	{
-	  XDrawString (xdisplay, impl->xid,
-		       GDK_GC_GET_XGC (gc), x, y, text, text_length);
-	}
-      else
-	{
-	  XDrawString16 (xdisplay, impl->xid,
-			 GDK_GC_GET_XGC (gc), x, y, (XChar2b *) text, text_length / 2);
-	}
-    }
-  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);
-    }
-  else
-    g_error("undefined font type\n");
-}
-
-static void
-gdk_x11_draw_text_wc (GdkDrawable    *drawable,
-		      GdkFont	     *font,
-		      GdkGC	     *gc,
-		      gint	      x,
-		      gint	      y,
-		      const GdkWChar *text,
-		      gint	      text_length)
-{
-  GdkDrawableImplX11 *impl;
-  Display *xdisplay;
-
-  impl = GDK_DRAWABLE_IMPL_X11 (drawable);
-  xdisplay = GDK_SCREEN_XDISPLAY (impl->screen);
-  
-  if (font->type == GDK_FONT_FONT)
-    {
-      XFontStruct *xfont = (XFontStruct *) GDK_FONT_XFONT (font);
-      gchar *text_8bit;
-      gint i;
-      XSetFont(xdisplay, GDK_GC_GET_XGC (gc), xfont->fid);
-      text_8bit = g_new (gchar, text_length);
-      for (i=0; i<text_length; i++) text_8bit[i] = text[i];
-      XDrawString (xdisplay, impl->xid,
-                   GDK_GC_GET_XGC (gc), x, y, text_8bit, text_length);
-      g_free (text_8bit);
-    }
-  else if (font->type == GDK_FONT_FONTSET)
-    {
-      if (sizeof(GdkWChar) == sizeof(wchar_t))
-	{
-	  XwcDrawString (xdisplay, impl->xid,
-			 (XFontSet) GDK_FONT_XFONT (font),
-			 GDK_GC_GET_XGC (gc), x, y, (wchar_t *)text, text_length);
-	}
-      else
-	{
-	  wchar_t *text_wchar;
-	  gint i;
-	  text_wchar = g_new (wchar_t, text_length);
-	  for (i=0; i<text_length; i++) text_wchar[i] = text[i];
-	  XwcDrawString (xdisplay, impl->xid,
-			 (XFontSet) GDK_FONT_XFONT (font),
-			 GDK_GC_GET_XGC (gc), x, y, text_wchar, text_length);
-	  g_free (text_wchar);
-	}
-    }
-  else
-    g_error("undefined font type\n");
-}
-
 static void
 gdk_x11_draw_drawable (GdkDrawable *drawable,
 		       GdkGC       *gc,



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