[gimp] plug-ins, pdb: remove the engrave plug-in 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 the engrave plug-in and add a PDB compat procedure
- Date: Mon, 15 Dec 2014 22:55:15 +0000 (UTC)
commit 4d5e42ac1a6f8100be9adda600470a22f13132ce
Author: Michael Natterer <mitch gimp org>
Date: Mon Dec 15 23:54:35 2014 +0100
plug-ins, pdb: remove the engrave plug-in and add a PDB compat procedure
app/pdb/internal-procs.c | 2 +-
app/pdb/plug-in-compat-cmds.c | 91 ++++++
plug-ins/common/.gitignore | 2 -
plug-ins/common/Makefile.am | 18 -
plug-ins/common/engrave.c | 586 -----------------------------------
plug-ins/common/gimprc.common | 1 -
plug-ins/common/plugin-defs.pl | 1 -
po-plug-ins/POTFILES.in | 1 -
tools/pdbgen/pdb/plug_in_compat.pdb | 51 +++
9 files changed, 143 insertions(+), 610 deletions(-)
---
diff --git a/app/pdb/internal-procs.c b/app/pdb/internal-procs.c
index 626d734..a8cda28 100644
--- a/app/pdb/internal-procs.c
+++ b/app/pdb/internal-procs.c
@@ -28,7 +28,7 @@
#include "internal-procs.h"
-/* 747 procedures registered total */
+/* 748 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 3fd60be..4f02c3c 100644
--- a/app/pdb/plug-in-compat-cmds.c
+++ b/app/pdb/plug-in-compat-cmds.c
@@ -954,6 +954,49 @@ plug_in_deinterlace_invoker (GimpProcedure *procedure,
}
static GimpValueArray *
+plug_in_engrave_invoker (GimpProcedure *procedure,
+ Gimp *gimp,
+ GimpContext *context,
+ GimpProgress *progress,
+ const GimpValueArray *args,
+ GError **error)
+{
+ gboolean success = TRUE;
+ GimpDrawable *drawable;
+ gint32 height;
+ gboolean limit;
+
+ drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
+ height = g_value_get_int (gimp_value_array_index (args, 3));
+ limit = g_value_get_boolean (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:engrave",
+ "row-height", height,
+ "limit", limit,
+ NULL);
+
+ gimp_drawable_apply_operation (drawable, progress,
+ C_("undo-type", "Engrave"),
+ node);
+ }
+ else
+ success = FALSE;
+ }
+
+ return gimp_procedure_get_return_values (procedure, success,
+ error ? *error : NULL);
+}
+
+static GimpValueArray *
plug_in_exchange_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
@@ -3661,6 +3704,54 @@ register_plug_in_compat_procs (GimpPDB *pdb)
g_object_unref (procedure);
/*
+ * gimp-plug-in-engrave
+ */
+ procedure = gimp_procedure_new (plug_in_engrave_invoker);
+ gimp_object_set_static_name (GIMP_OBJECT (procedure),
+ "plug-in-engrave");
+ gimp_procedure_set_static_strings (procedure,
+ "plug-in-engrave",
+ "Simulate an antique engraving",
+ "Creates a black-and-white 'engraved' version of an image as seen in
old illustrations.",
+ "Compatibility procedure. Please see 'gegl:engrave' for credits.",
+ "Compatibility procedure. Please see 'gegl:engrave' for credits.",
+ "2014",
+ 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,
+ gimp_param_spec_int32 ("height",
+ "height",
+ "Resolution in pixels",
+ 2, 16, 2,
+ GIMP_PARAM_READWRITE));
+ gimp_procedure_add_argument (procedure,
+ g_param_spec_boolean ("limit",
+ "limit",
+ "Limit line width",
+ FALSE,
+ GIMP_PARAM_READWRITE));
+ gimp_pdb_register_procedure (pdb, procedure);
+ g_object_unref (procedure);
+
+ /*
* gimp-plug-in-exchange
*/
procedure = gimp_procedure_new (plug_in_exchange_invoker);
diff --git a/plug-ins/common/.gitignore b/plug-ins/common/.gitignore
index 0da43b2..1bcf50a 100644
--- a/plug-ins/common/.gitignore
+++ b/plug-ins/common/.gitignore
@@ -62,8 +62,6 @@
/edge-neon.exe
/emboss
/emboss.exe
-/engrave
-/engrave.exe
/file-aa
/file-aa.exe
/file-cel
diff --git a/plug-ins/common/Makefile.am b/plug-ins/common/Makefile.am
index d3e648d..fb17409 100644
--- a/plug-ins/common/Makefile.am
+++ b/plug-ins/common/Makefile.am
@@ -74,7 +74,6 @@ libexec_PROGRAMS = \
edge-dog \
edge-neon \
emboss \
- engrave \
$(FILE_AA) \
file-cel \
file-compressor \
@@ -691,23 +690,6 @@ emboss_LDADD = \
$(INTLLIBS) \
$(emboss_RC)
-engrave_SOURCES = \
- engrave.c
-
-engrave_LDADD = \
- $(libgimpui) \
- $(libgimpwidgets) \
- $(libgimpmodule) \
- $(libgimp) \
- $(libgimpmath) \
- $(libgimpconfig) \
- $(libgimpcolor) \
- $(libgimpbase) \
- $(GTK_LIBS) \
- $(RT_LIBS) \
- $(INTLLIBS) \
- $(engrave_RC)
-
file_aa_SOURCES = \
file-aa.c
diff --git a/plug-ins/common/gimprc.common b/plug-ins/common/gimprc.common
index 9dcf4e7..8d51bd2 100644
--- a/plug-ins/common/gimprc.common
+++ b/plug-ins/common/gimprc.common
@@ -28,7 +28,6 @@ edge_RC = edge.rc.o
edge_dog_RC = edge-dog.rc.o
edge_neon_RC = edge-neon.rc.o
emboss_RC = emboss.rc.o
-engrave_RC = engrave.rc.o
file_aa_RC = file-aa.rc.o
file_cel_RC = file-cel.rc.o
file_compressor_RC = file-compressor.rc.o
diff --git a/plug-ins/common/plugin-defs.pl b/plug-ins/common/plugin-defs.pl
index cf8eed3..726c0bf 100644
--- a/plug-ins/common/plugin-defs.pl
+++ b/plug-ins/common/plugin-defs.pl
@@ -29,7 +29,6 @@
'edge-dog' => { ui => 1 },
'edge-neon' => { ui => 1 },
'emboss' => { ui => 1 },
- 'engrave' => { ui => 1 },
'file-aa' => { ui => 1, gegl => 1, optional => 1, libs => 'AA_LIBS' },
'file-cel' => { ui => 1, gegl => 1 },
'file-csource' => { ui => 1, gegl => 1 },
diff --git a/po-plug-ins/POTFILES.in b/po-plug-ins/POTFILES.in
index 6709517..e0b4e45 100644
--- a/po-plug-ins/POTFILES.in
+++ b/po-plug-ins/POTFILES.in
@@ -33,7 +33,6 @@ plug-ins/common/edge.c
plug-ins/common/edge-dog.c
plug-ins/common/edge-neon.c
plug-ins/common/emboss.c
-plug-ins/common/engrave.c
plug-ins/common/file-aa.c
plug-ins/common/file-cel.c
plug-ins/common/file-csource.c
diff --git a/tools/pdbgen/pdb/plug_in_compat.pdb b/tools/pdbgen/pdb/plug_in_compat.pdb
index 9ac21ed..0fbbc3d 100644
--- a/tools/pdbgen/pdb/plug_in_compat.pdb
+++ b/tools/pdbgen/pdb/plug_in_compat.pdb
@@ -857,6 +857,56 @@ CODE
);
}
+sub plug_in_engrave {
+ $blurb = 'Simulate an antique engraving';
+
+ $help = <<'HELP';
+Creates a black-and-white 'engraved' version of an image as seen in
+old illustrations.
+HELP
+
+ &std_pdb_compat('gegl:engrave');
+ $date = '2014';
+
+ @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 => 'height', type => '2 <= int32 <= 16',
+ desc => 'Resolution in pixels' },
+ { name => 'limit', type => 'boolean',
+ desc => 'Limit line width' }
+ );
+
+ %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:engrave",
+ "row-height", height,
+ "limit", limit,
+ NULL);
+
+ gimp_drawable_apply_operation (drawable, progress,
+ C_("undo-type", "Engrave"),
+ node);
+ }
+ else
+ success = FALSE;
+}
+CODE
+ );
+}
+
sub plug_in_exchange {
$blurb = 'Swap one color with another';
@@ -3330,6 +3380,7 @@ CODE
plug_in_convmatrix
plug_in_cubism
plug_in_deinterlace
+ plug_in_engrave
plug_in_exchange
plug_in_gauss
plug_in_gauss_iir
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]