app: rename all gimp_draw_tool_draw_foo() functions

to gimp_draw_tool_add_foo() because that's what they do now.
This commit is contained in:
Michael Natterer 2010-09-25 19:02:22 +02:00
parent 5089b9a706
commit b3af235e79
23 changed files with 622 additions and 617 deletions

View File

@ -665,8 +665,7 @@ gimp_align_tool_draw (GimpDrawTool *draw_tool)
w = MAX (align_tool->x1, align_tool->x0) - x;
h = MAX (align_tool->y1, align_tool->y0) - y;
gimp_draw_tool_draw_rectangle (draw_tool, FALSE,
x, y, w, h);
gimp_draw_tool_add_rectangle (draw_tool, FALSE, x, y, w, h);
for (list = align_tool->selected_objects;
list;
@ -696,18 +695,18 @@ gimp_align_tool_draw (GimpDrawTool *draw_tool)
h = gimp_item_get_height (item);
}
gimp_draw_tool_draw_handle (draw_tool, GIMP_HANDLE_FILLED_SQUARE,
x, y, MARKER_WIDTH, MARKER_WIDTH,
GTK_ANCHOR_NORTH_WEST);
gimp_draw_tool_draw_handle (draw_tool, GIMP_HANDLE_FILLED_SQUARE,
x + w, y, MARKER_WIDTH, MARKER_WIDTH,
GTK_ANCHOR_NORTH_EAST);
gimp_draw_tool_draw_handle (draw_tool, GIMP_HANDLE_FILLED_SQUARE,
x, y + h, MARKER_WIDTH, MARKER_WIDTH,
GTK_ANCHOR_SOUTH_WEST);
gimp_draw_tool_draw_handle (draw_tool, GIMP_HANDLE_FILLED_SQUARE,
x + w, y + h, MARKER_WIDTH, MARKER_WIDTH,
GTK_ANCHOR_SOUTH_EAST);
gimp_draw_tool_add_handle (draw_tool, GIMP_HANDLE_FILLED_SQUARE,
x, y, MARKER_WIDTH, MARKER_WIDTH,
GTK_ANCHOR_NORTH_WEST);
gimp_draw_tool_add_handle (draw_tool, GIMP_HANDLE_FILLED_SQUARE,
x + w, y, MARKER_WIDTH, MARKER_WIDTH,
GTK_ANCHOR_NORTH_EAST);
gimp_draw_tool_add_handle (draw_tool, GIMP_HANDLE_FILLED_SQUARE,
x, y + h, MARKER_WIDTH, MARKER_WIDTH,
GTK_ANCHOR_SOUTH_WEST);
gimp_draw_tool_add_handle (draw_tool, GIMP_HANDLE_FILLED_SQUARE,
x + w, y + h, MARKER_WIDTH, MARKER_WIDTH,
GTK_ANCHOR_SOUTH_EAST);
}
else if (GIMP_IS_GUIDE (list->data))
{
@ -721,23 +720,23 @@ gimp_align_tool_draw (GimpDrawTool *draw_tool)
case GIMP_ORIENTATION_VERTICAL:
x = gimp_guide_get_position (guide);
h = gimp_image_get_height (image);
gimp_draw_tool_draw_handle (draw_tool, GIMP_HANDLE_FILLED_SQUARE,
x, h, MARKER_WIDTH, MARKER_WIDTH,
GTK_ANCHOR_SOUTH);
gimp_draw_tool_draw_handle (draw_tool, GIMP_HANDLE_FILLED_SQUARE,
x, 0, MARKER_WIDTH, MARKER_WIDTH,
GTK_ANCHOR_NORTH);
gimp_draw_tool_add_handle (draw_tool, GIMP_HANDLE_FILLED_SQUARE,
x, h, MARKER_WIDTH, MARKER_WIDTH,
GTK_ANCHOR_SOUTH);
gimp_draw_tool_add_handle (draw_tool, GIMP_HANDLE_FILLED_SQUARE,
x, 0, MARKER_WIDTH, MARKER_WIDTH,
GTK_ANCHOR_NORTH);
break;
case GIMP_ORIENTATION_HORIZONTAL:
y = gimp_guide_get_position (guide);
w = gimp_image_get_width (image);
gimp_draw_tool_draw_handle (draw_tool, GIMP_HANDLE_FILLED_SQUARE,
w, y, MARKER_WIDTH, MARKER_WIDTH,
GTK_ANCHOR_EAST);
gimp_draw_tool_draw_handle (draw_tool, GIMP_HANDLE_FILLED_SQUARE,
0, y, MARKER_WIDTH, MARKER_WIDTH,
GTK_ANCHOR_WEST);
gimp_draw_tool_add_handle (draw_tool, GIMP_HANDLE_FILLED_SQUARE,
w, y, MARKER_WIDTH, MARKER_WIDTH,
GTK_ANCHOR_EAST);
gimp_draw_tool_add_handle (draw_tool, GIMP_HANDLE_FILLED_SQUARE,
0, y, MARKER_WIDTH, MARKER_WIDTH,
GTK_ANCHOR_WEST);
break;
default:

View File

@ -380,29 +380,29 @@ gimp_blend_tool_draw (GimpDrawTool *draw_tool)
GimpBlendTool *blend_tool = GIMP_BLEND_TOOL (draw_tool);
/* Draw the line between the start and end coords */
gimp_draw_tool_draw_line (draw_tool,
blend_tool->start_x,
blend_tool->start_y,
blend_tool->end_x,
blend_tool->end_y);
gimp_draw_tool_add_line (draw_tool,
blend_tool->start_x,
blend_tool->start_y,
blend_tool->end_x,
blend_tool->end_y);
/* Draw start target */
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_CROSS,
blend_tool->start_x,
blend_tool->start_y,
TARGET_SIZE,
TARGET_SIZE,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_CROSS,
blend_tool->start_x,
blend_tool->start_y,
TARGET_SIZE,
TARGET_SIZE,
GTK_ANCHOR_CENTER);
/* Draw end target */
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_CROSS,
blend_tool->end_x,
blend_tool->end_y,
TARGET_SIZE,
TARGET_SIZE,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_CROSS,
blend_tool->end_x,
blend_tool->end_y,
TARGET_SIZE,
TARGET_SIZE,
GTK_ANCHOR_CENTER);
}
static void

View File

@ -336,16 +336,16 @@ gimp_brush_tool_draw_brush (GimpBrushTool *brush_tool,
#undef EPSILON
}
gimp_draw_tool_draw_boundary (draw_tool,
brush_core->transformed_brush_bound_segs,
brush_core->n_brush_bound_segs,
x, y);
gimp_draw_tool_add_boundary (draw_tool,
brush_core->transformed_brush_bound_segs,
brush_core->n_brush_bound_segs,
x, y);
}
else if (draw_fallback)
{
gimp_draw_tool_draw_handle (draw_tool, GIMP_HANDLE_CROSS,
x, y,
5, 5, GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool, GIMP_HANDLE_CROSS,
x, y,
5, 5, GTK_ANCHOR_CENTER);
}
}
}

View File

@ -575,14 +575,14 @@ gimp_color_tool_draw (GimpDrawTool *draw_tool)
{
GimpImage *image = gimp_display_get_image (draw_tool->display);
gimp_draw_tool_draw_line (draw_tool,
0, color_tool->sample_point_y + 0.5,
gimp_image_get_width (image),
color_tool->sample_point_y + 0.5);
gimp_draw_tool_draw_line (draw_tool,
color_tool->sample_point_x + 0.5, 0,
color_tool->sample_point_x + 0.5,
gimp_image_get_height (image));
gimp_draw_tool_add_line (draw_tool,
0, color_tool->sample_point_y + 0.5,
gimp_image_get_width (image),
color_tool->sample_point_y + 0.5);
gimp_draw_tool_add_line (draw_tool,
color_tool->sample_point_x + 0.5, 0,
color_tool->sample_point_x + 0.5,
gimp_image_get_height (image));
}
}
else
@ -591,12 +591,12 @@ gimp_color_tool_draw (GimpDrawTool *draw_tool)
{
gdouble radius = color_tool->options->average_radius;
gimp_draw_tool_draw_rectangle (draw_tool,
FALSE,
color_tool->center_x - radius,
color_tool->center_y - radius,
2 * radius + 1,
2 * radius + 1);
gimp_draw_tool_add_rectangle (draw_tool,
FALSE,
color_tool->center_x - radius,
color_tool->center_y - radius,
2 * radius + 1,
2 * radius + 1);
}
}
}

