[gimp] Revert "app: Fix pdb properly this time"



commit bb80dfdc8eb0373a1a598ec5d149be50b7271073
Author: Michael Natterer <mitch gimp org>
Date:   Sat Mar 19 16:42:53 2011 +0100

    Revert "app: Fix pdb properly this time"
    
    This reverts commit 1a8edd7d1da2fb59e265c7dce3f25d9470c75e74.

 app/pdb/paint-tools-cmds.c       |   94 ++++++++--------
 tools/pdbgen/pdb/paint_tools.pdb |  226 +-------------------------------------
 2 files changed, 50 insertions(+), 270 deletions(-)
---
diff --git a/app/pdb/paint-tools-cmds.c b/app/pdb/paint-tools-cmds.c
index 7b2bd5b..1e2195d 100644
--- a/app/pdb/paint-tools-cmds.c
+++ b/app/pdb/paint-tools-cmds.c
@@ -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,
diff --git a/tools/pdbgen/pdb/paint_tools.pdb b/tools/pdbgen/pdb/paint_tools.pdb
index e583704..486ad17 100644
--- a/tools/pdbgen/pdb/paint_tools.pdb
+++ b/tools/pdbgen/pdb/paint_tools.pdb
@@ -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"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]