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



commit 8b08f958ba5bccb00c91da204e1d18dbb006bbc1
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

 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 61f0280e70..d64c761546 100644
--- a/app/pdb/internal-procs.c
+++ b/app/pdb/internal-procs.c
@@ -28,7 +28,7 @@
 #include "internal-procs.h"
 
 
-/* 737 procedures registered total */
+/* 738 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 5dba70ef81..f0d009df8c 100644
--- a/app/pdb/plug-in-compat-cmds.c
+++ b/app/pdb/plug-in-compat-cmds.c
@@ -2505,6 +2505,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,
@@ -6693,6 +6737,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 60cd7c7669..1fc772ce7c 100644
--- a/pdb/groups/plug_in_compat.pdb
+++ b/pdb/groups/plug_in_compat.pdb
@@ -2482,6 +2482,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';
 
@@ -4895,6 +4949,7 @@ CODE
             plug_in_mblur
             plug_in_mblur_inward
             plug_in_mosaic
+            plug_in_neon
             plug_in_nova
             plug_in_papertile
             plug_in_photocopy
diff --git a/plug-ins/common/.gitignore b/plug-ins/common/.gitignore
index d0465cde32..11e632c6f6 100644
--- a/plug-ins/common/.gitignore
+++ b/plug-ins/common/.gitignore
@@ -44,8 +44,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 60f1dc0997..c59a13ba5a 100644
--- a/plug-ins/common/Makefile.am
+++ b/plug-ins/common/Makefile.am
@@ -67,7 +67,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
@@ -157,7 +156,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
@@ -613,23 +611,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 6ae56d28f2..5f4ff96196 100644
--- a/plug-ins/common/gimprc.common
+++ b/plug-ins/common/gimprc.common
@@ -19,7 +19,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 82ddaf95be..b02508c7de 100644
--- a/plug-ins/common/plugin-defs.pl
+++ b/plug-ins/common/plugin-defs.pl
@@ -21,7 +21,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 123fdaa450..1ce2e6c846 100644
--- a/po-plug-ins/POTFILES.in
+++ b/po-plug-ins/POTFILES.in
@@ -25,7 +25,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]