View File

@ -169,16 +169,6 @@ gimp_draw_tool_control (GimpTool *tool,
GIMP_TOOL_CLASS (parent_class)->control (tool, action, display);
}
static void
gimp_draw_tool_add_item (GimpDrawTool *draw_tool,
GimpCanvasItem *item)
{
if (! draw_tool->item)
draw_tool->item = gimp_canvas_group_new ();
gimp_canvas_group_add_item (GIMP_CANVAS_GROUP (draw_tool->item), item);
}
static void
gimp_draw_tool_clear_items (GimpDrawTool *draw_tool)
{
@ -371,8 +361,21 @@ gimp_draw_tool_calc_distance_square (GimpDrawTool *draw_tool,
return SQR (tx2 - tx1) + SQR (ty2 - ty1);
}
void
gimp_draw_tool_add_item (GimpDrawTool *draw_tool,
GimpCanvasItem *item)
{
g_return_if_fail (GIMP_IS_DRAW_TOOL (draw_tool));
g_return_if_fail (GIMP_IS_CANVAS_ITEM (draw_tool));
if (! draw_tool->item)
draw_tool->item = gimp_canvas_group_new ();
gimp_canvas_group_add_item (GIMP_CANVAS_GROUP (draw_tool->item), item);
}
/**
* gimp_draw_tool_draw_line:
* gimp_draw_tool_add_line:
* @draw_tool: the #GimpDrawTool
* @x1: start point X in image coordinates
* @y1: start point Y in image coordinates
@ -384,11 +387,11 @@ gimp_draw_tool_calc_distance_square (GimpDrawTool *draw_tool,
* coordindates.
**/
GimpCanvasItem *
gimp_draw_tool_draw_line (GimpDrawTool *draw_tool,
gdouble x1,
gdouble y1,
gdouble x2,
gdouble y2)
gimp_draw_tool_add_line (GimpDrawTool *draw_tool,
gdouble x1,
gdouble y1,
gdouble x2,
gdouble y2)
{
GimpCanvasItem *item;
@ -411,9 +414,9 @@ gimp_draw_tool_draw_line (GimpDrawTool *draw_tool,
* This function draws a guide line across the canvas.
**/
GimpCanvasItem *
gimp_draw_tool_draw_guide_line (GimpDrawTool *draw_tool,
GimpOrientationType orientation,
gint position)
gimp_draw_tool_add_guide_line (GimpDrawTool *draw_tool,
GimpOrientationType orientation,
gint position)
{
GimpCanvasItem *item;
@ -428,7 +431,7 @@ gimp_draw_tool_draw_guide_line (GimpDrawTool *draw_tool,
}
/**
* gimp_draw_tool_draw_rectangle:
* gimp_draw_tool_add_rectangle:
* @draw_tool: the #GimpDrawTool
* @filled: whether to fill the rectangle
* @x: horizontal image coordinate
@ -440,12 +443,12 @@ gimp_draw_tool_draw_guide_line (GimpDrawTool *draw_tool,
* screen window coordinates, then draws the resulting rectangle.
**/
GimpCanvasItem *
gimp_draw_tool_draw_rectangle (GimpDrawTool *draw_tool,
gboolean filled,
gdouble x,
gdouble y,
gdouble width,
gdouble height)
gimp_draw_tool_add_rectangle (GimpDrawTool *draw_tool,
gboolean filled,
gdouble x,
gdouble y,
gdouble width,
gdouble height)
{
GimpCanvasItem *item;
@ -460,14 +463,14 @@ gimp_draw_tool_draw_rectangle (GimpDrawTool *draw_tool,
}
GimpCanvasItem *
gimp_draw_tool_draw_arc (GimpDrawTool *draw_tool,
gboolean filled,
gdouble x,
gdouble y,
gdouble width,
gdouble height,
gdouble start_angle,
gdouble slice_angle)
gimp_draw_tool_add_arc (GimpDrawTool *draw_tool,
gboolean filled,
gdouble x,
gdouble y,
gdouble width,
gdouble height,
gdouble start_angle,
gdouble slice_angle)
{
GimpCanvasItem *item;
@ -488,13 +491,13 @@ gimp_draw_tool_draw_arc (GimpDrawTool *draw_tool,
}
GimpCanvasItem *
gimp_draw_tool_draw_handle (GimpDrawTool *draw_tool,
GimpHandleType type,
gdouble x,
gdouble y,
gint width,
gint height,
GtkAnchorType anchor)
gimp_draw_tool_add_handle (GimpDrawTool *draw_tool,
GimpHandleType type,
gdouble x,
gdouble y,
gint width,
gint height,
GtkAnchorType anchor)
{
GimpCanvasItem *item;
@ -509,7 +512,7 @@ gimp_draw_tool_draw_handle (GimpDrawTool *draw_tool,
}
/**
* gimp_draw_tool_draw_corner:
* gimp_draw_tool_add_corner:
* @draw_tool: the #GimpDrawTool
* @highlight:
* @put_outside: whether to put the handles on the outside of the rectangle
@ -526,16 +529,16 @@ gimp_draw_tool_draw_handle (GimpDrawTool *draw_tool,
* rectangle outline, taking care of not drawing over an already drawn line.
**/
GimpCanvasItem *
gimp_draw_tool_draw_corner (GimpDrawTool *draw_tool,
gboolean highlight,
gboolean put_outside,
gdouble x1,
gdouble y1,
gdouble x2,
gdouble y2,
gint width,
gint height,
GtkAnchorType anchor)
gimp_draw_tool_add_corner (GimpDrawTool *draw_tool,
gboolean highlight,
gboolean put_outside,
gdouble x1,
gdouble y1,
gdouble x2,
gdouble y2,
gint width,
gint height,
GtkAnchorType anchor)
{
GimpCanvasItem *item;
@ -552,10 +555,10 @@ gimp_draw_tool_draw_corner (GimpDrawTool *draw_tool,
}
GimpCanvasItem *
gimp_draw_tool_draw_lines (GimpDrawTool *draw_tool,
const GimpVector2 *points,
gint n_points,
gboolean filled)
gimp_draw_tool_add_lines (GimpDrawTool *draw_tool,
const GimpVector2 *points,
gint n_points,
gboolean filled)
{
GimpCanvasItem *item;
@ -573,10 +576,10 @@ gimp_draw_tool_draw_lines (GimpDrawTool *draw_tool,
}
GimpCanvasItem *
gimp_draw_tool_draw_strokes (GimpDrawTool *draw_tool,
const GimpCoords *points,
gint n_points,
gboolean filled)
gimp_draw_tool_add_strokes (GimpDrawTool *draw_tool,
const GimpCoords *points,
gint n_points,
gboolean filled)
{
GimpCanvasItem *item;
@ -594,7 +597,7 @@ gimp_draw_tool_draw_strokes (GimpDrawTool *draw_tool,
}
/**
* gimp_draw_tool_draw_boundary:
* gimp_draw_tool_add_boundary:
* @draw_tool: a #GimpDrawTool
* @bound_segs: the sorted brush outline
* @n_bound_segs: the number of segments in @bound_segs
@ -607,11 +610,11 @@ gimp_draw_tool_draw_strokes (GimpDrawTool *draw_tool,
* indicate the end of connected segment sequences (groups) .
*/
GimpCanvasItem *
gimp_draw_tool_draw_boundary (GimpDrawTool *draw_tool,
const BoundSeg *bound_segs,
gint n_bound_segs,
gdouble offset_x,
gdouble offset_y)
gimp_draw_tool_add_boundary (GimpDrawTool *draw_tool,
const BoundSeg *bound_segs,
gint n_bound_segs,
gdouble offset_x,
gdouble offset_y)
{
GimpCanvasItem *item;
@ -629,9 +632,9 @@ gimp_draw_tool_draw_boundary (GimpDrawTool *draw_tool,
}
GimpCanvasItem *
gimp_draw_tool_draw_text_cursor (GimpDrawTool *draw_tool,
PangoRectangle *cursor,
gboolean overwrite)
gimp_draw_tool_add_text_cursor (GimpDrawTool *draw_tool,
PangoRectangle *cursor,
gboolean overwrite)
{
GimpCanvasItem *item;

View File

@ -82,21 +82,23 @@ gdouble gimp_draw_tool_calc_distance_square (GimpDrawTool *draw_too
gdouble x2,
gdouble y2);
GimpCanvasItem * gimp_draw_tool_draw_line (GimpDrawTool *draw_tool,
void gimp_draw_tool_add_item (GimpDrawTool *draw_tool,
GimpCanvasItem *item);
GimpCanvasItem * gimp_draw_tool_add_line (GimpDrawTool *draw_tool,
gdouble x1,
gdouble y1,
gdouble x2,
gdouble y2);
GimpCanvasItem * gimp_draw_tool_draw_guide_line (GimpDrawTool *draw_tool,
GimpCanvasItem * gimp_draw_tool_add_guide_line (GimpDrawTool *draw_tool,
GimpOrientationType orientation,
gint position);
GimpCanvasItem * gimp_draw_tool_draw_rectangle (GimpDrawTool *draw_tool,
GimpCanvasItem * gimp_draw_tool_add_rectangle (GimpDrawTool *draw_tool,
gboolean filled,
gdouble x,
gdouble y,
gdouble width,
gdouble height);
GimpCanvasItem * gimp_draw_tool_draw_arc (GimpDrawTool *draw_tool,
GimpCanvasItem * gimp_draw_tool_add_arc (GimpDrawTool *draw_tool,
gboolean filled,
gdouble x,
gdouble y,
@ -105,14 +107,14 @@ GimpCanvasItem * gimp_draw_tool_draw_arc (GimpDrawTool *draw_too
gdouble start_angle,
gdouble slice_angle);
GimpCanvasItem * gimp_draw_tool_draw_handle (GimpDrawTool *draw_tool,
GimpCanvasItem * gimp_draw_tool_add_handle (GimpDrawTool *draw_tool,
GimpHandleType type,
gdouble x,
gdouble y,
gint width,
gint height,
GtkAnchorType anchor);
GimpCanvasItem * gimp_draw_tool_draw_corner (GimpDrawTool *draw_tool,
GimpCanvasItem * gimp_draw_tool_add_corner (GimpDrawTool *draw_tool,
gboolean highlight,
gboolean put_outside,
gdouble x1,
@ -122,23 +124,23 @@ GimpCanvasItem * gimp_draw_tool_draw_corner (GimpDrawTool *draw_too
gint width,
gint height,
GtkAnchorType anchor);
GimpCanvasItem * gimp_draw_tool_draw_lines (GimpDrawTool *draw_tool,
GimpCanvasItem * gimp_draw_tool_add_lines (GimpDrawTool *draw_tool,
const GimpVector2 *points,
gint n_points,
gboolean filled);
GimpCanvasItem * gimp_draw_tool_draw_strokes (GimpDrawTool *draw_tool,
GimpCanvasItem * gimp_draw_tool_add_strokes (GimpDrawTool *draw_tool,
const GimpCoords *points,
gint n_points,
gboolean filled);
GimpCanvasItem * gimp_draw_tool_draw_boundary (GimpDrawTool *draw_tool,
GimpCanvasItem * gimp_draw_tool_add_boundary (GimpDrawTool *draw_tool,
const BoundSeg *bound_segs,
gint n_bound_segs,
gdouble offset_x,
gdouble offset_y);
GimpCanvasItem * gimp_draw_tool_draw_text_cursor (GimpDrawTool *draw_tool,
GimpCanvasItem * gimp_draw_tool_add_text_cursor (GimpDrawTool *draw_tool,
PangoRectangle *cursor,
gboolean overwrite);

View File

@ -812,29 +812,29 @@ gimp_edit_selection_tool_draw (GimpDrawTool *draw_tool)
if (! floating_sel && edit_select->segs_in)
{
gimp_draw_tool_draw_boundary (draw_tool,
edit_select->segs_in,
edit_select->num_segs_in,
edit_select->cumlx + off_x,
edit_select->cumly + off_y);
gimp_draw_tool_add_boundary (draw_tool,
edit_select->segs_in,
edit_select->num_segs_in,
edit_select->cumlx + off_x,
edit_select->cumly + off_y);
}
if (edit_select->segs_out)
{
gimp_draw_tool_draw_boundary (draw_tool,
edit_select->segs_out,
edit_select->num_segs_out,
edit_select->cumlx + off_x,
edit_select->cumly + off_y);
gimp_draw_tool_add_boundary (draw_tool,
edit_select->segs_out,
edit_select->num_segs_out,
edit_select->cumlx + off_x,
edit_select->cumly + off_y);
}
else if (edit_select->edit_mode != GIMP_TRANSLATE_MODE_MASK)
{
gimp_draw_tool_draw_rectangle (draw_tool,
FALSE,
edit_select->cumlx + off_x,
edit_select->cumly + off_y,
gimp_item_get_width (active_item),
gimp_item_get_height (active_item));
gimp_draw_tool_add_rectangle (draw_tool,
FALSE,
edit_select->cumlx + off_x,
edit_select->cumly + off_y,
gimp_item_get_width (active_item),
gimp_item_get_height (active_item));
}
}
break;
@ -847,12 +847,12 @@ gimp_edit_selection_tool_draw (GimpDrawTool *draw_tool)
gimp_item_get_offset (active_item, &off_x, &off_y);
gimp_draw_tool_draw_rectangle (draw_tool,
FALSE,
edit_select->x1 + off_x,
edit_select->y1 + off_y,
edit_select->x2 - edit_select->x1,
edit_select->y2 - edit_select->y1);
gimp_draw_tool_add_rectangle (draw_tool,
FALSE,
edit_select->x1 + off_x,
edit_select->y1 + off_y,
edit_select->x2 - edit_select->x1,
edit_select->y2 - edit_select->y1);
}
break;
@ -903,9 +903,9 @@ gimp_edit_selection_tool_draw (GimpDrawTool *draw_tool)
g_list_free (linked);
}
gimp_draw_tool_draw_rectangle (draw_tool, FALSE,
x1, y1,
x2 - x1, y2 - y1);
gimp_draw_tool_add_rectangle (draw_tool, FALSE,
x1, y1,
x2 - x1, y2 - y1);
}
break;
@ -955,29 +955,29 @@ gimp_edit_selection_tool_draw (GimpDrawTool *draw_tool)
x2 = ceil (x2);
y2 = ceil (y2);
gimp_draw_tool_draw_rectangle (draw_tool, FALSE,
x1, y1,
x2 - x1, y2 - y1);
gimp_draw_tool_add_rectangle (draw_tool, FALSE,
x1, y1,
x2 - x1, y2 - y1);
}
break;
case GIMP_TRANSLATE_MODE_FLOATING_SEL:
gimp_draw_tool_draw_boundary (draw_tool,
edit_select->segs_in,
edit_select->num_segs_in,
edit_select->cumlx,
edit_select->cumly);
gimp_draw_tool_add_boundary (draw_tool,
edit_select->segs_in,
edit_select->num_segs_in,
edit_select->cumlx,
edit_select->cumly);
break;
}
/* Mark the center because we snap to it */
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_CROSS,
edit_select->center_x + edit_select->cumlx,
edit_select->center_y + edit_select->cumly,
CENTER_CROSS_SIZE,
CENTER_CROSS_SIZE,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_CROSS,
edit_select->center_x + edit_select->cumlx,
edit_select->center_y + edit_select->cumly,
CENTER_CROSS_SIZE,
CENTER_CROSS_SIZE,
GTK_ANCHOR_CENTER);
GIMP_DRAW_TOOL_CLASS (parent_class)->draw (draw_tool);
}

View File

@ -110,11 +110,11 @@ gimp_ellipse_select_tool_draw (GimpDrawTool *draw_tool)
"y2", &y2,
NULL);
gimp_draw_tool_draw_arc (draw_tool,
FALSE,
x1, y1,
x2 - x1, y2 - y1,
0.0, 2 * G_PI);
gimp_draw_tool_add_arc (draw_tool,
FALSE,
x1, y1,
x2 - x1, y2 - y1,
0.0, 2 * G_PI);
}
static void

View File

@ -606,16 +606,16 @@ gimp_foreground_select_tool_draw (GimpDrawTool *draw_tool)
if (x < x1 + radius || x > x2 - radius ||
y < y1 + radius || y > y2 - radius)
{
gimp_draw_tool_draw_rectangle (draw_tool, FALSE,
x1, y1,
x2 - x1, y2 - y1);
gimp_draw_tool_add_rectangle (draw_tool, FALSE,
x1, y1,
x2 - x1, y2 - y1);
}
}
gimp_draw_tool_draw_arc (draw_tool, FALSE,
x - radius, y - radius,
2 * radius, 2 * radius,
0.0, 2.0 * G_PI);
gimp_draw_tool_add_arc (draw_tool, FALSE,
x - radius, y - radius,
2 * radius, 2 * radius,
0.0, 2.0 * G_PI);
}
else
{

View File

@ -1541,9 +1541,9 @@ gimp_free_select_tool_draw (GimpDrawTool *draw_tool)
tool->display,
NO_CLICK_TIME_AVAILABLE,
&coords);
gimp_draw_tool_draw_lines (draw_tool,
priv->points, priv->n_points,
FALSE);
gimp_draw_tool_add_lines (draw_tool,
priv->points, priv->n_points,
FALSE);
/* We always show the handle for the first point, even with button1
* down, since releasing the button on the first point will close
@ -1592,11 +1592,11 @@ gimp_free_select_tool_draw (GimpDrawTool *draw_tool)
handle_type = GIMP_HANDLE_CIRCLE;
if (handle_type != -1)
gimp_draw_tool_draw_handle (draw_tool, handle_type,
point->x,
point->y,
HANDLE_SIZE, HANDLE_SIZE,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool, handle_type,
point->x,
point->y,
HANDLE_SIZE, HANDLE_SIZE,
GTK_ANCHOR_CENTER);
}
}
@ -1604,11 +1604,11 @@ gimp_free_select_tool_draw (GimpDrawTool *draw_tool)
{
GimpVector2 last = priv->points[priv->n_points - 1];
gimp_draw_tool_draw_line (draw_tool,
last.x,
last.y,
priv->pending_point.x,
priv->pending_point.y);
gimp_draw_tool_add_line (draw_tool,
last.x,
last.y,
priv->pending_point.x,
priv->pending_point.y);
}
}

View File

@ -749,18 +749,18 @@ gimp_iscissors_tool_draw (GimpDrawTool *draw_tool)
/* Draw the crosshairs target if we're placing a seed */
if (iscissors->draw & DRAW_CURRENT_SEED)
{
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_CROSS,
iscissors->x, iscissors->y,
TARGET_SIZE, TARGET_SIZE,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_CROSS,
iscissors->x, iscissors->y,
TARGET_SIZE, TARGET_SIZE,
GTK_ANCHOR_CENTER);
/* Draw a line boundary */
if (! iscissors->first_point && ! (iscissors->draw & DRAW_LIVEWIRE))
{
gimp_draw_tool_draw_line (draw_tool,
iscissors->ix, iscissors->iy,
iscissors->x, iscissors->y);
gimp_draw_tool_add_line (draw_tool,
iscissors->ix, iscissors->iy,
iscissors->x, iscissors->y);
}
}
@ -808,13 +808,13 @@ gimp_iscissors_tool_draw (GimpDrawTool *draw_tool)
/* Draw a point at the init point coordinates */
if (! iscissors->connected)
{
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_FILLED_CIRCLE,
iscissors->ix,
iscissors->iy,
POINT_WIDTH,
POINT_WIDTH,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_FILLED_CIRCLE,
iscissors->ix,
iscissors->iy,
POINT_WIDTH,
POINT_WIDTH,
GTK_ANCHOR_CENTER);
}
/* Go through the list of icurves, and render each one... */
@ -831,13 +831,13 @@ gimp_iscissors_tool_draw (GimpDrawTool *draw_tool)
continue;
}
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_FILLED_CIRCLE,
curve->x1,
curve->y1,
POINT_WIDTH,
POINT_WIDTH,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_FILLED_CIRCLE,
curve->x1,
curve->y1,
POINT_WIDTH,
POINT_WIDTH,
GTK_ANCHOR_CENTER);
if (iscissors->draw & DRAW_ACTIVE_CURVE)
{
@ -856,28 +856,29 @@ gimp_iscissors_tool_draw (GimpDrawTool *draw_tool)
/* plot both curves, and the control point between them */
if (iscissors->curve1)
{
gimp_draw_tool_draw_line (draw_tool,
iscissors->curve1->x2,
iscissors->curve1->y2,
iscissors->nx,
iscissors->ny);
}
if (iscissors->curve2)
{
gimp_draw_tool_draw_line (draw_tool,
iscissors->curve2->x1,
iscissors->curve2->y1,
iscissors->nx,
iscissors->ny);
gimp_draw_tool_add_line (draw_tool,
iscissors->curve1->x2,
iscissors->curve1->y2,
iscissors->nx,
iscissors->ny);
}
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_FILLED_CIRCLE,
iscissors->nx,
iscissors->ny,
POINT_WIDTH,
POINT_WIDTH,
GTK_ANCHOR_CENTER);
if (iscissors->curve2)
{
gimp_draw_tool_add_line (draw_tool,
iscissors->curve2->x1,
iscissors->curve2->y1,
iscissors->nx,
iscissors->ny);
}
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_FILLED_CIRCLE,
iscissors->nx,
iscissors->ny,
POINT_WIDTH,
POINT_WIDTH,
GTK_ANCHOR_CENTER);
}
}
@ -905,7 +906,7 @@ iscissors_draw_curve (GimpDrawTool *draw_tool,
points[i].y = (coords >> 16);
}
gimp_draw_tool_draw_lines (draw_tool, points, len, FALSE);
gimp_draw_tool_add_lines (draw_tool, points, len, FALSE);
g_free (points);
}

View File

@ -362,9 +362,9 @@ gimp_magnify_tool_draw (GimpDrawTool *draw_tool)
{
GimpMagnifyTool *magnify = GIMP_MAGNIFY_TOOL (draw_tool);
gimp_draw_tool_draw_rectangle (draw_tool, FALSE,
magnify->x,
magnify->y,
magnify->w,
magnify->h);
gimp_draw_tool_add_rectangle (draw_tool, FALSE,
magnify->x,
magnify->y,
magnify->w,
magnify->h);
}

View File

@ -670,32 +670,32 @@ gimp_measure_tool_draw (GimpDrawTool *draw_tool)
{
if (i == 0 && measure->num_points == 3)
{
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_CIRCLE,
measure->x[i],
measure->y[i],
TARGET,
TARGET,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_CIRCLE,
measure->x[i],
measure->y[i],
TARGET,
TARGET,
GTK_ANCHOR_CENTER);
}
else
{
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_CROSS,
measure->x[i],
measure->y[i],
TARGET * 2,
TARGET * 2,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_CROSS,
measure->x[i],
measure->y[i],
TARGET * 2,
TARGET * 2,
GTK_ANCHOR_CENTER);
}
if (i > 0)
{
gimp_draw_tool_draw_line (draw_tool,
measure->x[0],
measure->y[0],
measure->x[i],
measure->y[i]);
gimp_draw_tool_add_line (draw_tool,
measure->x[0],
measure->y[0],
measure->x[i],
measure->y[i]);
/* only draw the arc if the lines are long enough */
if (gimp_draw_tool_calc_distance (draw_tool, tool->display,
@ -724,13 +724,13 @@ gimp_measure_tool_draw (GimpDrawTool *draw_tool)
{
GimpCanvasItem *item;
item = gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_CIRCLE,
measure->x[0],
measure->y[0],
ARC_RADIUS * 2 + 1,
ARC_RADIUS * 2 + 1,
GTK_ANCHOR_CENTER);
item = gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_CIRCLE,
measure->x[0],
measure->y[0],
ARC_RADIUS * 2 + 1,
ARC_RADIUS * 2 + 1,
GTK_ANCHOR_CENTER);
gimp_canvas_handle_set_angles (GIMP_CANVAS_HANDLE (item),
angle1, angle2);
@ -746,13 +746,13 @@ gimp_measure_tool_draw (GimpDrawTool *draw_tool)
target = FUNSCALEX (shell, (TARGET >> 1));
arc_radius = FUNSCALEX (shell, ARC_RADIUS);
gimp_draw_tool_draw_line (draw_tool,
measure->x[0],
measure->y[0],
(measure->x[1] >= measure->x[0] ?
measure->x[0] + arc_radius + target :
measure->x[0] - arc_radius - target),
measure->y[0]);
gimp_draw_tool_add_line (draw_tool,
measure->x[0],
measure->y[0],
(measure->x[1] >= measure->x[0] ?
measure->x[0] + arc_radius + target :
measure->x[0] - arc_radius - target),
measure->y[0]);
}
}
}

View File

@ -794,9 +794,9 @@ gimp_move_tool_draw (GimpDrawTool *draw_tool)
if (move->moving_guide && move->guide_position != -1)
{
gimp_draw_tool_draw_guide_line (draw_tool,
move->guide_orientation,
move->guide_position);
gimp_draw_tool_add_guide_line (draw_tool,
move->guide_orientation,
move->guide_position);
}
}

View File

@ -720,29 +720,29 @@ gimp_paint_tool_draw (GimpDrawTool *draw_tool)
gimp_item_get_offset (GIMP_ITEM (drawable), &off_x, &off_y);
/* Draw the line between the start and end coords */
gimp_draw_tool_draw_line (draw_tool,
core->last_coords.x + off_x,
core->last_coords.y + off_y,
core->cur_coords.x + off_x,
core->cur_coords.y + off_y);
gimp_draw_tool_add_line (draw_tool,
core->last_coords.x + off_x,
core->last_coords.y + off_y,
core->cur_coords.x + off_x,
core->cur_coords.y + off_y);
/* Draw start target */
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_CROSS,
core->last_coords.x + off_x,
core->last_coords.y + off_y,
HANDLE_SIZE,
HANDLE_SIZE,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_CROSS,
core->last_coords.x + off_x,
core->last_coords.y + off_y,
HANDLE_SIZE,
HANDLE_SIZE,
GTK_ANCHOR_CENTER);
/* Draw end target */
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_CROSS,
core->cur_coords.x + off_x,
core->cur_coords.y + off_y,
HANDLE_SIZE,
HANDLE_SIZE,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_CROSS,
core->cur_coords.x + off_x,
core->cur_coords.y + off_y,
HANDLE_SIZE,
HANDLE_SIZE,
GTK_ANCHOR_CENTER);
}
}

