[gimp] app: move all GimpDynamics members to private



commit e3c0a4e5492439ce4e50ea49eea4f62324221fa4
Author: Michael Natterer <mitch gimp org>
Date:   Thu Mar 3 18:43:56 2011 +0100

    app: move all GimpDynamics members to private

 app/core/gimpdynamics.c      |  226 +++++++++++++++++++++++++----------------
 app/core/gimpdynamics.h      |   14 +---
 app/paint/gimpairbrush.c     |   36 ++++---
 app/paint/gimpbrushcore.c    |  157 +++++++++++++++++-------------
 app/paint/gimpclone.c        |   41 ++++----
 app/paint/gimpconvolve.c     |   15 ++-
 app/paint/gimpdodgeburn.c    |   34 ++++---
 app/paint/gimperaser.c       |   36 ++++---
 app/paint/gimpheal.c         |   32 ++++---
 app/paint/gimppaintbrush.c   |   24 ++++-
 app/paint/gimppaintoptions.c |   15 ++-
 app/paint/gimpsmudge.c       |   44 +++++---
 app/paint/gimpsourcecore.c   |   36 ++++---
 13 files changed, 420 insertions(+), 290 deletions(-)
---
diff --git a/app/core/gimpdynamics.c b/app/core/gimpdynamics.c
index 12b6fab..ba37b03 100644
--- a/app/core/gimpdynamics.c
+++ b/app/core/gimpdynamics.c
@@ -55,6 +55,29 @@ enum
 };
 
 
+typedef struct _GimpDynamicsPrivate GimpDynamicsPrivate;
+
+struct _GimpDynamicsPrivate
+{
+  GimpDynamicsOutput *opacity_output;
+  GimpDynamicsOutput *hardness_output;
+  GimpDynamicsOutput *force_output;
+  GimpDynamicsOutput *rate_output;
+  GimpDynamicsOutput *flow_output;
+  GimpDynamicsOutput *size_output;
+  GimpDynamicsOutput *aspect_ratio_output;
+  GimpDynamicsOutput *color_output;
+  GimpDynamicsOutput *angle_output;
+  GimpDynamicsOutput *jitter_output;
+  GimpDynamicsOutput *spacing_output;
+};
+
+#define GET_PRIVATE(output) \
+        G_TYPE_INSTANCE_GET_PRIVATE (output, \
+                                     GIMP_TYPE_DYNAMICS, \
+                                     GimpDynamicsPrivate)
+
+
 static void          gimp_dynamics_finalize      (GObject      *object);
 static void          gimp_dynamics_set_property  (GObject      *object,
                                                   guint         property_id,
@@ -81,7 +104,6 @@ static void          gimp_dynamics_output_notify (GObject          *output,
                                                   GimpDynamics     *dynamics);
 
 
-
 G_DEFINE_TYPE (GimpDynamics, gimp_dynamics,
                GIMP_TYPE_DATA)
 
@@ -165,64 +187,87 @@ gimp_dynamics_class_init (GimpDynamicsClass *klass)
                                    "spacing-output", NULL,
                                    GIMP_TYPE_DYNAMICS_OUTPUT,
                                    GIMP_CONFIG_PARAM_AGGREGATE);
