diff --git a/ChangeLog b/ChangeLog index 33fc7f56e6..03989bd0eb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Jan 30 11:48:04 EST 1998 Adrian Likins + + * More plugin non-interactive fixes: + DigitalSignature, hot, sinus, smooth_palette + Thu Jan 29 19:25:52 EST 1998 Adrian Likins * fixed the non-iteractive modes for plugins: diff --git a/plug-ins/DigitalSignature/DigitalSignature.c b/plug-ins/DigitalSignature/DigitalSignature.c index 0b40e57951..955fc8a28c 100644 --- a/plug-ins/DigitalSignature/DigitalSignature.c +++ b/plug-ins/DigitalSignature/DigitalSignature.c @@ -180,11 +180,11 @@ run(char *name, if (nparams != 10) status = STATUS_CALLING_ERROR; if (status == STATUS_SUCCESS) - wvals.mode = param[3].data.d_int8; - strncpy (wvals.signature,param[4].data.d_string, 50); - strncpy (wvals.email,param[5].data.d_string, 30); - strncpy (wvals.homepage,param[6].data.d_string, 50); - strncpy (wvals.date,param[7].data.d_string, 20); + wvals.mode = param[7].data.d_int8; + strncpy (wvals.signature,param[3].data.d_string, 50); + strncpy (wvals.email,param[4].data.d_string, 30); + strncpy (wvals.homepage,param[5].data.d_string, 50); + strncpy (wvals.date,param[6].data.d_string, 20); wvals.signature[49]='\0'; wvals.email[29]='\0'; wvals.homepage[49]='\0'; diff --git a/plug-ins/common/hot.c b/plug-ins/common/hot.c index 0b537d9965..dc49b187db 100644 --- a/plug-ins/common/hot.c +++ b/plug-ins/common/hot.c @@ -196,7 +196,7 @@ query(void){ { PARAM_INT32, "action", "The action to perform" }, { PARAM_INT32, "new_layerp", "Create a new layer iff True" }, }; - static int nargs = 3; + static gint nargs = sizeof (args) / sizeof (args[0]); static GParamDef *rets = NULL; static int nrets = 0; @@ -257,12 +257,13 @@ run(char *name, int nparam, GParam *param, case RUN_NONINTERACTIVE: /* XXX: add code here for non-interactive running */ - if (nparam != 3) { + if (nparam != 6) { rvals[0].data.d_status = STATUS_CALLING_ERROR; break; } - args.mode = param[3].data.d_drawable; - args.action = param[4].data.d_drawable; + args.mode = param[3].data.d_int32; + args.action = param[4].data.d_int32; + args.new_layerp = param[5].data.d_int32; if (pluginCore(&args)==-1) { rvals[0].data.d_status = STATUS_EXECUTION_ERROR; diff --git a/plug-ins/common/smooth_palette.c b/plug-ins/common/smooth_palette.c index 975bc19f51..80e71e8581 100644 --- a/plug-ins/common/smooth_palette.c +++ b/plug-ins/common/smooth_palette.c @@ -61,6 +61,10 @@ static void query() {PARAM_INT32, "run_mode", "Interactive, non-interactive"}, {PARAM_IMAGE, "image", "Input image (unused)"}, {PARAM_DRAWABLE, "drawable", "Input drawable"}, + {PARAM_INT32, "width", "Width"}, + {PARAM_INT32, "height", "Height"}, + {PARAM_INT32, "ntries", "Search Time"}, + {PARAM_INT32, "show_image","Show Image?"}, }; static GParamDef *return_vals = NULL; static int nargs = sizeof(args) / sizeof(args[0]); @@ -85,11 +89,13 @@ static struct { gint height; gint ntries; gint try_size; + gint show_image; } config = { 256, 64, 50, - 10000 + 10000, + 1 }; @@ -122,7 +128,19 @@ run (char *name, break; case RUN_NONINTERACTIVE: - status = STATUS_CALLING_ERROR; + if (nparams != 7) + status = STATUS_CALLING_ERROR; + if (status == STATUS_SUCCESS) + { + config.width = param[3].data.d_int32; + config.height = param[4].data.d_int32; + config.ntries = param[5].data.d_int32; + config.show_image = (param[6].data.d_int32) ? TRUE : FALSE; + } + if (status == STATUS_SUCCESS && + ((config.width <= 0) || (config.height <= 0) || config.ntries <= 0)) + status = STATUS_CALLING_ERROR; + break; case RUN_WITH_LAST_VALS: @@ -142,7 +160,7 @@ run (char *name, values[1].data.d_image = doit(drawable, &values[2].data.d_layer); if (run_mode == RUN_INTERACTIVE) gimp_set_data ("plug_in_smooth_palette", &config, sizeof (config)); - if (run_mode != RUN_NONINTERACTIVE) + if (config.show_image) gimp_display_new (values[1].data.d_image); } else status = STATUS_EXECUTION_ERROR; diff --git a/plug-ins/hot/hot.c b/plug-ins/hot/hot.c index 0b537d9965..dc49b187db 100644 --- a/plug-ins/hot/hot.c +++ b/plug-ins/hot/hot.c @@ -196,7 +196,7 @@ query(void){ { PARAM_INT32, "action", "The action to perform" }, { PARAM_INT32, "new_layerp", "Create a new layer iff True" }, }; - static int nargs = 3; + static gint nargs = sizeof (args) / sizeof (args[0]); static GParamDef *rets = NULL; static int nrets = 0; @@ -257,12 +257,13 @@ run(char *name, int nparam, GParam *param, case RUN_NONINTERACTIVE: /* XXX: add code here for non-interactive running */ - if (nparam != 3) { + if (nparam != 6) { rvals[0].data.d_status = STATUS_CALLING_ERROR; break; } - args.mode = param[3].data.d_drawable; - args.action = param[4].data.d_drawable; + args.mode = param[3].data.d_int32; + args.action = param[4].data.d_int32; + args.new_layerp = param[5].data.d_int32; if (pluginCore(&args)==-1) { rvals[0].data.d_status = STATUS_EXECUTION_ERROR; diff --git a/plug-ins/sinus/sinus.c b/plug-ins/sinus/sinus.c index b45c8a6d95..36a956e873 100644 --- a/plug-ins/sinus/sinus.c +++ b/plug-ins/sinus/sinus.c @@ -210,7 +210,7 @@ static void run (gchar *name, case RUN_NONINTERACTIVE: /* Make sure all the arguments are there! */ - if (nparams != 16) + if (nparams != 14) status = STATUS_CALLING_ERROR; if (status == STATUS_SUCCESS) { diff --git a/plug-ins/smooth_palette/smooth_palette.c b/plug-ins/smooth_palette/smooth_palette.c index 975bc19f51..80e71e8581 100644 --- a/plug-ins/smooth_palette/smooth_palette.c +++ b/plug-ins/smooth_palette/smooth_palette.c @@ -61,6 +61,10 @@ static void query() {PARAM_INT32, "run_mode", "Interactive, non-interactive"}, {PARAM_IMAGE, "image", "Input image (unused)"}, {PARAM_DRAWABLE, "drawable", "Input drawable"}, + {PARAM_INT32, "width", "Width"}, + {PARAM_INT32, "height", "Height"}, + {PARAM_INT32, "ntries", "Search Time"}, + {PARAM_INT32, "show_image","Show Image?"}, }; static GParamDef *return_vals = NULL; static int nargs = sizeof(args) / sizeof(args[0]); @@ -85,11 +89,13 @@ static struct { gint height; gint ntries; gint try_size; + gint show_image; } config = { 256, 64, 50, - 10000 + 10000, + 1 }; @@ -122,7 +128,19 @@ run (char *name, break; case RUN_NONINTERACTIVE: - status = STATUS_CALLING_ERROR; + if (nparams != 7) + status = STATUS_CALLING_ERROR; + if (status == STATUS_SUCCESS) + { + config.width = param[3].data.d_int32; + config.height = param[4].data.d_int32; + config.ntries = param[5].data.d_int32; + config.show_image = (param[6].data.d_int32) ? TRUE : FALSE; + } + if (status == STATUS_SUCCESS && + ((config.width <= 0) || (config.height <= 0) || config.ntries <= 0)) + status = STATUS_CALLING_ERROR; + break; case RUN_WITH_LAST_VALS: @@ -142,7 +160,7 @@ run (char *name, values[1].data.d_image = doit(drawable, &values[2].data.d_layer); if (run_mode == RUN_INTERACTIVE) gimp_set_data ("plug_in_smooth_palette", &config, sizeof (config)); - if (run_mode != RUN_NONINTERACTIVE) + if (config.show_image) gimp_display_new (values[1].data.d_image); } else status = STATUS_EXECUTION_ERROR;