[gimp] plug-ins, pdb: remove the fractal-trace plug-in and add a PDB compat proc



commit 0b99fc8194b856c6adeba3045aac326f6212eafa
Author: Michael Natterer <mitch gimp org>
Date:   Sat Oct 20 13:05:17 2018 +0200

    plug-ins, pdb: remove the fractal-trace plug-in and add a PDB compat proc

 app/pdb/internal-procs.c        |   2 +-
 app/pdb/plug-in-compat-cmds.c   | 137 +++++++
 pdb/groups/plug_in_compat.pdb   |  72 ++++
 plug-ins/common/.gitignore      |   6 -
 plug-ins/common/Makefile.am     |  58 ---
 plug-ins/common/fractal-trace.c | 829 ----------------------------------------
 plug-ins/common/gimprc.common   |   3 -
 plug-ins/common/plugin-defs.pl  |   5 +-
 po-plug-ins/POTFILES.in         |   1 -
 9 files changed, 212 insertions(+), 901 deletions(-)
---
diff --git a/app/pdb/internal-procs.c b/app/pdb/internal-procs.c
index 271e2f7741..6d307a4147 100644
--- a/app/pdb/internal-procs.c
+++ b/app/pdb/internal-procs.c
@@ -28,7 +28,7 @@
 #include "internal-procs.h"
 
 