View File

@ -747,40 +747,40 @@ gimp_perspective_clone_tool_draw (GimpDrawTool *draw_tool)
if (clone_tool->use_handles)
{
/* draw the bounding box */
gimp_draw_tool_draw_line (draw_tool,
clone_tool->tx1, clone_tool->ty1,
clone_tool->tx2, clone_tool->ty2);
gimp_draw_tool_draw_line (draw_tool,
clone_tool->tx2, clone_tool->ty2,
clone_tool->tx4, clone_tool->ty4);
gimp_draw_tool_draw_line (draw_tool,
clone_tool->tx3, clone_tool->ty3,
clone_tool->tx4, clone_tool->ty4);
gimp_draw_tool_draw_line (draw_tool,
clone_tool->tx3, clone_tool->ty3,
clone_tool->tx1, clone_tool->ty1);
gimp_draw_tool_add_line (draw_tool,
clone_tool->tx1, clone_tool->ty1,
clone_tool->tx2, clone_tool->ty2);
gimp_draw_tool_add_line (draw_tool,
clone_tool->tx2, clone_tool->ty2,
clone_tool->tx4, clone_tool->ty4);
gimp_draw_tool_add_line (draw_tool,
clone_tool->tx3, clone_tool->ty3,
clone_tool->tx4, clone_tool->ty4);
gimp_draw_tool_add_line (draw_tool,
clone_tool->tx3, clone_tool->ty3,
clone_tool->tx1, clone_tool->ty1);
/* draw the tool handles */
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_SQUARE,
clone_tool->tx1, clone_tool->ty1,
HANDLE_SIZE, HANDLE_SIZE,
GTK_ANCHOR_CENTER);
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_SQUARE,
clone_tool->tx2, clone_tool->ty2,
HANDLE_SIZE, HANDLE_SIZE,
GTK_ANCHOR_CENTER);
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_SQUARE,
clone_tool->tx3, clone_tool->ty3,
HANDLE_SIZE, HANDLE_SIZE,
GTK_ANCHOR_CENTER);
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_SQUARE,
clone_tool->tx4, clone_tool->ty4,
HANDLE_SIZE, HANDLE_SIZE,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_SQUARE,
clone_tool->tx1, clone_tool->ty1,
HANDLE_SIZE, HANDLE_SIZE,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_SQUARE,
clone_tool->tx2, clone_tool->ty2,
HANDLE_SIZE, HANDLE_SIZE,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_SQUARE,
clone_tool->tx3, clone_tool->ty3,
HANDLE_SIZE, HANDLE_SIZE,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_SQUARE,
clone_tool->tx4, clone_tool->ty4,
HANDLE_SIZE, HANDLE_SIZE,
GTK_ANCHOR_CENTER);
}
if (GIMP_CLONE_OPTIONS (options)->clone_type == GIMP_IMAGE_CLONE &&
@ -791,12 +791,12 @@ gimp_perspective_clone_tool_draw (GimpDrawTool *draw_tool)
tmp_display = draw_tool->display;
draw_tool->display = clone_tool->src_display;
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_CROSS,
clone_tool->src_x,
clone_tool->src_y,
TARGET_SIZE, TARGET_SIZE,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_CROSS,
clone_tool->src_x,
clone_tool->src_y,
TARGET_SIZE, TARGET_SIZE,
GTK_ANCHOR_CENTER);
draw_tool->display = tmp_display;
}

