[gtk+/rendering-cleanup: 74/124] API: remove gdk_draw_point(s)



commit b0aaefe90273675bc0b9897977dca64933e3e580
Author: Benjamin Otte <otte redhat com>
Date:   Thu Jul 15 18:07:42 2010 +0200

    API: remove gdk_draw_point(s)

 docs/reference/gdk/gdk3-sections.txt |    2 -
 docs/reference/gdk/tmpl/drawing.sgml |   20 ------------
 gdk/directfb/gdkdrawable-directfb.c  |   49 ------------------------------
 gdk/gdk.symbols                      |    2 -
 gdk/gdkdraw.c                        |   55 ----------------------------------
 gdk/gdkdrawable.h                    |   12 -------
 gdk/gdkoffscreenwindow.c             |   38 -----------------------
 gdk/gdkpixmap.c                      |   17 ----------
 gdk/gdkwindow.c                      |   40 ------------------------
 gdk/quartz/gdkdrawable-quartz.c      |   27 ----------------
 gdk/win32/gdkdrawable-win32.c        |   36 ----------------------
 gdk/x11/gdkdrawable-x11.c            |   48 -----------------------------
 12 files changed, 0 insertions(+), 346 deletions(-)
---
diff --git a/docs/reference/gdk/gdk3-sections.txt b/docs/reference/gdk/gdk3-sections.txt
index a954531..ca6cde8 100644
--- a/docs/reference/gdk/gdk3-sections.txt
+++ b/docs/reference/gdk/gdk3-sections.txt
@@ -333,8 +333,6 @@ gdk_drawable_get_clip_region
 gdk_drawable_get_visible_region
 
 <SUBSECTION>
-gdk_draw_point
-gdk_draw_points
 gdk_draw_rectangle
 gdk_draw_layout_line
 gdk_draw_layout_line_with_colors
diff --git a/docs/reference/gdk/tmpl/drawing.sgml b/docs/reference/gdk/tmpl/drawing.sgml
index 25f5e13..fc5c18f 100644
--- a/docs/reference/gdk/tmpl/drawing.sgml
+++ b/docs/reference/gdk/tmpl/drawing.sgml
@@ -127,26 +127,6 @@ or a #GdkWindow.
 @Returns: 
 
 
-<!-- ##### FUNCTION gdk_draw_point ##### -->
-<para>
-</para>
-
- drawable: 
- gc: 
- x: 
- y: 
-
-
-<!-- ##### FUNCTION gdk_draw_points ##### -->
-<para>
-</para>
-
- drawable: 
- gc: 
- points: 
- n_points: 
-
-
 <!-- ##### FUNCTION gdk_draw_rectangle ##### -->
 <para>
 </para>
diff --git a/gdk/directfb/gdkdrawable-directfb.c b/gdk/directfb/gdkdrawable-directfb.c
index e89bdc2..238e92e 100644
--- a/gdk/directfb/gdkdrawable-directfb.c
+++ b/gdk/directfb/gdkdrawable-directfb.c
@@ -605,54 +605,6 @@ gdk_directfb_draw_drawable (GdkDrawable *drawable,
   temp_region_deinit( &clip );
 }
 
