Revert "app: Fix pdb properly this time"

This reverts commit 1a8edd7d1d.
This commit is contained in:
Michael Natterer 2011-03-19 16:42:53 +01:00
parent 1a8edd7d1d
commit bb80dfdc8e
2 changed files with 50 additions and 270 deletions

View File

@ -28,6 +28,7 @@
#include "core/gimpbrush.h"
#include "core/gimpdrawable.h"
#include "core/gimpdynamics.h"
#include "core/gimpdynamicsoutput.h"
#include "core/gimppaintinfo.h"
#include "core/gimpparamspecs.h"
#include "paint/gimppaintcore-stroke.h"
@ -128,9 +129,9 @@ airbrush_invoker (GimpProcedure *procedure,
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
gimp_brush_transform_size(brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
brush_size = MAX(height, width);
g_object_set (options,
"brush-size", brush_size,
@ -181,9 +182,9 @@ airbrush_default_invoker (GimpProcedure *procedure,
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
gimp_brush_transform_size(brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
brush_size = MAX(height, width);
g_object_set (options,
"brush-size", brush_size,
@ -241,9 +242,9 @@ clone_invoker (GimpProcedure *procedure,
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
gimp_brush_transform_size(brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
brush_size = MAX(height, width);
g_object_set (options,
"brush-size", brush_size,
@ -297,9 +298,9 @@ clone_default_invoker (GimpProcedure *procedure,
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
gimp_brush_transform_size(brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
brush_size = MAX(height, width);
g_object_set (options,
"brush-size", brush_size,
@ -353,14 +354,14 @@ convolve_invoker (GimpProcedure *procedure,
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
gimp_brush_transform_size(brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
brush_size = MAX(height, width);
g_object_set (options,
"brush-size", brush_size,
"type", convolve_type,
"rate", pressure,
"type", convolve_type,
"rate", pressure,
NULL);
success = paint_tools_stroke (gimp, context, options, drawable,
@ -407,9 +408,9 @@ convolve_default_invoker (GimpProcedure *procedure,
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
gimp_brush_transform_size(brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
brush_size = MAX(height, width);
g_object_set (options,
"brush-size", brush_size,
@ -465,18 +466,15 @@ dodgeburn_invoker (GimpProcedure *procedure,
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
gimp_brush_transform_size(brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
brush_size = MAX(height, width);
g_object_set (options,
"brush-size", brush_size,
NULL);
g_object_set (options,
"type", dodgeburn_type,
"mode", dodgeburn_mode,
"exposure", exposure,
"type", dodgeburn_type,
"mode", dodgeburn_mode,
"exposure", exposure,
NULL);
success = paint_tools_stroke (gimp, context, options, drawable,
@ -523,9 +521,9 @@ dodgeburn_default_invoker (GimpProcedure *procedure,
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
gimp_brush_transform_size(brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
brush_size = MAX(height, width);
g_object_set (options,
"brush-size", brush_size,
@ -579,9 +577,9 @@ eraser_invoker (GimpProcedure *procedure,
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
gimp_brush_transform_size(brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
brush_size = MAX(height, width);
g_object_set (options,
"brush-size", brush_size,
@ -633,9 +631,9 @@ eraser_default_invoker (GimpProcedure *procedure,
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
gimp_brush_transform_size(brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
brush_size = MAX(height, width);
g_object_set (options,
"brush-size", brush_size,
@ -691,9 +689,9 @@ heal_invoker (GimpProcedure *procedure,
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
gimp_brush_transform_size(brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
brush_size = MAX(height, width);
g_object_set (options,
"brush-size", brush_size,
@ -746,9 +744,9 @@ heal_default_invoker (GimpProcedure *procedure,
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
gimp_brush_transform_size(brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
brush_size = MAX(height, width);
g_object_set (options,
"brush-size", brush_size,
@ -806,9 +804,9 @@ paintbrush_invoker (GimpProcedure *procedure,
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
gimp_brush_transform_size(brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
brush_size = MAX(height, width);
g_object_set (options,
"brush-size", brush_size,
@ -818,18 +816,17 @@ paintbrush_invoker (GimpProcedure *procedure,
if (fade_out > 0)
{
GimpDynamicsOutput *opacity_output = gimp_dynamics_get_output(pcb_dynamics,
GIMP_DYNAMICS_OUTPUT_OPACITY);
g_object_set (opacity_output,
"use-fade", TRUE,
NULL);
GimpDynamicsOutput *opacity_output = gimp_dynamics_get_output(pcb_dynamics,
GIMP_DYNAMICS_OUTPUT_OPACITY);
g_object_set (opacity_output,
"use-fade", TRUE,
NULL);
}
if (gradient_length > 0)
{
GimpDynamicsOutput *color_output = gimp_dynamics_get_output(pcb_dynamics,
GIMP_DYNAMICS_OUTPUT_COLOR);
g_object_set (color_output,
"use-fade", TRUE,
NULL);
@ -883,9 +880,9 @@ paintbrush_default_invoker (GimpProcedure *procedure,
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
gimp_brush_transform_size(brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
brush_size = MAX(height, width);
g_object_set (options,
"brush-size", brush_size,
@ -935,13 +932,14 @@ pencil_invoker (GimpProcedure *procedure,
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
gimp_brush_transform_size(brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
brush_size = MAX(height, width);
g_object_set (options,
"brush-size", brush_size,
NULL);
success = paint_tools_stroke (gimp, context, options, drawable,
num_strokes, strokes, error,
"undo-desc", info->blurb,
@ -988,9 +986,9 @@ smudge_invoker (GimpProcedure *procedure,
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
gimp_brush_transform_size(brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
brush_size = MAX(height, width);
g_object_set (options,
"brush-size", brush_size,
@ -1041,9 +1039,9 @@ smudge_default_invoker (GimpProcedure *procedure,
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
gimp_brush_transform_size(brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
brush_size = MAX(height, width);
g_object_set (options,
"brush-size", brush_size,

View File

@ -59,17 +59,8 @@ HELP
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
GimpBrush *brush = gimp_context_get_brush (context);
gdouble brush_size;
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
g_object_set (options,
"brush-size", brush_size,
"pressure", pressure,
NULL);
@ -115,18 +106,6 @@ HELP
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
GimpBrush *brush = gimp_context_get_brush (context);
gdouble brush_size;
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
g_object_set (options,
"brush-size", brush_size,
NULL);
success = paint_tools_stroke (gimp, context, options, drawable,
num_strokes, strokes, error,
@ -185,17 +164,8 @@ HELP
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
GimpBrush *brush = gimp_context_get_brush (context);
gdouble brush_size;
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
g_object_set (options,
"brush-size", brush_size,
"clone-type", clone_type,
NULL);
@ -245,18 +215,6 @@ HELP
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
GimpBrush *brush = gimp_context_get_brush (context);
gdouble brush_size;
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
g_object_set (options,
"brush-size", brush_size,
NULL);
success = paint_tools_stroke (gimp, context, options, drawable,
num_strokes, strokes, error,
@ -300,18 +258,6 @@ HELP
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
GimpBrush *brush = gimp_context_get_brush (context);
gdouble brush_size;
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
g_object_set (options,
"brush-size", brush_size,
NULL);
success = paint_tools_stroke (gimp, context, options, drawable,
num_strokes, strokes, error,
@ -357,17 +303,8 @@ HELP
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
GimpBrush *brush = gimp_context_get_brush (context);
gdouble brush_size;
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
g_object_set (options,
"brush-size", brush_size,
"type", convolve_type,
"rate", pressure,
NULL);
@ -412,18 +349,6 @@ HELP
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
GimpBrush *brush = gimp_context_get_brush (context);
gdouble brush_size;
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
g_object_set (options,
"brush-size", brush_size,
NULL);
success = paint_tools_stroke (gimp, context, options, drawable,
num_strokes, strokes, error,
@ -470,17 +395,8 @@ HELP
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
GimpBrush *brush = gimp_context_get_brush (context);
gdouble brush_size;
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
g_object_set (options,
"brush-size", brush_size,
"application-mode", method,
"hard", hardness,
NULL);
@ -530,17 +446,8 @@ HELP
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
GimpBrush *brush = gimp_context_get_brush (context);
gdouble brush_size;
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
g_object_set (options,
"brush-size", brush_size,
"application-mode", method,
"hard", hardness,
"anti-erase", TRUE,
@ -595,18 +502,6 @@ HELP
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
GimpBrush *brush = gimp_context_get_brush (context);
gdouble brush_size;
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
g_object_set (options,
"brush-size", brush_size,
NULL);
success = paint_tools_stroke (gimp, context, options, drawable,
num_strokes, strokes, error,
@ -654,18 +549,6 @@ HELP
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
GimpBrush *brush = gimp_context_get_brush (context);
gdouble brush_size;
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
g_object_set (options,
"brush-size", brush_size,
NULL);
success = paint_tools_stroke (gimp, context, options, drawable,
num_strokes, strokes, error,
@ -720,50 +603,19 @@ HELP
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
GimpDynamics *pcb_dynamics = GIMP_DYNAMICS(gimp_dynamics_new(context, "pcb"));
GimpDynamics *user_dynamics = gimp_context_get_dynamics(context);
GimpBrush *brush = gimp_context_get_brush (context);
gdouble brush_size;
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
g_object_set (options,
"brush-size", brush_size,
"application-mode", method,
"fade-length", MAX(fade_out, gradient_length),
"use-fade", fade_out > 0.0,
"fade-length", fade_out,
"use-gradient", gradient_length > 0.0,
"gradient-length", gradient_length,
NULL);
if (fade_out > 0)
{
GimpDynamicsOutput *opacity_output = gimp_dynamics_get_output(pcb_dynamics,
GIMP_DYNAMICS_OUTPUT_OPACITY);
g_object_set (opacity_output,
"use-fade", TRUE,
NULL);
}
if (gradient_length > 0)
{
GimpDynamicsOutput *color_output = gimp_dynamics_get_output(pcb_dynamics,
GIMP_DYNAMICS_OUTPUT_COLOR);
g_object_set (color_output,
"use-fade", TRUE,
NULL);
}
gimp_context_set_dynamics (context, pcb_dynamics);
success = paint_tools_stroke (gimp, context, options, drawable,
num_strokes, strokes, error,
"undo-desc", info->blurb,
NULL);
gimp_context_set_dynamics (context, user_dynamics);
}
else
success = FALSE;
@ -810,18 +662,6 @@ HELP
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
GimpBrush *brush = gimp_context_get_brush (context);
gdouble brush_size;
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
g_object_set (options,
"brush-size", brush_size,
NULL);
success = paint_tools_stroke (gimp, context, options, drawable,
num_strokes, strokes, error,
@ -864,18 +704,7 @@ HELP
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
GimpBrush *brush = gimp_context_get_brush (context);
gdouble brush_size;
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
g_object_set (options,
"brush-size", brush_size,
NULL);
success = paint_tools_stroke (gimp, context, options, drawable,
num_strokes, strokes, error,
"undo-desc", info->blurb,
@ -916,17 +745,8 @@ HELP
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
GimpBrush *brush = gimp_context_get_brush (context);
gdouble brush_size;
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
g_object_set (options,
"brush-size", brush_size,
"rate", pressure,
NULL);
@ -972,18 +792,6 @@ HELP
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
GimpBrush *brush = gimp_context_get_brush (context);
gdouble brush_size;
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
g_object_set (options,
"brush-size", brush_size,
NULL);
success = paint_tools_stroke (gimp, context, options, drawable,
num_strokes, strokes, error,
@ -1030,18 +838,6 @@ HELP
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
GimpBrush *brush = gimp_context_get_brush (context);
gdouble brush_size;
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
g_object_set (options,
"brush-size", brush_size,
NULL);
g_object_set (options,
"type", dodgeburn_type,
@ -1091,18 +887,6 @@ HELP
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
{
GimpPaintOptions *options = gimp_paint_options_new (info);
GimpBrush *brush = gimp_context_get_brush (context);
gdouble brush_size;
gint height;
gint width;
gimp_brush_transform_size (brush, 1.0, 1.0, 0.0, &height, &width);
brush_size = MAX (height, width);
g_object_set (options,
"brush-size", brush_size,
NULL);
success = paint_tools_stroke (gimp, context, options, drawable,
num_strokes, strokes, error,
@ -1193,8 +977,6 @@ CODE
@headers = qw("libgimpmath/gimpmath.h"
"core/gimpbrush.h"
"core/gimpdynamics.h"
"core/gimppaintinfo.h"
"paint/gimppaintcore.h"
"paint/gimppaintcore-stroke.h"