View File

@ -310,25 +310,25 @@ gimp_rectangle_select_tool_draw (GimpDrawTool *draw_tool)
square_size = (int) (radius * 2);
gimp_draw_tool_draw_arc (draw_tool, FALSE,
x1, y1,
square_size, square_size,
G_PI / 2.0, G_PI / 2.0);
gimp_draw_tool_add_arc (draw_tool, FALSE,
x1, y1,
square_size, square_size,
G_PI / 2.0, G_PI / 2.0);
gimp_draw_tool_draw_arc (draw_tool, FALSE,
x2 - square_size, y1,
square_size, square_size,
0.0, G_PI / 2.0);
gimp_draw_tool_add_arc (draw_tool, FALSE,
x2 - square_size, y1,
square_size, square_size,
0.0, G_PI / 2.0);
gimp_draw_tool_draw_arc (draw_tool, FALSE,
x2 - square_size, y2 - square_size,
square_size, square_size,
G_PI * 1.5, G_PI / 2.0);
gimp_draw_tool_add_arc (draw_tool, FALSE,
x2 - square_size, y2 - square_size,
square_size, square_size,
G_PI * 1.5, G_PI / 2.0);
gimp_draw_tool_draw_arc (draw_tool, FALSE,
x1, y2 - square_size,
square_size, square_size,
G_PI, G_PI / 2.0);
gimp_draw_tool_add_arc (draw_tool, FALSE,
x1, y2 - square_size,
square_size, square_size,
G_PI, G_PI / 2.0);
}
gimp_rectangle_tool_draw (draw_tool);

