Commit 4d5e42ac authored by Michael Natterer's avatar Michael Natterer

plug-ins, pdb: remove the engrave plug-in and add a PDB compat procedure

parent be5e2e69
......@@ -28,7 +28,7 @@
#include "internal-procs.h"
/* 747 procedures registered total */
/* 748 procedures registered total */
void
internal_procs_init (GimpPDB *pdb)
......
......@@ -953,6 +953,49 @@ plug_in_deinterlace_invoker (GimpProcedure *procedure,
error ? *error : NULL);
}
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,
......@@ -3660,6 +3703,54 @@ register_plug_in_compat_procs (GimpPDB *pdb)
gimp_pdb_register_procedure (pdb, procedure);
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
*/
......
......@@ -62,8 +62,6 @@
/edge-neon.exe
/emboss
/emboss.exe
/engrave
/engrave.exe
/file-aa
/file-aa.exe
/file-cel
......
......@@ -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
......
This diff is collapsed.
......@@ -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
......
......@@ -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 },
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment