From 7e28f52dd746a0c69dde93afe3f2d79375e14de1 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Sun, 19 Sep 2010 18:58:23 +0200 Subject: [PATCH] app: remove unused clipping functions in GimpDrawTool and GimpCanvas --- app/display/gimpcanvas.c | 48 ---------------------------------------- app/display/gimpcanvas.h | 6 ----- app/tools/gimpdrawtool.c | 38 ------------------------------- app/tools/gimpdrawtool.h | 4 ---- 4 files changed, 96 deletions(-) diff --git a/app/display/gimpcanvas.c b/app/display/gimpcanvas.c index 91fe17b7f4..c6d1c5c322 100644 --- a/app/display/gimpcanvas.c +++ b/app/display/gimpcanvas.c @@ -549,54 +549,6 @@ gimp_canvas_get_layout (GimpCanvas *canvas, return canvas->layout; } -/** - * gimp_canvas_set_clip_rect: - * @canvas: a #GimpCanvas widget - * @style: one of the enumerated #GimpCanvasStyle's. - * @rect: a #GdkRectangle to set the bounds of the clipping area. - * - * Sets a rectangular clipping area for the specified style. - **/ -void -gimp_canvas_set_clip_rect (GimpCanvas *canvas, - GimpCanvasStyle style, - const GdkRectangle *rect) -{ - if (! canvas->gc[style]) - { - if (! rect) - return; - - canvas->gc[style] = gimp_canvas_gc_new (canvas, style); - } - - gdk_gc_set_clip_rectangle (canvas->gc[style], rect); -} - -/** - * gimp_canvas_set_clip_region: - * @canvas: a #GimpCanvas widget - * @style: one of the enumerated #GimpCanvasStyle's. - * @region: a #GdkRegion to set the bounds of the clipping area. - * - * Sets a clipping region for the specified style. - **/ -void -gimp_canvas_set_clip_region (GimpCanvas *canvas, - GimpCanvasStyle style, - const GdkRegion *region) -{ - if (! canvas->gc[style]) - { - if (! region) - return; - - canvas->gc[style] = gimp_canvas_gc_new (canvas, style); - } - - gdk_gc_set_clip_region (canvas->gc[style], region); -} - /** * gimp_canvas_set_bg_color: * @canvas: a #GimpCanvas widget diff --git a/app/display/gimpcanvas.h b/app/display/gimpcanvas.h index 060424b758..4203b8f27b 100644 --- a/app/display/gimpcanvas.h +++ b/app/display/gimpcanvas.h @@ -116,12 +116,6 @@ PangoLayout *gimp_canvas_get_layout (GimpCanvas *canvas, const gchar *format, ...) G_GNUC_PRINTF (2, 3); -void gimp_canvas_set_clip_rect (GimpCanvas *canvas, - GimpCanvasStyle style, - const GdkRectangle *rect); -void gimp_canvas_set_clip_region (GimpCanvas *canvas, - GimpCanvasStyle style, - const GdkRegion *region); void gimp_canvas_set_bg_color (GimpCanvas *canvas, GimpRGB *color); diff --git a/app/tools/gimpdrawtool.c b/app/tools/gimpdrawtool.c index 57be3a6ac6..252203833b 100644 --- a/app/tools/gimpdrawtool.c +++ b/app/tools/gimpdrawtool.c @@ -383,44 +383,6 @@ gimp_draw_tool_in_radius (GimpDrawTool *draw_tool, x1, y1, x2, y2) < SQR (radius)); } -void -gimp_draw_tool_set_clip_rect (GimpDrawTool *draw_tool, - GdkRectangle *rect, - gboolean use_offsets) -{ - GimpDisplayShell *shell; - - g_return_if_fail (GIMP_IS_DRAW_TOOL (draw_tool)); - - shell = gimp_display_get_shell (draw_tool->display); - - if (rect) - { - GdkRectangle r; - - gimp_display_shell_transform_xy (shell, - rect->x + rect->width, - rect->y + rect->height, - &r.width, &r.height, - use_offsets); - gimp_display_shell_transform_xy (shell, - rect->x, rect->y, - &r.x, &r.y, - use_offsets); - - r.width -= r.x; - r.height -= r.y; - - gimp_canvas_set_clip_rect (GIMP_CANVAS (shell->canvas), - GIMP_CANVAS_STYLE_XOR, &r); - } - else - { - gimp_canvas_set_clip_rect (GIMP_CANVAS (shell->canvas), - GIMP_CANVAS_STYLE_XOR, NULL); - } -} - /** * gimp_draw_tool_draw_line: * @draw_tool: the #GimpDrawTool diff --git a/app/tools/gimpdrawtool.h b/app/tools/gimpdrawtool.h index f4616e68f2..e2d010fa9f 100644 --- a/app/tools/gimpdrawtool.h +++ b/app/tools/gimpdrawtool.h @@ -101,10 +101,6 @@ gboolean gimp_draw_tool_in_radius (GimpDrawTool *draw_tool, gdouble y2, gint radius); -void gimp_draw_tool_set_clip_rect (GimpDrawTool *draw_tool, - GdkRectangle *rect, - gboolean use_offsets); - void gimp_draw_tool_draw_line (GimpDrawTool *draw_tool, gdouble x1, gdouble y1,