]> Pileus Git - ~andy/gtk/commitdiff
API: remove gdk_draw_{line,lines,segments}
authorBenjamin Otte <otte@redhat.com>
Thu, 15 Jul 2010 15:58:50 +0000 (17:58 +0200)
committerBenjamin Otte <otte@redhat.com>
Tue, 10 Aug 2010 19:02:27 +0000 (21:02 +0200)
Those were the 3 intermixed line drawing calls.

13 files changed:
docs/reference/gdk/gdk3-sections.txt
docs/reference/gdk/tmpl/drawing.sgml
gdk/directfb/gdkdrawable-directfb.c
gdk/gdk.symbols
gdk/gdkdraw.c
gdk/gdkdrawable.h
gdk/gdkoffscreenwindow.c
gdk/gdkpixmap.c
gdk/gdktypes.h
gdk/gdkwindow.c
gdk/quartz/gdkdrawable-quartz.c
gdk/win32/gdkdrawable-win32.c
gdk/x11/gdkdrawable-x11.c

index 413af2324dd88bcd2c5109982353aa0a1d53155f..b284d0eafc2afe79c7b10551966cf0494d696890 100644 (file)
@@ -336,10 +336,6 @@ gdk_drawable_get_visible_region
 <SUBSECTION>
 gdk_draw_point
 gdk_draw_points
-gdk_draw_line
-gdk_draw_lines
-gdk_draw_segments
-GdkSegment
 gdk_draw_rectangle
 gdk_draw_layout_line
 gdk_draw_layout_line_with_colors
index 19290892b4eaa7a518d1b35c16915605998e43fd..25f5e13a6ebf8ad74174596e95a678507424ab6b 100644 (file)
@@ -147,50 +147,6 @@ or a #GdkWindow.
 @n_points: 
 
 
-<!-- ##### FUNCTION gdk_draw_line ##### -->
-<para>
-</para>
-
-@drawable: 
-@gc: 
-@x1_: 
-@y1_: 
-@x2_: 
-@y2_: 
-
-
-<!-- ##### FUNCTION gdk_draw_lines ##### -->
-<para>
-</para>
-
-@drawable: 
-@gc: 
-@points: 
-lines.
-@n_points: 
-
-
-<!-- ##### FUNCTION gdk_draw_segments ##### -->
-<para>
-</para>
-
-@drawable: 
-@gc: 
-@segs: 
-@n_segs: 
-
-
-<!-- ##### STRUCT GdkSegment ##### -->
-<para>
-Specifies the start and end point of a line for use by the gdk_draw_segments()
-function.
-</para>
-
-@x1: the x coordinate of the start point.
-@y1: the y coordinate of the start point.
-@x2: the x coordinate of the end point.
-@y2: the y coordinate of the end point.
-
 <!-- ##### FUNCTION gdk_draw_rectangle ##### -->
 <para>
 </para>
