From caa4c529f54238930f1b4beac6615a97245a037c Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Thu, 17 Jul 2008 19:00:13 +0000 Subject: [PATCH] removed 'use_pressure' field from GimpPaintCore. 2008-07-17 Sven Neumann * app/paint/gimppaintcore.[ch]: removed 'use_pressure' field from GimpPaintCore. * app/paint/gimppaintoptions.[ch]: removed 'use_pressure' parameter. * app/paint/gimpairbrush.c * app/paint/gimpbrushcore.c * app/paint/gimpclone.c * app/paint/gimpconvolve.c * app/paint/gimpdodgeburn.c * app/paint/gimperaser.c * app/paint/gimpheal.c * app/paint/gimppaintbrush.c * app/paint/gimpsmudge.c * app/tools/gimppainttool.c: changed accordingly. svn path=/trunk/; revision=26225 --- ChangeLog | 18 ++++++++++++++++++ app/paint/gimpairbrush.c | 3 +-- app/paint/gimpbrushcore.c | 11 ++++------- app/paint/gimpclone.c | 6 ++---- app/paint/gimpconvolve.c | 3 +-- app/paint/gimpdodgeburn.c | 6 ++---- app/paint/gimperaser.c | 6 ++---- app/paint/gimpheal.c | 6 ++---- app/paint/gimppaintbrush.c | 9 +++------ app/paint/gimppaintcore.c | 1 - app/paint/gimppaintcore.h | 1 - app/paint/gimppaintoptions.c | 25 ++++++++++--------------- app/paint/gimppaintoptions.h | 13 ++++--------- app/paint/gimpsmudge.c | 9 +++------ app/tools/gimppainttool.c | 7 ------- 15 files changed, 52 insertions(+), 72 deletions(-) diff --git a/ChangeLog b/ChangeLog index 10cf6daaf0..6dbf05cf86 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2008-07-17 Sven Neumann + + * app/paint/gimppaintcore.[ch]: removed 'use_pressure' field from + GimpPaintCore. + + * app/paint/gimppaintoptions.[ch]: removed 'use_pressure' parameter. + + * app/paint/gimpairbrush.c + * app/paint/gimpbrushcore.c + * app/paint/gimpclone.c + * app/paint/gimpconvolve.c + * app/paint/gimpdodgeburn.c + * app/paint/gimperaser.c + * app/paint/gimpheal.c + * app/paint/gimppaintbrush.c + * app/paint/gimpsmudge.c + * app/tools/gimppainttool.c: changed accordingly. + 2008-07-17 Tor Lillqvist * app/Makefile.am (win32_ldflags): Use -Wl,--large-address-aware diff --git a/app/paint/gimpairbrush.c b/app/paint/gimpairbrush.c index f54006db37..f31d87fa69 100644 --- a/app/paint/gimpairbrush.c +++ b/app/paint/gimpairbrush.c @@ -143,8 +143,7 @@ gimp_airbrush_paint (GimpPaintCore *paint_core, airbrush->paint_options = paint_options; dynamic_rate = gimp_paint_options_get_dynamic_rate (paint_options, - &paint_core->cur_coords, - paint_core->use_pressure); + &paint_core->cur_coords); timeout = 10000 / (options->rate * dynamic_rate); diff --git a/app/paint/gimpbrushcore.c b/app/paint/gimpbrushcore.c index 2de3d31d1f..88828d835a 100644 --- a/app/paint/gimpbrushcore.c +++ b/app/paint/gimpbrushcore.c @@ -355,7 +355,6 @@ gimp_brush_core_start (GimpPaintCore *paint_core, core->scale = gimp_paint_options_get_dynamic_size (paint_options, coords, - paint_core->use_pressure, GIMP_BRUSH_CORE_GET_CLASS (core)->handles_scaling_brush); core->spacing = (gdouble) gimp_brush_get_spacing (core->main_brush) / 100.0; @@ -689,12 +688,10 @@ gimp_brush_core_get_paint_area (GimpPaintCore *paint_core, gint brush_width, brush_height; if (GIMP_BRUSH_CORE_GET_CLASS (core)->handles_scaling_brush) - { - core->scale = gimp_paint_options_get_dynamic_size (paint_options, - &paint_core->cur_coords, - paint_core->use_pressure, - TRUE); - } + core->scale = gimp_paint_options_get_dynamic_size (paint_options, + &paint_core->cur_coords, + TRUE); + /* else use scale from start(), we don't support on-the-fly scaling */ gimp_brush_scale_size (core->brush, core->scale, diff --git a/app/paint/gimpclone.c b/app/paint/gimpclone.c index b0a7bf7502..ad1a6775ba 100644 --- a/app/paint/gimpclone.c +++ b/app/paint/gimpclone.c @@ -237,12 +237,10 @@ gimp_clone_motion (GimpSourceCore *source_core, } opacity *= gimp_paint_options_get_dynamic_opacity (paint_options, - &paint_core->cur_coords, - paint_core->use_pressure); + &paint_core->cur_coords); hardness = gimp_paint_options_get_dynamic_hardness (paint_options, - &paint_core->cur_coords, - paint_core->use_pressure); + &paint_core->cur_coords); gimp_brush_core_paste_canvas (GIMP_BRUSH_CORE (paint_core), drawable, MIN (opacity, GIMP_OPACITY_OPAQUE), diff --git a/app/paint/gimpconvolve.c b/app/paint/gimpconvolve.c index 6fb49bbad3..36383dd84e 100644 --- a/app/paint/gimpconvolve.c +++ b/app/paint/gimpconvolve.c @@ -151,8 +151,7 @@ gimp_convolve_motion (GimpPaintCore *paint_core, rate = options->rate; rate *= gimp_paint_options_get_dynamic_rate (paint_options, - &paint_core->cur_coords, - paint_core->use_pressure); + &paint_core->cur_coords); gimp_convolve_calculate_matrix (convolve, options->type, brush_core->brush->mask->width / 2, diff --git a/app/paint/gimpdodgeburn.c b/app/paint/gimpdodgeburn.c index 56a511c723..dd30990d0e 100644 --- a/app/paint/gimpdodgeburn.c +++ b/app/paint/gimpdodgeburn.c @@ -237,12 +237,10 @@ gimp_dodge_burn_motion (GimpPaintCore *paint_core, g_free (temp_data); opacity *= gimp_paint_options_get_dynamic_opacity (paint_options, - &paint_core->cur_coords, - paint_core->use_pressure); + &paint_core->cur_coords); hardness = gimp_paint_options_get_dynamic_hardness (paint_options, - &paint_core->cur_coords, - paint_core->use_pressure); + &paint_core->cur_coords); /* Replace the newly dodgedburned area (canvas_buf) to the image */ gimp_brush_core_replace_canvas (GIMP_BRUSH_CORE (paint_core), drawable, diff --git a/app/paint/gimperaser.c b/app/paint/gimperaser.c index e81e5d188d..7bfe1aa27a 100644 --- a/app/paint/gimperaser.c +++ b/app/paint/gimperaser.c @@ -132,12 +132,10 @@ gimp_eraser_motion (GimpPaintCore *paint_core, area->width * area->height, area->bytes); opacity *= gimp_paint_options_get_dynamic_opacity (paint_options, - &paint_core->cur_coords, - paint_core->use_pressure); + &paint_core->cur_coords); hardness = gimp_paint_options_get_dynamic_hardness (paint_options, - &paint_core->cur_coords, - paint_core->use_pressure); + &paint_core->cur_coords); gimp_brush_core_paste_canvas (GIMP_BRUSH_CORE (paint_core), drawable, MIN (opacity, GIMP_OPACITY_OPAQUE), diff --git a/app/paint/gimpheal.c b/app/paint/gimpheal.c index b35a0d1a20..a8635e015f 100644 --- a/app/paint/gimpheal.c +++ b/app/paint/gimpheal.c @@ -438,8 +438,7 @@ gimp_heal_motion (GimpSourceCore *source_core, gdouble hardness; hardness = gimp_paint_options_get_dynamic_hardness (paint_options, - &paint_core->cur_coords, - paint_core->use_pressure); + &paint_core->cur_coords); mask_buf = gimp_brush_core_get_brush_mask (GIMP_BRUSH_CORE (source_core), GIMP_BRUSH_HARD, @@ -547,8 +546,7 @@ gimp_heal_motion (GimpSourceCore *source_core, temp_buf_free (temp); opacity *= gimp_paint_options_get_dynamic_opacity (paint_options, - &paint_core->cur_coords, - paint_core->use_pressure); + &paint_core->cur_coords); /* replace the canvas with our healed data */ gimp_brush_core_replace_canvas (GIMP_BRUSH_CORE (paint_core), diff --git a/app/paint/gimppaintbrush.c b/app/paint/gimppaintbrush.c index 3849dc7d74..8b14f3fdb8 100644 --- a/app/paint/gimppaintbrush.c +++ b/app/paint/gimppaintbrush.c @@ -129,8 +129,7 @@ _gimp_paintbrush_motion (GimpPaintCore *paint_core, paint_appl_mode = paint_options->application_mode; grad_point = gimp_paint_options_get_dynamic_color (paint_options, - &paint_core->cur_coords, - paint_core->use_pressure); + &paint_core->cur_coords); /* optionally take the color from the current gradient */ if (gimp_paint_options_get_gradient_color (paint_options, image, @@ -175,12 +174,10 @@ _gimp_paintbrush_motion (GimpPaintCore *paint_core, } opacity *= gimp_paint_options_get_dynamic_opacity (paint_options, - &paint_core->cur_coords, - paint_core->use_pressure); + &paint_core->cur_coords); hardness = gimp_paint_options_get_dynamic_hardness (paint_options, - &paint_core->cur_coords, - paint_core->use_pressure); + &paint_core->cur_coords); /* finally, let the brush core paste the colored area on the canvas */ gimp_brush_core_paste_canvas (brush_core, drawable, diff --git a/app/paint/gimppaintcore.c b/app/paint/gimppaintcore.c index f66edfdf73..feef8091b1 100644 --- a/app/paint/gimppaintcore.c +++ b/app/paint/gimppaintcore.c @@ -150,7 +150,6 @@ gimp_paint_core_init (GimpPaintCore *core) core->x2 = 0; core->y2 = 0; - core->use_pressure = FALSE; core->use_saved_proj = FALSE; core->undo_tiles = NULL; diff --git a/app/paint/gimppaintcore.h b/app/paint/gimppaintcore.h index 7611107ebf..7b5e8f10af 100644 --- a/app/paint/gimppaintcore.h +++ b/app/paint/gimppaintcore.h @@ -55,7 +55,6 @@ struct _GimpPaintCore gint x1, y1; /* undo extents in image coords */ gint x2, y2; /* undo extents in image coords */ - gboolean use_pressure; /* look at coords->pressure */ gboolean use_saved_proj; /* keep the unmodified proj around */ TileManager *undo_tiles; /* tiles which have been modified */ diff --git a/app/paint/gimppaintoptions.c b/app/paint/gimppaintoptions.c index c31d56ddd5..a6c0f03243 100644 --- a/app/paint/gimppaintoptions.c +++ b/app/paint/gimppaintoptions.c @@ -980,8 +980,7 @@ gimp_paint_options_get_dynamics_mix (gdouble mix1, gdouble gimp_paint_options_get_dynamic_opacity (GimpPaintOptions *paint_options, - const GimpCoords *coords, - gboolean use_pressure) + const GimpCoords *coords) { gdouble opacity = 1.0; @@ -996,7 +995,7 @@ gimp_paint_options_get_dynamic_opacity (GimpPaintOptions *paint_options, gdouble velocity = -1.0; gdouble random = -1.0; - if (paint_options->pressure_options->opacity && use_pressure) + if (paint_options->pressure_options->opacity) pressure = GIMP_PAINT_PRESSURE_SCALE * coords->pressure; if (paint_options->velocity_options->opacity) @@ -1019,7 +1018,6 @@ gimp_paint_options_get_dynamic_opacity (GimpPaintOptions *paint_options, gdouble gimp_paint_options_get_dynamic_size (GimpPaintOptions *paint_options, const GimpCoords *coords, - gboolean use_pressure, gboolean use_dynamics) { gdouble scale = 1.0; @@ -1030,11 +1028,11 @@ gimp_paint_options_get_dynamic_size (GimpPaintOptions *paint_options, gdouble velocity = -1.0; gdouble random = -1.0; - if (paint_options->pressure_options->size && use_pressure) + if (paint_options->pressure_options->size) { pressure = coords->pressure; } - else if (paint_options->pressure_options->inverse_size && use_pressure) + else if (paint_options->pressure_options->inverse_size) { pressure = 1.0 - 0.9 * coords->pressure; } @@ -1078,8 +1076,7 @@ gimp_paint_options_get_dynamic_size (GimpPaintOptions *paint_options, gdouble gimp_paint_options_get_dynamic_rate (GimpPaintOptions *paint_options, - const GimpCoords *coords, - gboolean use_pressure) + const GimpCoords *coords) { gdouble rate = 1.0; @@ -1094,7 +1091,7 @@ gimp_paint_options_get_dynamic_rate (GimpPaintOptions *paint_options, gdouble velocity = -1.0; gdouble random = -1.0; - if (paint_options->pressure_options->rate && use_pressure) + if (paint_options->pressure_options->rate) pressure = GIMP_PAINT_PRESSURE_SCALE * coords->pressure; if (paint_options->velocity_options->rate) @@ -1117,8 +1114,7 @@ gimp_paint_options_get_dynamic_rate (GimpPaintOptions *paint_options, gdouble gimp_paint_options_get_dynamic_color (GimpPaintOptions *paint_options, - const GimpCoords *coords, - gboolean use_pressure) + const GimpCoords *coords) { gdouble color = 1.0; @@ -1133,7 +1129,7 @@ gimp_paint_options_get_dynamic_color (GimpPaintOptions *paint_options, gdouble velocity = -1.0; gdouble random = -1.0; - if (paint_options->pressure_options->color && use_pressure) + if (paint_options->pressure_options->color) pressure = GIMP_PAINT_PRESSURE_SCALE * coords->pressure; if (paint_options->velocity_options->color) @@ -1155,8 +1151,7 @@ gimp_paint_options_get_dynamic_color (GimpPaintOptions *paint_options, gdouble gimp_paint_options_get_dynamic_hardness (GimpPaintOptions *paint_options, - const GimpCoords *coords, - gboolean use_pressure) + const GimpCoords *coords) { gdouble hardness = 1.0; @@ -1171,7 +1166,7 @@ gimp_paint_options_get_dynamic_hardness (GimpPaintOptions *paint_options, gdouble velocity = -1.0; gdouble random = -1.0; - if (paint_options->pressure_options->hardness && use_pressure) + if (paint_options->pressure_options->hardness) pressure = GIMP_PAINT_PRESSURE_SCALE * coords->pressure; if (paint_options->velocity_options->hardness) diff --git a/app/paint/gimppaintoptions.h b/app/paint/gimppaintoptions.h index 8dd841856b..0639a40497 100644 --- a/app/paint/gimppaintoptions.h +++ b/app/paint/gimppaintoptions.h @@ -139,25 +139,20 @@ GimpBrushApplicationMode gdouble gimp_paint_options_get_dynamic_opacity (GimpPaintOptions *paint_options, - const GimpCoords *coords, - gboolean use_pressure); + const GimpCoords *coords); gdouble gimp_paint_options_get_dynamic_size (GimpPaintOptions *paint_options, const GimpCoords *coords, - gboolean use_pressure, gboolean use_dynamics); gdouble gimp_paint_options_get_dynamic_rate (GimpPaintOptions *paint_options, - const GimpCoords *coords, - gboolean use_pressure); + const GimpCoords *coords); gdouble gimp_paint_options_get_dynamic_color (GimpPaintOptions *paint_options, - const GimpCoords *coords, - gboolean use_pressure); + const GimpCoords *coords); gdouble gimp_paint_options_get_dynamic_hardness(GimpPaintOptions *paint_options, - const GimpCoords *coords, - gboolean use_pressure); + const GimpCoords *coords); #endif /* __GIMP_PAINT_OPTIONS_H__ */ diff --git a/app/paint/gimpsmudge.c b/app/paint/gimpsmudge.c index 9f906ebb5c..c743f3593c 100644 --- a/app/paint/gimpsmudge.c +++ b/app/paint/gimpsmudge.c @@ -264,8 +264,7 @@ gimp_smudge_motion (GimpPaintCore *paint_core, /* Enable dynamic rate */ dynamic_rate = gimp_paint_options_get_dynamic_rate (paint_options, - &paint_core->cur_coords, - paint_core->use_pressure); + &paint_core->cur_coords); rate = (options->rate / 100.0) * dynamic_rate; /* The tempPR will be the built up buffer (for smudge) */ @@ -306,12 +305,10 @@ gimp_smudge_motion (GimpPaintCore *paint_core, copy_region (&tempPR, &destPR); opacity *= gimp_paint_options_get_dynamic_opacity (paint_options, - &paint_core->cur_coords, - paint_core->use_pressure); + &paint_core->cur_coords); hardness = gimp_paint_options_get_dynamic_hardness (paint_options, - &paint_core->cur_coords, - paint_core->use_pressure); + &paint_core->cur_coords); gimp_brush_core_replace_canvas (GIMP_BRUSH_CORE (paint_core), drawable, MIN (opacity, GIMP_OPACITY_OPAQUE), diff --git a/app/tools/gimppainttool.c b/app/tools/gimppainttool.c index 2072a1bd58..c4e8a1f767 100644 --- a/app/tools/gimppainttool.c +++ b/app/tools/gimppainttool.c @@ -274,7 +274,6 @@ gimp_paint_tool_button_press (GimpTool *tool, GimpPaintOptions *paint_options = GIMP_PAINT_TOOL_GET_OPTIONS (tool); GimpPaintCore *core = paint_tool->core; GimpDrawable *drawable; - GdkDisplay *gdk_display; GimpCoords curr_coords; gint off_x, off_y; GError *error = NULL; @@ -311,11 +310,6 @@ gimp_paint_tool_button_press (GimpTool *tool, tool->display = display; } - gdk_display = gtk_widget_get_display (display->shell); - - core->use_pressure = (gimp_devices_get_current (display->image->gimp) != - gdk_display_get_core_pointer (gdk_display)); - if (! gimp_paint_core_start (core, drawable, paint_options, &curr_coords, &error)) { @@ -345,7 +339,6 @@ gimp_paint_tool_button_press (GimpTool *tool, GIMP_BRUSH_HARD); core->start_coords = core->last_coords; - core->use_pressure = FALSE; gimp_paint_tool_round_line (core, hard, state); }