Commit 75b96a82 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

plug-ins/rcm/rcm.[ch] plug-ins/rcm/rcm_misc.[ch]

2000-08-24  Sven Neumann  <sven@gimp.org>

	* plug-ins/rcm/rcm.[ch]
	* plug-ins/rcm/rcm_misc.[ch]
	* plug-ins/sel2path/sel2path.c
	* plug-ins/sgi/sgi.c
	* plug-ins/twain/twain.c
	* plug-ins/webbrowser/webbrowser.c
	* plug-ins/winsnap/winsnap.c
	* plug-ins/xjt/xjpeg.[ch]
	* plug-ins/xjt/xjt.c
	* plug-ins/xjt/xpdb_calls.c: removed COMPAT_CRUFT
parent 5b205f17
2000-08-24 Sven Neumann <sven@gimp.org>
* plug-ins/rcm/rcm.[ch]
* plug-ins/rcm/rcm_misc.[ch]
* plug-ins/sel2path/sel2path.c
* plug-ins/sgi/sgi.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c
* plug-ins/xjt/xjpeg.[ch]
* plug-ins/xjt/xjt.c
* plug-ins/xjt/xpdb_calls.c: removed COMPAT_CRUFT
2000-08-23 Sven Neumann <sven@gimp.org>
 
* app/fileops.c: make the file_save dialog sensitive again if the
......
......@@ -55,7 +55,7 @@
/*-----------------------------------------------------------------------------------*/
void query (void);
void run (char *name, int nparams, GParam *param, int *nreturn_vals, GParam **return_vals);
void run (char *name, int nparams, GimpParam *param, int *nreturn_vals, GimpParam **return_vals);
/*-----------------------------------------------------------------------------------*/
/* Global variables */
......@@ -74,7 +74,7 @@ RcmParams Current =
/* Local variables */
/*-----------------------------------------------------------------------------------*/
GPlugInInfo PLUG_IN_INFO =
GimpPlugInInfo PLUG_IN_INFO =
{
NULL, /* init_proc */
NULL, /* quit_proc */
......@@ -95,14 +95,14 @@ MAIN()
void
query (void)
{
GParamDef args[] =
GimpParamDef args[] =
{
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
{ PARAM_IMAGE, "image", "Input image (used for indexed images)" },
{ PARAM_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (used for indexed images)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
};
GParamDef *return_vals = NULL;
GimpParamDef *return_vals = NULL;
int nargs = sizeof (args) / sizeof (args[0]);
int nreturn_vals = 0;
......@@ -117,7 +117,7 @@ query (void)
"04th April 1999",
N_("<Image>/Image/Colors/Colormap Rotation..."),
"RGB*",
PROC_PLUG_IN,
GIMP_PLUGIN,
nargs, nreturn_vals,
args, return_vals);
}
......@@ -197,9 +197,9 @@ rcm_row (const guchar *src_row,
/*-----------------------------------------------------------------------------------*/
void
rcm (GDrawable *drawable)
rcm (GimpDrawable *drawable)
{
GPixelRgn srcPR, destPR;
GimpPixelRgn srcPR, destPR;
gint width, height;
gint bytes;
guchar *src_row, *dest_row;
......@@ -247,17 +247,17 @@ rcm (GDrawable *drawable)
void
run (char *name,
int nparams,
GParam *param,
GimpParam *param,
int *nreturn_vals,
GParam **return_vals)
GimpParam **return_vals)
{
GParam values[1];
GStatusType status = STATUS_SUCCESS;
GimpParam values[1];
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
*nreturn_vals = 1;
*return_vals = values;
values[0].type = PARAM_STATUS;
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
Current.drawable = gimp_drawable_get(param[2].data.d_drawable);
......@@ -268,7 +268,7 @@ run (char *name,
if (gimp_drawable_is_indexed (Current.drawable->id) ||
gimp_drawable_is_gray (Current.drawable->id) )
{
status = STATUS_EXECUTION_ERROR;
status = GIMP_PDB_EXECUTION_ERROR;
}
else
{
......@@ -285,10 +285,10 @@ run (char *name,
gimp_displays_flush();
}
else
status = STATUS_EXECUTION_ERROR;
status = GIMP_PDB_EXECUTION_ERROR;
}
values[0].data.d_status = status;
if (status == STATUS_SUCCESS)
if (status == GIMP_PDB_SUCCESS)
gimp_drawable_detach(Current.drawable);
}
......@@ -124,8 +124,8 @@ typedef struct
gint Success;
gint Units;
gint Gray_to_from;
GDrawable *drawable;
GDrawable *mask;
GimpDrawable *drawable;
GimpDrawable *mask;
ReducedImage *reduced;
RcmCircle *To;
RcmCircle *From;
......
......@@ -181,12 +181,12 @@ rcm_is_gray (float s)
/*-----------------------------------------------------------------------------------*/
ReducedImage*
rcm_reduce_image (GDrawable *drawable,
GDrawable *mask,
rcm_reduce_image (GimpDrawable *drawable,
GimpDrawable *mask,
gint LongerSize,
gint Slctn)
{
GPixelRgn srcPR, srcMask;
GimpPixelRgn srcPR, srcMask;
ReducedImage *temp;
guchar *tempRGB, *src_row, *tempmask, *src_mask_row;
gint i, j, whichcol, whichrow, x1, x2, y1, y2;
......
......@@ -54,7 +54,7 @@ float *closest(float *alpha, float *beta, float angle);
float angle_mod_2PI(float angle);
ReducedImage *rcm_reduce_image(GDrawable *, GDrawable *, gint, gint);
ReducedImage *rcm_reduce_image(GimpDrawable *, GimpDrawable *, gint, gint);
void rcm_render_preview(GtkWidget *, gint);
......
......@@ -60,9 +60,9 @@
static void query (void);
static void run (gchar *name,
gint nparams,
GParam *param,
GimpParam *param,
gint *nreturn_vals,
GParam **return_vals);
GimpParam **return_vals);
static gint sel2path_dialog (SELVALS *sels);
static void sel2path_ok_callback (GtkWidget *widget,
......@@ -74,7 +74,7 @@ gboolean do_sel2path (gint32 drawable_ID,
gint32 image_ID);
GPlugInInfo PLUG_IN_INFO =
GimpPlugInInfo PLUG_IN_INFO =
{
NULL, /* init_proc */
NULL, /* quit_proc */
......@@ -85,7 +85,7 @@ GPlugInInfo PLUG_IN_INFO =
static gint sel_x1, sel_y1, sel_x2, sel_y2;
static gint has_sel, sel_width, sel_height;
static SELVALS selVals;
GPixelRgn selection_rgn;
GimpPixelRgn selection_rgn;
gboolean retVal = TRUE; /* Toggle if cancle button clicked */
MAIN ()
......@@ -93,33 +93,33 @@ MAIN ()
static void
query_2 (void)
{
static GParamDef args[] =
static GimpParamDef args[] =
{
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
{ PARAM_IMAGE, "image", "Input image (unused)" },
{ PARAM_DRAWABLE, "drawable", "Input drawable" },
{ PARAM_FLOAT, "align_threshold", "align_threshold"},
{ PARAM_FLOAT, "corner_always_threshold", "corner_always_threshold"},
{ PARAM_INT8, "corner_surround", "corner_surround"},
{ PARAM_FLOAT, "corner_threshold", "corner_threshold"},
{ PARAM_FLOAT, "error_threshold", "error_threshold"},
{ PARAM_INT8, "filter_alternative_surround", "filter_alternative_surround"},
{ PARAM_FLOAT, "filter_epsilon", "filter_epsilon"},
{ PARAM_INT8, "filter_iteration_count", "filter_iteration_count"},
{ PARAM_FLOAT, "filter_percent", "filter_percent"},
{ PARAM_INT8, "filter_secondary_surround", "filter_secondary_surround"},
{ PARAM_INT8, "filter_surround", "filter_surround"},
{ PARAM_INT8, "keep_knees", "{1-Yes, 0-No}"},
{ PARAM_FLOAT, "line_reversion_threshold", "line_reversion_threshold"},
{ PARAM_FLOAT, "line_threshold", "line_threshold"},
{ PARAM_FLOAT, "reparameterize_improvement", "reparameterize_improvement"},
{ PARAM_FLOAT, "reparameterize_threshold", "reparameterize_threshold"},
{ PARAM_FLOAT, "subdivide_search", "subdivide_search"},
{ PARAM_INT8, "subdivide_surround", "subdivide_surround"},
{ PARAM_FLOAT, "subdivide_threshold", "subdivide_threshold"},
{ PARAM_INT8, "tangent_surround", "tangent_surround"},
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (unused)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_FLOAT, "align_threshold", "align_threshold"},
{ GIMP_PDB_FLOAT, "corner_always_threshold", "corner_always_threshold"},
{ GIMP_PDB_INT8, "corner_surround", "corner_surround"},
{ GIMP_PDB_FLOAT, "corner_threshold", "corner_threshold"},
{ GIMP_PDB_FLOAT, "error_threshold", "error_threshold"},
{ GIMP_PDB_INT8, "filter_alternative_surround", "filter_alternative_surround"},
{ GIMP_PDB_FLOAT, "filter_epsilon", "filter_epsilon"},
{ GIMP_PDB_INT8, "filter_iteration_count", "filter_iteration_count"},
{ GIMP_PDB_FLOAT, "filter_percent", "filter_percent"},
{ GIMP_PDB_INT8, "filter_secondary_surround", "filter_secondary_surround"},
{ GIMP_PDB_INT8, "filter_surround", "filter_surround"},
{ GIMP_PDB_INT8, "keep_knees", "{1-Yes, 0-No}"},
{ GIMP_PDB_FLOAT, "line_reversion_threshold", "line_reversion_threshold"},
{ GIMP_PDB_FLOAT, "line_threshold", "line_threshold"},
{ GIMP_PDB_FLOAT, "reparameterize_improvement", "reparameterize_improvement"},
{ GIMP_PDB_FLOAT, "reparameterize_threshold", "reparameterize_threshold"},
{ GIMP_PDB_FLOAT, "subdivide_search", "subdivide_search"},
{ GIMP_PDB_INT8, "subdivide_surround", "subdivide_surround"},
{ GIMP_PDB_FLOAT, "subdivide_threshold", "subdivide_threshold"},
{ GIMP_PDB_INT8, "tangent_surround", "tangent_surround"},
};
static GParamDef *return_vals = NULL;
static GimpParamDef *return_vals = NULL;
static int nargs = sizeof (args) / sizeof (args[0]);
static int nreturn_vals = 0;
......@@ -131,7 +131,7 @@ query_2 (void)
"1999",
NULL,
"RGB*, INDEXED*, GRAY*",
PROC_PLUG_IN,
GIMP_PLUGIN,
nargs, nreturn_vals,
args, return_vals);
}
......@@ -139,13 +139,13 @@ query_2 (void)
static void
query (void)
{
static GParamDef args[] =
static GimpParamDef args[] =
{
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
{ PARAM_IMAGE, "image", "Input image (unused)" },
{ PARAM_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (unused)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
};
static GParamDef *return_vals = NULL;
static GimpParamDef *return_vals = NULL;
static int nargs = sizeof (args) / sizeof (args[0]);
static int nreturn_vals = 0;
......@@ -159,7 +159,7 @@ query (void)
"1999",
N_("<Image>/Select/To Path"),
"RGB*, INDEXED*, GRAY*",
PROC_PLUG_IN,
GIMP_PLUGIN,
nargs, nreturn_vals,
args, return_vals);
......@@ -169,16 +169,16 @@ query (void)
static void
run (gchar *name,
gint nparams,
GParam *param,
GimpParam *param,
gint *nreturn_vals,
GParam **return_vals)
GimpParam **return_vals)
{
static GParam values[1];
GDrawable * drawable;
static GimpParam values[1];
GimpDrawable * drawable;
gint32 drawable_ID;
gint32 image_ID;
GRunModeType run_mode;
GStatusType status = STATUS_SUCCESS;
GimpRunModeType run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
gboolean no_dialog = FALSE;
run_mode = param[0].data.d_int32;
......@@ -194,7 +194,7 @@ run (gchar *name,
*nreturn_vals = 1;
*return_vals = values;
values[0].type = PARAM_STATUS;
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
drawable_ID = param[2].data.d_drawable;
......@@ -215,7 +215,7 @@ run (gchar *name,
{
switch (run_mode)
{
case RUN_INTERACTIVE:
case GIMP_RUN_INTERACTIVE:
if (gimp_get_data_size ("plug_in_sel2path_advanced") > 0)
{
gimp_get_data ("plug_in_sel2path_advanced", &selVals);
......@@ -230,11 +230,11 @@ run (gchar *name,
fit_set_params (&selVals);
break;
case RUN_NONINTERACTIVE:
case GIMP_RUN_NONINTERACTIVE:
if (nparams != 23)
status = STATUS_CALLING_ERROR;
status = GIMP_PDB_CALLING_ERROR;
if (status == STATUS_SUCCESS)
if (status == GIMP_PDB_SUCCESS)
{
selVals.align_threshold = param[3].data.d_float;
selVals.corner_always_threshold = param[4].data.d_float;
......@@ -261,7 +261,7 @@ run (gchar *name,
break;
case RUN_WITH_LAST_VALS:
case GIMP_RUN_WITH_LAST_VALS:
if(gimp_get_data_size ("plug_in_sel2path_advanced") > 0)
{
gimp_get_data ("plug_in_sel2path_advanced", &selVals);
......@@ -280,10 +280,10 @@ run (gchar *name,
do_sel2path (drawable_ID,image_ID);
values[0].data.d_status = status;
if (status == STATUS_SUCCESS)
if (status == GIMP_PDB_SUCCESS)
{
dialog_print_selVals(&selVals);
if (run_mode == RUN_INTERACTIVE && !no_dialog)
if (run_mode == GIMP_RUN_INTERACTIVE && !no_dialog)
gimp_set_data ("plug_in_sel2path_advanced", &selVals, sizeof(SELVALS));
}
......@@ -558,7 +558,7 @@ do_sel2path (gint32 drawable_ID,
gint32 image_ID)
{
gint32 selection_ID;
GDrawable *sel_drawable;
GimpDrawable *sel_drawable;
pixel_outline_list_type olt;
spline_list_array_type splines;
......
......@@ -62,9 +62,9 @@
static void query (void);
static void run (gchar *name,
gint nparams,
GParam *param,
GimpParam *param,
gint *nreturn_vals,
GParam **return_vals);
GimpParam **return_vals);
static gint32 load_image (gchar *filename);
static gint save_image (gchar *filename,
......@@ -77,7 +77,7 @@ static gint save_dialog (void);
* Globals...
*/
GPlugInInfo PLUG_IN_INFO =
GimpPlugInInfo PLUG_IN_INFO =
{
NULL, /* init_proc */
NULL, /* quit_proc */
......@@ -94,28 +94,28 @@ MAIN ()
static void
query (void)
{
static GParamDef load_args[] =
static GimpParamDef load_args[] =
{
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
{ PARAM_STRING, "filename", "The name of the file to load" },
{ PARAM_STRING, "raw_filename", "The name of the file to load" },
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_STRING, "filename", "The name of the file to load" },
{ GIMP_PDB_STRING, "raw_filename", "The name of the file to load" },
};
static GParamDef load_return_vals[] =
static GimpParamDef load_return_vals[] =
{
{ PARAM_IMAGE, "image", "Output image" },
{ GIMP_PDB_IMAGE, "image", "Output image" },
};
static gint nload_args = sizeof (load_args) / sizeof (load_args[0]);
static gint nload_return_vals = (sizeof (load_return_vals) /
sizeof (load_return_vals[0]));
static GParamDef save_args[] =
static GimpParamDef save_args[] =
{
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
{ PARAM_IMAGE, "image", "Input image" },
{ PARAM_DRAWABLE, "drawable", "Drawable to save" },
{ PARAM_STRING, "filename", "The name of the file to save the image in" },
{ PARAM_STRING, "raw_filename", "The name of the file to save the image in" },
{ PARAM_INT32, "compression", "Compression level (0 = none, 1 = RLE, 2 = ARLE)" }
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image" },
{ GIMP_PDB_DRAWABLE, "drawable", "Drawable to save" },
{ GIMP_PDB_STRING, "filename", "The name of the file to save the image in" },
{ GIMP_PDB_STRING, "raw_filename", "The name of the file to save the image in" },
{ GIMP_PDB_INT32, "compression", "Compression level (0 = none, 1 = RLE, 2 = ARLE)" }
};
static gint nsave_args = sizeof (save_args) / sizeof (save_args[0]);
......@@ -129,7 +129,7 @@ query (void)
PLUG_IN_VERSION,
"<Load>/SGI",
NULL,
PROC_PLUG_IN,
GIMP_PLUGIN,
nload_args,
nload_return_vals,
load_args,
......@@ -143,7 +143,7 @@ query (void)
PLUG_IN_VERSION,
"<Save>/SGI",
"RGB*,GRAY*",
PROC_PLUG_IN,
GIMP_PLUGIN,
nsave_args,
0,
save_args,
......@@ -161,13 +161,13 @@ query (void)
static void
run (gchar *name,
gint nparams,
GParam *param,
GimpParam *param,
gint *nreturn_vals,
GParam **return_vals)
GimpParam **return_vals)
{
static GParam values[2];
GRunModeType run_mode;
GStatusType status = STATUS_SUCCESS;
static GimpParam values[2];
GimpRunModeType run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
gint32 image_ID;
gint32 drawable_ID;
GimpExportReturnType export = EXPORT_CANCEL;
......@@ -176,8 +176,8 @@ run (gchar *name,
*nreturn_vals = 1;
*return_vals = values;
values[0].type = PARAM_STATUS;
values[0].data.d_status = STATUS_EXECUTION_ERROR;
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
INIT_I18N_UI();
......@@ -188,12 +188,12 @@ run (gchar *name,
if (image_ID != -1)
{
*nreturn_vals = 2;
values[1].type = PARAM_IMAGE;
values[1].type = GIMP_PDB_IMAGE;
values[1].data.d_image = image_ID;
}
else
{
status = STATUS_EXECUTION_ERROR;
status = GIMP_PDB_EXECUTION_ERROR;
}
}
else if (strcmp (name, "file_sgi_save") == 0)
......@@ -204,8 +204,8 @@ run (gchar *name,
/* eventually export the image */
switch (run_mode)
{
case RUN_INTERACTIVE:
case RUN_WITH_LAST_VALS:
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init ("sgi", FALSE);
export = gimp_export_image (&image_ID, &drawable_ID, "SGI",
(CAN_HANDLE_RGB |
......@@ -213,7 +213,7 @@ run (gchar *name,
CAN_HANDLE_ALPHA));
if (export == EXPORT_CANCEL)
{
values[0].data.d_status = STATUS_CANCEL;
values[0].data.d_status = GIMP_PDB_CANCEL;
return;
}
break;
......@@ -223,7 +223,7 @@ run (gchar *name,
switch (run_mode)
{
case RUN_INTERACTIVE:
case GIMP_RUN_INTERACTIVE:
/*
* Possibly retrieve data...
*/
......@@ -233,27 +233,27 @@ run (gchar *name,
* Then acquire information with a dialog...
*/
if (!save_dialog ())
status = STATUS_CANCEL;
status = GIMP_PDB_CANCEL;
break;
case RUN_NONINTERACTIVE:
case GIMP_RUN_NONINTERACTIVE:
/*
* Make sure all the arguments are there!
*/
if (nparams != 6)
{
status = STATUS_CALLING_ERROR;
status = GIMP_PDB_CALLING_ERROR;
}
else
{
compression = param[5].data.d_int32;
if (compression < 0 || compression > 2)
status = STATUS_CALLING_ERROR;
status = GIMP_PDB_CALLING_ERROR;
};
break;
case RUN_WITH_LAST_VALS:
case GIMP_RUN_WITH_LAST_VALS:
/*
* Possibly retrieve data...
*/
......@@ -264,7 +264,7 @@ run (gchar *name,
break;
};
if (status == STATUS_SUCCESS)
if (status == GIMP_PDB_SUCCESS)
{
if (save_image (param[3].data.d_string, image_ID, drawable_ID))
{
......@@ -273,7 +273,7 @@ run (gchar *name,
}
else
{
status = STATUS_EXECUTION_ERROR;
status = GIMP_PDB_EXECUTION_ERROR;
}
}
......@@ -282,7 +282,7 @@ run (gchar *name,
}
else
{
status = STATUS_CALLING_ERROR;
status = GIMP_PDB_CALLING_ERROR;
}
values[0].data.d_status = status;
......@@ -306,8 +306,8 @@ load_image (gchar *filename) /* I - File to load */
sgi_t *sgip; /* File pointer */
gint32 image, /* Image */
layer; /* Layer */
GDrawable *drawable; /* Drawable for layer */
GPixelRgn pixel_rgn; /* Pixel region for layer */
GimpDrawable *drawable; /* Drawable for layer */
GimpPixelRgn pixel_rgn; /* Pixel region for layer */
guchar **pixels, /* Pixel rows */
*pixel, /* Pixel data */
*pptr; /* Current pixel */
......@@ -342,23 +342,23 @@ load_image (gchar *filename) /* I - File to load */
switch (sgip->zsize)
{
case 1 : /* Grayscale */
image_type = GRAY;
layer_type = GRAY_IMAGE;
image_type = GIMP_GRAY;
layer_type = GIMP_GRAY_IMAGE;
break;
case 2 : /* Grayscale + alpha */
image_type = GRAY;
layer_type = GRAYA_IMAGE;
image_type = GIMP_GRAY;
layer_type = GIMP_GRAYA_IMAGE;
break;
case 3 : /* RGB */
image_type = RGB;
layer_type = RGB_IMAGE;
image_type = GIMP_RGB;
layer_type = GIMP_RGB_IMAGE;
break;
case 4 : /* RGBA */
image_type = RGB;
layer_type = RGBA_IMAGE;
image_type = GIMP_RGB;
layer_type = GIMP_RGBA_IMAGE;
break;
}
......@@ -376,7 +376,7 @@ load_image (gchar *filename) /* I - File to load */
*/
layer = gimp_layer_new (image, _("Background"), sgip->xsize, sgip->ysize,
layer_type, 100, NORMAL_MODE);
layer_type, 100, GIMP_NORMAL_MODE);
gimp_image_add_layer(image, layer, 0);
/*
......@@ -494,8 +494,8 @@ save_image (gchar *filename,
count, /* Count of rows to put in image */
zsize; /* Number of channels in file */
sgi_t *sgip; /* File pointer */
GDrawable *drawable; /* Drawable for layer */
GPixelRgn pixel_rgn; /* Pixel region for layer */
GimpDrawable *drawable; /* Drawable for layer */