Commit 811d3054 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

removed COMPAT_CRUFT.

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

        * plug-ins/common/*.c: removed COMPAT_CRUFT.
parent f219503a
2000-08-22 Sven Neumann <sven@gimp.org>
* plug-ins/common/*.c: removed COMPAT_CRUFT.
Tue Aug 22 02:12:36 CEST 2000 Daniel Egger <egger@suse.de>
 
* plug-ins/AlienMap/AlienMap.c:
......
......@@ -41,9 +41,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 load_palette (FILE *fp,
guchar palette[]);
......@@ -57,7 +57,7 @@ static void palette_dialog (gchar *title);
/* Globals... */
GPlugInInfo PLUG_IN_INFO =
GimpPlugInInfo PLUG_IN_INFO =
{
NULL, /* init_proc */
NULL, /* quit_proc */
......@@ -77,29 +77,29 @@ MAIN ()
static void
query (void)
{
static GParamDef load_args[] =
static GimpParamDef load_args[] =
{
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
{ PARAM_STRING, "filename", "Filename to load image from" },
{ PARAM_STRING, "raw_filename", "Name entered" },
{ PARAM_STRING, "palette_filename", "Filename to load palette from" }
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_STRING, "filename", "Filename to load image from" },
{ GIMP_PDB_STRING, "raw_filename", "Name entered" },
{ GIMP_PDB_STRING, "palette_filename", "Filename to load palette from" }
};
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", "Filename to save image to" },
{ PARAM_STRING, "raw_filename", "Name entered" },
{ PARAM_STRING, "palette_filename", "Filename to save palette to" },
{ 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", "Filename to save image to" },
{ GIMP_PDB_STRING, "raw_filename", "Name entered" },
{ GIMP_PDB_STRING, "palette_filename", "Filename to save palette to" },
};
static gint nsave_args = sizeof (save_args) / sizeof (save_args[0]);
......@@ -111,7 +111,7 @@ query (void)
"May 1998",
"<Load>/CEL",
NULL,
PROC_PLUG_IN,
GIMP_PLUGIN,
nload_args, nload_return_vals,
load_args, load_return_vals);
......@@ -123,7 +123,7 @@ query (void)
"May 1998",
"<Save>/CEL",
"INDEXEDA",
PROC_PLUG_IN,
GIMP_PLUGIN,
nsave_args, 0,
save_args, NULL);
......@@ -139,13 +139,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]; /* Return values */
GRunModeType run_mode;
GStatusType status = STATUS_SUCCESS;
static GimpParam values[2]; /* Return values */
GimpRunModeType run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
gint32 image;
run_mode = param[0].data.d_int32;
......@@ -154,10 +154,10 @@ 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;
if (run_mode == RUN_INTERACTIVE)
if (run_mode == GIMP_RUN_INTERACTIVE)
{
INIT_I18N_UI();
}
......@@ -168,7 +168,7 @@ run (gchar *name,
if (strcmp (name, "file_cel_load") == 0)
{
if (run_mode != RUN_NONINTERACTIVE)
if (run_mode != GIMP_RUN_NONINTERACTIVE)
{
gimp_get_data ("file_cel_save:length", &data_length);
if (data_length > 0)
......@@ -183,12 +183,12 @@ run (gchar *name,
}
}
if (run_mode == RUN_NONINTERACTIVE)
if (run_mode == GIMP_RUN_NONINTERACTIVE)
{
palette_file = param[3].data.d_string;
data_length = strlen(palette_file) + 1;
}
else if (run_mode == RUN_INTERACTIVE)
else if (run_mode == GIMP_RUN_INTERACTIVE)
{
/* Let user choose KCF palette (cancel ignores) */
palette_dialog (_("Load KISS Palette"));
......@@ -201,12 +201,12 @@ run (gchar *name,
if (image != -1)
{
*nreturn_vals = 2;
values[1].type = PARAM_IMAGE;
values[1].type = GIMP_PDB_IMAGE;
values[1].data.d_image = image;
}
else
{
status = STATUS_EXECUTION_ERROR;
status = GIMP_PDB_EXECUTION_ERROR;
}
}
else if (strcmp (name, "file_cel_save") == 0)
......@@ -214,7 +214,7 @@ run (gchar *name,
if (! save_image (param[3].data.d_string, param[4].data.d_string,
param[1].data.d_int32, param[2].data.d_int32))
{
status = STATUS_EXECUTION_ERROR;
status = GIMP_PDB_EXECUTION_ERROR;
}
else
{
......@@ -224,7 +224,7 @@ run (gchar *name,
}
else
{
status = STATUS_CALLING_ERROR;
status = GIMP_PDB_CALLING_ERROR;
}
values[0].data.d_status = status;
......@@ -248,8 +248,8 @@ load_image (gchar *file,
guchar *palette, /* 24 bit palette */
*buffer, /* Temporary buffer */
*line; /* Pixel data */
GDrawable *drawable; /* Drawable for layer */
GPixelRgn pixel_rgn; /* Pixel region for layer */
GimpDrawable *drawable; /* Drawable for layer */
GimpPixelRgn pixel_rgn; /* Pixel region for layer */
gint i, j, k; /* Counters */
......@@ -289,7 +289,7 @@ load_image (gchar *file,
offy = header[10] + (256 * header[11]);
}
image = gimp_image_new (width + offx, height + offy, INDEXED);
image = gimp_image_new (width + offx, height + offy, GIMP_INDEXED);
if (image == -1)
{
......@@ -302,7 +302,7 @@ load_image (gchar *file,
/* Create an indexed-alpha layer to hold the image... */
layer = gimp_layer_new (image, _("Background"), width, height,
INDEXEDA_IMAGE, 100, NORMAL_MODE);
GIMP_INDEXEDA_IMAGE, 100, GIMP_NORMAL_MODE);
gimp_image_add_layer (image, layer, 0);
gimp_layer_set_offsets (layer, offx, offy);
......@@ -480,14 +480,14 @@ save_image (gchar *file,
guchar *buffer, /* Temporary buffer */
*line; /* Pixel data */
GDrawable *drawable; /* Drawable for layer */
GPixelRgn pixel_rgn; /* Pixel region for layer */
GimpDrawable *drawable; /* Drawable for layer */
GimpPixelRgn pixel_rgn; /* Pixel region for layer */
int i, j, k; /* Counters */
/* Check that this is an indexed image, fail otherwise */
type = gimp_drawable_type (layer);
if (type != INDEXEDA_IMAGE)
if (type != GIMP_INDEXEDA_IMAGE)
{
g_message (_("Only an indexed-alpha image can be saved in CEL format"));
return FALSE;
......
......@@ -304,11 +304,11 @@ static gchar *channel_names[] =
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 GStatusType CML_main_function (gint preview_p);
static GimpPDBStatusType CML_main_function (gint preview_p);
static void CML_compute_next_step (gint size,
gdouble **h,
gdouble **s,
......@@ -391,7 +391,7 @@ static gdouble parse_line_to_gdouble (FILE *file,
gint *flag);
GPlugInInfo PLUG_IN_INFO =
GimpPlugInInfo PLUG_IN_INFO =
{
NULL, /* init_proc */
NULL, /* quit_proc */
......@@ -449,12 +449,12 @@ MAIN ()
static void
query (void)
{
static GParamDef args [] =
static GimpParamDef args [] =
{
{ PARAM_INT32, "run_mode", "Interactive, non-interactive"},
{ PARAM_IMAGE, "image", "Input image (not used)"},
{ PARAM_DRAWABLE, "drawable", "Input drawable" },
{ PARAM_STRING, "parameter_file_name", "The name of parameter file. CML_explorer makes an image with its settings." }
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive"},
{ GIMP_PDB_IMAGE, "image", "Input image (not used)"},
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_STRING, "parameter_file_name", "The name of parameter file. CML_explorer makes an image with its settings." }
};
static gint nargs = sizeof (args) / sizeof (args[0]);
......@@ -462,7 +462,7 @@ query (void)
"Make an image of Coupled-Map Lattice",
"Make an image of Coupled-Map Lattice (CML). CML is "
"a kind of Cellula Automata on continuous (value) "
"domain. In RUN_NONINTERACTIVE, the name of a "
"domain. In GIMP_RUN_NONINTERACTIVE, the name of a "
"prameter file is passed as the 4th arg. You can "
"control CML_explorer via parameter file.",
/* Or do you want to call me with over 50 args? */
......@@ -472,7 +472,7 @@ query (void)
"1997",
N_("<Image>/Filters/Render/Pattern/CML Explorer..."),
"RGB*, GRAY*",
PROC_PLUG_IN,
GIMP_PLUGIN,
nargs, 0,
args, NULL);
}
......@@ -480,13 +480,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[1];
GStatusType status = STATUS_EXECUTION_ERROR;
GRunModeType run_mode;
static GimpParam values[1];
GimpPDBStatusType status = GIMP_PDB_EXECUTION_ERROR;
GimpRunModeType run_mode;
run_mode = param[0].data.d_int32;
drawable_id = param[2].data.d_drawable;
......@@ -494,18 +494,18 @@ 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;
switch (run_mode)
{
case RUN_INTERACTIVE:
case GIMP_RUN_INTERACTIVE:
INIT_I18N_UI();
gimp_get_data (PLUG_IN_NAME, &VALS);
if (! CML_explorer_dialog ())
return;
break;
case RUN_NONINTERACTIVE:
case GIMP_RUN_NONINTERACTIVE:
{
gchar *filename = param[3].data.d_string;
......@@ -513,7 +513,7 @@ run (gchar *name,
return;
break;
}
case RUN_WITH_LAST_VALS:
case GIMP_RUN_WITH_LAST_VALS:
gimp_get_data (PLUG_IN_NAME, &VALS);
break;
}
......@@ -521,9 +521,9 @@ run (gchar *name,
gimp_tile_cache_ntiles (TILE_CACHE_SIZE);
status = CML_main_function (FALSE);
if (run_mode != RUN_NONINTERACTIVE)
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_displays_flush();
if (run_mode == RUN_INTERACTIVE && status == STATUS_SUCCESS)
if (run_mode == GIMP_RUN_INTERACTIVE && status == GIMP_PDB_SUCCESS)
gimp_set_data (PLUG_IN_NAME, &VALS, sizeof (ValueType));
if (mem_chank0)
......@@ -533,15 +533,15 @@ run (gchar *name,
if (mem_chank2)
g_free (mem_chank2);
values[0].type = PARAM_STATUS;
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
}
static GStatusType
static GimpPDBStatusType
CML_main_function (gint preview_p)
{
GDrawable *drawable = NULL;
GPixelRgn dest_rgn, src_rgn;
GimpDrawable *drawable = NULL;
GimpPixelRgn dest_rgn, src_rgn;
guchar *dest_buffer = NULL;
guchar *src_buffer = NULL;
gint x1, x2, y1, y2;
......@@ -864,7 +864,7 @@ CML_main_function (gint preview_p)
gimp_drawable_detach (drawable);
}
return STATUS_SUCCESS;
return GIMP_PDB_SUCCESS;
}
static void
......
......@@ -29,9 +29,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 gboolean aa_savable (gint32 drawable_ID);
static gboolean save_aa (gint output_type,
gchar *filename,
......@@ -51,7 +51,7 @@ static void type_dialog_cancel_callback (GtkWidget *widget,
* Some global variables.
*/
GPlugInInfo PLUG_IN_INFO =
GimpPlugInInfo PLUG_IN_INFO =
{
NULL, /* init_proc */
NULL, /* quit_proc */
......@@ -70,14 +70,14 @@ MAIN ()
static void
query (void)
{
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 entered"},
{PARAM_STRING, "file_type", "File type to use"}
{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 entered"},
{GIMP_PDB_STRING, "file_type", "File type to use"}
};
static gint nsave_args = sizeof(save_args) / sizeof(save_args[0]);
......@@ -89,7 +89,7 @@ query (void)
"1997",
"<Save>/AA",
"GRAY*", /* support grayscales */
PROC_PLUG_IN,
GIMP_PLUGIN,
nsave_args, 0,
save_args, NULL);
......@@ -124,13 +124,13 @@ get_type_from_string (gchar *string)
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;
gint output_type = 0;
static int last_type = 0;
gint32 image_ID;
......@@ -140,8 +140,8 @@ run (gchar *name,
/* Set us up to return a status. */
*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;
run_mode = param[0].data.d_int32;
image_ID = param[1].data.d_int32;
......@@ -150,8 +150,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:
INIT_I18N_UI();
gimp_ui_init ("aa", FALSE);
export = gimp_export_image (&image_ID, &drawable_ID, "AA",
......@@ -159,7 +159,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;
......@@ -170,35 +170,35 @@ run (gchar *name,
if (!aa_savable (drawable_ID))
{
status = STATUS_CALLING_ERROR;
status = GIMP_PDB_CALLING_ERROR;
}
if (status == STATUS_SUCCESS)
if (status == GIMP_PDB_SUCCESS)
{
switch (run_mode)
{
case RUN_INTERACTIVE:
case GIMP_RUN_INTERACTIVE:
gimp_get_data ("file_aa_save", &last_type);
output_type = type_dialog (last_type);
if (output_type < 0)
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
{
output_type = get_type_from_string (param[5].data.d_string);
if (output_type < 0)
status = STATUS_CALLING_ERROR;
status = GIMP_PDB_CALLING_ERROR;
}
break;
case RUN_WITH_LAST_VALS:
case GIMP_RUN_WITH_LAST_VALS:
gimp_get_data ("file_aa_save", &last_type);
output_type = last_type;
break;
......@@ -208,11 +208,11 @@ run (gchar *name,
}
}
if (status == STATUS_SUCCESS)
if (status == GIMP_PDB_SUCCESS)
{
if (save_aa (output_type, param[3].data.d_string, image_ID, drawable_ID))
{
status = STATUS_EXECUTION_ERROR;
status = GIMP_PDB_EXECUTION_ERROR;
}
else
{
......@@ -239,7 +239,7 @@ save_aa (gint output_type,
{
aa_savedata savedata = {NULL, NULL};
aa_context *context = NULL;
GDrawable *drawable = NULL;
GimpDrawable *drawable = NULL;
aa_format format;
/*fprintf(stderr, "save %s\n", filename); */
......@@ -275,8 +275,8 @@ gimp2aa (gint32 image,
{
gint width, height, x, y;
guchar *buffer;
GDrawable *drawable = NULL;
GPixelRgn pixel_rgn;
GimpDrawable *drawable = NULL;
GimpPixelRgn pixel_rgn;
aa_renderparams *renderparams = NULL;
gint bpp;
......@@ -312,11 +312,11 @@ gimp2aa (gint32 image,
static gboolean
aa_savable (gint32 drawable_ID)
{
GDrawableType drawable_type;
GimpImageType drawable_type;
drawable_type = gimp_drawable_type (drawable_ID);
if (drawable_type != GRAY_IMAGE && drawable_type != GRAYA_IMAGE)
if (drawable_type != GIMP_GRAY_IMAGE && drawable_type != GIMP_GRAYA_IMAGE)
return FALSE;
return TRUE;
......
......@@ -72,11 +72,11 @@ enum
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 GStatusType align_layers (gint32 image_id);
static GimpPDBStatusType align_layers (gint32 image_id);
static void align_layers_get_align_offsets (gint32 drawable_id,
gint *x,
gint *y);
......@@ -85,7 +85,7 @@ static gint align_layers_dialog (void);
static void align_layers_ok_callback (GtkWidget *widget,
gpointer data);
GPlugInInfo PLUG_IN_INFO =
GimpPlugInInfo PLUG_IN_INFO =
{
NULL, /* init_proc */
NULL, /* quit_proc */
......@@ -133,13 +133,13 @@ MAIN ()
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 (not used)"},
{ PARAM_INT32, "link-afteer-alignment", "Link the visible layers after alignment"},
{ PARAM_INT32, "use-bottom", "use the bottom layer as the base of alignment"}
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive"},
{ GIMP_PDB_IMAGE, "image", "Input image"},
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable (not used)"},
{ GIMP_PDB_INT32, "link-afteer-alignment", "Link the visible layers after alignment"},
{ GIMP_PDB_INT32, "use-bottom", "use the bottom layer as the base of alignment"}
};
static gint nargs = sizeof (args) / sizeof (args[0]);
......@@ -151,7 +151,7 @@ query (void)
"1997",
N_("<Image>/Layers/Align Visible Layers..."),
"RGB*,GRAY*",
PROC_PLUG_IN,
GIMP_PLUGIN,
nargs, 0,
args, NULL);
}
......@@ -159,13 +159,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[1];
GStatusType status = STATUS_EXECUTION_ERROR;
GRunModeType run_mode;
static GimpParam values[1];
GimpPDBStatusType status = GIMP_PDB_EXECUTION_ERROR;
GimpRunModeType run_mode;
gint image_id, layer_num;
run_mode = param[0].data.d_int32;
......@@ -174,12 +174,12 @@ run (gchar *name,
*nreturn_vals = 1;