[gimp] Bug 795230 - Rename Blend tool and provide PDB compatibility



commit 4f2e078ccb7be72c3af4641781f23b7d0c27f25e
Author: Michael Natterer <mitch gimp org>
Date:   Fri Apr 13 23:43:27 2018 +0200

    Bug 795230 - Rename Blend tool and provide PDB compatibility
    
    Rename gimpdrawable-blend.[ch] to gimpdrawable-gradient.[ch]

 app/core/Makefile.am                               |    4 +-
 app/core/gimpdrawable-blend.h                      |   49 -----------------
 ...impdrawable-blend.c => gimpdrawable-gradient.c} |   56 ++++++++++----------
 app/core/gimpdrawable-gradient.h                   |   49 +++++++++++++++++
 app/pdb/edit-cmds.c                                |   28 +++++-----
 app/tools/gimpblendtool.c                          |    9 ++--
 pdb/groups/edit.pdb                                |   28 +++++-----
 po/POTFILES.in                                     |    2 +-
 8 files changed, 113 insertions(+), 112 deletions(-)
---
diff --git a/app/core/Makefile.am b/app/core/Makefile.am
index 7338113..b644685 100644
--- a/app/core/Makefile.am
+++ b/app/core/Makefile.am
@@ -150,8 +150,6 @@ libappcore_a_sources = \
        gimpdocumentlist.h                      \
        gimpdrawable.c                          \
        gimpdrawable.h                          \
-       gimpdrawable-blend.c                    \
-       gimpdrawable-blend.h                    \
        gimpdrawable-bucket-fill.c              \
        gimpdrawable-bucket-fill.h              \
        gimpdrawable-combine.c                  \
@@ -166,6 +164,8 @@ libappcore_a_sources = \
        gimpdrawable-floating-selection.h       \
        gimpdrawable-foreground-extract.c       \
        gimpdrawable-foreground-extract.h       \
+       gimpdrawable-gradient.c                 \
+       gimpdrawable-gradient.h                 \
        gimpdrawable-histogram.c                \
        gimpdrawable-histogram.h                \
        gimpdrawable-levels.c                   \
diff --git a/app/core/gimpdrawable-blend.c b/app/core/gimpdrawable-gradient.c
similarity index 80%
rename from app/core/gimpdrawable-blend.c
rename to app/core/gimpdrawable-gradient.c
index 3c012e4..9689eb5 100644
--- a/app/core/gimpdrawable-blend.c
+++ b/app/core/gimpdrawable-gradient.c
@@ -29,7 +29,7 @@
 #include "gimp.h"
 #include "gimpchannel.h"
 #include "gimpcontext.h"
-#include "gimpdrawable-blend.h"
+#include "gimpdrawable-gradient.h"
 #include "gimpgradient.h"
 #include "gimpimage.h"
 #include "gimpprogress.h"
@@ -40,25 +40,25 @@
 /*  public functions  */
 
 void
