[gimp/gimp-2-10] plug-ins, pdb: remove the edge-neon plug-in and add a PDB compat procedure



commit ab39b6acc741f4d3cc1f6e95b5b575cf19d12f6e
Author: Michael Natterer <mitch gimp org>
Date:   Sat Jul 13 23:59:31 2019 +0200

    plug-ins, pdb: remove the edge-neon plug-in and add a PDB compat procedure
    
    (cherry picked from commit 8b08f958ba5bccb00c91da204e1d18dbb006bbc1)

 app/pdb/internal-procs.c       |   2 +-
 app/pdb/plug-in-compat-cmds.c  |  92 +++++
 pdb/groups/plug_in_compat.pdb  |  55 +++
 plug-ins/common/.gitignore     |   2 -
 plug-ins/common/Makefile.am    |  19 -
 plug-ins/common/edge-neon.c    | 778 -----------------------------------------
 plug-ins/common/gimprc.common  |   1 -
 plug-ins/common/plugin-defs.pl |   1 -
 po-plug-ins/POTFILES.in        |   1 -
 9 files changed, 148 insertions(+), 803 deletions(-)
---
diff --git a/app/pdb/internal-procs.c b/app/pdb/internal-procs.c
index 569a2c2132..630450faff 100644
--- a/app/pdb/internal-procs.c
+++ b/app/pdb/internal-procs.c
@@ -28,7 +28,7 @@
 #include "internal-procs.h"
 
 
-/* 843 procedures registered total */
+/* 844 procedures registered total */
 
 void
 internal_procs_init (GimpPDB *pdb)
diff --git a/app/pdb/plug-in-compat-cmds.c b/app/pdb/plug-in-compat-cmds.c
index d029ac6308..0d06beecc4 100644
--- a/app/pdb/plug-in-compat-cmds.c
+++ b/app/pdb/plug-in-compat-cmds.c
@@ -2743,6 +2743,50 @@ plug_in_mosaic_invoker (GimpProcedure         *procedure,
                                            error ? *error : NULL);
 }
 
