removed 'use_pressure' field from GimpPaintCore.

2008-07-17  Sven Neumann  <sven@gimp.org>

	* 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
This commit is contained in:
Sven Neumann 2008-07-17 19:00:13 +00:00 committed by Sven Neumann
parent 3088d59d3e
commit caa4c529f5
15 changed files with 52 additions and 72 deletions

View File

@ -1,3 +1,21 @@
2008-07-17 Sven Neumann <sven@gimp.org>
* 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 <tml@novell.com>
* app/Makefile.am (win32_ldflags): Use -Wl,--large-address-aware

View File

@ -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);

View File

@ -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);
}
/* else use scale from start(), we don't support on-the-fly scaling */
gimp_brush_scale_size (core->brush, core->scale,

View File

@ -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),

View File

@ -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,

View File

@ -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,

View File

@ -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),

View File

@ -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),

View File

@ -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,

View File

@ -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;

View File

@ -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 */

View File

@ -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)

View File

@ -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__ */

View File

@ -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),

View File

@ -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);
}