diff -rNu plugindust/dustremove.c plugindust-hub/dustremove.c --- plugindust/dustremove.c Sun Jul 11 22:07:31 1999 +++ plugindust-hub/dustremove.c Fri May 31 08:30:41 2002 @@ -78,7 +78,7 @@ */ static void query(void); -static void run(char *, int, GParam *, int *, GParam **); +static void run(char *, int, GimpParam *, int *, GimpParam **); static void dustremove(void); static gint dustremove_dialog(void); static void dialog_create_ivalue(char *, GtkTable *, int, gint *, int, int); @@ -98,7 +98,7 @@ * Globals... */ -GPlugInInfo PLUG_IN_INFO = +GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ @@ -116,7 +116,7 @@ GtkObject *hscroll_data, /* Horizontal scrollbar data */ *vscroll_data; /* Vertical scrollbar data */ -GDrawable *drawable = NULL; /* Current image */ +GimpDrawable *drawable = NULL; /* Current image */ int sel_x1, /* Selection bounds */ sel_y1, sel_x2, @@ -147,14 +147,14 @@ static void query(void) { - static GParamDef args[] = + static GimpParamDef args[] = { - { PARAM_INT32, "run_mode", "Interactive, non-interactive" }, - { PARAM_IMAGE, "image", "Input image" }, - { PARAM_DRAWABLE, "drawable", "Input drawable" }, - { PARAM_INT32, "avg_thres", "Averaging filter width (default = 36)" } + { GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, + { GIMP_PDB_IMAGE, "image", "Input image" }, + { GIMP_PDB_DRAWABLE, "drawable", "Input drawable" }, + { GIMP_PDB_INT32, "avg_thres", "Averaging filter width (default = 36)" } }; - static GParamDef *return_vals = NULL; + static GimpParamDef *return_vals = NULL; static int nargs = sizeof(args) / sizeof(args[0]), nreturn_vals = 0; @@ -166,7 +166,7 @@ PLUG_IN_VERSION, "/Filters/Enhance/Dustremove", "RGBA", - PROC_PLUG_IN, nargs, nreturn_vals, args, return_vals); + GIMP_PLUGIN, nargs, nreturn_vals, args, return_vals); } @@ -177,23 +177,23 @@ static void run(char *name, /* I - Name of filter program. */ int nparams, /* I - Number of parameters passed in */ - GParam *param, /* I - Parameter values */ + GimpParam *param, /* I - Parameter values */ int *nreturn_vals, /* O - Number of return values */ - GParam **return_vals) /* O - Return values */ + GimpParam **return_vals) /* O - Return values */ { - GRunModeType run_mode; /* Current run mode */ - GStatusType status; /* Return status */ - static GParam values[1]; /* Return values */ + GimpRunModeType run_mode; /* Current run mode */ + GimpPDBStatusType status; /* Return status */ + static GimpParam values[1]; /* Return values */ /* * Initialize parameter data... */ - status = STATUS_SUCCESS; + status = GIMP_PDB_SUCCESS; run_mode = param[0].data.d_int32; - values[0].type = PARAM_STATUS; + values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = status; *nreturn_vals = 1; @@ -215,7 +215,7 @@ switch (run_mode) { - case RUN_INTERACTIVE : + case GIMP_RUN_INTERACTIVE : /* * Possibly retrieve data... */ @@ -230,18 +230,18 @@ return; break; - case RUN_NONINTERACTIVE : + case GIMP_RUN_NONINTERACTIVE : /* * Make sure all the arguments are present... */ if (nparams != 4) - status = STATUS_CALLING_ERROR; + status = GIMP_PDB_CALLING_ERROR; else avg_thres = param[3].data.d_int32; break; - case RUN_WITH_LAST_VALS : + case GIMP_RUN_WITH_LAST_VALS : /* * Possibly retrieve data... */ @@ -250,7 +250,7 @@ break; default : - status = STATUS_CALLING_ERROR; + status = GIMP_PDB_CALLING_ERROR; break; }; @@ -258,9 +258,9 @@ * Dustremove the image... */ - if (status == STATUS_SUCCESS) + if (status == GIMP_PDB_SUCCESS) { - if ((gimp_drawable_color(drawable->id) && + if ((gimp_drawable_is_rgb(drawable->id) && gimp_drawable_has_alpha(drawable->id))) { /* @@ -280,18 +280,18 @@ * If run mode is interactive, flush displays... */ - if (run_mode != RUN_NONINTERACTIVE) + if (run_mode != GIMP_RUN_NONINTERACTIVE) gimp_displays_flush(); /* * Store data... */ - if (run_mode == RUN_INTERACTIVE) + if (run_mode == GIMP_RUN_INTERACTIVE) gimp_set_data(PLUG_IN_NAME, &avg_thres, sizeof(avg_thres)); } else - status = STATUS_EXECUTION_ERROR; + status = GIMP_PDB_EXECUTION_ERROR; }; /* @@ -775,8 +775,8 @@ static void dustremove_rect (int sel_x1, int sel_y1, int sel_x2, int sel_y2, int do_preview) { - GPixelRgn src_rgn; /* source image region */ - GPixelRgn dst_rgn; /* destination image region */ + GimpPixelRgn src_rgn; /* source image region */ + GimpPixelRgn dst_rgn; /* destination image region */ guchar *src_rows; /* image data */ double progress, progress_inc; int sel_width = sel_x2 - sel_x1;