[gimp] plug-ins, pdb: remove plug-in whirl-pinch and add a PDB compat procedure
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] plug-ins, pdb: remove plug-in whirl-pinch and add a PDB compat procedure
- Date: Thu, 30 May 2013 15:53:34 +0000 (UTC)
commit 52dc7fb80026e62fe2b683b100064d72b9589f2b
Author: Michael Natterer <mitch gimp org>
Date: Thu May 30 17:52:11 2013 +0200
plug-ins, pdb: remove plug-in whirl-pinch and add a PDB compat procedure
app/pdb/internal-procs.c | 2 +-
app/pdb/plug-in-compat-cmds.c | 101 ++++++
plug-ins/common/.gitignore | 2 -
plug-ins/common/Makefile.am | 18 -
plug-ins/common/gimprc.common | 1 -
plug-ins/common/plugin-defs.pl | 1 -
plug-ins/common/whirl-pinch.c | 675 -----------------------------------
po-plug-ins/POTFILES.in | 1 -
tools/pdbgen/pdb/plug_in_compat.pdb | 60 +++-
9 files changed, 161 insertions(+), 700 deletions(-)
---
diff --git a/app/pdb/internal-procs.c b/app/pdb/internal-procs.c
index 15ae99d..b8a42b7 100644
--- a/app/pdb/internal-procs.c
+++ b/app/pdb/internal-procs.c
@@ -28,7 +28,7 @@
#include "internal-procs.h"
-/* 688 procedures registered total */
+/* 689 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 f185b13..8829ae3 100644
--- a/app/pdb/plug-in-compat-cmds.c
+++ b/app/pdb/plug-in-compat-cmds.c
@@ -814,6 +814,53 @@ plug_in_vinvert_invoker (GimpProcedure *procedure,
error ? *error : NULL);
}
+static GimpValueArray *
+plug_in_whirl_pinch_invoker (GimpProcedure *procedure,
+ Gimp *gimp,
+ GimpContext *context,
+ GimpProgress *progress,
+ const GimpValueArray *args,
+ GError **error)
+{
+ gboolean success = TRUE;
+ GimpDrawable *drawable;
+ gdouble whirl;
+ gdouble pinch;
+ gdouble radius;
+
+ drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
+ whirl = g_value_get_double (gimp_value_array_index (args, 3));
+ pinch = g_value_get_double (gimp_value_array_index (args, 4));
+ radius = g_value_get_double (gimp_value_array_index (args, 5));
+
+ 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 =
+ gegl_node_new_child (NULL,
+ "operation", "gegl:whirl-pinch",
+ "whirl", whirl,
+ "pinch", pinch,
+ "radius", radius,
+ NULL);
+
+ gimp_drawable_apply_operation (drawable, progress,
+ C_("undo-type", "Whirl and Pinch"),
+ node);
+
+ g_object_unref (node);
+ }
+ else
+ success = FALSE;
+ }
+
+ return gimp_procedure_get_return_values (procedure, success,
+ error ? *error : NULL);
+}
+
void
register_plug_in_compat_procs (GimpPDB *pdb)
{
@@ -1575,4 +1622,58 @@ register_plug_in_compat_procs (GimpPDB *pdb)
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
+
+ /*
+ * gimp-plug-in-whirl-pinch
+ */
+ procedure = gimp_procedure_new (plug_in_whirl_pinch_invoker);
+ gimp_object_set_static_name (GIMP_OBJECT (procedure),
+ "plug-in-whirl-pinch");
+ gimp_procedure_set_static_strings (procedure,
+ "plug-in-whirl-pinch",
+ "Distort an image by whirling and pinching",
+ "Distorts the image by whirling and pinching, which are two common
center-based, circular distortions. Whirling is like projecting the image onto the surface of water in a
toilet and flushing. Pinching is similar to projecting the image onto an elastic surface and pressing or
pulling on the center of the surface.",
+ "Compatibility procedure. Please see 'gegl:whirl-pinch' for credits.",
+ "Compatibility procedure. Please see 'gegl:whirl-pinch' for credits.",
+ "2013",
+ 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 ("whirl",
+ "whirl",
+ "Whirl angle (degrees)",
+ -720, 720, -720,
+ GIMP_PARAM_READWRITE));
+ gimp_procedure_add_argument (procedure,
+ g_param_spec_double ("pinch",
+ "pinch",
+ "Pinch amount",
+ -1, 1, -1,
+ GIMP_PARAM_READWRITE));
+ gimp_procedure_add_argument (procedure,
+ g_param_spec_double ("radius",
+ "radius",
+ "Radius (1.0 is the largest circle that fits in the
image, and 2.0 goes all the way to the corners)",
+ 0, 2, 0,
+ GIMP_PARAM_READWRITE));
+ gimp_pdb_register_procedure (pdb, procedure);
+ g_object_unref (procedure);
}
diff --git a/plug-ins/common/.gitignore b/plug-ins/common/.gitignore
index 4a4422e..67f0b9f 100644
--- a/plug-ins/common/.gitignore
+++ b/plug-ins/common/.gitignore
@@ -268,7 +268,5 @@
/web-browser.exe
/web-page
/web-page.exe
-/whirl-pinch
-/whirl-pinch.exe
/wind
/wind.exe
diff --git a/plug-ins/common/Makefile.am b/plug-ins/common/Makefile.am
index 88a75dd..a727333 100644
--- a/plug-ins/common/Makefile.am
+++ b/plug-ins/common/Makefile.am
@@ -177,7 +177,6 @@ libexec_PROGRAMS = \
waves \
web-browser \
$(WEB_PAGE) \
- whirl-pinch \
wind
EXTRA_PROGRAMS = \
@@ -2508,23 +2507,6 @@ web_page_LDADD = \
$(INTLLIBS) \
$(web_page_RC)
-whirl_pinch_SOURCES = \
- whirl-pinch.c
-
-whirl_pinch_LDADD = \
- $(libgimpui) \
- $(libgimpwidgets) \
- $(libgimpmodule) \
- $(libgimp) \
- $(libgimpmath) \
- $(libgimpconfig) \
- $(libgimpcolor) \
- $(libgimpbase) \
- $(GTK_LIBS) \
- $(RT_LIBS) \
- $(INTLLIBS) \
- $(whirl_pinch_RC)
-
wind_SOURCES = \
wind.c
diff --git a/plug-ins/common/gimprc.common b/plug-ins/common/gimprc.common
index 1f98589..421d4a4 100644
--- a/plug-ins/common/gimprc.common
+++ b/plug-ins/common/gimprc.common
@@ -131,5 +131,4 @@ warp_RC = warp.rc.o
waves_RC = waves.rc.o
web_browser_RC = web-browser.rc.o
web_page_RC = web-page.rc.o
-whirl_pinch_RC = whirl-pinch.rc.o
wind_RC = wind.rc.o
diff --git a/plug-ins/common/plugin-defs.pl b/plug-ins/common/plugin-defs.pl
index 6263fca..935f1b4 100644
--- a/plug-ins/common/plugin-defs.pl
+++ b/plug-ins/common/plugin-defs.pl
@@ -132,6 +132,5 @@
'waves' => { ui => 1 },
'web-browser' => { ui => 1 },
'web-page' => { ui => 1, optional => 1, libs => 'WEBKIT_LIBS', cflags => 'WEBKIT_CFLAGS' },
- 'whirl-pinch' => { ui => 1 },
'wind' => { ui => 1 }
);
diff --git a/po-plug-ins/POTFILES.in b/po-plug-ins/POTFILES.in
index 9daec35..953d477 100644
--- a/po-plug-ins/POTFILES.in
+++ b/po-plug-ins/POTFILES.in
@@ -139,7 +139,6 @@ plug-ins/common/warp.c
plug-ins/common/waves.c
plug-ins/common/web-browser.c
plug-ins/common/web-page.c
-plug-ins/common/whirl-pinch.c
plug-ins/common/wind.c
plug-ins/file-bmp/bmp-read.c
plug-ins/file-bmp/bmp-write.c
diff --git a/tools/pdbgen/pdb/plug_in_compat.pdb b/tools/pdbgen/pdb/plug_in_compat.pdb
index f4289f4..01a36d8 100644
--- a/tools/pdbgen/pdb/plug_in_compat.pdb
+++ b/tools/pdbgen/pdb/plug_in_compat.pdb
@@ -892,6 +892,63 @@ CODE
);
}
+sub plug_in_whirl_pinch {
+ $blurb = 'Distort an image by whirling and pinching';
+
+ $help = <<'HELP';
+Distorts the image by whirling and pinching, which are two common
+center-based, circular distortions. Whirling is like projecting the
+image onto the surface of water in a toilet and flushing. Pinching is
+similar to projecting the image onto an elastic surface and pressing
+or pulling on the center of the surface.
+HELP
+
+ &std_pdb_compat('gegl:whirl-pinch');
+ $date = '2013';
+
+ @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 => 'whirl', type => '-720 <= float <= 720',
+ desc => 'Whirl angle (degrees)' },
+ { name => 'pinch', type => '-1 <= float <= 1',
+ desc => 'Pinch amount' },
+ { name => 'radius', type => '0 <= float <= 2',
+ desc => 'Radius (1.0 is the largest circle that fits in the image, and 2.0 goes all the way to the
corners)' }
+ );
+
+ %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 =
+ gegl_node_new_child (NULL,
+ "operation", "gegl:whirl-pinch",
+ "whirl", whirl,
+ "pinch", pinch,
+ "radius", radius,
+ NULL);
+
+ gimp_drawable_apply_operation (drawable, progress,
+ C_("undo-type", "Whirl and Pinch"),
+ node);
+
+ g_object_unref (node);
+ }
+ else
+ success = FALSE;
+}
+CODE
+ );
+}
+
@headers = qw("libgimpbase/gimpbase.h"
"gegl/gimp-gegl-utils.h"
@@ -920,7 +977,8 @@ CODE
plug_in_shift
plug_in_spread
plug_in_threshold_alpha
- plug_in_vinvert);
+ plug_in_vinvert
+ plug_in_whirl_pinch);
%exports = (app => [ procs], lib => []);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]