-/* 735 procedures registered total */
+/* 736 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 44783264cc..d28d0d7006 100644
--- a/app/pdb/plug-in-compat-cmds.c
+++ b/app/pdb/plug-in-compat-cmds.c
@@ -1629,6 +1629,71 @@ plug_in_flarefx_invoker (GimpProcedure         *procedure,
                                            error ? *error : NULL);
 }
 
+static GimpValueArray *
+plug_in_fractal_trace_invoker (GimpProcedure         *procedure,
+                               Gimp                  *gimp,
+                               GimpContext           *context,
+                               GimpProgress          *progress,
+                               const GimpValueArray  *args,
+                               GError               **error)
+{
+  gboolean success = TRUE;
+  GimpDrawable *drawable;
+  gdouble xmin;
+  gdouble xmax;
+  gdouble ymin;
+  gdouble ymax;
+  gint32 depth;
+  gint32 outside_type;
+
+  drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
+  xmin = g_value_get_double (gimp_value_array_index (args, 3));
+  xmax = g_value_get_double (gimp_value_array_index (args, 4));
+  ymin = g_value_get_double (gimp_value_array_index (args, 5));
+  ymax = g_value_get_double (gimp_value_array_index (args, 6));
+  depth = g_value_get_int (gimp_value_array_index (args, 7));
+  outside_type = g_value_get_int (gimp_value_array_index (args, 8));
+
+  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;
+          GeglAbyssPolicy  abyss = GEGL_ABYSS_LOOP;
+
+          switch (outside_type)
+            {
+            case 0: abyss = GEGL_ABYSS_LOOP;  break;
+            case 1: abyss = GEGL_ABYSS_NONE;  break;
+            case 2: abyss = GEGL_ABYSS_BLACK; break;
+            case 3: abyss = GEGL_ABYSS_WHITE; break;
+            }
+
+          node = gegl_node_new_child (NULL,
+                                      "operation",    "gegl:fractal-trace",
+                                      "X1",           xmin,
+                                      "X2",           xmax,
+                                      "Y1",           ymin,
+                                      "Y2",           ymax,
+                                      "depth",        depth,
+                                      "abyss-policy", abyss,
+                                      NULL);
+
+          gimp_drawable_apply_operation (drawable, progress,
+                                         C_("undo-type", "Fractal Trace"),
+                                         node);
+          g_object_unref (node);
+        }
+      else
+        success = FALSE;
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
 static GimpValueArray *
 plug_in_gauss_invoker (GimpProcedure         *procedure,
                        Gimp                  *gimp,
@@ -5539,6 +5604,78 @@ register_plug_in_compat_procs (GimpPDB *pdb)
   gimp_pdb_register_procedure (pdb, procedure);
   g_object_unref (procedure);
 
+  /*
+   * gimp-plug-in-fractal-trace
+   */
+  procedure = gimp_procedure_new (plug_in_fractal_trace_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "plug-in-fractal-trace");
+  gimp_procedure_set_static_strings (procedure,
+                                     "plug-in-fractal-trace",
+                                     "Transform image with the Mandelbrot Fractal",
+                                     "Transform image with the Mandelbrot Fractal",
+                                     "Compatibility procedure. Please see 'gegl:fractal-trace' for credits.",
+                                     "Compatibility procedure. Please see 'gegl:fractal-trace' for credits.",
+                                     "2018",
+                                     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 ("xmin",
+                                                    "xmin",
+                                                    "xmin fractal image delimiter",
+                                                    -50.0, 50.0, -50.0,
+                                                    GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_double ("xmax",
+                                                    "xmax",
+                                                    "xmax fractal image delimiter",
+                                                    -50.0, 50.0, -50.0,
+                                                    GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_double ("ymin",
+                                                    "ymin",
+                                                    "ymin fractal image delimiter",
+                                                    -50.0, 50.0, -50.0,
+                                                    GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_double ("ymax",
+                                                    "ymax",
+                                                    "ymax fractal image delimiter",
+                                                    -50.0, 50.0, -50.0,
+                                                    GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_int32 ("depth",
+                                                      "depth",
+                                                      "Trace depth",
+                                                      1, 65536, 1,
+                                                      GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_int32 ("outside-type",
+                                                      "outside type",
+                                                      "Outside type { WRAP (0), TRANS (1), BLACK (2), WHITE 
(3) }",
+                                                      0, 3, 0,
+                                                      GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
   /*
    * gimp-plug-in-gauss
    */
diff --git a/pdb/groups/plug_in_compat.pdb b/pdb/groups/plug_in_compat.pdb
index cd1884ade2..7fa3dff515 100644
--- a/pdb/groups/plug_in_compat.pdb
+++ b/pdb/groups/plug_in_compat.pdb
@@ -1452,6 +1452,77 @@ CODE
     );
 }
 
+sub plug_in_fractal_trace {
+    $blurb = 'Transform image with the Mandelbrot Fractal';
+
+    $help = <<'HELP';
+Transform image with the Mandelbrot Fractal
+HELP
+
+    &std_pdb_compat('gegl:fractal-trace');
+    $date = '2018';
+
+    @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 => 'xmin', type => '-50.0 <= float <= 50.0',
+         desc => 'xmin fractal image delimiter' },
+       { name => 'xmax', type => '-50.0 <= float <= 50.0',
+         desc => 'xmax fractal image delimiter' },
+       { name => 'ymin', type => '-50.0 <= float <= 50.0',
+         desc => 'ymin fractal image delimiter' },
+       { name => 'ymax', type => '-50.0 <= float <= 50.0',
+         desc => 'ymax fractal image delimiter' },
+       { name => 'depth', type => '1 <= int32 <= 65536',
+         desc => 'Trace depth' },
+       { name => 'outside_type', type => '0 <= int32 <= 3',
+         desc => 'Outside type { WRAP (0), TRANS (1), BLACK (2), WHITE (3) }' }
+    );
+
+    %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;
+      GeglAbyssPolicy  abyss = GEGL_ABYSS_LOOP;
+
+      switch (outside_type)
+        {
+        case 0: abyss = GEGL_ABYSS_LOOP;  break;
+        case 1: abyss = GEGL_ABYSS_NONE;  break;
+        case 2: abyss = GEGL_ABYSS_BLACK; break;
+        case 3: abyss = GEGL_ABYSS_WHITE; break;
+        }
+
+      node = gegl_node_new_child (NULL,
+                                  "operation",    "gegl:fractal-trace",
+                                  "X1",           xmin,
+                                  "X2",           xmax,
+                                  "Y1",           ymin,
+                                  "Y2",           ymax,
+                                  "depth",        depth,
+                                  "abyss-policy", abyss,
+                                  NULL);
+
+      gimp_drawable_apply_operation (drawable, progress,
+                                     C_("undo-type", "Fractal Trace"),
+                                     node);
+      g_object_unref (node);
+    }
+  else
+    success = FALSE;
+}
+CODE
+    );
+}
+
 sub plug_in_gauss {
     $blurb = 'Simplest, most commonly used way of blurring';
 
@@ -4668,6 +4739,7 @@ CODE
             plug_in_engrave
             plug_in_exchange
             plug_in_flarefx
+            plug_in_fractal_trace
             plug_in_gauss
             plug_in_gauss_iir
             plug_in_gauss_iir2
diff --git a/plug-ins/common/.gitignore b/plug-ins/common/.gitignore
index d38ef2a088..3ce94ed5f6 100644
--- a/plug-ins/common/.gitignore
+++ b/plug-ins/common/.gitignore
@@ -6,8 +6,6 @@
 /align-layers.exe
 /animation-optimize
 /animation-optimize.exe
-/animation-play
-/animation-play.exe
 /blinds
 /blinds.exe
 /blur
@@ -36,8 +34,6 @@
 /contrast-retinex.exe
 /crop-zealous
 /crop-zealous.exe
-/curve-bend
-/curve-bend.exe
 /decompose
 /decompose.exe
 /depth-merge
@@ -126,8 +122,6 @@
 /film.exe
 /filter-pack
 /filter-pack.exe
-/fractal-trace
-/fractal-trace.exe
 /goat-exercise
 /goat-exercise.exe
 /gradient-map
diff --git a/plug-ins/common/Makefile.am b/plug-ins/common/Makefile.am
index 9ad8fc3e51..0d9ffc2dfb 100644
--- a/plug-ins/common/Makefile.am
+++ b/plug-ins/common/Makefile.am
@@ -48,7 +48,6 @@ AM_CPPFLAGS = \
 
 align_layers_libexecdir = $(gimpplugindir)/plug-ins/align-layers
 animation_optimize_libexecdir = $(gimpplugindir)/plug-ins/animation-optimize
-#animation_play_libexecdir = $(gimpplugindir)/plug-ins/animation-play
 blinds_libexecdir = $(gimpplugindir)/plug-ins/blinds
 blur_libexecdir = $(gimpplugindir)/plug-ins/blur
 border_average_libexecdir = $(gimpplugindir)/plug-ins/border-average
@@ -63,7 +62,6 @@ compose_libexecdir = $(gimpplugindir)/plug-ins/compose
 contrast_normalize_libexecdir = $(gimpplugindir)/plug-ins/contrast-normalize
 contrast_retinex_libexecdir = $(gimpplugindir)/plug-ins/contrast-retinex
 crop_zealous_libexecdir = $(gimpplugindir)/plug-ins/crop-zealous
-#curve_bend_libexecdir = $(gimpplugindir)/plug-ins/curve-bend
 decompose_libexecdir = $(gimpplugindir)/plug-ins/decompose
 depth_merge_libexecdir = $(gimpplugindir)/plug-ins/depth-merge
 despeckle_libexecdir = $(gimpplugindir)/plug-ins/despeckle
@@ -108,7 +106,6 @@ file_xpm_libexecdir = $(gimpplugindir)/plug-ins/file-xpm
 file_xwd_libexecdir = $(gimpplugindir)/plug-ins/file-xwd
 film_libexecdir = $(gimpplugindir)/plug-ins/film
 filter_pack_libexecdir = $(gimpplugindir)/plug-ins/filter-pack
-fractal_trace_libexecdir = $(gimpplugindir)/plug-ins/fractal-trace
 goat_exercise_libexecdir = $(gimpplugindir)/plug-ins/goat-exercise
 gradient_map_libexecdir = $(gimpplugindir)/plug-ins/gradient-map
 grid_libexecdir = $(gimpplugindir)/plug-ins/grid
@@ -142,7 +139,6 @@ web_page_libexecdir = $(gimpplugindir)/plug-ins/web-page
 
 align_layers_libexec_PROGRAMS = align-layers
 animation_optimize_libexec_PROGRAMS = animation-optimize
-#animation_play_libexec_PROGRAMS = animation-play
 blinds_libexec_PROGRAMS = blinds
 blur_libexec_PROGRAMS = blur
 border_average_libexec_PROGRAMS = border-average
@@ -157,7 +153,6 @@ compose_libexec_PROGRAMS = compose
 contrast_normalize_libexec_PROGRAMS = contrast-normalize
 contrast_retinex_libexec_PROGRAMS = contrast-retinex
 crop_zealous_libexec_PROGRAMS = crop-zealous
-#curve_bend_libexec_PROGRAMS = curve-bend
 decompose_libexec_PROGRAMS = decompose
 depth_merge_libexec_PROGRAMS = depth-merge
 despeckle_libexec_PROGRAMS = despeckle
@@ -202,7 +197,6 @@ file_xpm_libexec_PROGRAMS = $(FILE_XPM)
 file_xwd_libexec_PROGRAMS = file-xwd
 film_libexec_PROGRAMS = film
 filter_pack_libexec_PROGRAMS = filter-pack
-fractal_trace_libexec_PROGRAMS = fractal-trace
 goat_exercise_libexec_PROGRAMS = goat-exercise
 gradient_map_libexec_PROGRAMS = gradient-map
 grid_libexec_PROGRAMS = grid
@@ -291,24 +285,6 @@ animation_optimize_LDADD = \
        $(INTLLIBS)             \
        $(animation_optimize_RC)
 
-animation_play_SOURCES = \
-       animation-play.c
-
-animation_play_LDADD = \
-       $(libgimpui)            \
-       $(libgimpwidgets)       \
-       $(libgimpmodule)        \
-       $(libgimp)              \
-       $(libgimpmath)          \
-       $(libgimpconfig)        \
-       $(libgimpcolor)         \
-       $(libgimpbase)          \
-       $(GTK_LIBS)             \
-       $(GEGL_LIBS)            \
-       $(RT_LIBS)              \
-       $(INTLLIBS)             \
-       $(animation_play_RC)
-
 blinds_SOURCES = \
        blinds.c
 
@@ -546,23 +522,6 @@ crop_zealous_LDADD = \
        $(INTLLIBS)             \
        $(crop_zealous_RC)
 
-curve_bend_SOURCES = \
-       curve-bend.c
-
-curve_bend_LDADD = \
-       $(libgimpui)            \
-       $(libgimpwidgets)       \
-       $(libgimpmodule)        \
-       $(libgimp)              \
-       $(libgimpmath)          \
-       $(libgimpconfig)        \
-       $(libgimpcolor)         \
-       $(libgimpbase)          \
-       $(GTK_LIBS)             \
-       $(RT_LIBS)              \
-       $(INTLLIBS)             \
-       $(curve_bend_RC)
-
 decompose_SOURCES = \
        decompose.c
 
@@ -1371,23 +1330,6 @@ filter_pack_LDADD = \
        $(INTLLIBS)             \
        $(filter_pack_RC)
 
-fractal_trace_SOURCES = \
-       fractal-trace.c
-
-fractal_trace_LDADD = \
-       $(libgimpui)            \
-       $(libgimpwidgets)       \
-       $(libgimpmodule)        \
-       $(libgimp)              \
-       $(libgimpmath)          \
-       $(libgimpconfig)        \
-       $(libgimpcolor)         \
-       $(libgimpbase)          \
-       $(GTK_LIBS)             \
-       $(RT_LIBS)              \
-       $(INTLLIBS)             \
-       $(fractal_trace_RC)
-
 goat_exercise_SOURCES = \
        goat-exercise.c
 
diff --git a/plug-ins/common/gimprc.common b/plug-ins/common/gimprc.common
index 23b742eb68..111427e2d4 100644
--- a/plug-ins/common/gimprc.common
+++ b/plug-ins/common/gimprc.common
@@ -1,6 +1,5 @@
 align_layers_RC = align-layers.rc.o
 animation_optimize_RC = animation-optimize.rc.o
-animation_play_RC = animation-play.rc.o
 blinds_RC = blinds.rc.o
 blur_RC = blur.rc.o
 border_average_RC = border-average.rc.o
@@ -15,7 +14,6 @@ compose_RC = compose.rc.o
 contrast_normalize_RC = contrast-normalize.rc.o
 contrast_retinex_RC = contrast-retinex.rc.o
 crop_zealous_RC = crop-zealous.rc.o
-curve_bend_RC = curve-bend.rc.o
 decompose_RC = decompose.rc.o
 depth_merge_RC = depth-merge.rc.o
 despeckle_RC = despeckle.rc.o
@@ -60,7 +58,6 @@ file_xpm_RC = file-xpm.rc.o
 file_xwd_RC = file-xwd.rc.o
 film_RC = film.rc.o
 filter_pack_RC = filter-pack.rc.o
-fractal_trace_RC = fractal-trace.rc.o
 goat_exercise_RC = goat-exercise.rc.o
 gradient_map_RC = gradient-map.rc.o
 grid_RC = grid.rc.o
diff --git a/plug-ins/common/plugin-defs.pl b/plug-ins/common/plugin-defs.pl
index 12a1d2f452..c806a553cc 100644
--- a/plug-ins/common/plugin-defs.pl
+++ b/plug-ins/common/plugin-defs.pl
@@ -1,7 +1,7 @@
 %plugins = (
     'align-layers' => { ui => 1 },
     'animation-optimize' => {},
-    'animation-play' => { ui => 1, gegl => 1 },
+# FIXME 'animation-play' => { ui => 1, gegl => 1 },
     'blinds' => { ui => 1 },
     'blur' => {},
     'border-average' => { ui => 1, gegl => 1 },
@@ -16,7 +16,7 @@
     'contrast-normalize' => {},
     'contrast-retinex' => { ui => 1 },
     'crop-zealous' => { gegl => 1 },
-    'curve-bend' => { ui => 1 },
+# FIXME 'curve-bend' => { ui => 1 },
     'decompose' => { ui => 1, gegl => 1 },
     'depth-merge' => { ui => 1 },
     'despeckle' => { ui => 1 },
@@ -61,7 +61,6 @@
     'file-xwd' => {  ui => 1, gegl => 1 },
     'film' => { ui => 1 },
     'filter-pack' => { ui => 1 },
-    'fractal-trace' => { ui => 1 },
     'goat-exercise' => { gegl => 1 },
     'gradient-map' => { gegl => 1 },
     'grid' => { ui => 1 },
diff --git a/po-plug-ins/POTFILES.in b/po-plug-ins/POTFILES.in
index ad0aa2ee66..4a47a30046 100644
--- a/po-plug-ins/POTFILES.in
+++ b/po-plug-ins/POTFILES.in
@@ -65,7 +65,6 @@ plug-ins/common/file-xpm.c
 plug-ins/common/file-xwd.c
 plug-ins/common/film.c
 plug-ins/common/filter-pack.c
-plug-ins/common/fractal-trace.c
 plug-ins/common/goat-exercise.c
 plug-ins/common/gradient-map.c
 plug-ins/common/grid.c


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