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

more plug-ins adapted to libgimp changes.

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

	* plug-ins: more plug-ins adapted to libgimp changes.
parent 4162cf16
2003-07-02 Sven Neumann <sven@gimp.org>
* plug-ins: more plug-ins adapted to libgimp changes.
2003-07-02 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpitemfactory.c: misc cleanup.
......@@ -54,22 +54,22 @@
static void query (void);
static void run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static gint32 load_image (gchar *filename,
gint32 run_mode,
static void run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static gint32 load_image (const gchar *filename,
gint32 run_mode,
GimpPDBStatusType *status /* return value */);
static GimpPDBStatusType save_image (gchar *filename,
gint32 image_ID,
gint32 drawable_ID,
gint32 run_mode);
static GimpPDBStatusType save_image (const gchar *filename,
gint32 image_ID,
gint32 drawable_ID,
gint32 run_mode);
static gboolean valid_file (gchar *filename);
static gchar * find_extension (gchar *filename);
static gboolean valid_file (const gchar *filename);
static gchar * find_extension (const gchar *filename);
GimpPlugInInfo PLUG_IN_INFO =
{
......@@ -248,10 +248,10 @@ spawn_bz (gchar *filename,
#endif
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)
{
FILE *f;
gchar *ext;
......@@ -336,7 +336,7 @@ save_image (gchar *filename,
}
static gint32
load_image (gchar *filename,
load_image (const gchar *filename,
gint32 run_mode,
GimpPDBStatusType *status /* return value */)
{
......@@ -428,7 +428,7 @@ load_image (gchar *filename,
}
static gboolean
valid_file (gchar* filename)
valid_file (const gchar* filename)
{
gint stat_res;
struct stat buf;
......@@ -442,7 +442,7 @@ valid_file (gchar* filename)
}
static gchar *
find_extension (gchar* filename)
find_extension (const gchar* filename)
{
gchar *filename_copy;
gchar *ext;
......
......@@ -76,24 +76,24 @@ static gint32 create_new_image (const gchar *filename,
GimpDrawable **drawable,
GimpPixelRgn *pixel_rgn);
static void compose_rgb (const guchar **src,
const gint *incr, gint numpix, guchar *dst);
static void compose_rgba (const guchar **src,
const gint *incr, gint numpix, guchar *dst);
static void compose_hsv (const guchar **src,
const gint *incr, gint numpix, guchar *dst);
static void compose_cmy (const guchar **src,
const gint *incr, gint numpix, guchar *dst);
static void compose_cmyk (const guchar **src,
const gint *incr, gint numpix, guchar *dst);
static void compose_ycbcr470 (const guchar **src,
const gint *incr, gint numpix, guchar *dst);
static void compose_ycbcr709 (const guchar **src,
const gint *incr, gint numpix, guchar *dst);
static void compose_ycbcr470f (const guchar **src,
const gint *incr, gint numpix, guchar *dst);
static void compose_ycbcr709f (const guchar **src,
const gint *incr, gint numpix, guchar *dst);
static void compose_rgb (guchar **src,
gint *incr, gint numpix, guchar *dst);
static void compose_rgba (guchar **src,
gint *incr, gint numpix, guchar *dst);
static void compose_hsv (guchar **src,
gint *incr, gint numpix, guchar *dst);
static void compose_cmy (guchar **src,
gint *incr, gint numpix, guchar *dst);
static void compose_cmyk (guchar **src,
gint *incr, gint numpix, guchar *dst);
static void compose_ycbcr470 (guchar **src,
gint *incr, gint numpix, guchar *dst);
static void compose_ycbcr709 (guchar **src,
gint *incr, gint numpix, guchar *dst);
static void compose_ycbcr470f (guchar **src,
gint *incr, gint numpix, guchar *dst);
static void compose_ycbcr709f (guchar **src,
gint *incr, gint numpix, guchar *dst);
static gboolean compose_dialog (const gchar *compose_type,
gint32 drawable_ID);
......@@ -124,10 +124,10 @@ typedef struct
const gchar *channel_icon[MAX_COMPOSE_IMAGES];
const gchar *filename; /* Name of new image */
/* Compose functon */
void (* compose_fun) (const guchar **src,
const gint *incr_src,
gint numpix,
guchar *dst);
void (* compose_fun) (guchar **src,
gint *incr_src,
gint numpix,
guchar *dst);
} COMPOSE_DSC;
/* Array of available compositions. */
......@@ -626,17 +626,19 @@ create_new_image (const gchar *filename,
}
static void
compose_rgb (const guchar **src,
const gint *incr_src,
gint numpix,
guchar *dst)
compose_rgb (guchar **src,
gint *incr_src,
gint numpix,
guchar *dst)
{
register const guchar *red_src = src[0];
register const guchar *green_src = src[1];
register const guchar *blue_src = src[2];
register guchar *rgb_dst = dst;
register gint count = numpix;
gint red_incr = incr_src[0], green_incr = incr_src[1], blue_incr = incr_src[2];
gint red_incr = incr_src[0];
gint green_incr = incr_src[1];
gint blue_incr = incr_src[2];
if ((red_incr == 1) && (green_incr == 1) && (blue_incr == 1))
{
......@@ -660,10 +662,10 @@ compose_rgb (const guchar **src,
static void
compose_rgba (const guchar **src,
const gint *incr_src,
gint numpix,
guchar *dst)
compose_rgba (guchar **src,
gint *incr_src,
gint numpix,
guchar *dst)
{
register const guchar *red_src = src[0];
register const guchar *green_src = src[1];
......@@ -671,8 +673,10 @@ compose_rgba (const guchar **src,
register const guchar *alpha_src = src[3];
register guchar *rgb_dst = dst;
register gint count = numpix;
gint red_incr = incr_src[0], green_incr = incr_src[1],
blue_incr = incr_src[2], alpha_incr = incr_src[3];
gint red_incr = incr_src[0];
gint green_incr = incr_src[1];
gint blue_incr = incr_src[2];
gint alpha_incr = incr_src[3];
if ((red_incr == 1) && (green_incr == 1) && (blue_incr == 1) &&
(alpha_incr == 1))
......@@ -699,17 +703,19 @@ compose_rgba (const guchar **src,
static void
compose_hsv (const guchar **src,
const gint *incr_src,
gint numpix,
guchar *dst)
compose_hsv (guchar **src,
gint *incr_src,
gint numpix,
guchar *dst)
{
register const guchar *hue_src = src[0];
register const guchar *sat_src = src[1];
register const guchar *val_src = src[2];
register guchar *rgb_dst = dst;
register gint count = numpix;
gint hue_incr = incr_src[0], sat_incr = incr_src[1], val_incr = incr_src[2];
gint hue_incr = incr_src[0];
gint sat_incr = incr_src[1];
gint val_incr = incr_src[2];
while (count-- > 0)
{
......@@ -725,19 +731,19 @@ compose_hsv (const guchar **src,
static void
compose_cmy (const guchar **src,
const gint *incr_src,
gint numpix,
guchar *dst)
compose_cmy (guchar **src,
gint *incr_src,
gint numpix,
guchar *dst)
{
register const guchar *cyan_src = src[0];
register const guchar *magenta_src = src[1];
register const guchar *yellow_src = src[2];
register guchar *rgb_dst = dst;
register gint count = numpix;
gint cyan_incr = incr_src[0];
gint cyan_incr = incr_src[0];
gint magenta_incr = incr_src[1];
gint yellow_incr = incr_src[2];
gint yellow_incr = incr_src[2];
if ((cyan_incr == 1) && (magenta_incr == 1) && (yellow_incr == 1))
{
......@@ -764,10 +770,10 @@ compose_cmy (const guchar **src,
static void
compose_cmyk (const guchar **src,
const gint *incr_src,
gint numpix,
guchar *dst)
compose_cmyk (guchar **src,
gint *incr_src,
gint numpix,
guchar *dst)
{
register const guchar *cyan_src = src[0];
register const guchar *magenta_src = src[1];
......@@ -776,10 +782,10 @@ compose_cmyk (const guchar **src,
register guchar *rgb_dst = dst;
register gint count = numpix;
gint cyan, magenta, yellow, black;
gint cyan_incr = incr_src[0];
gint cyan_incr = incr_src[0];
gint magenta_incr = incr_src[1];
gint yellow_incr = incr_src[2];
gint black_incr = incr_src[3];
gint yellow_incr = incr_src[2];
gint black_incr = incr_src[3];
while (count-- > 0)
{
......@@ -819,18 +825,20 @@ compose_cmyk (const guchar **src,
static void
compose_ycbcr470 (const guchar **src,
const gint *incr_src,
gint numpix,
guchar *dst)
compose_ycbcr470 (guchar **src,
gint *incr_src,
gint numpix,
guchar *dst)
{
register const guchar *y_src = src[0];
register const guchar *cb_src = src[1];
register const guchar *cr_src = src[2];
register guchar *rgb_dst = dst;
register gint count = numpix;
gint y_incr = incr_src[0], cb_incr = incr_src[1], cr_incr = incr_src[2];
gint y_incr = incr_src[0];
gint cb_incr = incr_src[1];
gint cr_incr = incr_src[2];
while (count-- > 0)
{
int r,g,b,y,cb,cr;
......@@ -857,17 +865,19 @@ compose_ycbcr470 (const guchar **src,
static void
compose_ycbcr709 (const guchar **src,
const gint *incr_src,
gint numpix,
guchar *dst)
compose_ycbcr709 (guchar **src,
gint *incr_src,
gint numpix,
guchar *dst)
{
register const guchar *y_src = src[0];
register const guchar *cb_src = src[1];
register const guchar *cr_src = src[2];
register guchar *rgb_dst = dst;
register gint count = numpix;
gint y_incr = incr_src[0], cb_incr = incr_src[1], cr_incr = incr_src[2];
gint y_incr = incr_src[0];
gint cb_incr = incr_src[1];
gint cr_incr = incr_src[2];
while (count-- > 0)
{
......@@ -895,17 +905,19 @@ compose_ycbcr709 (const guchar **src,
static void
compose_ycbcr470f (const guchar **src,
const gint *incr_src,
gint numpix,
guchar *dst)
compose_ycbcr470f (guchar **src,
gint *incr_src,
gint numpix,
guchar *dst)
{
register const guchar *y_src = src[0];
register const guchar *cb_src = src[1];
register const guchar *cr_src = src[2];
register guchar *rgb_dst = dst;
register gint count = numpix;
gint y_incr = incr_src[0], cb_incr = incr_src[1], cr_incr = incr_src[2];
gint y_incr = incr_src[0];
gint cb_incr = incr_src[1];
gint cr_incr = incr_src[2];
while (count-- > 0)
{
......@@ -933,17 +945,19 @@ compose_ycbcr470f (const guchar **src,
static void
compose_ycbcr709f (const guchar **src,
const gint *incr_src,
gint numpix,
guchar *dst)
compose_ycbcr709f (guchar **src,
gint *incr_src,
gint numpix,
guchar *dst)
{
register const guchar *y_src = src[0];
register const guchar *cb_src = src[1];
register const guchar *cr_src = src[2];
register guchar *rgb_dst = dst;
register gint count = numpix;
gint y_incr = incr_src[0], cb_incr = incr_src[1], cr_incr = incr_src[2];
gint y_incr = incr_src[0];
gint cb_incr = incr_src[1];
gint cr_incr = incr_src[2];
while (count-- > 0)
{
......
......@@ -102,22 +102,22 @@
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,
gint32 run_mode,
static void run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static gint32 load_image (const gchar *filename,
gint32 run_mode,
GimpPDBStatusType *status /* return value */);
static GimpPDBStatusType save_image (gchar *filename,
gint32 image_ID,
gint32 drawable_ID,
gint32 run_mode);
static GimpPDBStatusType save_image (const gchar *filename,
gint32 image_ID,
gint32 drawable_ID,
gint32 run_mode);
static gboolean valid_file (gchar *filename);
static gchar * find_extension (gchar *filename);
static gboolean valid_file (const gchar *filename);
static gchar * find_extension (const gchar *filename);
GimpPlugInInfo PLUG_IN_INFO =
{
......@@ -187,11 +187,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;
......@@ -296,10 +296,10 @@ spawn_gzip (gchar *filename,
#endif
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;
......@@ -421,7 +421,7 @@ save_image (gchar *filename,
}
static gint32
load_image (gchar *filename,
load_image (const gchar *filename,
gint32 run_mode,
GimpPDBStatusType *status /* return value */)
{
......@@ -552,7 +552,7 @@ load_image (gchar *filename,
}
static gboolean
valid_file (gchar *filename)
valid_file (const gchar *filename)
{
gint stat_res;
struct stat buf;
......@@ -566,7 +566,7 @@ valid_file (gchar *filename)
}
static gchar *
find_extension (gchar *filename)
find_extension (const gchar *filename)
{
gchar *filename_copy;
gchar *ext;
......
......@@ -98,13 +98,13 @@ static gchar * const bmode_labels[] =
/* 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 gint dialog (void);
static gint dialog (void);
static void doit (void);
static void check_config (void);
......@@ -198,11 +198,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;
......
......@@ -49,16 +49,16 @@ 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 gint save_image (Config *config,
gint32 image_ID,
gint32 drawable_ID);
static gboolean run_save_dialog (Config *config);
static gint save_image (Config *config,
gint32 image_ID,
gint32 drawable_ID);
static gboolean run_save_dialog (Config *config);
/* --- variables --- */
......@@ -117,11 +117,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;
......
......@@ -56,18 +56,18 @@ typedef struct
typedef struct
{
gint run;
gboolean run;
} CubismInterface;
/* Declare local functions.
*/
static void query (void);
static void run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static void cubism (GimpDrawable *drawable);
static void run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static void cubism (GimpDrawable *drawable);
static void fill_poly_color (Polygon *poly,
GimpDrawable *drawable,
......@@ -162,16 +162,16 @@ 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 *active_drawable;
GimpRunMode run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
static GimpParam values[1];
GimpDrawable *active_drawable;
GimpRunMode run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
INIT_I18N ();
......
......@@ -181,7 +181,7 @@ struct _BenderDialog
BenderValues *bval_to;
BenderValues *bval_curr;
gint run;
gboolean run;
};
/* points Coords:
......@@ -264,11 +264,11 @@ typedef struct
/* curves action 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 BenderDialog * bender_new_dialog (GimpDrawable *);
static void bender_update (BenderDialog *, int);
......@@ -379,8 +379,8 @@ int gb_debug = FALSE;
* ============================================================================
*/
gint
p_pdb_procedure_available (char *proc_name)
static gint
p_pdb_procedure_available (const gchar *proc_name)
{
gint l_nparams;
gint l_nreturn_vals;
......@@ -521,9 +521,9 @@ p_gimp_edit_copy (gint32 image_id,
if (p_pdb_procedure_available(l_procname) >= 0)
{
return_vals = gimp_run_procedure (l_procname,
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_id,
GIMP_PDB_END);
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_id,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
{
......@@ -555,10 +555,10 @@ p_gimp_edit_paste (gint32 image_id,
if (p_pdb_procedure_available(l_procname) >= 0)
{
return_vals = gimp_run_procedure (l_procname,
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_id,
GIMP_PDB_INT32, paste_into,
GIMP_PDB_END);
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_id,
GIMP_PDB_INT32, paste_into,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
{
......@@ -702,11 +702,11 @@ query (void)
}
static void
run (gchar *name, /* name of plugin */
gint nparams, /* number of in-paramters */
GimpParam *param, /* in-parameters */
gint *nreturn_vals, /* number of out-parameters */
GimpParam **return_vals) /* out-parameters */
run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
const gchar *l_env;
BenderDialog *cd;
......
......@@ -59,28 +59,29 @@ static gchar rcsid[] = "$Id$";
typedef struct
{
gdouble amount;
gint wrapmode;
gdouble amount;
gint wrapmode;
} EdgeVals;
typedef struct
{
gint run;
gboolean run;
} EdgeInterface;
/*
* Function prototypes.
*/
static void query (void);
static void run (gchar *name,
gint nparams,
GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static void query (void);
static void run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static void edge (GimpDrawable *drawable);
static gint edge_dialog (GimpDrawable *drawable);
static void edge (GimpDrawable *drawable);
static gint edge_dialog (GimpDrawable *drawable);
/***** Local vars *****/