+static GimpValueArray *
+plug_in_neon_invoker (GimpProcedure         *procedure,
+                      Gimp                  *gimp,
+                      GimpContext           *context,
+                      GimpProgress          *progress,
+                      const GimpValueArray  *args,
+                      GError               **error)
+{
+  gboolean success = TRUE;
+  GimpDrawable *drawable;
+  gdouble radius;
+  gdouble amount;
+
+  drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
+  radius = g_value_get_double (gimp_value_array_index (args, 3));
+  amount = g_value_get_double (gimp_value_array_index (args, 4));
+
+  if (success)
+    {
+      if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
+                                     GIMP_PDB_ITEM_CONTENT, error) &&
+          gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
+        {
+          GeglNode *node;
+
+          node = gegl_node_new_child (NULL,
+                                      "operation", "gegl:edge-neon",
+                                      "radius",    radius,
+                                      "amount",    amount,
+                                      NULL);
+
+          gimp_drawable_apply_operation (drawable, progress,
+                                         C_("undo-type", "Neon"),
+                                         node);
+          g_object_unref (node);
+        }
+      else
+        success = FALSE;
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
 static GimpValueArray *
 plug_in_nova_invoker (GimpProcedure         *procedure,
                       Gimp                  *gimp,
@@ -7010,6 +7054,54 @@ register_plug_in_compat_procs (GimpPDB *pdb)
   gimp_pdb_register_procedure (pdb, procedure);
   g_object_unref (procedure);
 
+  /*
+   * gimp-plug-in-neon
+   */
+  procedure = gimp_procedure_new (plug_in_neon_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "plug-in-neon");
+  gimp_procedure_set_static_strings (procedure,
+                                     "plug-in-neon",
+                                     "Simulate the glowing boundary of a neon light",
+                                     "This filter works in a manner similar to the edge plug-in, but uses 
the first derivative of the gaussian operator to achieve resolution independence. The IIR method of 
calculating the effect is utilized to keep the processing time constant between large and small standard 
deviations.",
+                                     "Compatibility procedure. Please see 'gegl:edge-neon' for credits.",
+                                     "Compatibility procedure. Please see 'gegl:edge-neon' for credits.",
+                                     "2019",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_enum ("run-mode",
+                                                  "run mode",
+                                                  "The run mode",
+                                                  GIMP_TYPE_RUN_MODE,
+                                                  GIMP_RUN_INTERACTIVE,
+                                                  GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_image_id ("image",
+                                                         "image",
+                                                         "Input image (unused)",
+                                                         pdb->gimp, FALSE,
+                                                         GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_drawable_id ("drawable",
+                                                            "drawable",
+                                                            "Input drawable",
+                                                            pdb->gimp, FALSE,
+                                                            GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_double ("radius",
+                                                    "radius",
+                                                    "Radius of neon effect (in pixels)",
+                                                    0.0, 1500.0, 0.0,
+                                                    GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_double ("amount",
+                                                    "amount",
+                                                    "Effect enhancement variable",
+                                                    0.0, 100.0, 0.0,
+                                                    GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
   /*
    * gimp-plug-in-nova
    */
diff --git a/pdb/groups/plug_in_compat.pdb b/pdb/groups/plug_in_compat.pdb
index 826c845c0c..030635c1d2 100644
--- a/pdb/groups/plug_in_compat.pdb
+++ b/pdb/groups/plug_in_compat.pdb
@@ -2717,6 +2717,60 @@ CODE
     );
 }
 
+sub plug_in_neon {
+    $blurb = 'Simulate the glowing boundary of a neon light';
+
+    $help = <<'HELP';
+This filter works in a manner similar to the edge plug-in, but uses
+the first derivative of the gaussian operator to achieve resolution
+independence. The IIR method of calculating the effect is utilized to
+keep the processing time constant between large and small standard
+deviations.
+HELP
+
+    &std_pdb_compat('gegl:edge-neon');
+    $date = '2019';
+
+    @inargs = (
+        { name => 'run_mode', type => 'enum GimpRunMode', dead => 1,
+          desc => 'The run mode' },
+        { name => 'image', type => 'image', dead => 1,
+          desc => 'Input image (unused)' },
+        { name => 'drawable', type => 'drawable',
+          desc => 'Input drawable' },
+        { name => 'radius', type => '0.0 <= float <= 1500.0',
+          desc => 'Radius of neon effect (in pixels)' },
+        { name => 'amount', type => '0.0 <= float <= 100.0',
+          desc => 'Effect enhancement variable' }
+    );
+
+    %invoke = (
+        code => <<'CODE'
+{
+  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
+                                 GIMP_PDB_ITEM_CONTENT, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
+    {
+      GeglNode *node;
+
+      node = gegl_node_new_child (NULL,
+                                  "operation", "gegl:edge-neon",
+                                  "radius",    radius,
+                                  "amount",    amount,
+                                  NULL);
+
+      gimp_drawable_apply_operation (drawable, progress,
+                                     C_("undo-type", "Neon"),
+                                     node);
+      g_object_unref (node);
+    }
+  else
+    success = FALSE;
+}
+CODE
+    );
+}
+
 sub plug_in_nova {
     $blurb = 'Add a starburst to the image';
 
@@ -5061,6 +5115,7 @@ CODE
             plug_in_mblur
             plug_in_mblur_inward
             plug_in_mosaic
+            plug_in_neon
             plug_in_nova
             plug_in_papertile
             plug_in_pixelize
diff --git a/plug-ins/common/.gitignore b/plug-ins/common/.gitignore
index 2c0538e5e6..58b0f604c5 100644
--- a/plug-ins/common/.gitignore
+++ b/plug-ins/common/.gitignore
@@ -50,8 +50,6 @@
 /destripe.exe
 /edge-dog
 /edge-dog.exe
-/edge-neon
-/edge-neon.exe
 /emboss
 /emboss.exe
 /file-aa
diff --git a/plug-ins/common/Makefile.am b/plug-ins/common/Makefile.am
index 09df128d66..a5588fb2d0 100644
--- a/plug-ins/common/Makefile.am
+++ b/plug-ins/common/Makefile.am
@@ -70,7 +70,6 @@ depth_merge_libexecdir = $(gimpplugindir)/plug-ins/depth-merge
 despeckle_libexecdir = $(gimpplugindir)/plug-ins/despeckle
 destripe_libexecdir = $(gimpplugindir)/plug-ins/destripe
 edge_dog_libexecdir = $(gimpplugindir)/plug-ins/edge-dog
-edge_neon_libexecdir = $(gimpplugindir)/plug-ins/edge-neon
 emboss_libexecdir = $(gimpplugindir)/plug-ins/emboss
 file_aa_libexecdir = $(gimpplugindir)/plug-ins/file-aa
 file_cel_libexecdir = $(gimpplugindir)/plug-ins/file-cel
@@ -165,7 +164,6 @@ depth_merge_libexec_PROGRAMS = depth-merge
 despeckle_libexec_PROGRAMS = despeckle
 destripe_libexec_PROGRAMS = destripe
 edge_dog_libexec_PROGRAMS = edge-dog
-edge_neon_libexec_PROGRAMS = edge-neon
 emboss_libexec_PROGRAMS = emboss
 file_aa_libexec_PROGRAMS = $(FILE_AA)
 file_cel_libexec_PROGRAMS = file-cel
@@ -675,23 +673,6 @@ edge_dog_LDADD = \
        $(INTLLIBS)             \
        $(edge_dog_RC)
 
-edge_neon_SOURCES = \
-       edge-neon.c
-
-edge_neon_LDADD = \
-       $(libgimpui)            \
-       $(libgimpwidgets)       \
-       $(libgimpmodule)        \
-       $(libgimp)              \
-       $(libgimpmath)          \
-       $(libgimpconfig)        \
-       $(libgimpcolor)         \
-       $(libgimpbase)          \
-       $(GTK_LIBS)             \
-       $(RT_LIBS)              \
-       $(INTLLIBS)             \
-       $(edge_neon_RC)
-
 emboss_SOURCES = \
        emboss.c
 
diff --git a/plug-ins/common/gimprc.common b/plug-ins/common/gimprc.common
index d47b82f171..77d946983b 100644
--- a/plug-ins/common/gimprc.common
+++ b/plug-ins/common/gimprc.common
@@ -22,7 +22,6 @@ depth_merge_RC = depth-merge.rc.o
 despeckle_RC = despeckle.rc.o
 destripe_RC = destripe.rc.o
 edge_dog_RC = edge-dog.rc.o
-edge_neon_RC = edge-neon.rc.o
 emboss_RC = emboss.rc.o
 file_aa_RC = file-aa.rc.o
 file_cel_RC = file-cel.rc.o
diff --git a/plug-ins/common/plugin-defs.pl b/plug-ins/common/plugin-defs.pl
index ef7d810fe2..a979f4f2d0 100644
--- a/plug-ins/common/plugin-defs.pl
+++ b/plug-ins/common/plugin-defs.pl
@@ -23,7 +23,6 @@
     'despeckle' => { ui => 1, gegl => 1 },
     'destripe' => { ui => 1, gegl => 1 },
     'edge-dog' => { ui => 1 },
-    'edge-neon' => { ui => 1 },
     'emboss' => { ui => 1 },
     'file-aa' => { ui => 1, gegl => 1, optional => 1, libs => 'AA_LIBS' },
     'file-cel' => { ui => 1, gegl => 1 },
diff --git a/po-plug-ins/POTFILES.in b/po-plug-ins/POTFILES.in
index b771722c17..aa3e281588 100644
--- a/po-plug-ins/POTFILES.in
+++ b/po-plug-ins/POTFILES.in
@@ -27,7 +27,6 @@ plug-ins/common/depth-merge.c
 plug-ins/common/despeckle.c
 plug-ins/common/destripe.c
 plug-ins/common/edge-dog.c
-plug-ins/common/edge-neon.c
 plug-ins/common/emboss.c
 plug-ins/common/file-aa.c
 plug-ins/common/file-cel.c


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