-static void
-gdk_directfb_draw_points (GdkDrawable *drawable,
-                          GdkGC       *gc,
-                          GdkPoint    *points,
-                          gint         npoints)
-{
-  GdkDrawableImplDirectFB *impl;
-  cairo_region_t                clip;
-
-  DFBRegion region = { points->x, points->y, points->x, points->y };
-
-  D_DEBUG_AT( GDKDFB_Drawable, "%s( %p, %p, %p, %d )\n", G_STRFUNC, drawable, gc, points, npoints );
-
-  if (npoints < 1)
-    return;
-
-  impl = GDK_DRAWABLE_IMPL_DIRECTFB (drawable);
-
-  if (!gdk_directfb_setup_for_drawing (impl, GDK_GC_DIRECTFB (gc)))
-    return;
-
-  gdk_directfb_clip_region (drawable, gc, NULL, &clip);
-
-  while (npoints > 0)
-    {
-      if (cairo_region_contains_point (&clip, points->x, points->y))
-        {
-          impl->surface->FillRectangle (impl->surface,
-                                        points->x, points->y, 1, 1);
-
-          if (points->x < region.x1)
-            region.x1 = points->x;
-          if (points->x > region.x2)
-            region.x2 = points->x;
-
-          if (points->y < region.y1)
-            region.y1 = points->y;
-          if (points->y > region.y2)
-            region.y2 = points->y;
-        }
-
-      npoints--;
-      points++;
-    }
-
-  temp_region_deinit( &clip );
-}
-
 static inline void
 convert_rgba_pixbuf_to_image (guint32 *src,
                               guint    src_pitch,
@@ -751,7 +703,6 @@ gdk_drawable_impl_directfb_class_init (GdkDrawableImplDirectFBClass *klass)
   drawable_class->create_gc      = _gdk_directfb_gc_new;
   drawable_class->draw_rectangle = gdk_directfb_draw_rectangle;
   drawable_class->draw_drawable  = gdk_directfb_draw_drawable;
-  drawable_class->draw_points    = gdk_directfb_draw_points;
 
   drawable_class->ref_cairo_surface = gdk_directfb_ref_cairo_surface;
   drawable_class->set_colormap   = gdk_directfb_set_colormap;
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index 1590efe..459a9a8 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_point
-gdk_draw_points
 gdk_draw_rectangle
 #endif
 #endif
diff --git a/gdk/gdkdraw.c b/gdk/gdkdraw.c
index 46a92ca..37a6a6a 100644
--- a/gdk/gdkdraw.c
+++ b/gdk/gdkdraw.c
@@ -216,33 +216,6 @@ gdk_drawable_get_colormap (GdkDrawable *drawable)
  */
 
 /**
- * gdk_draw_point:
- * @drawable: a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
- * @gc: a #GdkGC.
- * @x: the x coordinate of the point.
- * @y: the y coordinate of the point.
- * 
- * Draws a point, using the foreground color and other attributes of 
- * the #GdkGC.
- **/
-void
-gdk_draw_point (GdkDrawable *drawable,
-                GdkGC       *gc,
-                gint         x,
-                gint         y)
-{
-  GdkPoint point;
-
-  g_return_if_fail (GDK_IS_DRAWABLE (drawable));
-  g_return_if_fail (GDK_IS_GC (gc));
-
-  point.x = x;
-  point.y = y;
-  
-  GDK_DRAWABLE_GET_CLASS (drawable)->draw_points (drawable, gc, &point, 1);
-}
-
-/**
  * gdk_draw_rectangle:
  * @drawable: a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
  * @gc: a #GdkGC.
@@ -383,34 +356,6 @@ gdk_draw_drawable (GdkDrawable *drawable,
   g_object_unref (composite);
 }
 
-/**
- * gdk_draw_points:
- * @drawable: a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
- * @gc: a #GdkGC.
- * @points: an array of #GdkPoint structures.
- * @n_points: the number of points to be drawn.
- * 
- * Draws a number of points, using the foreground color and other 
- * attributes of the #GdkGC.
- **/
-void
-gdk_draw_points (GdkDrawable    *drawable,
-		 GdkGC          *gc,
-		 const GdkPoint *points,
-		 gint            n_points)
-{
-  g_return_if_fail (GDK_IS_DRAWABLE (drawable));
-  g_return_if_fail ((points != NULL) && (n_points > 0));
-  g_return_if_fail (GDK_IS_GC (gc));
-  g_return_if_fail (n_points >= 0);
-
-  if (n_points == 0)
-    return;
-
-  GDK_DRAWABLE_GET_CLASS (drawable)->draw_points (drawable, gc,
-                                                  (GdkPoint *) points, n_points);
-}
-
 static GdkDrawable *
 gdk_drawable_real_get_composite_drawable (GdkDrawable *drawable,
                                           gint         x,
diff --git a/gdk/gdkdrawable.h b/gdk/gdkdrawable.h
index c0d88f2..de741d3 100644
--- a/gdk/gdkdrawable.h
+++ b/gdk/gdkdrawable.h
@@ -76,10 +76,6 @@ struct _GdkDrawableClass
 			  gint		ydest,
 			  gint		width,
 			  gint		height);
-  void (*draw_points)	 (GdkDrawable  *drawable,
-			  GdkGC	       *gc,
-			  GdkPoint     *points,
-			  gint		npoints);
 
   gint (*get_depth)      (GdkDrawable  *drawable);
   void (*get_size)       (GdkDrawable  *drawable,
@@ -154,10 +150,6 @@ GdkDisplay*	gdk_drawable_get_display  (GdkDrawable    *drawable);
 
 /* Drawing
  */
-void gdk_draw_point     (GdkDrawable      *drawable,
-			 GdkGC            *gc,
-			 gint              x,
-			 gint              y);
 void gdk_draw_rectangle (GdkDrawable      *drawable,
 			 GdkGC            *gc,
 			 gboolean          filled,
@@ -174,10 +166,6 @@ void gdk_draw_drawable  (GdkDrawable      *drawable,
 			 gint              ydest,
 			 gint              width,
 			 gint              height);
-void gdk_draw_points    (GdkDrawable      *drawable,
-			 GdkGC            *gc,
-			 const GdkPoint   *points,
-			 gint              n_points);
 
 void gdk_draw_layout_line (GdkDrawable      *drawable,
 			   GdkGC            *gc,
diff --git a/gdk/gdkoffscreenwindow.c b/gdk/gdkoffscreenwindow.c
index 48c2c8b..2846d0c 100644
--- a/gdk/gdkoffscreenwindow.c
+++ b/gdk/gdkoffscreenwindow.c
@@ -323,43 +323,6 @@ gdk_offscreen_window_draw_rectangle (GdkDrawable  *drawable,
 
 }
 
-static void
-gdk_offscreen_window_draw_points (GdkDrawable  *drawable,
-				  GdkGC	       *gc,
-				  GdkPoint     *points,
-				  gint		npoints)
-{
-  GdkOffscreenWindow *offscreen = GDK_OFFSCREEN_WINDOW (drawable);
-  GdkDrawable *real_drawable = get_real_drawable (offscreen);
-
-  gdk_draw_points (real_drawable,
-		   gc,
-		   points,
-		   npoints);
-
-
-  if (npoints > 0)
-    {
-      int min_x, min_y, max_x, max_y, i;
-
-      min_x = max_x = points[0].x;
-      min_y = max_y = points[0].y;
-
-	for (i = 1; i < npoints; i++)
-	  {
-	    min_x = MIN (min_x, points[i].x);
-	    max_x = MAX (max_x, points[i].x);
-	    min_y = MIN (min_y, points[i].y);
-	    max_y = MAX (max_y, points[i].y);
-	  }
-
-	add_damage (offscreen, min_x, min_y,
-		    max_x - min_x + 1,
-		    max_y - min_y + 1,
-		    FALSE);
-    }
-}
-
 void
 _gdk_offscreen_window_new (GdkWindow     *window,
 			   GdkScreen     *screen,
@@ -987,7 +950,6 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
 
   drawable_class->draw_rectangle = gdk_offscreen_window_draw_rectangle;
   drawable_class->draw_drawable_with_src = gdk_offscreen_window_draw_drawable;
-  drawable_class->draw_points = gdk_offscreen_window_draw_points;
 }
 
 static void
diff --git a/gdk/gdkpixmap.c b/gdk/gdkpixmap.c
index d516cae..e2ca656 100644
--- a/gdk/gdkpixmap.c
+++ b/gdk/gdkpixmap.c
@@ -51,10 +51,6 @@ static void   gdk_pixmap_draw_drawable  (GdkDrawable     *drawable,
 					 gint             width,
 					 gint             height,
 					 GdkPixmap       *original_src);
-static void   gdk_pixmap_draw_points    (GdkDrawable     *drawable,
-					 GdkGC           *gc,
-					 GdkPoint        *points,
-					 gint             npoints);
 
 static void   gdk_pixmap_real_get_size  (GdkDrawable     *drawable,
                                          gint            *width,
@@ -115,7 +111,6 @@ gdk_pixmap_class_init (GdkPixmapObjectClass *klass)
   drawable_class->create_gc = gdk_pixmap_create_gc;
   drawable_class->draw_rectangle = gdk_pixmap_draw_rectangle;
   drawable_class->draw_drawable_with_src = gdk_pixmap_draw_drawable;
-  drawable_class->draw_points = gdk_pixmap_draw_points;
   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;
@@ -235,18 +230,6 @@ gdk_pixmap_draw_drawable (GdkDrawable *drawable,
 }
 
 static void
-gdk_pixmap_draw_points (GdkDrawable *drawable,
-			GdkGC       *gc,
-			GdkPoint    *points,
-			gint         npoints)
-{
-  GdkPixmapObject *private = (GdkPixmapObject *)drawable;
-
-  _gdk_gc_remove_drawable_clip (gc);  
-  gdk_draw_points (private->impl, gc, points, npoints);
-}
-
-static void
 gdk_pixmap_real_get_size (GdkDrawable *drawable,
                           gint *width,
                           gint *height)
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 8e81762..02068a7 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -246,10 +246,6 @@ static void   gdk_window_draw_drawable  (GdkDrawable     *drawable,
 					 gint             width,
 					 gint             height,
 					 GdkDrawable     *original_src);
-static void   gdk_window_draw_points    (GdkDrawable     *drawable,
-					 GdkGC           *gc,
-					 GdkPoint        *points,
-					 gint             npoints);
 
 static cairo_surface_t *gdk_window_ref_cairo_surface (GdkDrawable *drawable);
 static cairo_surface_t *gdk_window_create_cairo_surface (GdkDrawable *drawable,
@@ -430,7 +426,6 @@ gdk_window_class_init (GdkWindowObjectClass *klass)
   drawable_class->create_gc = gdk_window_create_gc;
   drawable_class->draw_rectangle = gdk_window_draw_rectangle;
   drawable_class->draw_drawable_with_src = gdk_window_draw_drawable;
-  drawable_class->draw_points = gdk_window_draw_points;
   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;
@@ -4193,41 +4188,6 @@ gdk_window_draw_drawable (GdkDrawable *drawable,
   END_DRAW;
 }
 
-static void
-gdk_window_draw_points (GdkDrawable *drawable,
-			GdkGC       *gc,
-			GdkPoint    *points,
-			gint         npoints)
-{
-  GdkPoint *new_points;
-
-  if (GDK_WINDOW_DESTROYED (drawable))
-    return;
-
-  BEGIN_DRAW;
-
-  if (x_offset != 0 || y_offset != 0)
-    {
-      gint i;
-
-      new_points = g_new (GdkPoint, npoints);
-      for (i=0; i<npoints; i++)
-	{
-	  new_points[i].x = points[i].x - x_offset;
-	  new_points[i].y = points[i].y - y_offset;
-	}
-    }
-  else
-    new_points = points;
-
-  gdk_draw_points (impl, gc, new_points, npoints);
-
-  if (new_points != points)
-    g_free (new_points);
-
-  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 */
diff --git a/gdk/quartz/gdkdrawable-quartz.c b/gdk/quartz/gdkdrawable-quartz.c
index 1f83a80..ec6ed52 100644
--- a/gdk/quartz/gdkdrawable-quartz.c
+++ b/gdk/quartz/gdkdrawable-quartz.c
@@ -265,32 +265,6 @@ gdk_quartz_draw_drawable (GdkDrawable *drawable,
                src_depth, dest_depth);
 }
 
-static void
-gdk_quartz_draw_points (GdkDrawable *drawable,
-			GdkGC       *gc,
-			GdkPoint    *points,
-			gint         npoints)
-{
-  CGContextRef context = gdk_quartz_drawable_get_context (drawable, FALSE);
-  int i;
-
-  if (!context)
-    return;
-
-  _gdk_quartz_gc_update_cg_context (gc, drawable, context,
-				    GDK_QUARTZ_CONTEXT_STROKE |
-				    GDK_QUARTZ_CONTEXT_FILL);
-
-  /* Just draw 1x1 rectangles */
-  for (i = 0; i < npoints; i++) 
-    {
-      CGRect rect = CGRectMake (points[i].x, points[i].y, 1, 1);
-      CGContextFillRect (context, rect);
-    }
-
-  gdk_quartz_drawable_release_context (drawable, context);
-}
-
 static inline void
 gdk_quartz_fix_cap_not_last_line (GdkGCQuartz *private,
 				  gint         x1,
@@ -342,7 +316,6 @@ gdk_drawable_impl_quartz_class_init (GdkDrawableImplQuartzClass *klass)
   drawable_class->create_gc = _gdk_quartz_gc_new;
   drawable_class->draw_rectangle = gdk_quartz_draw_rectangle;
   drawable_class->draw_drawable_with_src = gdk_quartz_draw_drawable;
-  drawable_class->draw_points = gdk_quartz_draw_points;
 
   drawable_class->ref_cairo_surface = gdk_quartz_ref_cairo_surface;
 
diff --git a/gdk/win32/gdkdrawable-win32.c b/gdk/win32/gdkdrawable-win32.c
index b0a730b..fae749f 100644
--- a/gdk/win32/gdkdrawable-win32.c
+++ b/gdk/win32/gdkdrawable-win32.c
@@ -65,10 +65,6 @@ static void gdk_win32_draw_drawable  (GdkDrawable    *drawable,
 				      gint            width,
 				      gint            height,
 				      GdkDrawable    *original_src);
-static void gdk_win32_draw_points    (GdkDrawable    *drawable,
-				      GdkGC          *gc,
-				      GdkPoint       *points,
-				      gint            npoints);
 
 static cairo_surface_t *gdk_win32_ref_cairo_surface (GdkDrawable *drawable);
      
@@ -101,7 +97,6 @@ _gdk_drawable_impl_win32_class_init (GdkDrawableImplWin32Class *klass)
   drawable_class->create_gc = _gdk_win32_gc_new;
   drawable_class->draw_rectangle = gdk_win32_draw_rectangle;
   drawable_class->draw_drawable_with_src = gdk_win32_draw_drawable;
-  drawable_class->draw_points = gdk_win32_draw_points;
   
   drawable_class->ref_cairo_surface = gdk_win32_ref_cairo_surface;
   
@@ -776,37 +771,6 @@ gdk_win32_draw_drawable (GdkDrawable *drawable,
 }
 
 static void
-gdk_win32_draw_points (GdkDrawable *drawable,
-		       GdkGC       *gc,
-		       GdkPoint    *points,
-		       gint         npoints)
-{
-  HDC hdc;
-  HGDIOBJ old_pen;
-  int i;
-
-  hdc = gdk_win32_hdc_get (drawable, gc, GDK_GC_FOREGROUND);
-  
-  GDK_NOTE (DRAW, g_print ("gdk_win32_draw_points: %s %d points\n",
-			   _gdk_win32_drawable_description (drawable),
-			   npoints));
-
-  /* The X11 version uses XDrawPoint(), which doesn't use the fill
-   * mode, so don't use generic_draw. But we should use the current
-   * function, so we can't use SetPixel(). Draw single-pixel
-   * rectangles (sigh).
-   */
-
-  old_pen = SelectObject (hdc, GetStockObject (NULL_PEN));
-  for (i = 0; i < npoints; i++)
-    Rectangle (hdc, points[i].x, points[i].y,
-	       points[i].x + 2, points[i].y + 2);
-
-  SelectObject (hdc, old_pen);
-  gdk_win32_hdc_release (drawable, gc, GDK_GC_FOREGROUND);
-}
-
-static void
 blit_from_pixmap (gboolean              use_fg_bg,
 		  GdkDrawableImplWin32 *dest,
 		  HDC                   hdc,
diff --git a/gdk/x11/gdkdrawable-x11.c b/gdk/x11/gdkdrawable-x11.c
index 37b53bb..7143c4e 100644
--- a/gdk/x11/gdkdrawable-x11.c
+++ b/gdk/x11/gdkdrawable-x11.c
@@ -65,10 +65,6 @@ static void gdk_x11_draw_drawable  (GdkDrawable    *drawable,
 				    gint            width,
 				    gint            height,
 				    GdkDrawable    *original_src);
-static void gdk_x11_draw_points    (GdkDrawable    *drawable,
-				    GdkGC          *gc,
-				    GdkPoint       *points,
-				    gint            npoints);
 
 static cairo_surface_t *gdk_x11_ref_cairo_surface (GdkDrawable *drawable);
      
@@ -97,7 +93,6 @@ _gdk_drawable_impl_x11_class_init (GdkDrawableImplX11Class *klass)
   drawable_class->create_gc = _gdk_x11_gc_new;
   drawable_class->draw_rectangle = gdk_x11_draw_rectangle;
   drawable_class->draw_drawable_with_src = gdk_x11_draw_drawable;
-  drawable_class->draw_points = gdk_x11_draw_points;
   
   drawable_class->ref_cairo_surface = gdk_x11_ref_cairo_surface;
 
@@ -400,49 +395,6 @@ gdk_x11_draw_drawable (GdkDrawable *drawable,
                src_depth, dest_depth);
 }
 
-static void
-gdk_x11_draw_points (GdkDrawable *drawable,
-		     GdkGC       *gc,
-		     GdkPoint    *points,
-		     gint         npoints)
-{
-  GdkDrawableImplX11 *impl;
-
-  impl = GDK_DRAWABLE_IMPL_X11 (drawable);
-
-  
-  /* We special-case npoints == 1, because X will merge multiple
-   * consecutive XDrawPoint requests into a PolyPoint request
-   */
-  if (npoints == 1)
-    {
-      XDrawPoint (GDK_SCREEN_XDISPLAY (impl->screen),
-		  impl->xid,
-		  GDK_GC_GET_XGC (gc),
-		  points[0].x, points[0].y);
-    }
-  else
-    {
-      gint i;
-      XPoint *tmp_points = g_new (XPoint, npoints);
-
-      for (i=0; i<npoints; i++)
-	{
-	  tmp_points[i].x = points[i].x;
-	  tmp_points[i].y = points[i].y;
-	}
-      
-      XDrawPoints (GDK_SCREEN_XDISPLAY (impl->screen),
-		   impl->xid,
-		   GDK_GC_GET_XGC (gc),
-		   tmp_points,
-		   npoints,
-		   CoordModeOrigin);
-
-      g_free (tmp_points);
-    }
-}
-
 static gint
 gdk_x11_get_depth (GdkDrawable *drawable)
 {



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