index 87cfd71b0833b12ef1818bd17fba279cc834d6c6..e89bdc2e684f9eff0cfbdf78ee7daf4df535d65d 100644 (file)
@@ -117,10 +117,6 @@ do {\
 
 static GdkScreen * gdk_directfb_get_screen (GdkDrawable    *drawable);
 static void gdk_drawable_impl_directfb_class_init (GdkDrawableImplDirectFBClass *klass);
-static void gdk_directfb_draw_lines (GdkDrawable *drawable,
-                                     GdkGC       *gc,
-                                     GdkPoint    *points,
-                                     gint         npoints);
 
 static cairo_surface_t *gdk_directfb_ref_cairo_surface (GdkDrawable *drawable);
 
@@ -657,151 +653,6 @@ gdk_directfb_draw_points (GdkDrawable *drawable,
   temp_region_deinit( &clip );
 }
 
-static void
-gdk_directfb_draw_segments (GdkDrawable *drawable,
-                            GdkGC       *gc,
-                            GdkSegment  *segs,
-                            gint         nsegs)
-{
-  GdkDrawableImplDirectFB *impl;
-  cairo_region_t                clip;
-  gint                     i;
-
-//  DFBRegion region = { segs->x1, segs->y1, segs->x2, segs->y2 };
-
-  D_DEBUG_AT( GDKDFB_Drawable, "%s( %p, %p, %p, %d )\n", G_STRFUNC, drawable, gc, segs, nsegs );
-
-  if (nsegs < 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);
-
-  for (i = 0; i < clip.numRects; i++)
-    {
-      DFBRegion reg = { clip.rects[i].x1,   clip.rects[i].y1,
-                        clip.rects[i].x2, clip.rects[i].y2 };
-
-      impl->surface->SetClip (impl->surface, &reg);
-
-      impl->surface->DrawLines (impl->surface, (DFBRegion *)segs, nsegs);
-    }
-
-  temp_region_deinit( &clip );
-
-  /* everything below can be omitted if the drawing is buffered */
-/*  if (impl->buffered)
-    return;
-
-  if (region.x1 > region.x2)
-    {
-      region.x1 = segs->x2;
-      region.x2 = segs->x1;
-    }
-  if (region.y1 > region.y2)
-    {
-      region.y1 = segs->y2;
-      region.y2 = segs->y1;
-    }
-
-  while (nsegs > 1)
-    {
-      nsegs--;
-      segs++;
-
-      if (segs->x1 < region.x1)
-        region.x1 = segs->x1;
-      if (segs->x2 < region.x1)
-        region.x1 = segs->x2;
-
-      if (segs->y1 < region.y1)
-        region.y1 = segs->y1;
-      if (segs->y2 < region.y1)
-        region.y1 = segs->y2;
-
-      if (segs->x1 > region.x2)
-        region.x2 = segs->x1;
-      if (segs->x2 > region.x2)
-        region.x2 = segs->x2;
-
-      if (segs->y1 > region.y2)
-        region.y2 = segs->y1;
-      if (segs->y2 > region.y2)
-        region.y2 = segs->y2;
-    }*/
-}
-
-static void
-gdk_directfb_draw_lines (GdkDrawable *drawable,
-                         GdkGC       *gc,
-                         GdkPoint    *points,
-                         gint         npoints)
-{
-  GdkDrawableImplDirectFB *impl;
-  cairo_region_t                clip;
-  gint                     i;
-
-  DFBRegion lines[npoints > 1 ? npoints - 1 : 1];
-
-  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 < 2)
-    return;
-
-  impl = GDK_DRAWABLE_IMPL_DIRECTFB (drawable);
-
-  if (!gdk_directfb_setup_for_drawing (impl, GDK_GC_DIRECTFB (gc)))
-    return;
-
-  /* create an array of DFBRegions so we can use DrawLines */
-
-  lines[0].x1 = points->x;
-  lines[0].y1 = points->y;
-
-  for (i = 0; i < npoints - 2; i++)
-    {
-      points++;
-
-      lines[i].x2 = lines[i+1].x1 = points->x;
-      lines[i].y2 = lines[i+1].y1 = points->y;
-
-      if (points->x < region.x1)
-        region.x1 = points->x;
-
-      if (points->y < region.y1)
-        region.y1 = points->y;
-
-      if (points->x > region.x2)
-        region.x2 = points->x;
-
-      if (points->y > region.y2)
-        region.y2 = points->y;
-    }
-
-  points++;
-  lines[i].x2 = points->x;
-  lines[i].y2 = points->y;
-
-  gdk_directfb_clip_region (drawable, gc, NULL, &clip);
-
-  for (i = 0; i < clip.numRects; i++)
-    {
-      DFBRegion reg = { clip.rects[i].x1,   clip.rects[i].y1,
-                        clip.rects[i].x2, clip.rects[i].y2 };
-
-      impl->surface->SetClip (impl->surface, &reg);
-      impl->surface->DrawLines (impl->surface, lines, npoints - 1);
-    }
-
-  temp_region_deinit( &clip );
-}
-
 static inline void
 convert_rgba_pixbuf_to_image (guint32 *src,
                               guint    src_pitch,
@@ -901,8 +752,6 @@ gdk_drawable_impl_directfb_class_init (GdkDrawableImplDirectFBClass *klass)
   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->draw_segments  = gdk_directfb_draw_segments;
-  drawable_class->draw_lines     = gdk_directfb_draw_lines;
 
   drawable_class->ref_cairo_surface = gdk_directfb_ref_cairo_surface;
   drawable_class->set_colormap   = gdk_directfb_set_colormap;
index 21604c8b4d2edf5cd4b48f0d20215f975714ce21..e0616c6bb73945d282d1b6427c66cbba837a8ecc 100644 (file)
@@ -550,12 +550,9 @@ gdk_drawable_get_visible_region
 gdk_drawable_get_visual
 gdk_drawable_set_colormap
 gdk_draw_drawable
-gdk_draw_line
-gdk_draw_lines
 gdk_draw_point
 gdk_draw_points
 gdk_draw_rectangle
-gdk_draw_segments
 #endif
 #endif
 
index 8181cc1a89000f69ca68355b2975eae4e21b5639..832685abe70bfc6a4bf72320493fd4e5f93480aa 100644 (file)
@@ -241,38 +241,6 @@ gdk_draw_point (GdkDrawable *drawable,
   GDK_DRAWABLE_GET_CLASS (drawable)->draw_points (drawable, gc, &point, 1);
 }
 
-/**
- * gdk_draw_line:
- * @drawable: a #GdkDrawable (a #GdkWindow or a #GdkPixmap). 
- * @gc: a #GdkGC.
- * @x1_: the x coordinate of the start point.
- * @y1_: the y coordinate of the start point.
- * @x2_: the x coordinate of the end point.
- * @y2_: the y coordinate of the end point.
- * 
- * Draws a line, using the foreground color and other attributes of 
- * the #GdkGC.
- **/
-void
-gdk_draw_line (GdkDrawable *drawable,
-              GdkGC       *gc,
-              gint         x1,
-              gint         y1,
-              gint         x2,
-              gint         y2)
-{
-  GdkSegment segment;
-
-  g_return_if_fail (GDK_IS_DRAWABLE (drawable));
-  g_return_if_fail (GDK_IS_GC (gc));
-
-  segment.x1 = x1;
-  segment.y1 = y1;
-  segment.x2 = x2;
-  segment.y2 = y2;
-  GDK_DRAWABLE_GET_CLASS (drawable)->draw_segments (drawable, gc, &segment, 1);
-}
-
 /**
  * gdk_draw_rectangle:
  * @drawable: a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
@@ -442,66 +410,6 @@ gdk_draw_points (GdkDrawable    *drawable,
                                                   (GdkPoint *) points, n_points);
 }
 
-/**
- * gdk_draw_segments:
- * @drawable: a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
- * @gc: a #GdkGC.
- * @segs: an array of #GdkSegment structures specifying the start and 
- *   end points of the lines to be drawn.
- * @n_segs: the number of line segments to draw, i.e. the size of the 
- *   @segs array.
- * 
- * Draws a number of unconnected lines.
- **/
-void
-gdk_draw_segments (GdkDrawable      *drawable,
-                  GdkGC            *gc,
-                  const GdkSegment *segs,
-                  gint              n_segs)
-{
-  g_return_if_fail (GDK_IS_DRAWABLE (drawable));
-
-  if (n_segs == 0)
-    return;
-
-  g_return_if_fail (segs != NULL);
-  g_return_if_fail (GDK_IS_GC (gc));
-  g_return_if_fail (n_segs >= 0);
-
-  GDK_DRAWABLE_GET_CLASS (drawable)->draw_segments (drawable, gc,
-                                                    (GdkSegment *) segs, n_segs);
-}
-
-/**
- * gdk_draw_lines:
- * @drawable: a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
- * @gc: a #GdkGC.
- * @points: an array of #GdkPoint structures specifying the endpoints of the
- * @n_points: the size of the @points array.
- * 
- * Draws a series of lines connecting the given points.
- * The way in which joins between lines are draw is determined by the
- * #GdkCapStyle value in the #GdkGC. This can be set with
- * gdk_gc_set_line_attributes().
- **/
-void
-gdk_draw_lines (GdkDrawable    *drawable,
-               GdkGC          *gc,
-               const GdkPoint *points,
-               gint            n_points)
-{
-  g_return_if_fail (GDK_IS_DRAWABLE (drawable));
-  g_return_if_fail (points != NULL);
-  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_lines (drawable, gc,
-                                                 (GdkPoint *) points, n_points);
-}
-
 static GdkDrawable *
 gdk_drawable_real_get_composite_drawable (GdkDrawable *drawable,
                                           gint         x,
index 151152c053018137c21274eacb456d46ec30542d..c0d88f2271e937a55e6b8077e7ff085163f08575 100644 (file)
@@ -80,14 +80,6 @@ struct _GdkDrawableClass
                          GdkGC        *gc,
                          GdkPoint     *points,
                          gint          npoints);
-  void (*draw_segments)         (GdkDrawable  *drawable,
-                         GdkGC        *gc,
-                         GdkSegment   *segs,
-                         gint          nsegs);
-  void (*draw_lines)     (GdkDrawable  *drawable,
-                         GdkGC        *gc,
-                         GdkPoint     *points,
-                         gint          npoints);
 
   gint (*get_depth)      (GdkDrawable  *drawable);
   void (*get_size)       (GdkDrawable  *drawable,
@@ -166,12 +158,6 @@ void gdk_draw_point     (GdkDrawable      *drawable,
                         GdkGC            *gc,
                         gint              x,
                         gint              y);
-void gdk_draw_line      (GdkDrawable      *drawable,
-                        GdkGC            *gc,
-                        gint              x1_,
-                        gint              y1_,
-                        gint              x2_,
-                        gint              y2_);
 void gdk_draw_rectangle (GdkDrawable      *drawable,
                         GdkGC            *gc,
                         gboolean          filled,
@@ -192,14 +178,6 @@ void gdk_draw_points    (GdkDrawable      *drawable,
                         GdkGC            *gc,
                         const GdkPoint   *points,
                         gint              n_points);
-void gdk_draw_segments  (GdkDrawable      *drawable,
-                        GdkGC            *gc,
-                        const GdkSegment *segs,
-                        gint              n_segs);
-void gdk_draw_lines     (GdkDrawable      *drawable,
-                        GdkGC            *gc,
-                        const GdkPoint   *points,
-                        gint              n_points);
 
 void gdk_draw_layout_line (GdkDrawable      *drawable,
                           GdkGC            *gc,
index 9a21e0993e16aa431973ee4bf25d4f1bf861d7f3..2ee6f9ec27c59654e150fd01e450fad384968323 100644 (file)
@@ -360,67 +360,6 @@ gdk_offscreen_window_draw_points (GdkDrawable  *drawable,
     }
 }
 
-static void
-gdk_offscreen_window_draw_segments (GdkDrawable  *drawable,
-                                   GdkGC        *gc,
-                                   GdkSegment   *segs,
-                                   gint          nsegs)
-{
-  GdkOffscreenWindow *offscreen = GDK_OFFSCREEN_WINDOW (drawable);
-  GdkDrawable *real_drawable = get_real_drawable (offscreen);
-
-  gdk_draw_segments (real_drawable,
-                    gc,
-                    segs,
-                    nsegs);
-
-  if (nsegs > 0)
-    {
-      int min_x, min_y, max_x, max_y, i;
-
-      min_x = max_x = segs[0].x1;
-      min_y = max_y = segs[0].y1;
-
-       for (i = 0; i < nsegs; i++)
-         {
-           min_x = MIN (min_x, segs[i].x1);
-           max_x = MAX (max_x, segs[i].x1);
-           min_x = MIN (min_x, segs[i].x2);
-           max_x = MAX (max_x, segs[i].x2);
-           min_y = MIN (min_y, segs[i].y1);
-           max_y = MAX (max_y, segs[i].y1);
-           min_y = MIN (min_y, segs[i].y2);
-           max_y = MAX (max_y, segs[i].y2);
-         }
-
-       add_damage (offscreen, min_x, min_y,
-                   max_x - min_x,
-                   max_y - min_y, TRUE);
-    }
-
-}
-
-static void
-gdk_offscreen_window_draw_lines (GdkDrawable  *drawable,
-                                GdkGC        *gc,
-                                GdkPoint     *points,
-                                gint          npoints)
-{
-  GdkOffscreenWindow *offscreen = GDK_OFFSCREEN_WINDOW (drawable);
-  GdkDrawable *real_drawable = get_real_drawable (offscreen);
-  GdkWindowObject *private = GDK_WINDOW_OBJECT (offscreen->wrapper);
-
-  gdk_draw_lines (real_drawable,
-                 gc,
-                 points,
-                 npoints);
-
-  /* Hard to compute the minimal size, as we don't know the line
-     width, and since joins are hard to calculate.
-     Its not that often used anyway, damage it all */
-  add_damage (offscreen, 0, 0, private->width, private->height, TRUE);
-}
-
 void
 _gdk_offscreen_window_new (GdkWindow     *window,
                           GdkScreen     *screen,
@@ -1048,8 +987,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;
-  drawable_class->draw_segments = gdk_offscreen_window_draw_segments;
-  drawable_class->draw_lines = gdk_offscreen_window_draw_lines;
 }
 
 static void
index 9d0465b561d58d7e604522687140d78c0f033373..3df695be2950c186d1da87dc13344af97f4596ec 100644 (file)
@@ -55,14 +55,6 @@ static void   gdk_pixmap_draw_points    (GdkDrawable     *drawable,
                                         GdkGC           *gc,
                                         GdkPoint        *points,
                                         gint             npoints);
-static void   gdk_pixmap_draw_segments  (GdkDrawable     *drawable,
-                                        GdkGC           *gc,
-                                        GdkSegment      *segs,
-                                        gint             nsegs);
-static void   gdk_pixmap_draw_lines     (GdkDrawable     *drawable,
-                                        GdkGC           *gc,
-                                        GdkPoint        *points,
-                                        gint             npoints);
 
 static void   gdk_pixmap_real_get_size  (GdkDrawable     *drawable,
                                          gint            *width,
@@ -124,8 +116,6 @@ gdk_pixmap_class_init (GdkPixmapObjectClass *klass)
   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->draw_segments = gdk_pixmap_draw_segments;
-  drawable_class->draw_lines = gdk_pixmap_draw_lines;
   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;
@@ -256,30 +246,6 @@ gdk_pixmap_draw_points (GdkDrawable *drawable,
   gdk_draw_points (private->impl, gc, points, npoints);
 }
 
-static void
-gdk_pixmap_draw_segments (GdkDrawable *drawable,
-                         GdkGC       *gc,
-                         GdkSegment  *segs,
-                         gint         nsegs)
-{
-  GdkPixmapObject *private = (GdkPixmapObject *)drawable;
-
-  _gdk_gc_remove_drawable_clip (gc);  
-  gdk_draw_segments (private->impl, gc, segs, nsegs);
-}
-
-static void
-gdk_pixmap_draw_lines (GdkDrawable *drawable,
-                      GdkGC       *gc,
-                      GdkPoint    *points,
-                      gint         npoints)
-{
-  GdkPixmapObject *private = (GdkPixmapObject *)drawable;
-
-  _gdk_gc_remove_drawable_clip (gc);  
-  gdk_draw_lines (private->impl, gc, points, npoints);
-}
-
 static void
 gdk_pixmap_real_get_size (GdkDrawable *drawable,
                           gint *width,
index aaba5898bfcca9e935269e4ccd42d0ac8c34f968..b86cecc8ce0f294ea64017e8818f1c9bcbe31081 100644 (file)
@@ -75,7 +75,6 @@ G_BEGIN_DECLS
  */
 typedef struct _GdkPoint             GdkPoint;
 typedef cairo_rectangle_int_t        GdkRectangle;
-typedef struct _GdkSegment           GdkSegment;
 typedef struct _GdkSpan                      GdkSpan;
 
 typedef struct _GdkAtom            *GdkAtom;
@@ -270,14 +269,6 @@ struct _GdkPoint
   gint y;
 };
 
-struct _GdkSegment
-{
-  gint x1;
-  gint y1;
-  gint x2;
-  gint y2;
-};
-
 struct _GdkSpan
 {
   gint x;
index d6f2d7239336bdfbc323455c4fb3f7241e614c4e..0178c2dbe362a804e3362fb3fe64d80330a23943 100644 (file)
@@ -250,14 +250,6 @@ static void   gdk_window_draw_points    (GdkDrawable     *drawable,
                                         GdkGC           *gc,
                                         GdkPoint        *points,
                                         gint             npoints);
-static void   gdk_window_draw_segments  (GdkDrawable     *drawable,
-                                        GdkGC           *gc,
-                                        GdkSegment      *segs,
-                                        gint             nsegs);
-static void   gdk_window_draw_lines     (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,
@@ -439,8 +431,6 @@ gdk_window_class_init (GdkWindowObjectClass *klass)
   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->draw_segments = gdk_window_draw_segments;
-  drawable_class->draw_lines = gdk_window_draw_lines;
   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;
@@ -4239,78 +4229,6 @@ gdk_window_draw_points (GdkDrawable *drawable,
   END_DRAW;
 }
 
-static void
-gdk_window_draw_segments (GdkDrawable *drawable,
-                         GdkGC       *gc,
-                         GdkSegment  *segs,
-                         gint         nsegs)
-{
-  GdkSegment *new_segs;
-
-  if (GDK_WINDOW_DESTROYED (drawable))
-    return;
-
-  BEGIN_DRAW;
-
-  if (x_offset != 0 || y_offset != 0)
-    {
-      gint i;
-
-      new_segs = g_new (GdkSegment, nsegs);
-      for (i=0; i<nsegs; i++)
-       {
-         new_segs[i].x1 = segs[i].x1 - x_offset;
-         new_segs[i].y1 = segs[i].y1 - y_offset;
-         new_segs[i].x2 = segs[i].x2 - x_offset;
-         new_segs[i].y2 = segs[i].y2 - y_offset;
-       }
-    }
-  else
-    new_segs = segs;
-
-  gdk_draw_segments (impl, gc, new_segs, nsegs);
-
-  if (new_segs != segs)
-    g_free (new_segs);
-
-  END_DRAW;
-}
-
-static void
-gdk_window_draw_lines (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_lines (impl, gc, new_points, npoints);
-
-  if (new_points != points)
-    g_free (new_points);
-
-  END_DRAW;
-}
-
 static cairo_t *
 setup_backing_rect (GdkWindow *window, GdkWindowPaint *paint, int x_offset_cairo, int y_offset_cairo)
 {
index f7d365f047d76f62860ccc8db39004e953b61e7e..1f83a807bd1c535cb41c06254cdd6d0cfb6a6471 100644 (file)
@@ -318,80 +318,6 @@ gdk_quartz_fix_cap_not_last_line (GdkGCQuartz *private,
     }
 }
 
-static void
-gdk_quartz_draw_segments (GdkDrawable    *drawable,
-                         GdkGC          *gc,
-                         GdkSegment     *segs,
-                         gint            nsegs)
-{
-  CGContextRef context = gdk_quartz_drawable_get_context (drawable, FALSE);
-  GdkGCQuartz *private;
-  int i;
-
-  if (!context)
-    return;
-
-  private = GDK_GC_QUARTZ (gc);
-
-  _gdk_quartz_gc_update_cg_context (gc, drawable, context,
-                                   GDK_QUARTZ_CONTEXT_STROKE);
-
-  for (i = 0; i < nsegs; i++)
-    {
-      gint xfix, yfix;
-
-      gdk_quartz_fix_cap_not_last_line (private,
-                                       segs[i].x1, segs[i].y1,
-                                       segs[i].x2, segs[i].y2,
-                                       &xfix, &yfix);
-
-      CGContextMoveToPoint (context, segs[i].x1 + 0.5, segs[i].y1 + 0.5);
-      CGContextAddLineToPoint (context, segs[i].x2 + 0.5 + xfix, segs[i].y2 + 0.5 + yfix);
-    }
-  
-  CGContextStrokePath (context);
-
-  gdk_quartz_drawable_release_context (drawable, context);
-}
-
-static void
-gdk_quartz_draw_lines (GdkDrawable *drawable,
-                      GdkGC       *gc,
-                      GdkPoint    *points,
-                      gint         npoints)
-{
-  CGContextRef context = gdk_quartz_drawable_get_context (drawable, FALSE);
-  GdkGCQuartz *private;
-  gint xfix, yfix;
-  gint i;
-
-  if (!context)
-    return;
-
-  private = GDK_GC_QUARTZ (gc);
-
-  _gdk_quartz_gc_update_cg_context (gc, drawable, context,
-                                   GDK_QUARTZ_CONTEXT_STROKE);
-
-  CGContextMoveToPoint (context, points[0].x + 0.5, points[0].y + 0.5);
-
-  for (i = 1; i < npoints - 1; i++)
-    CGContextAddLineToPoint (context, points[i].x + 0.5, points[i].y + 0.5);
-
-  gdk_quartz_fix_cap_not_last_line (private,
-                                   points[npoints - 2].x, points[npoints - 2].y,
-                                   points[npoints - 1].x, points[npoints - 1].y,
-                                   &xfix, &yfix);
-
-  CGContextAddLineToPoint (context,
-                          points[npoints - 1].x + 0.5 + xfix,
-                          points[npoints - 1].y + 0.5 + yfix);
-
-  CGContextStrokePath (context);
-
-  gdk_quartz_drawable_release_context (drawable, context);
-}
-
 static void
 gdk_drawable_impl_quartz_finalize (GObject *object)
 {
@@ -417,8 +343,6 @@ gdk_drawable_impl_quartz_class_init (GdkDrawableImplQuartzClass *klass)
   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->draw_segments = gdk_quartz_draw_segments;
-  drawable_class->draw_lines = gdk_quartz_draw_lines;
 
   drawable_class->ref_cairo_surface = gdk_quartz_ref_cairo_surface;
 
index 4f6a562d41cf34ff53bb21938273ca9218b0845d..b0a730b061feb6884c4cc895f2d25ea3663cbad9 100644 (file)
@@ -69,14 +69,6 @@ static void gdk_win32_draw_points    (GdkDrawable    *drawable,
                                      GdkGC          *gc,
                                      GdkPoint       *points,
                                      gint            npoints);
-static void gdk_win32_draw_segments  (GdkDrawable    *drawable,
-                                     GdkGC          *gc,
-                                     GdkSegment     *segs,
-                                     gint            nsegs);
-static void gdk_win32_draw_lines     (GdkDrawable    *drawable,
-                                     GdkGC          *gc,
-                                     GdkPoint       *points,
-                                     gint            npoints);
 
 static cairo_surface_t *gdk_win32_ref_cairo_surface (GdkDrawable *drawable);
      
@@ -110,8 +102,6 @@ _gdk_drawable_impl_win32_class_init (GdkDrawableImplWin32Class *klass)
   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->draw_segments = gdk_win32_draw_segments;
-  drawable_class->draw_lines = gdk_win32_draw_lines;
   
   drawable_class->ref_cairo_surface = gdk_win32_ref_cairo_surface;
   
@@ -816,229 +806,6 @@ gdk_win32_draw_points (GdkDrawable *drawable,
   gdk_win32_hdc_release (drawable, gc, GDK_GC_FOREGROUND);
 }
 
-static void
-draw_segments (GdkGCWin32 *gcwin32,
-              HDC         hdc,
-              gint        x_offset,
-              gint        y_offset,
-              va_list     args)
-{
-  GdkSegment *segs;
-  gint nsegs;
-  gint i;
-
-  segs = va_arg (args, GdkSegment *);
-  nsegs = va_arg (args, gint);
-
-  if (x_offset != 0 || y_offset != 0)
-    {
-      /* must not modify in place, but could splice in the offset all below */
-      segs = g_memdup (segs, nsegs * sizeof (GdkSegment));
-      for (i = 0; i < nsegs; i++)
-        {
-          segs[i].x1 -= x_offset;
-          segs[i].y1 -= y_offset;
-          segs[i].x2 -= x_offset;
-          segs[i].y2 -= y_offset;
-        }
-    }
-
-  if (MUST_RENDER_DASHES_MANUALLY (gcwin32))
-    {
-      for (i = 0; i < nsegs; i++)
-       {
-         if (segs[i].x1 == segs[i].x2)
-           {
-             int y1, y2;
-             
-             if (segs[i].y1 <= segs[i].y2)
-               y1 = segs[i].y1, y2 = segs[i].y2;
-             else
-               y1 = segs[i].y2, y2 = segs[i].y1;
-             
-             render_line_vertical (gcwin32, segs[i].x1, y1, y2);
-           }
-         else if (segs[i].y1 == segs[i].y2)
-           {
-             int x1, x2;
-             
-             if (segs[i].x1 <= segs[i].x2)
-               x1 = segs[i].x1, x2 = segs[i].x2;
-             else
-               x1 = segs[i].x2, x2 = segs[i].x1;
-             
-             render_line_horizontal (gcwin32, x1, x2, segs[i].y1);
-           }
-         else
-           GDI_CALL (MoveToEx, (hdc, segs[i].x1, segs[i].y1, NULL)) &&
-             GDI_CALL (LineTo, (hdc, segs[i].x2, segs[i].y2));
-       }
-    }
-  else
-    {
-      for (i = 0; i < nsegs; i++)
-       {
-         const GdkSegment *ps = &segs[i];
-         const int x1 = ps->x1, y1 = ps->y1;
-         int x2 = ps->x2, y2 = ps->y2;
-
-         GDK_NOTE (DRAW, g_print (" +%d+%d..+%d+%d", x1, y1, x2, y2));
-         GDI_CALL (MoveToEx, (hdc, x1, y1, NULL)) &&
-           GDI_CALL (LineTo, (hdc, x2, y2));
-       }
-
-      GDK_NOTE (DRAW, g_print ("\n"));
-    }
-  if (x_offset != 0 || y_offset != 0)
-    g_free (segs);
-}
-
-static void
-gdk_win32_draw_segments (GdkDrawable *drawable,
-                        GdkGC       *gc,
-                        GdkSegment  *segs,
-                        gint         nsegs)
-{
-  GdkRectangle bounds;
-  cairo_region_t *region;
-  gint i;
-
-  GDK_NOTE (DRAW, g_print ("gdk_win32_draw_segments: %s %d segs\n",
-                          _gdk_win32_drawable_description (drawable),
-                          nsegs));
-
-  bounds.x = G_MAXINT;
-  bounds.y = G_MAXINT;
-  bounds.width = 0;
-  bounds.height = 0;
-
-  for (i = 0; i < nsegs; i++)
-    {
-      bounds.x = MIN (bounds.x, segs[i].x1);
-      bounds.x = MIN (bounds.x, segs[i].x2);
-      bounds.y = MIN (bounds.y, segs[i].y1);
-      bounds.y = MIN (bounds.y, segs[i].y2);
-    }
-
-  for (i = 0; i < nsegs; i++)
-    {
-      bounds.width = MAX (bounds.width, segs[i].x1 - bounds.x);
-      bounds.width = MAX (bounds.width, segs[i].x2 - bounds.x);
-      bounds.height = MAX (bounds.height, segs[i].y1 - bounds.y);
-      bounds.height = MAX (bounds.height, segs[i].y2 - bounds.y);
-    }
-
-  region = widen_bounds (&bounds, GDK_GC_WIN32 (gc)->pen_width);
-
-  generic_draw (drawable, gc, GDK_GC_FOREGROUND | LINE_ATTRIBUTES,
-               draw_segments, region, segs, nsegs);
-
-  cairo_region_destroy (region);
-}
-
-static void
-draw_lines (GdkGCWin32 *gcwin32,
-           HDC         hdc,
-           gint        x_offset,
-           gint        y_offset,
-           va_list     args)
-{
-  POINT *pts;
-  gint npoints;
-  gint i;
-
-  pts = va_arg (args, POINT *);
-  npoints = va_arg (args, gint);
-
-  if (x_offset != 0 || y_offset != 0)
-    for (i = 0; i < npoints; i++)
-      {
-       pts[i].x -= x_offset;
-       pts[i].y -= y_offset;
-      }
-  
-  if (MUST_RENDER_DASHES_MANUALLY (gcwin32))
-    {
-      for (i = 0; i < npoints - 1; i++)
-        {
-         if (pts[i].x == pts[i+1].x)
-           {
-             int y1, y2;
-             if (pts[i].y > pts[i+1].y)
-               y1 = pts[i+1].y, y2 = pts[i].y;
-             else
-               y1 = pts[i].y, y2 = pts[i+1].y;
-             
-             render_line_vertical (gcwin32, pts[i].x, y1, y2);
-           }
-         else if (pts[i].y == pts[i+1].y)
-           {
-             int x1, x2;
-             if (pts[i].x > pts[i+1].x)
-               x1 = pts[i+1].x, x2 = pts[i].x;
-             else
-               x1 = pts[i].x, x2 = pts[i+1].x;
-
-             render_line_horizontal (gcwin32, x1, x2, pts[i].y);
-           }
-         else
-           GDI_CALL (MoveToEx, (hdc, pts[i].x, pts[i].y, NULL)) &&
-             GDI_CALL (LineTo, (hdc, pts[i+1].x, pts[i+1].y));
-       }
-    }
-  else
-    GDI_CALL (Polyline, (hdc, pts, npoints));
-}
-
-static void
-gdk_win32_draw_lines (GdkDrawable *drawable,
-                     GdkGC       *gc,
-                     GdkPoint    *points,
-                     gint         npoints)
-{
-  GdkRectangle bounds;
-  cairo_region_t *region;
-  POINT *pts;
-  int i;
-
-  GDK_NOTE (DRAW, g_print ("gdk_win32_draw_lines: %s %d points\n",
-                          _gdk_win32_drawable_description (drawable),
-                          npoints));
-
-  if (npoints < 2)
-    return;
-
-  bounds.x = G_MAXINT;
-  bounds.y = G_MAXINT;
-  bounds.width = 0;
-  bounds.height = 0;
-
-  pts = g_new (POINT, npoints);
-
-  for (i = 0; i < npoints; i++)
-    {
-      bounds.x = MIN (bounds.x, points[i].x);
-      bounds.y = MIN (bounds.y, points[i].y);
-      pts[i].x = points[i].x;
-      pts[i].y = points[i].y;
-    }
-
-  for (i = 0; i < npoints; i++)
-    {
-      bounds.width = MAX (bounds.width, points[i].x - bounds.x);
-      bounds.height = MAX (bounds.height, points[i].y - bounds.y);
-    }
-
-  region = widen_bounds (&bounds, GDK_GC_WIN32 (gc)->pen_width);
-
-  generic_draw (drawable, gc, GDK_GC_FOREGROUND | GDK_GC_BACKGROUND |
-                             LINE_ATTRIBUTES,
-               draw_lines, region, pts, npoints);
-
-  cairo_region_destroy (region);
-  g_free (pts);
-}
-
 static void
 blit_from_pixmap (gboolean              use_fg_bg,
                  GdkDrawableImplWin32 *dest,
index b15637606178dc862e84adb1e27b47a7f631e853..4261c6f9beac6d0db01c888602106d1d25d32844 100644 (file)
@@ -69,14 +69,6 @@ static void gdk_x11_draw_points    (GdkDrawable    *drawable,
                                    GdkGC          *gc,
                                    GdkPoint       *points,
                                    gint            npoints);
-static void gdk_x11_draw_segments  (GdkDrawable    *drawable,
-                                   GdkGC          *gc,
-                                   GdkSegment     *segs,
-                                   gint            nsegs);
-static void gdk_x11_draw_lines     (GdkDrawable    *drawable,
-                                   GdkGC          *gc,
-                                   GdkPoint       *points,
-                                   gint            npoints);
 
 static cairo_surface_t *gdk_x11_ref_cairo_surface (GdkDrawable *drawable);
      
@@ -106,8 +98,6 @@ _gdk_drawable_impl_x11_class_init (GdkDrawableImplX11Class *klass)
   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->draw_segments = gdk_x11_draw_segments;
-  drawable_class->draw_lines = gdk_x11_draw_lines;
   
   drawable_class->ref_cairo_surface = gdk_x11_ref_cairo_surface;
 
@@ -453,76 +443,6 @@ gdk_x11_draw_points (GdkDrawable *drawable,
     }
 }
 
-static void
-gdk_x11_draw_segments (GdkDrawable *drawable,
-                      GdkGC       *gc,
-                      GdkSegment  *segs,
-                      gint         nsegs)
-{
-  GdkDrawableImplX11 *impl;
-
-  impl = GDK_DRAWABLE_IMPL_X11 (drawable);
-
-  
-  /* We special-case nsegs == 1, because X will merge multiple
-   * consecutive XDrawLine requests into a PolySegment request
-   */
-  if (nsegs == 1)
-    {
-      XDrawLine (GDK_SCREEN_XDISPLAY (impl->screen), impl->xid,
-                GDK_GC_GET_XGC (gc), segs[0].x1, segs[0].y1,
-                segs[0].x2, segs[0].y2);
-    }
-  else
-    {
-      gint i;
-      XSegment *tmp_segs = g_new (XSegment, nsegs);
-
-      for (i=0; i<nsegs; i++)
-       {
-         tmp_segs[i].x1 = segs[i].x1;
-         tmp_segs[i].x2 = segs[i].x2;
-         tmp_segs[i].y1 = segs[i].y1;
-         tmp_segs[i].y2 = segs[i].y2;
-       }
-      
-      XDrawSegments (GDK_SCREEN_XDISPLAY (impl->screen),
-                    impl->xid,
-                    GDK_GC_GET_XGC (gc),
-                    tmp_segs, nsegs);
-
-      g_free (tmp_segs);
-    }
-}
-
-static void
-gdk_x11_draw_lines (GdkDrawable *drawable,
-                   GdkGC       *gc,
-                   GdkPoint    *points,
-                   gint         npoints)
-{
-  gint i;
-  XPoint *tmp_points = g_new (XPoint, npoints);
-  GdkDrawableImplX11 *impl;
-
-  impl = GDK_DRAWABLE_IMPL_X11 (drawable);
-
-  
-  for (i=0; i<npoints; i++)
-    {
-      tmp_points[i].x = points[i].x;
-      tmp_points[i].y = points[i].y;
-    }
-      
-  XDrawLines (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)
 {