View File

@ -1736,11 +1736,11 @@ gimp_rectangle_tool_draw (GimpDrawTool *draw_tool)
gimp_rectangle_tool_draw_guides (draw_tool);
gimp_draw_tool_draw_rectangle (draw_tool, FALSE,
pub_x1,
pub_y1,
pub_x2 - pub_x1,
pub_y2 - pub_y1);
gimp_draw_tool_add_rectangle (draw_tool, FALSE,
pub_x1,
pub_y1,
pub_x2 - pub_x1,
pub_y2 - pub_y1);
switch (private->function)
{
@ -1749,13 +1749,13 @@ gimp_rectangle_tool_draw (GimpDrawTool *draw_tool)
if (gimp_tool_control_is_active (tool->control))
{
/* Mark the center because we snap to it */
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_CROSS,
(pub_x1 + pub_x2) / 2.0,
(pub_y1 + pub_y2) / 2.0,
CENTER_CROSS_SIZE,
CENTER_CROSS_SIZE,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_CROSS,
(pub_x1 + pub_x2) / 2.0,
(pub_y1 + pub_y2) / 2.0,
CENTER_CROSS_SIZE,
CENTER_CROSS_SIZE,
GTK_ANCHOR_CENTER);
break;
}
else
@ -1765,65 +1765,65 @@ gimp_rectangle_tool_draw (GimpDrawTool *draw_tool)
case GIMP_RECTANGLE_TOOL_DEAD:
case GIMP_RECTANGLE_TOOL_CREATING:
gimp_draw_tool_draw_corner (draw_tool, FALSE, private->narrow_mode,
pub_x1, pub_y1,
pub_x2, pub_y2,
private->corner_handle_w,
private->corner_handle_h,
GTK_ANCHOR_NORTH_WEST);
gimp_draw_tool_draw_corner (draw_tool, FALSE, private->narrow_mode,
pub_x1, pub_y1,
pub_x2, pub_y2,
private->corner_handle_w,
private->corner_handle_h,
GTK_ANCHOR_NORTH_EAST);
gimp_draw_tool_draw_corner (draw_tool, FALSE, private->narrow_mode,
pub_x1, pub_y1,
pub_x2, pub_y2,
private->corner_handle_w,
private->corner_handle_h,
GTK_ANCHOR_SOUTH_WEST);
gimp_draw_tool_draw_corner (draw_tool, FALSE, private->narrow_mode,
pub_x1, pub_y1,
pub_x2, pub_y2,
private->corner_handle_w,
private->corner_handle_h,
GTK_ANCHOR_SOUTH_EAST);
gimp_draw_tool_add_corner (draw_tool, FALSE, private->narrow_mode,
pub_x1, pub_y1,
pub_x2, pub_y2,
private->corner_handle_w,
private->corner_handle_h,
GTK_ANCHOR_NORTH_WEST);
gimp_draw_tool_add_corner (draw_tool, FALSE, private->narrow_mode,
pub_x1, pub_y1,
pub_x2, pub_y2,
private->corner_handle_w,
private->corner_handle_h,
GTK_ANCHOR_NORTH_EAST);
gimp_draw_tool_add_corner (draw_tool, FALSE, private->narrow_mode,
pub_x1, pub_y1,
pub_x2, pub_y2,
private->corner_handle_w,
private->corner_handle_h,
GTK_ANCHOR_SOUTH_WEST);
gimp_draw_tool_add_corner (draw_tool, FALSE, private->narrow_mode,
pub_x1, pub_y1,
pub_x2, pub_y2,
private->corner_handle_w,
private->corner_handle_h,
GTK_ANCHOR_SOUTH_EAST);
break;
case GIMP_RECTANGLE_TOOL_RESIZING_TOP:
case GIMP_RECTANGLE_TOOL_RESIZING_BOTTOM:
gimp_draw_tool_draw_corner (draw_tool,
! gimp_tool_control_is_active (tool->control),
private->narrow_mode,
pub_x1, pub_y1,
pub_x2, pub_y2,
private->top_and_bottom_handle_w,
private->corner_handle_h,
gimp_rectangle_tool_get_anchor (private));
gimp_draw_tool_add_corner (draw_tool,
! gimp_tool_control_is_active (tool->control),
private->narrow_mode,
pub_x1, pub_y1,
pub_x2, pub_y2,
private->top_and_bottom_handle_w,
private->corner_handle_h,
gimp_rectangle_tool_get_anchor (private));
break;
case GIMP_RECTANGLE_TOOL_RESIZING_LEFT:
case GIMP_RECTANGLE_TOOL_RESIZING_RIGHT:
gimp_draw_tool_draw_corner (draw_tool,
! gimp_tool_control_is_active (tool->control),
private->narrow_mode,
pub_x1, pub_y1,
pub_x2, pub_y2,
private->corner_handle_w,
private->left_and_right_handle_h,
gimp_rectangle_tool_get_anchor (private));
gimp_draw_tool_add_corner (draw_tool,
! gimp_tool_control_is_active (tool->control),
private->narrow_mode,
pub_x1, pub_y1,
pub_x2, pub_y2,
private->corner_handle_w,
private->left_and_right_handle_h,
gimp_rectangle_tool_get_anchor (private));
break;
default:
gimp_draw_tool_draw_corner (draw_tool,
! gimp_tool_control_is_active (tool->control),
private->narrow_mode,
pub_x1, pub_y1,
pub_x2, pub_y2,
private->corner_handle_w,
private->corner_handle_h,
gimp_rectangle_tool_get_anchor (private));
gimp_draw_tool_add_corner (draw_tool,
! gimp_tool_control_is_active (tool->control),
private->narrow_mode,
pub_x1, pub_y1,
pub_x2, pub_y2,
private->corner_handle_w,
private->corner_handle_h,
gimp_rectangle_tool_get_anchor (private));
break;
}
}
@ -1846,77 +1846,77 @@ gimp_rectangle_tool_draw_guides (GimpDrawTool *draw_tool)
break;
case GIMP_RECTANGLE_GUIDE_CENTER_LINES:
gimp_draw_tool_draw_line (draw_tool,
x1, (y1 + y2) / 2,
x2, (y1 + y2) / 2);
gimp_draw_tool_draw_line (draw_tool,
(x1 + x2) / 2, y1,
(x1 + x2) / 2, y2);
gimp_draw_tool_add_line (draw_tool,
x1, (y1 + y2) / 2,
x2, (y1 + y2) / 2);
gimp_draw_tool_add_line (draw_tool,
(x1 + x2) / 2, y1,
(x1 + x2) / 2, y2);
break;
case GIMP_RECTANGLE_GUIDE_THIRDS:
gimp_draw_tool_draw_line (draw_tool,
x1, (2 * y1 + y2) / 3,
x2, (2 * y1 + y2) / 3);
gimp_draw_tool_draw_line (draw_tool,
x1, (y1 + 2 * y2) / 3,
x2, (y1 + 2 * y2) / 3);
gimp_draw_tool_draw_line (draw_tool,
(2 * x1 + x2) / 3, y1,
(2 * x1 + x2) / 3, y2);
gimp_draw_tool_draw_line (draw_tool,
(x1 + 2 * x2) / 3, y1,
(x1 + 2 * x2) / 3, y2);
gimp_draw_tool_add_line (draw_tool,
x1, (2 * y1 + y2) / 3,
x2, (2 * y1 + y2) / 3);
gimp_draw_tool_add_line (draw_tool,
x1, (y1 + 2 * y2) / 3,
x2, (y1 + 2 * y2) / 3);
gimp_draw_tool_add_line (draw_tool,
(2 * x1 + x2) / 3, y1,
(2 * x1 + x2) / 3, y2);
gimp_draw_tool_add_line (draw_tool,
(x1 + 2 * x2) / 3, y1,
(x1 + 2 * x2) / 3, y2);
break;
case GIMP_RECTANGLE_GUIDE_FIFTHS:
gimp_draw_tool_draw_line (draw_tool,
x1, y1 + (y2 - y1) / 5,
x2, y1 + (y2 - y1) / 5);
gimp_draw_tool_draw_line (draw_tool,
x1, y1 + 2 * (y2 - y1) / 5,
x2, y1 + 2 * (y2 - y1) / 5);
gimp_draw_tool_draw_line (draw_tool,
x1, y1 + 3 * (y2 - y1) / 5,
x2, y1 + 3 * (y2 - y1) / 5);
gimp_draw_tool_draw_line (draw_tool,
x1, y1 + 4 * (y2 - y1) / 5,
x2, y1 + 4 * (y2 - y1) / 5);
gimp_draw_tool_draw_line (draw_tool,
x1 + (x2 - x1) / 5, y1,
x1 + (x2 - x1) / 5, y2);
gimp_draw_tool_draw_line (draw_tool,
x1 + 2 * (x2 - x1) / 5, y1,
x1 + 2 * (x2 - x1) / 5, y2);
gimp_draw_tool_draw_line (draw_tool,
x1 + 3 * (x2 - x1) / 5, y1,
x1 + 3 * (x2 - x1) / 5, y2);
gimp_draw_tool_draw_line (draw_tool,
x1 + 4 * (x2 - x1) / 5, y1,
x1 + 4 * (x2 - x1) / 5, y2);
gimp_draw_tool_add_line (draw_tool,
x1, y1 + (y2 - y1) / 5,
x2, y1 + (y2 - y1) / 5);
gimp_draw_tool_add_line (draw_tool,
x1, y1 + 2 * (y2 - y1) / 5,
x2, y1 + 2 * (y2 - y1) / 5);
gimp_draw_tool_add_line (draw_tool,
x1, y1 + 3 * (y2 - y1) / 5,
x2, y1 + 3 * (y2 - y1) / 5);
gimp_draw_tool_add_line (draw_tool,
x1, y1 + 4 * (y2 - y1) / 5,
x2, y1 + 4 * (y2 - y1) / 5);
gimp_draw_tool_add_line (draw_tool,
x1 + (x2 - x1) / 5, y1,
x1 + (x2 - x1) / 5, y2);
gimp_draw_tool_add_line (draw_tool,
x1 + 2 * (x2 - x1) / 5, y1,
x1 + 2 * (x2 - x1) / 5, y2);
gimp_draw_tool_add_line (draw_tool,
x1 + 3 * (x2 - x1) / 5, y1,
x1 + 3 * (x2 - x1) / 5, y2);
gimp_draw_tool_add_line (draw_tool,
x1 + 4 * (x2 - x1) / 5, y1,
x1 + 4 * (x2 - x1) / 5, y2);
break;
case GIMP_RECTANGLE_GUIDE_GOLDEN:
gimp_draw_tool_draw_line (draw_tool,
x1,
(2 * y1 + (1 + SQRT5) * y2) / (3 + SQRT5),
x2,
(2 * y1 + (1 + SQRT5) * y2) / (3 + SQRT5));
gimp_draw_tool_draw_line (draw_tool,
x1,
((1 + SQRT5) * y1 + 2 * y2) / (3 + SQRT5),
x2,
((1 + SQRT5) * y1 + 2 * y2) / (3 + SQRT5));
gimp_draw_tool_draw_line (draw_tool,
(2 * x1 + (1 + SQRT5) * x2) / (3 + SQRT5),
y1,
(2 * x1 + (1 + SQRT5) * x2) / (3 + SQRT5),
y2);
gimp_draw_tool_draw_line (draw_tool,
((1 + SQRT5) * x1 + 2 * x2) / (3 + SQRT5),
y1,
((1 + SQRT5) * x1 + 2 * x2) / (3 + SQRT5),
y2);
gimp_draw_tool_add_line (draw_tool,
x1,
(2 * y1 + (1 + SQRT5) * y2) / (3 + SQRT5),
x2,
(2 * y1 + (1 + SQRT5) * y2) / (3 + SQRT5));
gimp_draw_tool_add_line (draw_tool,
x1,
((1 + SQRT5) * y1 + 2 * y2) / (3 + SQRT5),
x2,
((1 + SQRT5) * y1 + 2 * y2) / (3 + SQRT5));
gimp_draw_tool_add_line (draw_tool,
(2 * x1 + (1 + SQRT5) * x2) / (3 + SQRT5),
y1,
(2 * x1 + (1 + SQRT5) * x2) / (3 + SQRT5),
y2);
gimp_draw_tool_add_line (draw_tool,
((1 + SQRT5) * x1 + 2 * x2) / (3 + SQRT5),
y1,
((1 + SQRT5) * x1 + 2 * x2) / (3 + SQRT5),
y2);
break;
/* This code implements the method of diagonals discovered by
@ -1930,14 +1930,14 @@ gimp_rectangle_tool_draw_guides (GimpDrawTool *draw_tool)
const gdouble square_side = MIN (x2 - x1, y2 - y1);
/* diagonal from the top-left edge */
gimp_draw_tool_draw_line (draw_tool,
x1, y1,
x1 + square_side, y1 + square_side);
gimp_draw_tool_add_line (draw_tool,
x1, y1,
x1 + square_side, y1 + square_side);
/* diagonal from the top-right edge */
gimp_draw_tool_draw_line (draw_tool,
x2, y1,
x2 - square_side, y1 + square_side);
gimp_draw_tool_add_line (draw_tool,
x2, y1,
x2 - square_side, y1 + square_side);
/* If user selected a square, we cannot draw from bottom points
* as we would erase the guides drawn from the top points
@ -1945,14 +1945,14 @@ gimp_rectangle_tool_draw_guides (GimpDrawTool *draw_tool)
if ((x1 + square_side != x2) || (y1 + square_side != y2))
{
/* diagonal from the bottom-left edge */
gimp_draw_tool_draw_line (draw_tool,
x1, y2,
x1 + square_side, y2 - square_side);
gimp_draw_tool_add_line (draw_tool,
x1, y2,
x1 + square_side, y2 - square_side);
/* diagonal from the bottom-right edge */
gimp_draw_tool_draw_line (draw_tool,
x2, y2,
x2 - square_side, y2 - square_side);
gimp_draw_tool_add_line (draw_tool,
x2, y2,
x2 - square_side, y2 - square_side);
}
}
break;

