[gimp] Revert "app: Fix pdb size and dynamics issues"



commit b3a597c7de16d41a36c0340d08bddfe1d2c86588
Author: Michael Natterer <mitch gimp org>
Date:   Sat Mar 19 16:43:09 2011 +0100

    Revert "app: Fix pdb size and dynamics issues"
    
    This reverts commit 9bae2a15cbcff4d23fb59c9bf99bb278acba81f5.

 app/pdb/paint-tools-cmds.c |  225 ++------------------------------------------
 1 files changed, 9 insertions(+), 216 deletions(-)
---
diff --git a/app/pdb/paint-tools-cmds.c b/app/pdb/paint-tools-cmds.c
index 1e2195d..ba594a4 100644
--- a/app/pdb/paint-tools-cmds.c
+++ b/app/pdb/paint-tools-cmds.c
@@ -25,10 +25,7 @@
 
 #include "pdb-types.h"
 
-#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"
@@ -124,17 +121,8 @@ airbrush_invoker (GimpProcedure      *procedure,
           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);
 
@@ -177,18 +165,6 @@ airbrush_default_invoker (GimpProcedure      *procedure,
           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,
@@ -237,17 +213,8 @@ clone_invoker (GimpProcedure      *procedure,
           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);
 
@@ -293,18 +260,6 @@ clone_default_invoker (GimpProcedure      *procedure,
           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,
@@ -349,19 +304,10 @@ convolve_invoker (GimpProcedure      *procedure,
           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,
+                        "type", convolve_type,
+                        "rate", pressure,
                         NULL);
 
           success = paint_tools_stroke (gimp, context, options, drawable,
@@ -403,18 +349,6 @@ convolve_default_invoker (GimpProcedure      *procedure,
           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,
@@ -461,20 +395,11 @@ dodgeburn_invoker (GimpProcedure      *procedure,
           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",       dodgeburn_type,
-                        "mode",       dodgeburn_mode,
-                        "exposure",   exposure,
+                        "type",     dodgeburn_type,
+                        "mode",     dodgeburn_mode,
+                        "exposure", exposure,
                         NULL);
 
           success = paint_tools_stroke (gimp, context, options, drawable,
@@ -516,18 +441,6 @@ dodgeburn_default_invoker (GimpProcedure      *procedure,
           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,
@@ -572,17 +485,8 @@ eraser_invoker (GimpProcedure      *procedure,
           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);
@@ -626,18 +530,6 @@ eraser_default_invoker (GimpProcedure      *procedure,
           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,
@@ -684,18 +576,6 @@ heal_invoker (GimpProcedure      *procedure,
           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,
@@ -739,18 +619,6 @@ heal_default_invoker (GimpProcedure      *procedure,
           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,
@@ -797,49 +665,19 @@ paintbrush_invoker (GimpProcedure      *procedure,
           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;
@@ -875,18 +713,6 @@ paintbrush_default_invoker (GimpProcedure      *procedure,
           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,
@@ -927,18 +753,6 @@ pencil_invoker (GimpProcedure      *procedure,
           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,
@@ -981,17 +795,8 @@ smudge_invoker (GimpProcedure      *procedure,
           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);
 
@@ -1034,18 +839,6 @@ smudge_default_invoker (GimpProcedure      *procedure,
           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,



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