Commit 7a315530 authored by Adrian Likins's avatar Adrian Likins
Browse files

Fixes for non-interactive operation of plugins including

	holes, exchange, grid, deinterlace

-adrian
parent 7e4a7620
Thu Jan 29 19:25:52 EST 1998 Adrian Likins <adrian@gimp.org>
* fixed the non-iteractive modes for plugins:
exchange, holes, grid, deinterlace
(mainly expecting wrong number of arguments or just ingome
non-interactive mood entirely)
Thu Jan 29 01:05:10 PST 1998 Manish Singh <yosh@gimp.org>
* updated refract and warp plugins
......
......@@ -51,7 +51,7 @@ GPlugInInfo PLUG_IN_INFO =
run, /* run_proc */
};
static gint DeinterlaceValue = 1;
static gint DeinterlaceValue = 1;
MAIN ()
......@@ -108,10 +108,11 @@ run (char *name,
break;
case RUN_NONINTERACTIVE:
if (nparams != 1)
if (nparams != 4)
status = STATUS_CALLING_ERROR;
if (status == STATUS_SUCCESS)
DeinterlaceValue = param[3].data.d_int32;
break;
case RUN_WITH_LAST_VALS:
......
......@@ -150,8 +150,20 @@ void run(char *name, int nparams, GParam *param, int *nreturn_vals, GParam **ret
gimp_palette_get_foreground(&xargs.fromred, &xargs.fromgreen, &xargs.fromblue);
break;
case RUN_NONINTERACTIVE:
status = STATUS_EXECUTION_ERROR;
return;
if(nparams != 10)
status = STATUS_EXECUTION_ERROR;
if (status == STATUS_SUCCESS)
{
xargs.fromred = param[3].data.d_int8;
xargs.fromgreen = param[4].data.d_int8;
xargs.fromblue = param[5].data.d_int8;
xargs.tored = param[6].data.d_int8;
xargs.togreen = param[7].data.d_int8;
xargs.toblue = param[8].data.d_int8;
xargs.threshold = param[9].data.d_int32;
}
break;
default:
break;
}
......
This diff is collapsed.
......@@ -51,7 +51,7 @@ GPlugInInfo PLUG_IN_INFO =
run, /* run_proc */
};
static gint DeinterlaceValue = 1;
static gint DeinterlaceValue = 1;
MAIN ()
......@@ -108,10 +108,11 @@ run (char *name,
break;
case RUN_NONINTERACTIVE:
if (nparams != 1)
if (nparams != 4)
status = STATUS_CALLING_ERROR;
if (status == STATUS_SUCCESS)
DeinterlaceValue = param[3].data.d_int32;
break;
case RUN_WITH_LAST_VALS:
......
......@@ -150,8 +150,20 @@ void run(char *name, int nparams, GParam *param, int *nreturn_vals, GParam **ret
gimp_palette_get_foreground(&xargs.fromred, &xargs.fromgreen, &xargs.fromblue);
break;
case RUN_NONINTERACTIVE:
status = STATUS_EXECUTION_ERROR;
return;
if(nparams != 10)
status = STATUS_EXECUTION_ERROR;
if (status == STATUS_SUCCESS)
{
xargs.fromred = param[3].data.d_int8;
xargs.fromgreen = param[4].data.d_int8;
xargs.fromblue = param[5].data.d_int8;
xargs.tored = param[6].data.d_int8;
xargs.togreen = param[7].data.d_int8;
xargs.toblue = param[8].data.d_int8;
xargs.threshold = param[9].data.d_int32;
}
break;
default:
break;
}
......
This diff is collapsed.
......@@ -148,7 +148,7 @@ static void run(char *name, int n_params, GParam * param, int *nreturn_vals,
run_mode = param[0].data.d_int32;
if (run_mode == RUN_NONINTERACTIVE) {
if (n_params != 8) {
if (n_params != 7) {
status = STATUS_CALLING_ERROR;
} else {
params.density = param[3].data.d_float;
......
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