-gimp_drawable_blend (GimpDrawable       *drawable,
-                     GimpContext        *context,
-                     GimpGradient       *gradient,
-                     GeglDistanceMetric  metric,
-                     GimpLayerMode       paint_mode,
-                     GimpGradientType    gradient_type,
-                     gdouble             opacity,
-                     gdouble             offset,
-                     GimpRepeatMode      repeat,
-                     gboolean            reverse,
-                     gboolean            supersample,
-                     gint                max_depth,
-                     gdouble             threshold,
-                     gboolean            dither,
-                     gdouble             startx,
-                     gdouble             starty,
-                     gdouble             endx,
-                     gdouble             endy,
-                     GimpProgress       *progress)
+gimp_drawable_gradient (GimpDrawable       *drawable,
+                        GimpContext        *context,
+                        GimpGradient       *gradient,
+                        GeglDistanceMetric  metric,
+                        GimpLayerMode       paint_mode,
+                        GimpGradientType    gradient_type,
+                        gdouble             opacity,
+                        gdouble             offset,
+                        GimpRepeatMode      repeat,
+                        gboolean            reverse,
+                        gboolean            supersample,
+                        gint                max_depth,
+                        gdouble             threshold,
+                        gboolean            dither,
+                        gdouble             startx,
+                        gdouble             starty,
+                        gdouble             endx,
+                        gdouble             endy,
+                        GimpProgress       *progress)
 {
   GimpImage  *image;
   GeglBuffer *buffer;
@@ -87,9 +87,9 @@ gimp_drawable_blend (GimpDrawable       *drawable,
       gradient_type <= GIMP_GRADIENT_SHAPEBURST_DIMPLED)
     {
       shapeburst =
-        gimp_drawable_blend_shapeburst_distmap (drawable, metric,
-                                                GEGL_RECTANGLE (x, y, width, height),
-                                                progress);
+        gimp_drawable_gradient_shapeburst_distmap (drawable, metric,
+                                                   GEGL_RECTANGLE (x, y, width, height),
+                                                   progress);
     }
 
   render = gegl_node_new_child (NULL,
@@ -122,7 +122,7 @@ gimp_drawable_blend (GimpDrawable       *drawable,
 
   gimp_drawable_apply_buffer (drawable, buffer,
                               GEGL_RECTANGLE (x, y, width, height),
-                              TRUE, C_("undo-type", "Blend"),
+                              TRUE, C_("undo-type", "Gradient"),
                               opacity, paint_mode,
                               GIMP_LAYER_COLOR_SPACE_AUTO,
                               GIMP_LAYER_COLOR_SPACE_AUTO,
@@ -137,10 +137,10 @@ gimp_drawable_blend (GimpDrawable       *drawable,
 }
 
 GeglBuffer *
-gimp_drawable_blend_shapeburst_distmap (GimpDrawable        *drawable,
-                                        GeglDistanceMetric   metric,
-                                        const GeglRectangle *region,
-                                        GimpProgress        *progress)
+gimp_drawable_gradient_shapeburst_distmap (GimpDrawable        *drawable,
+                                           GeglDistanceMetric   metric,
+                                           const GeglRectangle *region,
+                                           GimpProgress        *progress)
 {
   GimpChannel *mask;
   GimpImage   *image;
diff --git a/app/core/gimpdrawable-gradient.h b/app/core/gimpdrawable-gradient.h
new file mode 100644
index 0000000..21de4b4
--- /dev/null
+++ b/app/core/gimpdrawable-gradient.h
@@ -0,0 +1,49 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef  __GIMP_DRAWABLE_GRADIENT_H__
+#define  __GIMP_DRAWABLE_GRADIENT_H__
+
+
+void   gimp_drawable_gradient (GimpDrawable       *drawable,
+                               GimpContext        *context,
+                               GimpGradient       *gradient,
+                               GeglDistanceMetric  metric,
+                               GimpLayerMode       paint_mode,
+                               GimpGradientType    gradient_type,
+                               gdouble             opacity,
+                               gdouble             offset,
+                               GimpRepeatMode      repeat,
+                               gboolean            reverse,
+                               gboolean            supersample,
+                               gint                max_depth,
+                               gdouble             threshold,
+                               gboolean            dither,
+                               gdouble             startx,
+                               gdouble             starty,
+                               gdouble             endx,
+                               gdouble             endy,
+                               GimpProgress       *progress);
+
+GeglBuffer *
+gimp_drawable_gradient_shapeburst_distmap (GimpDrawable        *drawable,
+                                           GeglDistanceMetric   metric,
+                                           const GeglRectangle *region,
+                                           GimpProgress        *progress);
+
+
+#endif /* __GIMP_DRAWABLE_GRADIENT_H__ */
diff --git a/app/pdb/edit-cmds.c b/app/pdb/edit-cmds.c
index a40df04..545abe7 100644
--- a/app/pdb/edit-cmds.c
+++ b/app/pdb/edit-cmds.c
@@ -34,8 +34,8 @@
 #include "core/gimp.h"
 #include "core/gimpbuffer.h"
 #include "core/gimpchannel.h"
-#include "core/gimpdrawable-blend.h"
 #include "core/gimpdrawable-bucket-fill.h"
+#include "core/gimpdrawable-gradient.h"
 #include "core/gimpdrawable.h"
 #include "core/gimpimage.h"
 #include "core/gimplayer.h"
@@ -794,7 +794,7 @@ edit_blend_invoker (GimpProcedure         *procedure,
             paint_mode = GIMP_LAYER_MODE_SOFTLIGHT_LEGACY;
 
           if (progress)
-            gimp_progress_start (progress, FALSE, _("Blending"));
+            gimp_progress_start (progress, FALSE, _("Gradient"));
 
           switch (blend_mode)
             {
@@ -816,18 +816,18 @@ edit_blend_invoker (GimpProcedure         *procedure,
               break;
             }
 
-          gimp_drawable_blend (drawable,
-                               context,
-                               gradient,
-                               GIMP_PDB_CONTEXT (context)->distance_metric,
-                               paint_mode,
-                               gradient_type,
-                               opacity / 100.0,
-                               offset, repeat, reverse,
-                               supersample, max_depth,
-                               threshold, dither,
-                               x1, y1, x2, y2,
-                               progress);
+          gimp_drawable_gradient (drawable,
+                                  context,
+                                  gradient,
+                                  GIMP_PDB_CONTEXT (context)->distance_metric,
+                                  paint_mode,
+                                  gradient_type,
+                                  opacity / 100.0,
+                                  offset, repeat, reverse,
+                                  supersample, max_depth,
+                                  threshold, dither,
+                                  x1, y1, x2, y2,
+                                  progress);
 
           if (progress)
             gimp_progress_end (progress);
diff --git a/app/tools/gimpblendtool.c b/app/tools/gimpblendtool.c
index 851d8eb..ea70d9a 100644
--- a/app/tools/gimpblendtool.c
+++ b/app/tools/gimpblendtool.c
@@ -31,7 +31,7 @@
 #include "operations/gimp-operation-config.h"
 
 #include "core/gimpdrawable.h"
-#include "core/gimpdrawable-blend.h"
+#include "core/gimpdrawable-gradient.h"
 #include "core/gimpdrawablefilter.h"
 #include "core/gimperror.h"
 #include "core/gimpgradient.h"
@@ -803,9 +803,10 @@ gimp_blend_tool_precalc_shapeburst (GimpBlendTool *blend_tool)
     return;
 
   blend_tool->dist_buffer =
-    gimp_drawable_blend_shapeburst_distmap (tool->drawable, options->distance_metric,
-                                            GEGL_RECTANGLE (x, y, width, height),
-                                            GIMP_PROGRESS (blend_tool));
+    gimp_drawable_gradient_shapeburst_distmap (tool->drawable,
+                                               options->distance_metric,
+                                               GEGL_RECTANGLE (x, y, width, height),
+                                               GIMP_PROGRESS (blend_tool));
 
   if (blend_tool->dist_node)
     gegl_node_set (blend_tool->dist_node,
diff --git a/pdb/groups/edit.pdb b/pdb/groups/edit.pdb
index b150c07..82317a1 100644
--- a/pdb/groups/edit.pdb
+++ b/pdb/groups/edit.pdb
@@ -852,7 +852,7 @@ HELP
     );
 
     %invoke = (
-        headers => [ qw("core/gimp-gradients.h" "core/gimpdrawable-blend.h") ],
+        headers => [ qw("core/gimp-gradients.h" "core/gimpdrawable-gradient.h") ],
        code => <<'CODE'
 {
   success = (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
@@ -876,7 +876,7 @@ HELP
         paint_mode = GIMP_LAYER_MODE_SOFTLIGHT_LEGACY;
 
       if (progress)
-        gimp_progress_start (progress, FALSE, _("Blending"));
+        gimp_progress_start (progress, FALSE, _("Gradient"));
 
       switch (blend_mode)
         {
@@ -898,18 +898,18 @@ HELP
           break;
         }
 
-      gimp_drawable_blend (drawable,
-                           context,
-                           gradient,
-                           GIMP_PDB_CONTEXT (context)->distance_metric,
-                           paint_mode,
-                           gradient_type,
-                           opacity / 100.0,
-                          offset, repeat, reverse,
-                           supersample, max_depth,
-                           threshold, dither,
-                           x1, y1, x2, y2,
-                          progress);
+      gimp_drawable_gradient (drawable,
+                              context,
+                              gradient,
+                              GIMP_PDB_CONTEXT (context)->distance_metric,
+                              paint_mode,
+                              gradient_type,
+                              opacity / 100.0,
+                             offset, repeat, reverse,
+                              supersample, max_depth,
+                              threshold, dither,
+                              x1, y1, x2, y2,
+                             progress);
 
       if (progress)
         gimp_progress_end (progress);
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 91163af..8678079 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -131,12 +131,12 @@ app/core/gimpcurve-save.c
 app/core/gimpdata.c
 app/core/gimpdatafactory.c
 app/core/gimpdrawable.c
-app/core/gimpdrawable-blend.c
 app/core/gimpdrawable-bucket-fill.c
 app/core/gimpdrawable-equalize.c
 app/core/gimpdrawable-floating-selection.c
 app/core/gimpdrawable-foreground-extract.c
 app/core/gimpdrawable-fill.c
+app/core/gimpdrawable-gradient.c
 app/core/gimpdrawable-levels.c
 app/core/gimpdrawable-offset.c
 app/core/gimpdrawable-stroke.c


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