Commit b338b771 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

more plug-ins adapted to libgimp changes. Includes fix for #12582.

2003-07-02  Sven Neumann  <sven@gimp.org>

	* plug-ins: more plug-ins adapted to libgimp changes.
	Includes fix for #12582.
parent adbec9c4
......@@ -46,15 +46,15 @@ static void run (const gchar *name,
gint *nreturn_vals,
GimpParam **return_vals);
static gint load_palette (FILE *fp,
guchar palette[]);
static gint32 load_image (gchar *file,
gchar *brief);
static gint save_image (gchar *file,
gchar *brief,
gint32 image,
gint32 layer);
static void palette_dialog (gchar *title);
static gint load_palette (FILE *fp,
guchar palette[]);
static gint32 load_image (const gchar *file,
const gchar *brief);
static gint save_image (const gchar *file,
const gchar *brief,
gint32 image,
gint32 layer);
static void palette_dialog (const gchar *title);
/* Globals... */
......@@ -224,8 +224,8 @@ run (const gchar *name,
/* Load CEL image into The GIMP */
static gint32
load_image (gchar *file,
gchar *brief)
load_image (const gchar *file,
const gchar *brief)
{
FILE *fp; /* Read file pointer */
gchar *progress; /* Title for progress display */
......@@ -458,10 +458,10 @@ load_palette (FILE *fp,
}
static gint
save_image (gchar *file,
gchar *brief,
gint32 image,
gint32 layer)
save_image (const gchar *file,
const gchar *brief,
gint32 image,
gint32 layer)
{
FILE *fp; /* Write file pointer */
char *progress; /* Title for progress display */
......@@ -594,7 +594,7 @@ palette_ok (GtkWidget *widget,
}
static void
palette_dialog (gchar *title)
palette_dialog (const gchar *title)
{
GtkWidget *dialog;
......
......@@ -33,14 +33,14 @@
/* Declare some local functions.
*/
static void query (void);
static void run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static gint save_image (gchar *filename,
gint32 image_ID,
gint32 drawable_ID);
static void run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static gint save_image (const gchar *filename,
gint32 image_ID,
gint32 drawable_ID);
GimpPlugInInfo PLUG_IN_INFO =
......@@ -84,17 +84,17 @@ query (void)
}
static void
run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[2];
GimpRunMode run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
gint32 image_ID;
gint32 drawable_ID;
static GimpParam values[2];
GimpRunMode run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
gint32 image_ID;
gint32 drawable_ID;
GimpExportReturnType export = GIMP_EXPORT_CANCEL;
run_mode = param[0].data.d_int32;
......@@ -147,13 +147,13 @@ run (gchar *name,
}
static int
save_image (gchar *filename,
gint32 image_ID,
gint32 drawable_ID)
save_image (const gchar *filename,
gint32 image_ID,
gint32 drawable_ID)
{
GimpPixelRgn pixel_rgn;
GimpDrawable *drawable;
GimpImageType drawable_type;
GimpPixelRgn pixel_rgn;
GimpDrawable *drawable;
GimpImageType drawable_type;
FILE *fp;
gint x, y, b, c;
gchar *backslash = "\\\\";
......
......@@ -143,11 +143,11 @@ static glong ichroma_lim2; /* chroma limit squared (scaled integer) */
static gint icompos_lim; /* composite amplitude limit (scaled integer) */
static void query (void);
static void run (gchar *name,
gint nparam,
GimpParam *param,
gint *nretvals,
GimpParam **retvals);
static void run (const gchar *name,
gint nparam,
const GimpParam *param,
gint *nretvals,
GimpParam **retvals);
static gint pluginCore (piArgs *argp);
static gint pluginCoreIA (piArgs *argp);
......@@ -222,11 +222,11 @@ query (void)
}
static void
run (gchar *name,
gint nparam,
GimpParam *param,
gint *nretvals,
GimpParam **retvals)
run (const gchar *name,
gint nparam,
const GimpParam *param,
gint *nretvals,
GimpParam **retvals)
{
static GimpParam rvals[1];
piArgs args;
......
......@@ -70,22 +70,22 @@
typedef struct
{
gint run; /* run */
gboolean run;
} HRZSaveInterface;
/* Declare some local functions.
*/
static void query (void);
static void run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static gint32 load_image (gchar *filename);
static gint save_image (gchar *filename,
gint32 image_ID,
gint32 drawable_ID);
static void run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static gint32 load_image (const gchar *filename);
static gint save_image (const gchar *filename,
gint32 image_ID,
gint32 drawable_ID);
/*
static gint save_dialog (void);
......@@ -177,17 +177,17 @@ query (void)
}
static void
run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[2];
GimpRunMode run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
gint32 image_ID;
gint32 drawable_ID;
static GimpParam values[2];
GimpRunMode run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
gint32 image_ID;
gint32 drawable_ID;
GimpExportReturnType export = GIMP_EXPORT_CANCEL;
run_mode = param[0].data.d_int32;
......@@ -282,7 +282,7 @@ run (gchar *name,
/************ load HRZ image row *********************/
void
do_hrz_load (void *mapped,
do_hrz_load (void *mapped,
GimpPixelRgn *pixel_rgn)
{
guchar *data, *d;
......@@ -318,7 +318,7 @@ do_hrz_load (void *mapped,
/********************* Load HRZ image **********************/
static gint32
load_image (gchar *filename)
load_image (const gchar *filename)
{
GimpPixelRgn pixel_rgn;
gint32 image_ID;
......@@ -412,9 +412,9 @@ saverow (FILE *fp,
/********************* save image *********************/
static gint
save_image (gchar *filename,
gint32 image_ID,
gint32 drawable_ID)
save_image (const gchar *filename,
gint32 image_ID,
gint32 drawable_ID)
{
GimpPixelRgn pixel_rgn;
GimpDrawable *drawable;
......
......@@ -43,11 +43,11 @@
static void query (void);
static void run (gchar *name,
gint nparam,
GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static void run (const gchar *name,
gint nparam,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static void filter (GimpDrawable *drawable);
static void filter_preview (void);
......@@ -108,11 +108,11 @@ query (void)
}
static void
run (gchar *name,
gint nparams,
GimpParam *params,
gint *nreturn_vals,
GimpParam **return_vals)
run (const gchar *name,
gint nparams,
const GimpParam *params,
gint *nreturn_vals,
GimpParam **return_vals)
{
GimpDrawable *drawable;
GimpRunMode run_mode;
......
......@@ -76,7 +76,7 @@ typedef enum
typedef struct
{
gint run;
gboolean run;
} iwarp_interface;
typedef struct
......@@ -94,11 +94,11 @@ typedef struct
/* Declare local functions.
*/
static void query (void);
static void run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static void run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static void iwarp (void);
static void iwarp_frame (void);
......@@ -264,15 +264,15 @@ query (void)
}
static void
run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[1];
GimpRunMode run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
static GimpParam values[1];
GimpRunMode run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
run_mode = param[0].data.d_int32;
......
......@@ -62,11 +62,11 @@ typedef enum
static void query (void);
static void run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static void run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static gint jigsaw (gboolean preview_mode);
static void jigsaw_values_changed (GtkWidget *widget, gpointer data);
......@@ -414,11 +414,11 @@ query (void)
}
static void
run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[1];
GimpDrawable *drawable;
......
......@@ -208,7 +208,7 @@ typedef struct
typedef struct
{
gint run;
gboolean run;
} JpegSaveInterface;
typedef struct
......@@ -223,7 +223,7 @@ typedef struct
guchar *src;
GimpDrawable *drawable;
GimpPixelRgn pixel_rgn;
gchar *file_name;
const gchar *file_name;
gboolean abort_me;
} PreviewPersistent;
......@@ -233,15 +233,15 @@ static gboolean *abort_me = NULL;
/* Declare local functions.
*/
static void query (void);
static void run (gchar *name,
static void run (const gchar *name,
gint nparams,
GimpParam *param,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static gint32 load_image (gchar *filename,
static gint32 load_image (const gchar *filename,
GimpRunMode runmode,
gboolean preview);
static gboolean save_image (gchar *filename,
static gboolean save_image (const gchar *filename,
gint32 image_ID,
gint32 drawable_ID,
gint32 orig_image_ID,
......@@ -369,11 +369,11 @@ query (void)
}
static void
run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[2];
GimpRunMode run_mode;
......@@ -733,7 +733,7 @@ my_error_exit (j_common_ptr cinfo)
}
static gint32
load_image (gchar *filename,
load_image (const gchar *filename,
GimpRunMode runmode,
gboolean preview)
{
......@@ -1180,7 +1180,6 @@ background_jpeg_save (PreviewPersistent *pp)
/* we cleanup here (load_image doesn't run in the background) */
unlink (pp->file_name);
g_free (pp->file_name);
if (abort_me == &(pp->abort_me))
abort_me = NULL;
......@@ -1225,11 +1224,11 @@ background_jpeg_save (PreviewPersistent *pp)
}
static gboolean
save_image (gchar *filename,
gint32 image_ID,
gint32 drawable_ID,
gint32 orig_image_ID,
gboolean preview)
save_image (const gchar *filename,
gint32 image_ID,
gint32 drawable_ID,
gint32 orig_image_ID,
gboolean preview)
{
GimpPixelRgn pixel_rgn;
GimpDrawable *drawable;
......
......@@ -901,11 +901,11 @@ query (void)
}
static void
run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[1];
GimpDrawable *drawable;
......
......@@ -129,35 +129,35 @@
static void query (void);
static void run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static GimpPDBStatusType save_image (gchar *filename,
gint32 image_ID,
gint32 drawable_ID,
gint32 run_mode);
static gint save_dialog (void);
static void ok_callback (GtkWidget *widget,
gpointer data);
static void mail_entry_callback (GtkWidget *widget,
gpointer data);
static void mesg_body_callback (GtkTextBuffer *buffer,
gpointer data);
static gint valid_file (gchar *filename);
static void create_headers (FILE *mailpipe);
static char * find_extension (gchar *filename);
static gint to64 (FILE *infile,
FILE *outfile);
static void output64chunk (gint c1,
gint c2,
gint c3,
gint pads,
FILE *outfile);
static void run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static GimpPDBStatusType save_image (const gchar *filename,
gint32 image_ID,
gint32 drawable_ID,
gint32 run_mode);
static gint save_dialog (void);
static void ok_callback (GtkWidget *widget,
gpointer data);
static void mail_entry_callback (GtkWidget *widget,
gpointer data);
static void mesg_body_callback (GtkTextBuffer *buffer,
gpointer data);
static gint valid_file (const gchar *filename);
static void create_headers (FILE *mailpipe);
static gchar * find_extension (const gchar *filename);
static gint to64 (FILE *infile,
FILE *outfile);
static void output64chunk (gint c1,
gint c2,
gint c3,
gint pads,
FILE *outfile);
GimpPlugInInfo PLUG_IN_INFO =
{
......@@ -225,11 +225,11 @@ query (void)
}
static void
run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[2];
GimpRunMode run_mode;
......@@ -305,10 +305,10 @@ run (gchar *name,
}
static GimpPDBStatusType
save_image (gchar *filename,
gint32 image_ID,
gint32 drawable_ID,
gint32 run_mode)
save_image (const gchar *filename,
gint32 image_ID,
gint32 drawable_ID,
gint32 run_mode)
{
gchar *ext;
gchar *tmpname;
......@@ -603,7 +603,7 @@ save_dialog (void)
}
static gint
valid_file (gchar *filename)
valid_file (const gchar *filename)
{
int stat_res;
struct stat buf;
......@@ -617,11 +617,11 @@ valid_file (gchar *filename)
}
static gchar *
find_content_type (gchar *filename)
find_content_type (const gchar *filename)
{
/* This function returns a MIME Content-type: value based on the
filename it is given. */
gchar *type_mappings[20] =
const gchar *type_mappings[20] =
{
"gif" , "image/gif",
"jpg" , "image/jpeg",
......@@ -636,7 +636,7 @@ find_content_type (gchar *filename)
};
gchar *ext;
gchar *mimetype = malloc(100);
gchar *mimetype = g_new (gchar, 100);
gint i=0;
ext = find_extension (filename);
......@@ -663,7 +663,7 @@ find_content_type (gchar *filename)
}
static gchar *
find_extension (gchar *filename)
find_extension (const gchar *filename)
{
gchar *filename_copy;
gchar *ext;
......@@ -766,14 +766,16 @@ create_headers (FILE *mailpipe)
fprintf (mailpipe, "\n\n");
if (mail_info.encapsulation == ENCAPSULATION_MIME )
{
char *content;
content = find_content_type (mail_info.filename);
gchar *content = find_content_type (mail_info.filename);
fprintf (mailpipe, "--GUMP-MIME-boundary\n");
fprintf (mailpipe, "Content-type: %s\n",content);
fprintf (mailpipe, "Content-transfer-encoding: base64\n");
fprintf (mailpipe, "Content-disposition: attachment; filename=\"%s\"\n",mail_info.filename);
fprintf (mailpipe, "Content-disposition: attachment; filename=\"%s\"\n",
mail_info.filename);
fprintf (mailpipe, "Content-description: %s\n\n",mail_info.filename);
free(content);
g_free (content);
}
}
......
......@@ -98,11 +98,11 @@ static gboolean run_flag = FALSE;
/* Declare some local functions.
*/
static void query (void);
static void run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static void run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
GimpPlugInInfo PLUG_IN_INFO =
{
......@@ -375,11 +375,11 @@ query (void)
static void
run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[1];
......
......@@ -80,11 +80,12 @@ typedef struct
/***** Prototypes *****/
static void query (void);
static void run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static void run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static void mblur (void);
static void mblur_linear (void);
static void mblur_radial (void);
......@@ -157,11 +158,11 @@ query (void)
}
static void
run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[1];
GimpRunMode run_mode;
......
......@@ -1397,11 +1397,11 @@ query (void)
}
static void
run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[1];
*nreturn_vals = 1;
......
......@@ -252,7 +252,7 @@ typedef struct
typedef struct
{
gint run;
gboolean run;
} NewsprintInterface;