View File

@ -328,10 +328,10 @@ gimp_region_select_tool_draw (GimpDrawTool *draw_tool)
gimp_item_get_offset (GIMP_ITEM (drawable), &off_x, &off_y);
}
gimp_draw_tool_draw_boundary (draw_tool,
region_sel->segs,
region_sel->n_segs,
off_x, off_y);
gimp_draw_tool_add_boundary (draw_tool,
region_sel->segs,
region_sel->n_segs,
off_x, off_y);
}
}

View File

@ -382,12 +382,12 @@ gimp_source_tool_draw (GimpDrawTool *draw_tool)
source_tool->src_y + off_y,
FALSE);
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_CROSS,
source_tool->src_x + off_x,
source_tool->src_y + off_y,
TARGET_SIZE, TARGET_SIZE,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_CROSS,
source_tool->src_x + off_x,
source_tool->src_y + off_y,
TARGET_SIZE, TARGET_SIZE,
GTK_ANCHOR_CENTER);
draw_tool->display = tmp_display;
}

View File

@ -813,7 +813,7 @@ gimp_text_tool_draw (GimpDrawTool *draw_tool)
overwrite = text_tool->overwrite_mode && cursor_rect.width > 0;
gimp_draw_tool_draw_text_cursor (draw_tool, &cursor_rect, overwrite);
gimp_draw_tool_add_text_cursor (draw_tool, &cursor_rect, overwrite);
}
}
@ -871,9 +871,9 @@ gimp_text_tool_draw_selection (GimpDrawTool *draw_tool)
rect.x += offset_x;
rect.y += offset_y;
gimp_draw_tool_draw_rectangle (draw_tool, TRUE,
rect.x, rect.y,
rect.width, rect.height);
gimp_draw_tool_add_rectangle (draw_tool, TRUE,
rect.x, rect.y,
rect.width, rect.height);
}
}
while (pango_layout_iter_next_char (iter));

