{PARAM_INT32, "flag", "Clear it if you want to make holes in your image, or set it if you want to keep the painted (I mean opaque) regions."},
};
static GParamDef *return_vals = NULL;
static int nargs = sizeof(args) / sizeof(args[0]);
static int nreturn_vals = 0;
gimp_install_procedure("plug_in_holes",
"make bucks on a image.",
"makes holes in the alpha channel of an image, with a density depending on the actual transparency of this image. (so the image must have an alpha channel...)",
"Xavier Bouchoux",
"Xavier Bouchoux",
"1997",
"<Image>/Image/Alpha/Holes",
"RGBA, GRAYA, INDEXEDA",
PROC_PLUG_IN,
nargs, nreturn_vals,
args, return_vals
);
}
static void run(char *name, int n_params, GParam * param, int *nreturn_vals,
GParam ** return_vals)
{
static GParam values[1];
GDrawable *drawable;
GRunModeType run_mode;
GStatusType status = STATUS_SUCCESS;
/* initialize */
drawable = NULL;
*nreturn_vals = 1;
*return_vals = values;
run_mode = param[0].data.d_int32;
if (run_mode == RUN_NONINTERACTIVE) {
if (n_params != 7) {
status = STATUS_CALLING_ERROR;
} else {
params.density = param[3].data.d_float;
params.shape = param[4].data.d_int32;
params.size = param[5].data.d_int32;
params.flag = param[6].data.d_int32;
}
} else {
/* Possibly retrieve data */
gimp_get_data("plug_in_holes", ¶ms);
if ((run_mode == RUN_INTERACTIVE) ) {
/* Oh boy. We get to do a dialog box, because we can't really expect the
* user to set us up with the right values using gdb.
*/
if (!dialog()) {
/* The dialog was closed, or something similarly evil happened. */