+
+  g_type_class_add_private (klass, sizeof (GimpDynamicsPrivate));
 }
 
 static void
 gimp_dynamics_init (GimpDynamics *dynamics)
 {
-  dynamics->opacity_output      = gimp_dynamics_create_output (dynamics,
-                                                               "opacity-output",
-                                                               GIMP_DYNAMICS_OUTPUT_OPACITY);
-
-  dynamics->force_output        = gimp_dynamics_create_output (dynamics,
-                                                               "force-output",
-                                                               GIMP_DYNAMICS_OUTPUT_FORCE);
-
-  dynamics->hardness_output     = gimp_dynamics_create_output (dynamics,
-                                                               "hardness-output",
-                                                               GIMP_DYNAMICS_OUTPUT_HARDNESS);
-  dynamics->rate_output         = gimp_dynamics_create_output (dynamics,
-                                                               "rate-output",
-                                                               GIMP_DYNAMICS_OUTPUT_RATE);
-  dynamics->flow_output         = gimp_dynamics_create_output (dynamics,
-                                                               "flow-output",
-                                                               GIMP_DYNAMICS_OUTPUT_RATE);
-  dynamics->size_output         = gimp_dynamics_create_output (dynamics,
-                                                               "size-output",
-                                                               GIMP_DYNAMICS_OUTPUT_SIZE);
-  dynamics->aspect_ratio_output = gimp_dynamics_create_output (dynamics,
-                                                               "aspect-ratio-output",
-                                                               GIMP_DYNAMICS_OUTPUT_ASPECT_RATIO);
-  dynamics->color_output        = gimp_dynamics_create_output (dynamics,
-                                                               "color-output",
-                                                               GIMP_DYNAMICS_OUTPUT_COLOR);
-  dynamics->angle_output        = gimp_dynamics_create_output (dynamics,
-                                                               "angle-output",
-                                                               GIMP_DYNAMICS_OUTPUT_ANGLE);
-  dynamics->jitter_output       = gimp_dynamics_create_output (dynamics,
-                                                               "jitter-output",
-                                                               GIMP_DYNAMICS_OUTPUT_JITTER);
-  dynamics->spacing_output      = gimp_dynamics_create_output (dynamics,
-                                                               "spacing-output",
-                                                               GIMP_DYNAMICS_OUTPUT_SPACING);
+  GimpDynamicsPrivate *private = GET_PRIVATE (dynamics);
+
+  private->opacity_output =
+    gimp_dynamics_create_output (dynamics,
+                                 "opacity-output",
+                                 GIMP_DYNAMICS_OUTPUT_OPACITY);
+
+  private->force_output =
+    gimp_dynamics_create_output (dynamics,
+                                 "force-output",
+                                 GIMP_DYNAMICS_OUTPUT_FORCE);
+
+  private->hardness_output =
+    gimp_dynamics_create_output (dynamics,
+                                 "hardness-output",
+                                 GIMP_DYNAMICS_OUTPUT_HARDNESS);
+
+  private->rate_output =
+    gimp_dynamics_create_output (dynamics,
+                                 "rate-output",
+                                 GIMP_DYNAMICS_OUTPUT_RATE);
+
+  private->flow_output =
+    gimp_dynamics_create_output (dynamics,
+                                 "flow-output",
+                                 GIMP_DYNAMICS_OUTPUT_RATE);
+
+  private->size_output =
+    gimp_dynamics_create_output (dynamics,
+                                 "size-output",
+                                 GIMP_DYNAMICS_OUTPUT_SIZE);
+
+  private->aspect_ratio_output =
+    gimp_dynamics_create_output (dynamics,
+                                 "aspect-ratio-output",
+                                 GIMP_DYNAMICS_OUTPUT_ASPECT_RATIO);
+
+  private->color_output =
+    gimp_dynamics_create_output (dynamics,
+                                 "color-output",
+                                 GIMP_DYNAMICS_OUTPUT_COLOR);
+
+  private->angle_output =
+    gimp_dynamics_create_output (dynamics,
+                                 "angle-output",
+                                 GIMP_DYNAMICS_OUTPUT_ANGLE);
+
+  private->jitter_output =
+    gimp_dynamics_create_output (dynamics,
+                                 "jitter-output",
+                                 GIMP_DYNAMICS_OUTPUT_JITTER);
+
+  private->spacing_output =
+    gimp_dynamics_create_output (dynamics,
+                                 "spacing-output",
+                                 GIMP_DYNAMICS_OUTPUT_SPACING);
 }
 
 static void
 gimp_dynamics_finalize (GObject *object)
 {
-  GimpDynamics *dynamics = GIMP_DYNAMICS (object);
-
-  g_object_unref (dynamics->opacity_output);
-  g_object_unref (dynamics->force_output);
-  g_object_unref (dynamics->hardness_output);
-  g_object_unref (dynamics->rate_output);
-  g_object_unref (dynamics->flow_output);
-  g_object_unref (dynamics->size_output);
-  g_object_unref (dynamics->aspect_ratio_output);
-  g_object_unref (dynamics->color_output);
-  g_object_unref (dynamics->angle_output);
-  g_object_unref (dynamics->jitter_output);
-  g_object_unref (dynamics->spacing_output);
+  GimpDynamicsPrivate *private = GET_PRIVATE (object);
+
+  g_object_unref (private->opacity_output);
+  g_object_unref (private->force_output);
+  g_object_unref (private->hardness_output);
+  g_object_unref (private->rate_output);
+  g_object_unref (private->flow_output);
+  g_object_unref (private->size_output);
+  g_object_unref (private->aspect_ratio_output);
+  g_object_unref (private->color_output);
+  g_object_unref (private->angle_output);
+  g_object_unref (private->jitter_output);
+  g_object_unref (private->spacing_output);
 
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }
@@ -233,69 +278,69 @@ gimp_dynamics_set_property (GObject      *object,
                             const GValue *value,
                             GParamSpec   *pspec)
 {
-  GimpDynamics       *dynamics    = GIMP_DYNAMICS (object);
-  GimpDynamicsOutput *src_output  = NULL;
-  GimpDynamicsOutput *dest_output = NULL;
+  GimpDynamicsPrivate *private     = GET_PRIVATE (object);
+  GimpDynamicsOutput  *src_output  = NULL;
+  GimpDynamicsOutput  *dest_output = NULL;
 
   switch (property_id)
     {
     case PROP_NAME:
-      gimp_object_set_name (GIMP_OBJECT (dynamics), g_value_get_string (value));
+      gimp_object_set_name (GIMP_OBJECT (object), g_value_get_string (value));
       break;
 
     case PROP_OPACITY_OUTPUT:
       src_output  = g_value_get_object (value);
-      dest_output = dynamics->opacity_output;
+      dest_output = private->opacity_output;
       break;
 
     case PROP_FORCE_OUTPUT:
       src_output  = g_value_get_object (value);
-      dest_output = dynamics->force_output;
+      dest_output = private->force_output;
       break;
 
     case PROP_HARDNESS_OUTPUT:
       src_output  = g_value_get_object (value);
-      dest_output = dynamics->hardness_output;
+      dest_output = private->hardness_output;
       break;
 
     case PROP_RATE_OUTPUT:
       src_output  = g_value_get_object (value);
-      dest_output = dynamics->rate_output;
+      dest_output = private->rate_output;
       break;
 
     case PROP_FLOW_OUTPUT:
       src_output  = g_value_get_object (value);
-      dest_output = dynamics->flow_output;
+      dest_output = private->flow_output;
       break;
 
     case PROP_SIZE_OUTPUT:
       src_output  = g_value_get_object (value);
-      dest_output = dynamics->size_output;
+      dest_output = private->size_output;
       break;
 
     case PROP_ASPECT_RATIO_OUTPUT:
       src_output  = g_value_get_object (value);
-      dest_output = dynamics->aspect_ratio_output;
+      dest_output = private->aspect_ratio_output;
       break;
 
     case PROP_COLOR_OUTPUT:
       src_output  = g_value_get_object (value);
-      dest_output = dynamics->color_output;
+      dest_output = private->color_output;
       break;
 
     case PROP_ANGLE_OUTPUT:
       src_output  = g_value_get_object (value);
-      dest_output = dynamics->angle_output;
+      dest_output = private->angle_output;
       break;
 
     case PROP_JITTER_OUTPUT:
       src_output  = g_value_get_object (value);
-      dest_output = dynamics->jitter_output;
+      dest_output = private->jitter_output;
       break;
 
     case PROP_SPACING_OUTPUT:
       src_output  = g_value_get_object (value);
-      dest_output = dynamics->spacing_output;
+      dest_output = private->spacing_output;
       break;
 
     default:
@@ -317,56 +362,56 @@ gimp_dynamics_get_property (GObject    *object,
                             GValue     *value,
                             GParamSpec *pspec)
 {
-  GimpDynamics *dynamics = GIMP_DYNAMICS (object);
+  GimpDynamicsPrivate *private = GET_PRIVATE (object);
 
   switch (property_id)
     {
     case PROP_NAME:
-      g_value_set_string (value, gimp_object_get_name (dynamics));
+      g_value_set_string (value, gimp_object_get_name (object));
       break;
 
     case PROP_OPACITY_OUTPUT:
-      g_value_set_object (value, dynamics->opacity_output);
+      g_value_set_object (value, private->opacity_output);
       break;
 
     case PROP_FORCE_OUTPUT:
-      g_value_set_object (value, dynamics->force_output);
+      g_value_set_object (value, private->force_output);
       break;
 
     case PROP_HARDNESS_OUTPUT:
-      g_value_set_object (value, dynamics->hardness_output);
+      g_value_set_object (value, private->hardness_output);
       break;
 
     case PROP_RATE_OUTPUT:
-      g_value_set_object (value, dynamics->rate_output);
+      g_value_set_object (value, private->rate_output);
       break;
 
     case PROP_FLOW_OUTPUT:
-      g_value_set_object (value, dynamics->flow_output);
+      g_value_set_object (value, private->flow_output);
       break;
 
     case PROP_SIZE_OUTPUT:
-      g_value_set_object (value, dynamics->size_output);
+      g_value_set_object (value, private->size_output);
       break;
 
     case PROP_ASPECT_RATIO_OUTPUT:
-      g_value_set_object (value, dynamics->aspect_ratio_output);
+      g_value_set_object (value, private->aspect_ratio_output);
       break;
 
     case PROP_COLOR_OUTPUT:
-      g_value_set_object (value, dynamics->color_output);
+      g_value_set_object (value, private->color_output);
       break;
 
     case PROP_ANGLE_OUTPUT:
-      g_value_set_object (value, dynamics->angle_output);
+      g_value_set_object (value, private->angle_output);
       break;
 
     case PROP_JITTER_OUTPUT:
-      g_value_set_object (value, dynamics->jitter_output);
+      g_value_set_object (value, private->jitter_output);
       break;
 
     case PROP_SPACING_OUTPUT:
-      g_value_set_object (value, dynamics->spacing_output);
+      g_value_set_object (value, private->spacing_output);
       break;
 
     default:
@@ -450,51 +495,56 @@ GimpDynamicsOutput *
 gimp_dynamics_get_output (GimpDynamics           *dynamics,
                           GimpDynamicsOutputType  type_id)
 {
+  GimpDynamicsPrivate *private;
+
+  g_return_val_if_fail (GIMP_IS_DYNAMICS (dynamics), NULL);
+
+  private = GET_PRIVATE (dynamics);
 
   switch (type_id)
     {
     case GIMP_DYNAMICS_OUTPUT_OPACITY:
-      return dynamics->opacity_output;
+      return private->opacity_output;
       break;
 
     case GIMP_DYNAMICS_OUTPUT_FORCE:
-      return dynamics->force_output;
+      return private->force_output;
       break;
 
     case GIMP_DYNAMICS_OUTPUT_HARDNESS:
-      return dynamics->hardness_output;
+      return private->hardness_output;
       break;
 
     case GIMP_DYNAMICS_OUTPUT_RATE:
-      return dynamics->rate_output;
+      return private->rate_output;
       break;
 
     case GIMP_DYNAMICS_OUTPUT_FLOW:
-      return dynamics->flow_output;
+      return private->flow_output;
       break;
 
     case GIMP_DYNAMICS_OUTPUT_SIZE:
-      return dynamics->size_output;
+      return private->size_output;
       break;
 
     case GIMP_DYNAMICS_OUTPUT_ASPECT_RATIO:
-      return dynamics->aspect_ratio_output;
+      return private->aspect_ratio_output;
       break;
 
     case GIMP_DYNAMICS_OUTPUT_COLOR:
-      return dynamics->color_output;
+      return private->color_output;
       break;
 
     case GIMP_DYNAMICS_OUTPUT_ANGLE:
-      return dynamics->angle_output;
+      return private->angle_output;
       break;
 
     case GIMP_DYNAMICS_OUTPUT_JITTER:
-      return dynamics->jitter_output;
+      return private->jitter_output;
       break;
 
     case GIMP_DYNAMICS_OUTPUT_SPACING:
-      return dynamics->spacing_output;
+      return private->spacing_output;
       break;
 
     default:
diff --git a/app/core/gimpdynamics.h b/app/core/gimpdynamics.h
index 5c3a470..a6d2f6d 100644
--- a/app/core/gimpdynamics.h
+++ b/app/core/gimpdynamics.h
@@ -34,19 +34,7 @@ typedef struct _GimpDynamicsClass GimpDynamicsClass;
 
 struct _GimpDynamics
 {
-  GimpData            parent_instance;
-
-  GimpDynamicsOutput *opacity_output;
-  GimpDynamicsOutput *hardness_output;
-  GimpDynamicsOutput *force_output;
-  GimpDynamicsOutput *rate_output;
-  GimpDynamicsOutput *flow_output;
-  GimpDynamicsOutput *size_output;
-  GimpDynamicsOutput *aspect_ratio_output;
-  GimpDynamicsOutput *color_output;
-  GimpDynamicsOutput *angle_output;
-  GimpDynamicsOutput *jitter_output;
-  GimpDynamicsOutput *spacing_output;
+  GimpData  parent_instance;
 };
 
 struct _GimpDynamicsClass
diff --git a/app/paint/gimpairbrush.c b/app/paint/gimpairbrush.c
index 27ff463..936f450 100644
--- a/app/paint/gimpairbrush.c
+++ b/app/paint/gimpairbrush.c
@@ -142,10 +142,11 @@ gimp_airbrush_paint (GimpPaintCore    *paint_core,
 
       if ((options->rate != 0.0) && (!options->motion_only))
         {
-          GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
-          gdouble    fade_point;
-          gdouble    dynamic_rate;
-          gint       timeout;
+          GimpImage          *image = gimp_item_get_image (GIMP_ITEM (drawable));
+          GimpDynamicsOutput *rate_output;
+          gdouble             fade_point;
+          gdouble             dynamic_rate;
+          gint                timeout;
 
           fade_point = gimp_paint_options_get_fade (paint_options, image,
                                                     paint_core->pixel_dist);
@@ -153,11 +154,13 @@ gimp_airbrush_paint (GimpPaintCore    *paint_core,
           airbrush->drawable      = drawable;
           airbrush->paint_options = paint_options;
 
-          dynamic_rate =
-            gimp_dynamics_output_get_linear_value (dynamics->rate_output,
-                                                   coords,
-                                                   paint_options,
-                                                   fade_point);
+          rate_output = gimp_dynamics_get_output (dynamics,
+                                                  GIMP_DYNAMICS_OUTPUT_RATE);
+
+          dynamic_rate = gimp_dynamics_output_get_linear_value (rate_output,
+                                                                coords,
+                                                                paint_options,
+                                                                fade_point);
 
           timeout = 10000 / (options->rate * dynamic_rate);
 
@@ -191,20 +194,23 @@ gimp_airbrush_motion (GimpPaintCore    *paint_core,
 {
   GimpAirbrushOptions *options = GIMP_AIRBRUSH_OPTIONS (paint_options);
   GimpImage           *image   = gimp_item_get_image (GIMP_ITEM (drawable));
+  GimpDynamicsOutput  *flow_output;
   gdouble              opacity;
   gdouble              fade_point;
 
+  flow_output = gimp_dynamics_get_output (GIMP_BRUSH_CORE (paint_core)->dynamics,
+                                          GIMP_DYNAMICS_OUTPUT_FLOW);
+
   fade_point = gimp_paint_options_get_fade (paint_options, image,
                                             paint_core->pixel_dist);
-  opacity  = options->flow / 100.0;
-  opacity *= gimp_dynamics_output_get_linear_value(GIMP_BRUSH_CORE(paint_core)->dynamics->flow_output,
-                                                   coords,
-                                                   paint_options,
-                                                   fade_point);
 
+  opacity = (options->flow / 100.0 *
+             gimp_dynamics_output_get_linear_value (flow_output,
+                                                    coords,
+                                                    paint_options,
+                                                    fade_point));
 
   _gimp_paintbrush_motion (paint_core, drawable, paint_options, coords, opacity);
-
 }
 
 static gboolean
diff --git a/app/paint/gimpbrushcore.c b/app/paint/gimpbrushcore.c
index b1abcd3..5542e4d 100644
--- a/app/paint/gimpbrushcore.c
+++ b/app/paint/gimpbrushcore.c
@@ -361,13 +361,18 @@ gimp_brush_core_pre_paint (GimpPaintCore    *paint_core,
 
           if (GIMP_BRUSH_CORE_GET_CLASS (core)->handles_dynamic_transforming_brush)
             {
+              GimpDynamicsOutput *size_output;
+
+              size_output = gimp_dynamics_get_output (core->dynamics,
+                                                      GIMP_DYNAMICS_OUTPUT_SIZE);
+
               fade_point = gimp_paint_options_get_fade (paint_options, image,
                                                         paint_core->pixel_dist);
 
               scale = paint_options->brush_size /
                       MAX (core->main_brush->mask->width,
                            core->main_brush->mask->height) *
-                      gimp_dynamics_output_get_linear_value (core->dynamics->size_output,
+                      gimp_dynamics_output_get_linear_value (size_output,
                                                              &current_coords,
                                                              paint_options,
                                                              fade_point);
@@ -489,40 +494,40 @@ gimp_brush_core_interpolate (GimpPaintCore    *paint_core,
                              GimpPaintOptions *paint_options,
                              guint32           time)
 {
-  GimpBrushCore *core  = GIMP_BRUSH_CORE (paint_core);
-  GimpImage     *image = gimp_item_get_image (GIMP_ITEM (drawable));
-  GimpCoords     last_coords;
-  GimpCoords     current_coords;
-  GimpVector2    delta_vec;
-  gdouble        delta_pressure;
-  gdouble        delta_xtilt, delta_ytilt;
-  gdouble        delta_wheel;
-  gdouble        delta_velocity;
-  gdouble        temp_direction;
-  GimpVector2    temp_vec;
-  gint           n, num_points;
-  gdouble        t0, dt, tn;
-  gdouble        st_factor, st_offset;
-  gdouble        initial;
-  gdouble        dist;
-  gdouble        total;
-  gdouble        pixel_dist;
-  gdouble        pixel_initial;
-  gdouble        xd, yd;
-  gdouble        mag;
-  gdouble        dyn_spacing = core->spacing;
-  gdouble        fade_point;
-  gboolean       use_dyn_spacing;
+  GimpBrushCore      *core  = GIMP_BRUSH_CORE (paint_core);
+  GimpImage          *image = gimp_item_get_image (GIMP_ITEM (drawable));
+  GimpDynamicsOutput *spacing_output;
+  GimpCoords          last_coords;
+  GimpCoords          current_coords;
+  GimpVector2         delta_vec;
+  gdouble             delta_pressure;
+  gdouble             delta_xtilt, delta_ytilt;
+  gdouble             delta_wheel;
+  gdouble             delta_velocity;
+  gdouble             temp_direction;
+  GimpVector2         temp_vec;
+  gint                n, num_points;
+  gdouble             t0, dt, tn;
+  gdouble             st_factor, st_offset;
+  gdouble             initial;
+  gdouble             dist;
+  gdouble             total;
+  gdouble             pixel_dist;
+  gdouble             pixel_initial;
+  gdouble             xd, yd;
+  gdouble             mag;
+  gdouble             dyn_spacing = core->spacing;
+  gdouble             fade_point;
+  gboolean            use_dyn_spacing;
 
   g_return_if_fail (GIMP_IS_BRUSH (core->brush));
 
   gimp_paint_core_get_last_coords (paint_core, &last_coords);
   gimp_paint_core_get_current_coords (paint_core, &current_coords);
 
-
-  /*Zero sized brushes are unfit for interpolate,
-   * so we just let paint core fail onits own
-   **/
+  /*  Zero sized brushes are unfit for interpolate, so we just let
+   *  paint core fail onits own
+   */
   if (core->scale == 0.0)
     {
       gimp_paint_core_set_last_coords (paint_core, &current_coords);
@@ -532,19 +537,20 @@ gimp_brush_core_interpolate (GimpPaintCore    *paint_core,
       return;
     }
 
+  spacing_output = gimp_dynamics_get_output (core->dynamics,
+                                             GIMP_DYNAMICS_OUTPUT_SPACING);
+
   fade_point = gimp_paint_options_get_fade (paint_options, image,
                                             paint_core->pixel_dist);
 
-  use_dyn_spacing =
-    gimp_dynamics_output_is_enabled (core->dynamics->spacing_output);
+  use_dyn_spacing = gimp_dynamics_output_is_enabled (spacing_output);
 
   if (use_dyn_spacing)
     {
-      dyn_spacing =
-        gimp_dynamics_output_get_linear_value (core->dynamics->spacing_output,
-                                               &current_coords,
-                                               paint_options,
-                                               fade_point);
+      dyn_spacing = gimp_dynamics_output_get_linear_value (spacing_output,
+                                                           &current_coords,
+                                                           paint_options,
+                                                           fade_point);
 
       /* Dynamic spacing assumes that the value set in core is the min
        * value and the max is full 200% spacing. This approach differs
@@ -769,16 +775,19 @@ gimp_brush_core_interpolate (GimpPaintCore    *paint_core,
 
       if (core->jitter > 0.0)
         {
-          gdouble dyn_jitter;
-          gdouble jitter_dist;
-          gint32  jitter_angle;
+          GimpDynamicsOutput *jitter_output;
+          gdouble             dyn_jitter;
+          gdouble             jitter_dist;
+          gint32              jitter_angle;
+
+          jitter_output = gimp_dynamics_get_output (core->dynamics,
+                                                    GIMP_DYNAMICS_OUTPUT_JITTER);
 
-          dyn_jitter =
-            core->jitter *
-            gimp_dynamics_output_get_linear_value (core->dynamics->jitter_output,
-                                                   &current_coords,
-                                                   paint_options,
-                                                   fade_point);
+          dyn_jitter = (core->jitter *
+                        gimp_dynamics_output_get_linear_value (jitter_output,
+                                                               &current_coords,
+                                                               paint_options,
+                                                               fade_point));
 
           jitter_dist  = g_rand_double_range (core->rand, 0, dyn_jitter);
           jitter_angle = g_rand_int_range (core->rand,
@@ -1707,7 +1716,12 @@ gimp_brush_core_eval_transform_dynamics (GimpPaintCore     *paint_core,
 
   if (GIMP_BRUSH_CORE_GET_CLASS (core)->handles_dynamic_transforming_brush)
     {
-      gdouble dyn_aspect_ratio = 0.0;
+      GimpDynamicsOutput *size_output;
+      GimpDynamicsOutput *angle_output;
+      GimpDynamicsOutput *hardness_output;
+      GimpDynamicsOutput *aspect_output;
+      gdouble             dyn_aspect_ratio = 0.0;
+
       if (drawable)
         {
           GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
@@ -1716,35 +1730,42 @@ gimp_brush_core_eval_transform_dynamics (GimpPaintCore     *paint_core,
                                                     paint_core->pixel_dist);
         }
 
-      core->scale *=
-        gimp_dynamics_output_get_linear_value (core->dynamics->size_output,
-                                               coords,
-                                               paint_options,
-                                               fade_point);
-
-      core->angle +=
-        gimp_dynamics_output_get_angular_value (core->dynamics->angle_output,
-                                                coords,
-                                                paint_options,
-                                                fade_point);
+      size_output     = gimp_dynamics_get_output (core->dynamics,
+                                                  GIMP_DYNAMICS_OUTPUT_SIZE);
+      angle_output    = gimp_dynamics_get_output (core->dynamics,
+                                                  GIMP_DYNAMICS_OUTPUT_ANGLE);
+      hardness_output = gimp_dynamics_get_output (core->dynamics,
+                                                  GIMP_DYNAMICS_OUTPUT_HARDNESS);
+      hardness_output = gimp_dynamics_get_output (core->dynamics,
+                                                  GIMP_DYNAMICS_OUTPUT_HARDNESS);
+      aspect_output   = gimp_dynamics_get_output (core->dynamics,
+                                                  GIMP_DYNAMICS_OUTPUT_ASPECT_RATIO);
+
+      core->scale *= gimp_dynamics_output_get_linear_value (size_output,
+                                                            coords,
+                                                            paint_options,
+                                                            fade_point);
+
+      core->angle += gimp_dynamics_output_get_angular_value (angle_output,
+                                                             coords,
+                                                             paint_options,
+                                                             fade_point);
 
-      core->hardness =
-        gimp_dynamics_output_get_linear_value (core->dynamics->hardness_output,
-                                               coords,
-                                               paint_options,
-                                               fade_point);
+      core->hardness = gimp_dynamics_output_get_linear_value (hardness_output,
+                                                              coords,
+                                                              paint_options,
+                                                              fade_point);
 
-      dyn_aspect_ratio =
-        gimp_dynamics_output_get_aspect_value (core->dynamics->aspect_ratio_output,
-                                               coords,
-                                               paint_options,
-                                               fade_point);
+      dyn_aspect_ratio = gimp_dynamics_output_get_aspect_value (aspect_output,
+                                                                coords,
+                                                                paint_options,
+                                                                fade_point);
 
       /* Zero aspect ratio is special cased to half of all ar range,
        * to force dynamics to have any effect . Forcing to full results
        * in disapearing stamp if applied to maximum.
        */
-      if (gimp_dynamics_output_is_enabled (core->dynamics->aspect_ratio_output))
+      if (gimp_dynamics_output_is_enabled (aspect_output))
         {
           if (core->aspect_ratio == 0.0)
             core->aspect_ratio = 10.0 * dyn_aspect_ratio;
diff --git a/app/paint/gimpclone.c b/app/paint/gimpclone.c
index 992aa71..6d16485 100644
--- a/app/paint/gimpclone.c
+++ b/app/paint/gimpclone.c
@@ -164,21 +164,21 @@ gimp_clone_motion (GimpSourceCore   *source_core,
                    gint              paint_area_width,
                    gint              paint_area_height)
 {
-  GimpPaintCore     *paint_core     = GIMP_PAINT_CORE (source_core);
-  GimpCloneOptions  *options        = GIMP_CLONE_OPTIONS (paint_options);
-  GimpSourceOptions *source_options = GIMP_SOURCE_OPTIONS (paint_options);
-  GimpContext       *context        = GIMP_CONTEXT (paint_options);
-  GimpDynamics      *dynamics       = GIMP_BRUSH_CORE (paint_core)->dynamics;
-  GimpImage         *image          = gimp_item_get_image (GIMP_ITEM (drawable));
-  GimpImage         *src_image      = NULL;
-  GimpImageType      src_type       = 0;
-  GimpImageType      dest_type;
-  gpointer           pr = NULL;
-  gint               y;
-  PixelRegion        destPR;
-  GimpPattern       *pattern = NULL;
-  gdouble            fade_point;
-  gdouble            force;
+  GimpPaintCore      *paint_core     = GIMP_PAINT_CORE (source_core);
+  GimpCloneOptions   *options        = GIMP_CLONE_OPTIONS (paint_options);
+  GimpSourceOptions  *source_options = GIMP_SOURCE_OPTIONS (paint_options);
+  GimpContext        *context        = GIMP_CONTEXT (paint_options);
+  GimpImage          *image          = gimp_item_get_image (GIMP_ITEM (drawable));
+  GimpImage          *src_image      = NULL;
+  GimpDynamicsOutput *force_output;
+  GimpImageType       src_type       = 0;
+  GimpImageType       dest_type;
+  gpointer            pr = NULL;
+  gint                y;
+  PixelRegion         destPR;
+  GimpPattern        *pattern = NULL;
+  gdouble             fade_point;
+  gdouble             force;
 
   switch (options->clone_type)
     {
@@ -240,13 +240,16 @@ gimp_clone_motion (GimpSourceCore   *source_core,
         }
     }
 
+  force_output = gimp_dynamics_get_output (GIMP_BRUSH_CORE (paint_core)->dynamics,
+                                           GIMP_DYNAMICS_OUTPUT_FORCE);
+
   fade_point = gimp_paint_options_get_fade (paint_options, image,
                                             paint_core->pixel_dist);
 
-  force = gimp_dynamics_output_get_linear_value (dynamics->force_output,
-                                                    coords,
-                                                    paint_options,
-                                                    fade_point);
+  force = gimp_dynamics_output_get_linear_value (force_output,
+                                                 coords,
+                                                 paint_options,
+                                                 fade_point);
 
   gimp_brush_core_paste_canvas (GIMP_BRUSH_CORE (paint_core), drawable,
                                 coords,
diff --git a/app/paint/gimpconvolve.c b/app/paint/gimpconvolve.c
index 23f123c..bb6d936 100644
--- a/app/paint/gimpconvolve.c
+++ b/app/paint/gimpconvolve.c
@@ -130,6 +130,8 @@ gimp_convolve_motion (GimpPaintCore    *paint_core,
   GimpConvolveOptions *options    = GIMP_CONVOLVE_OPTIONS (paint_options);
   GimpContext         *context    = GIMP_CONTEXT (paint_options);
   GimpDynamics        *dynamics   = GIMP_BRUSH_CORE (paint_core)->dynamics;
+  GimpDynamicsOutput  *opacity_output;
+  GimpDynamicsOutput  *rate_output;
   GimpImage           *image;
   TempBuf             *area;
   PixelRegion          srcPR;
@@ -146,10 +148,13 @@ gimp_convolve_motion (GimpPaintCore    *paint_core,
 
   image = gimp_item_get_image (GIMP_ITEM (drawable));
 
+  opacity_output = gimp_dynamics_get_output (dynamics,
+                                             GIMP_DYNAMICS_OUTPUT_OPACITY);
+
   fade_point = gimp_paint_options_get_fade (paint_options, image,
                                             paint_core->pixel_dist);
 
-  opacity = gimp_dynamics_output_get_linear_value (dynamics->opacity_output,
+  opacity = gimp_dynamics_output_get_linear_value (opacity_output,
                                                    coords,
                                                    paint_options,
                                                    fade_point);
@@ -161,12 +166,14 @@ gimp_convolve_motion (GimpPaintCore    *paint_core,
   if (! area)
     return;
 
-  rate = options->rate;
+  rate_output = gimp_dynamics_get_output (dynamics,
+                                          GIMP_DYNAMICS_OUTPUT_RATE);
 
-  rate *= gimp_dynamics_output_get_linear_value (dynamics->rate_output,
+  rate = (options->rate *
+          gimp_dynamics_output_get_linear_value (rate_output,
                                                  coords,
                                                  paint_options,
-                                                 fade_point);
+                                                 fade_point));
 
   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 a3286a4..71b6e4a 100644
--- a/app/paint/gimpdodgeburn.c
+++ b/app/paint/gimpdodgeburn.c
@@ -168,27 +168,32 @@ gimp_dodge_burn_motion (GimpPaintCore    *paint_core,
                         GimpPaintOptions *paint_options,
                         const GimpCoords *coords)
 {
-  GimpDodgeBurn *dodgeburn = GIMP_DODGE_BURN (paint_core);
-  GimpContext   *context   = GIMP_CONTEXT (paint_options);
-  GimpDynamics  *dynamics  = GIMP_BRUSH_CORE (paint_core)->dynamics;
-  GimpImage     *image;
-  TempBuf       *area;
-  TempBuf       *orig;
-  PixelRegion    srcPR, destPR, tempPR;
-  guchar        *temp_data;
-  gdouble        fade_point;
-  gdouble        opacity;
-  gdouble        hardness;
+  GimpDodgeBurn      *dodgeburn = GIMP_DODGE_BURN (paint_core);
+  GimpContext        *context   = GIMP_CONTEXT (paint_options);
+  GimpDynamics       *dynamics  = GIMP_BRUSH_CORE (paint_core)->dynamics;
+  GimpDynamicsOutput *opacity_output;
+  GimpDynamicsOutput *hardness_output;
+  GimpImage          *image;
+  TempBuf            *area;
+  TempBuf            *orig;
+  PixelRegion         srcPR, destPR, tempPR;
+  guchar             *temp_data;
+  gdouble             fade_point;
+  gdouble             opacity;
+  gdouble             hardness;
 
   if (gimp_drawable_is_indexed (drawable))
     return;
 
   image = gimp_item_get_image (GIMP_ITEM (drawable));
 
+  opacity_output = gimp_dynamics_get_output (dynamics,
+                                             GIMP_DYNAMICS_OUTPUT_OPACITY);
+
   fade_point = gimp_paint_options_get_fade (paint_options, image,
                                             paint_core->pixel_dist);
 
-  opacity = gimp_dynamics_output_get_linear_value (dynamics->opacity_output,
+  opacity = gimp_dynamics_output_get_linear_value (opacity_output,
                                                    coords,
                                                    paint_options,
                                                    fade_point);
@@ -255,7 +260,10 @@ gimp_dodge_burn_motion (GimpPaintCore    *paint_core,
 
   g_free (temp_data);
 
-  hardness = gimp_dynamics_output_get_linear_value (dynamics->hardness_output,
+  hardness_output = gimp_dynamics_get_output (dynamics,
+                                              GIMP_DYNAMICS_OUTPUT_HARDNESS);
+
+  hardness = gimp_dynamics_output_get_linear_value (hardness_output,
                                                     coords,
                                                     paint_options,
                                                     fade_point);
diff --git a/app/paint/gimperaser.c b/app/paint/gimperaser.c
index daafb91..6cf296e 100644
--- a/app/paint/gimperaser.c
+++ b/app/paint/gimperaser.c
@@ -107,23 +107,28 @@ gimp_eraser_motion (GimpPaintCore    *paint_core,
                     GimpPaintOptions *paint_options,
                     const GimpCoords *coords)
 {
-  GimpEraserOptions *options  = GIMP_ERASER_OPTIONS (paint_options);
-  GimpContext       *context  = GIMP_CONTEXT (paint_options);
-  GimpDynamics      *dynamics = GIMP_BRUSH_CORE (paint_core)->dynamics;
-  GimpImage         *image;
-  gdouble            fade_point;
-  gdouble            opacity;
-  TempBuf           *area;
-  guchar             col[MAX_CHANNELS];
-  gdouble            force;
+  GimpEraserOptions  *options  = GIMP_ERASER_OPTIONS (paint_options);
+  GimpContext        *context  = GIMP_CONTEXT (paint_options);
+  GimpDynamics       *dynamics = GIMP_BRUSH_CORE (paint_core)->dynamics;
+  GimpDynamicsOutput *opacity_output;
+  GimpDynamicsOutput *force_output;
+  GimpImage          *image;
+  gdouble             fade_point;
+  gdouble             opacity;
+  TempBuf            *area;
+  guchar              col[MAX_CHANNELS];
+  gdouble             force;
 
   image = gimp_item_get_image (GIMP_ITEM (drawable));
 
+  opacity_output = gimp_dynamics_get_output (dynamics,
+                                             GIMP_DYNAMICS_OUTPUT_OPACITY);
+
   fade_point = gimp_paint_options_get_fade (paint_options,
                                             gimp_item_get_image (GIMP_ITEM (drawable)),
                                             paint_core->pixel_dist);
 
-  opacity = gimp_dynamics_output_get_linear_value (dynamics->opacity_output,
+  opacity = gimp_dynamics_output_get_linear_value (opacity_output,
                                                    coords,
                                                    paint_options,
                                                    fade_point);
@@ -145,10 +150,13 @@ gimp_eraser_motion (GimpPaintCore    *paint_core,
   color_pixels (temp_buf_get_data (area), col,
                 area->width * area->height, area->bytes);
 
-  force = gimp_dynamics_output_get_linear_value (dynamics->force_output,
-                                                    coords,
-                                                    paint_options,
-                                                    fade_point);
+  force_output = gimp_dynamics_get_output (dynamics,
+                                           GIMP_DYNAMICS_OUTPUT_FORCE);
+
+  force = gimp_dynamics_output_get_linear_value (force_output,
+                                                 coords,
+                                                 paint_options,
+                                                 fade_point);
 
   gimp_brush_core_paste_canvas (GIMP_BRUSH_CORE (paint_core), drawable,
                                 coords,
diff --git a/app/paint/gimpheal.c b/app/paint/gimpheal.c
index 15a0108..3c3c5f6 100644
--- a/app/paint/gimpheal.c
+++ b/app/paint/gimpheal.c
@@ -431,24 +431,28 @@ gimp_heal_motion (GimpSourceCore   *source_core,
                   gint              paint_area_width,
                   gint              paint_area_height)
 {
-  GimpPaintCore *paint_core = GIMP_PAINT_CORE (source_core);
-  GimpContext   *context    = GIMP_CONTEXT (paint_options);
-  GimpDynamics  *dynamics   = GIMP_BRUSH_CORE (paint_core)->dynamics;
-  GimpImage     *image      = gimp_item_get_image (GIMP_ITEM (drawable));
-  TempBuf       *src;
-  TempBuf       *temp;
-  PixelRegion    origPR;
-  PixelRegion    tempPR;
-  PixelRegion    destPR;
-  GimpImageType  src_type;
-  TempBuf       *mask_buf;
-  gdouble        fade_point;
-  gdouble        hardness;
+  GimpPaintCore      *paint_core = GIMP_PAINT_CORE (source_core);
+  GimpContext        *context    = GIMP_CONTEXT (paint_options);
+  GimpDynamics       *dynamics   = GIMP_BRUSH_CORE (paint_core)->dynamics;
+  GimpDynamicsOutput *hardness_output;
+  GimpImage          *image      = gimp_item_get_image (GIMP_ITEM (drawable));
+  TempBuf            *src;
+  TempBuf            *temp;
+  PixelRegion         origPR;
+  PixelRegion         tempPR;
+  PixelRegion         destPR;
+  GimpImageType       src_type;
+  TempBuf            *mask_buf;
+  gdouble             fade_point;
+  gdouble             hardness;
+
+  hardness_output = gimp_dynamics_get_output (dynamics,
+                                              GIMP_DYNAMICS_OUTPUT_HARDNESS);
 
   fade_point = gimp_paint_options_get_fade (paint_options, image,
                                             paint_core->pixel_dist);
 
-  hardness = gimp_dynamics_output_get_linear_value (dynamics->hardness_output,
+  hardness = gimp_dynamics_output_get_linear_value (hardness_output,
                                                     coords,
                                                     paint_options,
                                                     fade_point);
diff --git a/app/paint/gimppaintbrush.c b/app/paint/gimppaintbrush.c
index 28bd385..dfdea9a 100644
--- a/app/paint/gimppaintbrush.c
+++ b/app/paint/gimppaintbrush.c
@@ -112,6 +112,9 @@ _gimp_paintbrush_motion (GimpPaintCore    *paint_core,
   GimpBrushCore            *brush_core = GIMP_BRUSH_CORE (paint_core);
   GimpContext              *context    = GIMP_CONTEXT (paint_options);
   GimpDynamics             *dynamics   = brush_core->dynamics;
+  GimpDynamicsOutput       *opacity_output;
+  GimpDynamicsOutput       *color_output;
+  GimpDynamicsOutput       *force_output;
   GimpImage                *image;
   GimpRGB                   gradient_color;
   TempBuf                  *area;
@@ -123,10 +126,13 @@ _gimp_paintbrush_motion (GimpPaintCore    *paint_core,
 
   image = gimp_item_get_image (GIMP_ITEM (drawable));
 
+  opacity_output = gimp_dynamics_get_output (dynamics,
+                                             GIMP_DYNAMICS_OUTPUT_OPACITY);
+
   fade_point = gimp_paint_options_get_fade (paint_options, image,
                                             paint_core->pixel_dist);
 
-  opacity *= gimp_dynamics_output_get_linear_value (dynamics->opacity_output,
+  opacity *= gimp_dynamics_output_get_linear_value (opacity_output,
                                                     coords,
                                                     paint_options,
                                                     fade_point);
@@ -140,7 +146,10 @@ _gimp_paintbrush_motion (GimpPaintCore    *paint_core,
 
   paint_appl_mode = paint_options->application_mode;
 
-  grad_point = gimp_dynamics_output_get_linear_value (dynamics->color_output,
+  color_output = gimp_dynamics_get_output (dynamics,
+                                           GIMP_DYNAMICS_OUTPUT_COLOR);
+
+  grad_point = gimp_dynamics_output_get_linear_value (color_output,
                                                       coords,
                                                       paint_options,
                                                       fade_point);
@@ -195,10 +204,13 @@ _gimp_paintbrush_motion (GimpPaintCore    *paint_core,
                     area->bytes);
     }
 
-  force = gimp_dynamics_output_get_linear_value (dynamics->force_output,
-                                                    coords,
-                                                    paint_options,
-                                                    fade_point);
+  force_output = gimp_dynamics_get_output (dynamics,
+                                           GIMP_DYNAMICS_OUTPUT_FORCE);
+
+  force = gimp_dynamics_output_get_linear_value (force_output,
+                                                 coords,
+                                                 paint_options,
+                                                 fade_point);
 
   /* 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/gimppaintoptions.c b/app/paint/gimppaintoptions.c
index 14d51c4..0663c56 100644
--- a/app/paint/gimppaintoptions.c
+++ b/app/paint/gimppaintoptions.c
@@ -661,6 +661,7 @@ gimp_paint_options_get_gradient_color (GimpPaintOptions *paint_options,
   GimpGradientOptions *gradient_options;
   GimpGradient        *gradient;
   GimpDynamics        *dynamics;
+  GimpDynamicsOutput  *color_output;
 
   g_return_val_if_fail (GIMP_IS_PAINT_OPTIONS (paint_options), FALSE);
   g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
@@ -672,7 +673,10 @@ gimp_paint_options_get_gradient_color (GimpPaintOptions *paint_options,
 
   dynamics = gimp_context_get_dynamics (GIMP_CONTEXT (paint_options));
 
-  if (gimp_dynamics_output_is_enabled (dynamics->color_output))
+  color_output = gimp_dynamics_get_output (dynamics,
+                                           GIMP_DYNAMICS_OUTPUT_COLOR);
+
+  if (gimp_dynamics_output_is_enabled (color_output))
     {
       gimp_gradient_get_color_at (gradient, GIMP_CONTEXT (paint_options),
                                   NULL, grad_point,
@@ -688,7 +692,8 @@ gimp_paint_options_get_gradient_color (GimpPaintOptions *paint_options,
 GimpBrushApplicationMode
 gimp_paint_options_get_brush_mode (GimpPaintOptions *paint_options)
 {
-  GimpDynamics *dynamics;
+  GimpDynamics       *dynamics;
+  GimpDynamicsOutput *force_output;
 
   g_return_val_if_fail (GIMP_IS_PAINT_OPTIONS (paint_options), GIMP_BRUSH_SOFT);
 
@@ -697,9 +702,11 @@ gimp_paint_options_get_brush_mode (GimpPaintOptions *paint_options)
 
   dynamics = gimp_context_get_dynamics (GIMP_CONTEXT (paint_options));
 
+  force_output = gimp_dynamics_get_output (dynamics,
+                                           GIMP_DYNAMICS_OUTPUT_FORCE);
 
-   if (gimp_dynamics_output_is_enabled(dynamics->force_output))
-     return GIMP_BRUSH_PRESSURE;
+  if (gimp_dynamics_output_is_enabled (force_output))
+    return GIMP_BRUSH_PRESSURE;
 
   return GIMP_BRUSH_SOFT;
 }
diff --git a/app/paint/gimpsmudge.c b/app/paint/gimpsmudge.c
index 27be04c..392e19e 100644
--- a/app/paint/gimpsmudge.c
+++ b/app/paint/gimpsmudge.c
@@ -238,29 +238,35 @@ gimp_smudge_motion (GimpPaintCore    *paint_core,
                     GimpPaintOptions *paint_options,
                     const GimpCoords *coords)
 {
-  GimpSmudge        *smudge   = GIMP_SMUDGE (paint_core);
-  GimpSmudgeOptions *options  = GIMP_SMUDGE_OPTIONS (paint_options);
-  GimpContext       *context  = GIMP_CONTEXT (paint_options);
-  GimpDynamics      *dynamics = GIMP_BRUSH_CORE (paint_core)->dynamics;
-  GimpImage         *image;
-  TempBuf           *area;
-  PixelRegion        srcPR, destPR, tempPR;
-  gdouble            fade_point;
-  gdouble            opacity;
-  gdouble            rate;
-  gdouble            dynamic_rate;
-  gint               x, y, w, h;
-  gdouble            hardness;
+  GimpSmudge         *smudge   = GIMP_SMUDGE (paint_core);
+  GimpSmudgeOptions  *options  = GIMP_SMUDGE_OPTIONS (paint_options);
+  GimpContext        *context  = GIMP_CONTEXT (paint_options);
+  GimpDynamics       *dynamics = GIMP_BRUSH_CORE (paint_core)->dynamics;
+  GimpDynamicsOutput *opacity_output;
+  GimpDynamicsOutput *rate_output;
+  GimpDynamicsOutput *hardness_output;
+  GimpImage          *image;
+  TempBuf            *area;
+  PixelRegion         srcPR, destPR, tempPR;
+  gdouble             fade_point;
+  gdouble             opacity;
+  gdouble             rate;
+  gdouble             dynamic_rate;
+  gint                x, y, w, h;
+  gdouble             hardness;
 
   if (gimp_drawable_is_indexed (drawable))
     return;
 
   image = gimp_item_get_image (GIMP_ITEM (drawable));
 
+  opacity_output = gimp_dynamics_get_output (dynamics,
+                                             GIMP_DYNAMICS_OUTPUT_OPACITY);
+
   fade_point = gimp_paint_options_get_fade (paint_options, image,
                                             paint_core->pixel_dist);
 
-  opacity = gimp_dynamics_output_get_linear_value (dynamics->opacity_output,
+  opacity = gimp_dynamics_output_get_linear_value (opacity_output,
                                                    coords,
                                                    paint_options,
                                                    fade_point);
@@ -280,7 +286,10 @@ gimp_smudge_motion (GimpPaintCore    *paint_core,
                      area->x, area->y, area->width, area->height, FALSE);
 
   /* Enable dynamic rate */
-  dynamic_rate = gimp_dynamics_output_get_linear_value (dynamics->rate_output,
+  rate_output = gimp_dynamics_get_output (dynamics,
+                                          GIMP_DYNAMICS_OUTPUT_RATE);
+
+  dynamic_rate = gimp_dynamics_output_get_linear_value (rate_output,
                                                         coords,
                                                         paint_options,
                                                         fade_point);
@@ -324,7 +333,10 @@ gimp_smudge_motion (GimpPaintCore    *paint_core,
   else
     copy_region (&tempPR, &destPR);
 
-  hardness = gimp_dynamics_output_get_linear_value (dynamics->hardness_output,
+  hardness_output = gimp_dynamics_get_output (dynamics,
+                                              GIMP_DYNAMICS_OUTPUT_HARDNESS);
+
+  hardness = gimp_dynamics_output_get_linear_value (hardness_output,
                                                     coords,
                                                     paint_options,
                                                     fade_point);
diff --git a/app/paint/gimpsourcecore.c b/app/paint/gimpsourcecore.c
index 2495dd9..aebef20 100644
--- a/app/paint/gimpsourcecore.c
+++ b/app/paint/gimpsourcecore.c
@@ -345,26 +345,30 @@ gimp_source_core_motion (GimpSourceCore   *source_core,
                          const GimpCoords *coords)
 
 {
-  GimpPaintCore     *paint_core   = GIMP_PAINT_CORE (source_core);
-  GimpSourceOptions *options      = GIMP_SOURCE_OPTIONS (paint_options);
-  GimpDynamics      *dynamics     = GIMP_BRUSH_CORE (paint_core)->dynamics;
-  GimpImage         *image        = gimp_item_get_image (GIMP_ITEM (drawable));
-  GimpPickable      *src_pickable = NULL;
-  PixelRegion        srcPR;
-  gint               src_offset_x;
-  gint               src_offset_y;
-  TempBuf           *paint_area;
-  gint               paint_area_offset_x;
-  gint               paint_area_offset_y;
-  gint               paint_area_width;
-  gint               paint_area_height;
-  gdouble            fade_point;
-  gdouble            opacity;
+  GimpPaintCore      *paint_core   = GIMP_PAINT_CORE (source_core);
+  GimpSourceOptions  *options      = GIMP_SOURCE_OPTIONS (paint_options);
+  GimpDynamics       *dynamics     = GIMP_BRUSH_CORE (paint_core)->dynamics;
+  GimpDynamicsOutput *opacity_output;
+  GimpImage          *image        = gimp_item_get_image (GIMP_ITEM (drawable));
+  GimpPickable       *src_pickable = NULL;
+  PixelRegion         srcPR;
+  gint                src_offset_x;
+  gint                src_offset_y;
+  TempBuf            *paint_area;
+  gint                paint_area_offset_x;
+  gint                paint_area_offset_y;
+  gint                paint_area_width;
+  gint                paint_area_height;
+  gdouble             fade_point;
+  gdouble             opacity;
+
+  opacity_output = gimp_dynamics_get_output (dynamics,
+                                             GIMP_DYNAMICS_OUTPUT_OPACITY);
 
   fade_point = gimp_paint_options_get_fade (paint_options, image,
                                             paint_core->pixel_dist);
 
-  opacity = gimp_dynamics_output_get_linear_value (dynamics->opacity_output,
+  opacity = gimp_dynamics_output_get_linear_value (opacity_output,
                                                    coords,
                                                    paint_options,
                                                    fade_point);



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