Commit 7313cb55 authored by Michael Natterer's avatar Michael Natterer

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

parent 41e61719
......@@ -28,7 +28,7 @@
#include "internal-procs.h"
/* 746 procedures registered total */
/* 747 procedures registered total */
void
internal_procs_init (GimpPDB *pdb)
......
......@@ -1251,6 +1251,49 @@ plug_in_hsv_noise_invoker (GimpProcedure *procedure,
error ? *error : NULL);
}
static GimpValueArray *
plug_in_illusion_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpDrawable *drawable;
gint32 division;
gint32 type;
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
division = g_value_get_int (gimp_value_array_index (args, 3));
type = g_value_get_int (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 =
gegl_node_new_child (NULL,
"operation", "gegl:illusion",
"division", (gint) division,
"illusion-type", (gint) type,
NULL);
gimp_drawable_apply_operation (drawable, progress,
C_("undo-type", "Illusion"),
node);
g_object_unref (node);
}
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GimpValueArray *
plug_in_laplace_invoker (GimpProcedure *procedure,
Gimp *gimp,
......@@ -4060,6 +4103,54 @@ register_plug_in_compat_procs (GimpPDB *pdb)
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-plug-in-illusion
*/
procedure = gimp_procedure_new (plug_in_illusion_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"plug-in-illusion");
gimp_procedure_set_static_strings (procedure,
"plug-in-illusion",
"Superimpose many altered copies of the image",
"Produce illusion.",
"Compatibility procedure. Please see 'gegl:illusion' for credits.",
"Compatibility procedure. Please see 'gegl:illusion' 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 ("division",
"division",
"The number of divisions",
0, 64, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("type",
"type",
"Illusion type { TYPE1 (0), TYPE2 (1) }",
0, 1, 0,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-plug-in-laplace
*/
......
......@@ -152,8 +152,6 @@
/guillotine.exe
/hot
/hot.exe
/illusion
/illusion.exe
/jigsaw
/jigsaw.exe
/lcms
......
......@@ -119,7 +119,6 @@ libexec_PROGRAMS = \
grid \
guillotine \
hot \
illusion \
jigsaw \
lcms \
lens-flare \
......@@ -1508,23 +1507,6 @@ hot_LDADD = \
$(INTLLIBS) \
$(hot_RC)
illusion_SOURCES = \
illusion.c
illusion_LDADD = \
$(libgimpui) \
$(libgimpwidgets) \
$(libgimpmodule) \
$(libgimp) \
$(libgimpmath) \
$(libgimpconfig) \
$(libgimpcolor) \
$(libgimpbase) \
$(GTK_LIBS) \
$(RT_LIBS) \
$(INTLLIBS) \
$(illusion_RC)
jigsaw_SOURCES = \
jigsaw.c
......
......@@ -73,7 +73,6 @@ gradient_map_RC = gradient-map.rc.o
grid_RC = grid.rc.o
guillotine_RC = guillotine.rc.o
hot_RC = hot.rc.o
illusion_RC = illusion.rc.o
jigsaw_RC = jigsaw.rc.o
lcms_RC = lcms.rc.o
lens_flare_RC = lens-flare.rc.o
......
This diff is collapsed.
......@@ -74,7 +74,6 @@
'grid' => { ui => 1 },
'guillotine' => {},
'hot' => { ui => 1 },
'illusion' => { ui => 1 },
'jigsaw' => { ui => 1 },
'lcms' => { ui => 1, gegl => 1, libs => 'LCMS_LIBS', cflags => 'LCMS_CFLAGS' },
'lens-flare' => { ui => 1 },
......
......@@ -78,7 +78,6 @@ plug-ins/common/gradient-map.c
plug-ins/common/grid.c
plug-ins/common/guillotine.c
plug-ins/common/hot.c
plug-ins/common/illusion.c
plug-ins/common/jigsaw.c
plug-ins/common/lcms.c
plug-ins/common/lens-flare.c
......
......@@ -1225,6 +1225,55 @@ CODE
);
}
sub plug_in_illusion {
$blurb = 'Superimpose many altered copies of the image';
$help = <<'HELP';
Produce illusion.
HELP
&std_pdb_compat('gegl:illusion');
$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 => 'division', type => '0 <= int32 <= 64',
desc => 'The number of divisions' },
{ name => 'type', type => '0 <= int32 <= 1',
desc => 'Illusion type { TYPE1 (0), TYPE2 (1) }' }
);
%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:illusion",
"division", (gint) division,
"illusion-type", (gint) type,
NULL);
gimp_drawable_apply_operation (drawable, progress,
C_("undo-type", "Illusion"),
node);
g_object_unref (node);
}
else
success = FALSE;
}
CODE
);
}
sub plug_in_laplace {
$blurb = 'High-resolution edge detection';
......@@ -3276,6 +3325,7 @@ CODE
plug_in_gauss_rle2
plug_in_glasstile
plug_in_hsv_noise
plug_in_illusion
plug_in_laplace
plug_in_lens_distortion
plug_in_make_seamless
......
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