View File

@ -809,27 +809,27 @@ gimp_transform_tool_draw (GimpDrawTool *draw_tool)
for (i = 0, gci = 0; i < k; i++, gci += 4)
{
gimp_draw_tool_draw_line (draw_tool,
tr_tool->tgrid_coords[gci],
tr_tool->tgrid_coords[gci + 1],
tr_tool->tgrid_coords[gci + 2],
tr_tool->tgrid_coords[gci + 3]);
gimp_draw_tool_add_line (draw_tool,
tr_tool->tgrid_coords[gci],
tr_tool->tgrid_coords[gci + 1],
tr_tool->tgrid_coords[gci + 2],
tr_tool->tgrid_coords[gci + 3]);
}
}
/* draw the bounding box */
gimp_draw_tool_draw_line (draw_tool,
tr_tool->tx1, tr_tool->ty1,
tr_tool->tx2, tr_tool->ty2);
gimp_draw_tool_draw_line (draw_tool,
tr_tool->tx2, tr_tool->ty2,
tr_tool->tx4, tr_tool->ty4);
gimp_draw_tool_draw_line (draw_tool,
tr_tool->tx3, tr_tool->ty3,
tr_tool->tx4, tr_tool->ty4);
gimp_draw_tool_draw_line (draw_tool,
tr_tool->tx3, tr_tool->ty3,
tr_tool->tx1, tr_tool->ty1);
gimp_draw_tool_add_line (draw_tool,
tr_tool->tx1, tr_tool->ty1,
tr_tool->tx2, tr_tool->ty2);
gimp_draw_tool_add_line (draw_tool,
tr_tool->tx2, tr_tool->ty2,
tr_tool->tx4, tr_tool->ty4);
gimp_draw_tool_add_line (draw_tool,
tr_tool->tx3, tr_tool->ty3,
tr_tool->tx4, tr_tool->ty4);
gimp_draw_tool_add_line (draw_tool,
tr_tool->tx3, tr_tool->ty3,
tr_tool->tx1, tr_tool->ty1);
}
@ -838,26 +838,26 @@ gimp_transform_tool_draw (GimpDrawTool *draw_tool)
if (tr_tool->use_handles)
{
/* draw the tool handles */
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_SQUARE,
tr_tool->tx1, tr_tool->ty1,
tr_tool->handle_w, tr_tool->handle_h,
GTK_ANCHOR_CENTER);
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_SQUARE,
tr_tool->tx2, tr_tool->ty2,
tr_tool->handle_w, tr_tool->handle_h,
GTK_ANCHOR_CENTER);
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_SQUARE,
tr_tool->tx3, tr_tool->ty3,
tr_tool->handle_w, tr_tool->handle_h,
GTK_ANCHOR_CENTER);
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_SQUARE,
tr_tool->tx4, tr_tool->ty4,
tr_tool->handle_w, tr_tool->handle_h,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_SQUARE,
tr_tool->tx1, tr_tool->ty1,
tr_tool->handle_w, tr_tool->handle_h,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_SQUARE,
tr_tool->tx2, tr_tool->ty2,
tr_tool->handle_w, tr_tool->handle_h,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_SQUARE,
tr_tool->tx3, tr_tool->ty3,
tr_tool->handle_w, tr_tool->handle_h,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_SQUARE,
tr_tool->tx4, tr_tool->ty4,
tr_tool->handle_w, tr_tool->handle_h,
GTK_ANCHOR_CENTER);
if (tr_tool->use_mid_handles)
{
@ -866,38 +866,38 @@ gimp_transform_tool_draw (GimpDrawTool *draw_tool)
x = (tr_tool->tx1 + tr_tool->tx2) / 2.0;
y = (tr_tool->ty1 + tr_tool->ty2) / 2.0;
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_SQUARE,
x, y,
tr_tool->handle_w, tr_tool->handle_h,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_SQUARE,
x, y,
tr_tool->handle_w, tr_tool->handle_h,
GTK_ANCHOR_CENTER);
x = (tr_tool->tx2 + tr_tool->tx4) / 2.0;
y = (tr_tool->ty2 + tr_tool->ty4) / 2.0;
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_SQUARE,
x, y,
tr_tool->handle_w, tr_tool->handle_h,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_SQUARE,
x, y,
tr_tool->handle_w, tr_tool->handle_h,
GTK_ANCHOR_CENTER);
x = (tr_tool->tx3 + tr_tool->tx4) / 2.0;
y = (tr_tool->ty3 + tr_tool->ty4) / 2.0;
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_SQUARE,
x, y,
tr_tool->handle_w, tr_tool->handle_h,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_SQUARE,
x, y,
tr_tool->handle_w, tr_tool->handle_h,
GTK_ANCHOR_CENTER);
x = (tr_tool->tx3 + tr_tool->tx1) / 2.0;
y = (tr_tool->ty3 + tr_tool->ty1) / 2.0;
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_SQUARE,
x, y,
tr_tool->handle_w, tr_tool->handle_h,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_SQUARE,
x, y,
tr_tool->handle_w, tr_tool->handle_h,
GTK_ANCHOR_CENTER);
}
}
@ -906,16 +906,16 @@ gimp_transform_tool_draw (GimpDrawTool *draw_tool)
{
gint d = MIN (tr_tool->handle_w, tr_tool->handle_h);
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_CIRCLE,
tr_tool->tcx, tr_tool->tcy,
d, d,
GTK_ANCHOR_CENTER);
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_CROSS,
tr_tool->tcx, tr_tool->tcy,
d, d,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_CIRCLE,
tr_tool->tcx, tr_tool->tcy,
d, d,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_CROSS,
tr_tool->tcx, tr_tool->tcy,
d, d,
GTK_ANCHOR_CENTER);
}
if (tr_tool->type == GIMP_TRANSFORM_TYPE_SELECTION)
@ -966,9 +966,9 @@ gimp_transform_tool_draw (GimpDrawTool *draw_tool)
}
}
gimp_draw_tool_draw_boundary (draw_tool,
segs_in, num_segs_in,
0, 0);
gimp_draw_tool_add_boundary (draw_tool,
segs_in, num_segs_in,
0, 0);
g_free (segs_in);
}
@ -997,9 +997,9 @@ gimp_transform_tool_draw (GimpDrawTool *draw_tool)
}
}
gimp_draw_tool_draw_boundary (draw_tool,
segs_out, num_segs_out,
0, 0);
gimp_draw_tool_add_boundary (draw_tool,
segs_out, num_segs_out,
0, 0);
g_free (segs_out);
}
}
@ -1036,10 +1036,10 @@ gimp_transform_tool_draw (GimpDrawTool *draw_tool)
&curr->x, &curr->y);
}
gimp_draw_tool_draw_strokes (draw_tool,
&g_array_index (coords,
GimpCoords, 0),
coords->len, FALSE);
gimp_draw_tool_add_strokes (draw_tool,
&g_array_index (coords,
GimpCoords, 0),
coords->len, FALSE);
}
if (coords)

