Commit 769bc933 authored by Thomas Manni's avatar Thomas Manni

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

parent 3c4aead2
......@@ -28,7 +28,7 @@
#include "internal-procs.h"
/* 761 procedures registered total */
/* 762 procedures registered total */
void
internal_procs_init (GimpPDB *pdb)
......
......@@ -3575,6 +3575,58 @@ plug_in_whirl_pinch_invoker (GimpProcedure *procedure,
error ? *error : NULL);
}
static GimpValueArray *
plug_in_wind_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpDrawable *drawable;
gint32 threshold;
gint32 direction;
gint32 strength;
gint32 algorithm;
gint32 edge;
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 2), gimp);
threshold = g_value_get_int (gimp_value_array_index (args, 3));
direction = g_value_get_int (gimp_value_array_index (args, 4));
strength = g_value_get_int (gimp_value_array_index (args, 5));
algorithm = g_value_get_int (gimp_value_array_index (args, 6));
edge = g_value_get_int (gimp_value_array_index (args, 7));
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:wind",
"threshold", threshold,
"direction", direction,
"strength", strength,
"style", algorithm,
"edge", edge,
NULL);
gimp_drawable_apply_operation (drawable, progress,
C_("undo-type", "Wind"),
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)
{
......@@ -7127,4 +7179,70 @@ register_plug_in_compat_procs (GimpPDB *pdb)
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-plug-in-wind
*/
procedure = gimp_procedure_new (plug_in_wind_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"plug-in-wind");
gimp_procedure_set_static_strings (procedure,
"plug-in-wind",
"Smear image to give windblown effect",
"Renders a wind effect.",
"Compatibility procedure. Please see 'gegl:wind' for credits.",
"Compatibility procedure. Please see 'gegl:wind' for credits.",
"2015",
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 ("threshold",
"threshold",
"Controls where blending will be done",
0, 50, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("direction",
"direction",
"Wind direction { 0:left, 1:right, 2:top, 3:bottom }",
0, 3, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("strength",
"strength",
"Controls the extent of the blending",
1, 100, 1,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("algorithm",
"algorithm",
"Algorithm { WIND (0), BLAST (1) }",
0, 1, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("edge",
"edge",
"Affected edge { BOTH (0), LEADING (1), TRAILING (2) }",
0, 2, 0,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
}
......@@ -202,5 +202,3 @@
/web-browser.exe
/web-page
/web-page.exe
/wind
/wind.exe
......@@ -143,8 +143,8 @@ libexec_PROGRAMS = \
van-gogh-lic \
warp \
web-browser \
$(WEB_PAGE) \
wind
$(WEB_PAGE)
EXTRA_PROGRAMS = \
file-aa \
......@@ -1940,20 +1940,3 @@ web_page_LDADD = \
$(RT_LIBS) \
$(INTLLIBS) \
$(web_page_RC)
wind_SOURCES = \
wind.c
wind_LDADD = \
$(libgimpui) \
$(libgimpwidgets) \
$(libgimpmodule) \
$(libgimp) \
$(libgimpmath) \
$(libgimpconfig) \
$(libgimpcolor) \
$(libgimpbase) \
$(GTK_LIBS) \
$(RT_LIBS) \
$(INTLLIBS) \
$(wind_RC)
......@@ -98,4 +98,3 @@ van_gogh_lic_RC = van-gogh-lic.rc.o
warp_RC = warp.rc.o
web_browser_RC = web-browser.rc.o
web_page_RC = web-page.rc.o
wind_RC = wind.rc.o
......@@ -98,6 +98,5 @@
'van-gogh-lic' => { ui => 1 },
'warp' => { ui => 1 },
'web-browser' => { ui => 1 },
'web-page' => { ui => 1, optional => 1, libs => 'WEBKIT_LIBS', cflags => 'WEBKIT_CFLAGS' },
'wind' => { ui => 1 }
'web-page' => { ui => 1, optional => 1, libs => 'WEBKIT_LIBS', cflags => 'WEBKIT_CFLAGS' }
);
This diff is collapsed.
......@@ -103,7 +103,6 @@ plug-ins/common/van-gogh-lic.c
plug-ins/common/warp.c
plug-ins/common/web-browser.c
plug-ins/common/web-page.c
plug-ins/common/wind.c
plug-ins/file-bmp/bmp-read.c
plug-ins/file-bmp/bmp-write.c
plug-ins/file-bmp/bmp.c
......
......@@ -3852,6 +3852,64 @@ CODE
);
}
sub plug_in_wind {
$blurb = 'Smear image to give windblown effect';
$help = <<'HELP';
Renders a wind effect.
HELP
&std_pdb_compat('gegl:wind');
$date = '2015';
@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 => 'threshold', type => '0 <= int32 <= 50',
desc => 'Controls where blending will be done' },
{ name => 'direction', type => '0 <= int32 <= 3',
desc => 'Wind direction { 0:left, 1:right, 2:top, 3:bottom }' },
{ name => 'strength', type => '1 <= int32 <= 100',
desc => 'Controls the extent of the blending' },
{ name => 'algorithm', type => '0 <= int32 <= 1',
desc => 'Algorithm { WIND (0), BLAST (1) }' },
{ name => 'edge', type => '0 <= int32 <= 2',
desc => 'Affected edge { BOTH (0), LEADING (1), TRAILING (2) }' },
);
%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:wind",
"threshold", threshold,
"direction", direction,
"strength", strength,
"style", algorithm,
"edge", edge,
NULL);
gimp_drawable_apply_operation (drawable, progress,
C_("undo-type", "Wind"),
node);
g_object_unref (node);
}
else
success = FALSE;
}
CODE
);
}
$extra{app}->{code} = <<'CODE';
static GeglNode *
wrap_in_selection_bounds (GeglNode *node,
......@@ -4075,7 +4133,8 @@ CODE
plug_in_dilate
plug_in_erode
plug_in_waves
plug_in_whirl_pinch);
plug_in_whirl_pinch
plug_in_wind);
%exports = (app => [@procs], lib => []);
......
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