Commit 1016c682 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 1240214a
2003-07-02 Sven Neumann <sven@gimp.org>
* plug-ins: more plug-ins adapted to libgimp changes.
2003-07-01 Sven Neumann <sven@gimp.org>
* libgimp/gimpbrushselect.c
......@@ -93,11 +93,11 @@
#include "libgimp/stdplugins-intl.h"
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 explorer (GimpDrawable *drawable);
static void explorer_render_row (const guchar *src_row,
......@@ -222,11 +222,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];
gint32 image_ID;
......
......@@ -171,11 +171,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;
......
......@@ -207,11 +207,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;
......
......@@ -73,11 +73,11 @@ struct Bitmap_Head_Struct Bitmap_Head;
/* 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 =
{
......@@ -147,18 +147,18 @@ 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;
GimpExportReturnType export = GIMP_EXPORT_CANCEL;
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;
......
......@@ -58,11 +58,11 @@ static char ident[] = "@(#) GIMP Compose plug-in v1.03 17-Mar-99";
/* 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 gint32 compose (const gchar *compose_type,
gint32 *compose_ID,
......@@ -76,18 +76,27 @@ static gint32 create_new_image (const gchar *filename,
GimpDrawable **drawable,
GimpPixelRgn *pixel_rgn);
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 (gchar *compose_type,
gint32 drawable_ID);
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 gboolean compose_dialog (const gchar *compose_type,
gint32 drawable_ID);
static gboolean check_gray (gint32 image_id,
gint32 drawable_id,
......@@ -115,10 +124,10 @@ typedef struct
const gchar *channel_icon[MAX_COMPOSE_IMAGES];
const gchar *filename; /* Name of new image */
/* Compose functon */
void (*compose_fun) (guchar **src,
gint *incr_src,
gint numpix,
guchar *dst);
void (* compose_fun) (const guchar **src,
const gint *incr_src,
gint numpix,
guchar *dst);
} COMPOSE_DSC;
/* Array of available compositions. */
......@@ -313,11 +322,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];
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
......@@ -538,7 +547,8 @@ compose (const gchar *compose_type,
? GIMP_RGBA_IMAGE : GIMP_RGB_IMAGE;
image_ID_dst = create_new_image (compose_dsc[compose_idx].filename,
width, height, gdtype_dst,
&layer_ID_dst, &drawable_dst, &pixel_rgn_dst);
&layer_ID_dst, &drawable_dst,
&pixel_rgn_dst);
dst = g_new (guchar, tile_height * width * drawable_dst->bpp);
/* Do the composition */
......@@ -553,7 +563,10 @@ compose (const gchar *compose_type,
width, scan_lines);
/* Do the composition */
compose_dsc[compose_idx].compose_fun (src,incr_src,width*tile_height,dst);
compose_dsc[compose_idx].compose_fun (src,
incr_src,
width * tile_height,
dst);
/* Set destination pixel region */
gimp_pixel_rgn_set_rect (&pixel_rgn_dst, dst, 0, i, width, scan_lines);
......@@ -613,16 +626,16 @@ create_new_image (const gchar *filename,
}
static void
compose_rgb (guchar **src,
gint *incr_src,
gint numpix,
guchar *dst)
compose_rgb (const guchar **src,
const gint *incr_src,
gint numpix,
guchar *dst)
{
register guchar *red_src = src[0];
register guchar *green_src = src[1];
register guchar *blue_src = src[2];
register guchar *rgb_dst = dst;
register gint count = numpix;
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];
if ((red_incr == 1) && (green_incr == 1) && (blue_incr == 1))
......@@ -647,17 +660,17 @@ compose_rgb (guchar **src,
static void
compose_rgba (guchar **src,
gint *incr_src,
gint numpix,
guchar *dst)
compose_rgba (const guchar **src,
const gint *incr_src,
gint numpix,
guchar *dst)
{
register guchar *red_src = src[0];
register guchar *green_src = src[1];
register guchar *blue_src = src[2];
register guchar *alpha_src = src[3];
register guchar *rgb_dst = dst;
register gint count = numpix;
register const guchar *red_src = src[0];
register const guchar *green_src = src[1];
register const guchar *blue_src = src[2];
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];
......@@ -686,16 +699,16 @@ compose_rgba (guchar **src,
static void
compose_hsv (guchar **src,
gint *incr_src,
gint numpix,
guchar *dst)
compose_hsv (const guchar **src,
const gint *incr_src,
gint numpix,
guchar *dst)
{
register guchar *hue_src = src[0];
register guchar *sat_src = src[1];
register guchar *val_src = src[2];
register guchar *rgb_dst = dst;
register gint count = numpix;
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];
while (count-- > 0)
......@@ -712,16 +725,16 @@ compose_hsv (guchar **src,
static void
compose_cmy (guchar **src,
gint *incr_src,
gint numpix,
guchar *dst)
compose_cmy (const guchar **src,
const gint *incr_src,
gint numpix,
guchar *dst)
{
register guchar *cyan_src = src[0];
register guchar *magenta_src = src[1];
register guchar *yellow_src = src[2];
register guchar *rgb_dst = dst;
register gint count = numpix;
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 magenta_incr = incr_src[1];
gint yellow_incr = incr_src[2];
......@@ -751,17 +764,17 @@ compose_cmy (guchar **src,
static void
compose_cmyk (guchar **src,
gint *incr_src,
gint numpix,
guchar *dst)
compose_cmyk (const guchar **src,
const gint *incr_src,
gint numpix,
guchar *dst)
{
register guchar *cyan_src = src[0];
register guchar *magenta_src = src[1];
register guchar *yellow_src = src[2];
register guchar *black_src = src[3];
register guchar *rgb_dst = dst;
register gint count = numpix;
register const guchar *cyan_src = src[0];
register const guchar *magenta_src = src[1];
register const guchar *yellow_src = src[2];
register const guchar *black_src = src[3];
register guchar *rgb_dst = dst;
register gint count = numpix;
gint cyan, magenta, yellow, black;
gint cyan_incr = incr_src[0];
gint magenta_incr = incr_src[1];
......@@ -806,16 +819,16 @@ compose_cmyk (guchar **src,
static void
compose_ycbcr470 (guchar **src,
gint *incr_src,
gint numpix,
guchar *dst)
compose_ycbcr470 (const guchar **src,
const gint *incr_src,
gint numpix,
guchar *dst)
{
register guchar *y_src = src[0];
register guchar *cb_src = src[1];
register guchar *cr_src = src[2];
register guchar *rgb_dst = dst;
register gint count = numpix;
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];
while (count-- > 0)
......@@ -844,16 +857,16 @@ compose_ycbcr470 (guchar **src,
static void
compose_ycbcr709 (guchar **src,
gint *incr_src,
gint numpix,
guchar *dst)
compose_ycbcr709 (const guchar **src,
const gint *incr_src,
gint numpix,
guchar *dst)
{
register guchar *y_src = src[0];
register guchar *cb_src = src[1];
register guchar *cr_src = src[2];
register guchar *rgb_dst = dst;
register gint count = numpix;
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];
while (count-- > 0)
......@@ -882,16 +895,16 @@ compose_ycbcr709 (guchar **src,
static void
compose_ycbcr470f (guchar **src,
gint *incr_src,
gint numpix,
guchar *dst)
compose_ycbcr470f (const guchar **src,
const gint *incr_src,
gint numpix,
guchar *dst)
{
register guchar *y_src = src[0];
register guchar *cb_src = src[1];
register guchar *cr_src = src[2];
register guchar *rgb_dst = dst;
register gint count = numpix;
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];
while (count-- > 0)
......@@ -920,16 +933,16 @@ compose_ycbcr470f (guchar **src,
static void
compose_ycbcr709f (guchar **src,
gint *incr_src,
gint numpix,
guchar *dst)
compose_ycbcr709f (const guchar **src,
const gint *incr_src,
gint numpix,
guchar *dst)
{
register guchar *y_src = src[0];
register guchar *cb_src = src[1];
register guchar *cr_src = src[2];
register guchar *rgb_dst = dst;
register gint count = numpix;
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];
while (count-- > 0)
......@@ -958,8 +971,8 @@ compose_ycbcr709f (guchar **src,
static gboolean
compose_dialog (gchar *compose_type,
gint32 drawable_ID)
compose_dialog (const gchar *compose_type,
gint32 drawable_ID)
{
GtkWidget *dlg;
GtkWidget *toggle;
......
......@@ -51,11 +51,11 @@ static char ident[] = "@(#) GIMP Decompose plug-in v1.01 19-Mar-99";
/* 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 gint32 decompose (gint32 image_id,
gint32 drawable_ID,
......@@ -173,8 +173,8 @@ typedef struct
typedef struct
{
gint extract_flag[NUM_EXTRACT_TYPES];
gint run;
gint extract_flag[NUM_EXTRACT_TYPES];
gboolean run;
} DecoInterface;
GimpPlugInInfo PLUG_IN_INFO =
......@@ -235,11 +235,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[MAX_EXTRACT_IMAGES+1];
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
......
......@@ -45,11 +45,11 @@ enum
/* 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 deinterlace (GimpDrawable *drawable);
......@@ -96,11 +96,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;
......
......@@ -75,7 +75,7 @@ typedef struct _DepthMergeInterface
guchar *previewDepthMap1;
guchar *previewDepthMap2;
gint run;
gboolean run;
} DepthMergeInterface;
typedef struct _DepthMergeParams
......@@ -154,11 +154,11 @@ void util_convertColorspace (guchar *dest,
/* ----- plug-in entry points ----- */
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 =
{
......@@ -207,11 +207,11 @@ query (void)
}
static void
run (gchar *name,
gint numParams,
GimpParam *param,
gint *numReturnVals,
GimpParam **returnVals)
run (const gchar *name,
gint numParams,
const GimpParam *param,
gint *numReturnVals,
GimpParam **returnVals)
{
static GimpParam values[1];
GimpRunMode runMode;
......
......@@ -85,11 +85,11 @@
*/
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 despeckle (void);
......@@ -140,7 +140,7 @@ gint sel_width, /* Selection width */
sel_height; /* Selection height */
gint img_bpp; /* Bytes-per-pixel in image */
gint run_filter = FALSE; /* True if we should run the filter */
gboolean run_filter = FALSE; /* True if we should run the filter */
gint despeckle_vals[4] =
{
......@@ -196,15 +196,15 @@ query (void)
*/
static void
run (gchar *name, /* I - Name of filter program. */
gint nparams, /* I - Number of parameters passed in */
GimpParam *param, /* I - Parameter values */
gint *nreturn_vals, /* O - Number of return values */
GimpParam **return_vals) /* O - Return values */
run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
GimpRunMode run_mode; /* Current run mode */
GimpPDBStatusType status; /* Return status */
GimpParam *values; /* Return values */
GimpRunMode run_mode;
GimpPDBStatusType status;
GimpParam *values;
INIT_I18N ();
......
......@@ -71,24 +71,24 @@
* Local functions...
*/
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 destripe (void);
static void destripe (void);
static gint destripe_dialog (void);
static gint destripe_dialog (void);
static void dialog_histogram_callback (GtkWidget *, gpointer);
static void dialog_iscale_update (GtkAdjustment *, gint *);
static void dialog_ok_callback (GtkWidget *, gpointer);
static void dialog_iscale_update (GtkAdjustment *, gint *);
static void dialog_ok_callback (GtkWidget *, gpointer);
static void preview_init (void);
static void preview_exit (void);
static void preview_update (void);
static void preview_scroll_callback (void);
static void preview_init (void);
static void preview_exit (void);
static void preview_update (void);
static void preview_scroll_callback (void);
/*
......@@ -103,26 +103,26 @@ GimpPlugInInfo PLUG_IN_INFO =
run /* run_proc */
};
GtkWidget *preview; /* Preview widget */
gint preview_width, /* Width of preview widget */