View File

@ -1424,10 +1424,10 @@ gimp_vector_tool_draw (GimpDrawTool *draw_tool)
if (coords)
{
if (coords->len)
gimp_draw_tool_draw_strokes (draw_tool,
&g_array_index (coords,
GimpCoords, 0),
coords->len, FALSE);
gimp_draw_tool_add_strokes (draw_tool,
&g_array_index (coords,
GimpCoords, 0),
coords->len, FALSE);
g_array_free (coords, TRUE);
}
@ -1442,15 +1442,15 @@ gimp_vector_tool_draw (GimpDrawTool *draw_tool)
if (cur_anchor->type == GIMP_ANCHOR_ANCHOR)
{
gimp_draw_tool_draw_handle (draw_tool,
cur_anchor->selected ?
GIMP_HANDLE_CIRCLE :
GIMP_HANDLE_FILLED_CIRCLE,
cur_anchor->position.x,
cur_anchor->position.y,
TARGET,
TARGET,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
cur_anchor->selected ?
GIMP_HANDLE_CIRCLE :
GIMP_HANDLE_FILLED_CIRCLE,
cur_anchor->position.x,
cur_anchor->position.y,
TARGET,
TARGET,
GTK_ANCHOR_CENTER);
}
}
@ -1471,7 +1471,7 @@ gimp_vector_tool_draw (GimpDrawTool *draw_tool)
{
GimpCanvasItem *item;
item = gimp_draw_tool_draw_line
item = gimp_draw_tool_add_line
(draw_tool,
g_array_index (coords, GimpCoords, i).x,
g_array_index (coords, GimpCoords, i).y,
@ -1492,13 +1492,13 @@ gimp_vector_tool_draw (GimpDrawTool *draw_tool)
{
cur_anchor = GIMP_ANCHOR (list->data);
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_SQUARE,
cur_anchor->position.x,
cur_anchor->position.y,
TARGET - 3,
TARGET - 3,
GTK_ANCHOR_CENTER);
gimp_draw_tool_add_handle (draw_tool,
GIMP_HANDLE_SQUARE,
cur_anchor->position.x,
cur_anchor->position.y,
TARGET - 3,
TARGET - 3,
GTK_ANCHOR_CENTER);
}
g_list_free (draw_anchors);
@ -1541,10 +1541,10 @@ gimp_vector_tool_vectors_visible (GimpVectors *vectors,
if (coords)
{
if (coords->len)
gimp_draw_tool_draw_strokes (draw_tool,
&g_array_index (coords,
GimpCoords, 0),
coords->len, FALSE);
gimp_draw_tool_add_strokes (draw_tool,
&g_array_index (coords,
GimpCoords, 0),
coords->len, FALSE);
g_array_free (coords, TRUE);
}