plug-ins/common/tga.c plug-ins/common/threshold_alpha.c

2005-08-16  Michael Natterer  <mitch@gimp.org>

	* plug-ins/common/tga.c
	* plug-ins/common/threshold_alpha.c
	* plug-ins/common/tiff.c
	* plug-ins/common/tile.c
	* plug-ins/common/tileit.c
	* plug-ins/common/tiler.c
	* plug-ins/common/uniteditor.c
	* plug-ins/common/unsharp.c
	* plug-ins/common/video.c
	* plug-ins/common/vinvert.c
	* plug-ins/common/vpropagate.c
	* plug-ins/common/warp.c
	* plug-ins/common/waves.c
	* plug-ins/common/webbrowser.c
	* plug-ins/common/whirlpinch.c
	* plug-ins/common/wind.c
	* plug-ins/common/winprint.c
	* plug-ins/common/wmf.c
	* plug-ins/common/xbm.c
	* plug-ins/common/xpm.c
	* plug-ins/common/xwd.c
	* plug-ins/common/zealouscrop.c: canonicalize procedure and
	parameter names. Misc cleanups.
This commit is contained in:
Michael Natterer 2005-08-15 22:42:34 +00:00 committed by Michael Natterer
parent 1778b39f12
commit 56f255ad3d
23 changed files with 488 additions and 408 deletions

View File

@ -1,3 +1,29 @@
2005-08-16 Michael Natterer <mitch@gimp.org>
* plug-ins/common/tga.c
* plug-ins/common/threshold_alpha.c
* plug-ins/common/tiff.c
* plug-ins/common/tile.c
* plug-ins/common/tileit.c
* plug-ins/common/tiler.c
* plug-ins/common/uniteditor.c
* plug-ins/common/unsharp.c
* plug-ins/common/video.c
* plug-ins/common/vinvert.c
* plug-ins/common/vpropagate.c
* plug-ins/common/warp.c
* plug-ins/common/waves.c
* plug-ins/common/webbrowser.c
* plug-ins/common/whirlpinch.c
* plug-ins/common/wind.c
* plug-ins/common/winprint.c
* plug-ins/common/wmf.c
* plug-ins/common/xbm.c
* plug-ins/common/xpm.c
* plug-ins/common/xwd.c
* plug-ins/common/zealouscrop.c: canonicalize procedure and
parameter names. Misc cleanups.
2005-08-15 Michael Natterer <mitch@gimp.org>
* configure.in: check for libgnomeui-2.0. Added version

View File

@ -84,6 +84,11 @@
#include "libgimp/stdplugins-intl.h"
#define LOAD_PROC "file-tga-load"
#define SAVE_PROC "file-tga-save"
#define PLUG_IN_BINARY "tga"
/* Round up a division to the nearest integer. */
#define ROUNDUP_DIVIDE(n,d) (((n) + (d - 1)) / (d))
@ -197,9 +202,9 @@ query (void)
{
static GimpParamDef load_args[] =
{
{ 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 entered" }
{ 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 entered" }
};
static GimpParamDef load_return_vals[] =
@ -209,17 +214,16 @@ query (void)
static GimpParamDef save_args[] =
{
{ 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, "rle", "Use RLE compression" },
{ GIMP_PDB_INT32, "origin", "Image origin (0 = top-left, 1 = bottom-left)"}
{ 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, "rle", "Use RLE compression" },
{ GIMP_PDB_INT32, "origin", "Image origin (0 = top-left, 1 = bottom-left)"}
} ;
gimp_install_procedure ("file_tga_load",
gimp_install_procedure (LOAD_PROC,
"Loads files of Targa file format",
"FIXME: write help for tga_load",
"Raphael FRANCOIS, Gordon Matzigkeit",
@ -232,10 +236,10 @@ query (void)
G_N_ELEMENTS (load_return_vals),
load_args, load_return_vals);
gimp_register_file_handler_mime ("file_tga_load", "image/x-tga");
gimp_register_load_handler ("file_tga_load", "tga", "");
gimp_register_file_handler_mime (LOAD_PROC, "image/x-tga");
gimp_register_load_handler (LOAD_PROC, "tga", "");
gimp_install_procedure ("file_tga_save",
gimp_install_procedure (SAVE_PROC,
"saves files in the Targa file format",
"FIXME: write help for tga_save",
"Raphael FRANCOIS, Gordon Matzigkeit",
@ -247,8 +251,8 @@ query (void)
G_N_ELEMENTS (save_args), 0,
save_args, NULL);
gimp_register_file_handler_mime ("file_tga_save", "image/x-tga");
gimp_register_save_handler ("file_tga_save", "tga", "");
gimp_register_file_handler_mime (SAVE_PROC, "image/x-tga");
gimp_register_save_handler (SAVE_PROC, "tga", "");
}
static void
@ -275,10 +279,11 @@ run (const gchar *name,
*nreturn_vals = 1;
*return_vals = values;
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
if (strcmp (name, "file_tga_load") == 0)
if (strcmp (name, LOAD_PROC) == 0)
{
#ifdef PROFILE
times (&tbuf1);
@ -297,9 +302,9 @@ run (const gchar *name,
status = GIMP_PDB_EXECUTION_ERROR;
}
}
else if (strcmp (name, "file_tga_save") == 0)
else if (strcmp (name, SAVE_PROC) == 0)
{
gimp_ui_init ("tga", FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
image_ID = param[1].data.d_int32;
drawable_ID = param[2].data.d_int32;
@ -328,7 +333,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
/* Possibly retrieve data */
gimp_get_data ("file_tga_save", &tsvals);
gimp_get_data (SAVE_PROC, &tsvals);
/* First acquire information with a dialog */
if (! save_dialog ())
@ -349,7 +354,7 @@ run (const gchar *name,
case GIMP_RUN_WITH_LAST_VALS:
/* Possibly retrieve data */
gimp_get_data ("file_tga_save", &tsvals);
gimp_get_data (SAVE_PROC, &tsvals);
break;
default:
@ -365,7 +370,7 @@ run (const gchar *name,
if (save_image (param[3].data.d_string, image_ID, drawable_ID))
{
/* Store psvals data */
gimp_set_data ("file_tga_save", &tsvals, sizeof (tsvals));
gimp_set_data (SAVE_PROC, &tsvals, sizeof (tsvals));
}
else
{
@ -1182,9 +1187,9 @@ save_dialog (void)
GtkWidget *vbox;
gboolean run;
dlg = gimp_dialog_new (_("Save as TGA"), "tga",
dlg = gimp_dialog_new (_("Save as TGA"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "file-tga-save",
gimp_standard_help_func, SAVE_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -1192,9 +1197,9 @@ save_dialog (void)
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dlg),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);

View File

@ -30,9 +30,8 @@
#include "libgimp/stdplugins-intl.h"
#define PLUG_IN_NAME "plug_in_threshold_alpha"
#define SHORT_NAME "threshold_alpha"
#define HELP_ID "plug-in-threshold-alpha"
#define PLUG_IN_PROC "plug-in-threshold-alpha"
#define PLUG_IN_BINARY "threshold_alpha"
#define PROGRESS_UPDATE_NUM 100
#define SCALE_WIDTH 120
@ -82,7 +81,7 @@ query (void)
{ GIMP_PDB_INT32, "threshold", "Threshold" }
};
gimp_install_procedure (PLUG_IN_NAME,
gimp_install_procedure (PLUG_IN_PROC,
"",
"",
"Shuji Narazaki (narazaki@InetQ.or.jp)",
@ -94,7 +93,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register (PLUG_IN_NAME,
gimp_plugin_menu_register (PLUG_IN_PROC,
"<Image>/Layer/Transparency/Modify");
}
@ -138,7 +137,7 @@ run (const gchar *name,
g_message (_("RGBA/GRAYA drawable is not selected."));
return;
}
gimp_get_data (PLUG_IN_NAME, &VALS);
gimp_get_data (PLUG_IN_PROC, &VALS);
if (! threshold_alpha_dialog (drawable))
return;
break;
@ -155,7 +154,7 @@ run (const gchar *name,
break;
case GIMP_RUN_WITH_LAST_VALS:
gimp_get_data (PLUG_IN_NAME, &VALS);
gimp_get_data (PLUG_IN_PROC, &VALS);
break;
}
@ -170,7 +169,7 @@ run (const gchar *name,
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_displays_flush ();
if (run_mode == GIMP_RUN_INTERACTIVE && status == GIMP_PDB_SUCCESS)
gimp_set_data (PLUG_IN_NAME, &VALS, sizeof (ValueType));
gimp_set_data (PLUG_IN_PROC, &VALS, sizeof (ValueType));
}
else
{
@ -244,11 +243,11 @@ threshold_alpha_dialog (GimpDrawable *drawable)
GtkObject *adj;
gboolean run;
gimp_ui_init (SHORT_NAME, FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
dialog = gimp_dialog_new (_("Threshold Alpha"), SHORT_NAME,
dialog = gimp_dialog_new (_("Threshold Alpha"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, HELP_ID,
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,

View File

@ -49,6 +49,12 @@
#include "libgimp/stdplugins-intl.h"
#define LOAD_PROC "file-tiff-load"
#define SAVE_PROC "file-tiff-save"
#define SAVE2_PROC "file-tiff-save2"
#define PLUG_IN_BINARY "tiff"
typedef struct
{
gint compression;
@ -188,9 +194,9 @@ query (void)
{
static GimpParamDef load_args[] =
{
{ 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" }
{ 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 GimpParamDef load_return_vals[] =
{
@ -198,12 +204,12 @@ query (void)
};
#define COMMON_SAVE_ARGS \
{ 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 type: { NONE (0), LZW (1), PACKBITS (2), DEFLATE (3), JPEG (4)" }
{ 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 type: { NONE (0), LZW (1), PACKBITS (2), DEFLATE (3), JPEG (4)" }
static GimpParamDef save_args_old[] =
{
@ -213,10 +219,10 @@ query (void)
static GimpParamDef save_args[] =
{
COMMON_SAVE_ARGS,
{ GIMP_PDB_INT32, "save_transp_pixels", "Keep the color data masked by an alpha channel intact" }
{ GIMP_PDB_INT32, "save-transp-pixels", "Keep the color data masked by an alpha channel intact" }
};
gimp_install_procedure ("file_tiff_load",
gimp_install_procedure (LOAD_PROC,
"loads files of the tiff file format",
"FIXME: write help for tiff_load",
"Spencer Kimball, Peter Mattis & Nick Lamb",
@ -229,13 +235,13 @@ query (void)
G_N_ELEMENTS (load_return_vals),
load_args, load_return_vals);
gimp_register_file_handler_mime ("file_tiff_load", "image/tiff");
gimp_register_magic_load_handler ("file_tiff_load",
gimp_register_file_handler_mime (LOAD_PROC, "image/tiff");
gimp_register_magic_load_handler (LOAD_PROC,
"tif,tiff",
"",
"0,string,II*\\0,0,string,MM\\0*");
gimp_install_procedure ("file_tiff_save",
gimp_install_procedure (SAVE_PROC,
"saves files in the tiff file format",
"Saves files in the Tagged Image File Format. "
"The value for the saved comment is taken "
@ -249,10 +255,10 @@ query (void)
G_N_ELEMENTS (save_args_old), 0,
save_args_old, NULL);
gimp_register_file_handler_mime ("file_tiff_save", "image/tiff");
gimp_register_save_handler ("file_tiff_save", "tif,tiff", "");
gimp_register_file_handler_mime (SAVE_PROC, "image/tiff");
gimp_register_save_handler (SAVE_PROC, "tif,tiff", "");
gimp_install_procedure ("file_tiff_save2",
gimp_install_procedure (SAVE2_PROC,
"saves files in the tiff file format",
"Saves files in the Tagged Image File Format. "
"The value for the saved comment is taken "
@ -266,7 +272,7 @@ query (void)
G_N_ELEMENTS (save_args), 0,
save_args, NULL);
gimp_register_file_handler_mime ("file_tiff_save2", "image/tiff");
gimp_register_file_handler_mime (SAVE2_PROC, "image/tiff");
}
static void
@ -294,7 +300,7 @@ run (const gchar *name,
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
if (strcmp (name, "file_tiff_load") == 0)
if (strcmp (name, LOAD_PROC) == 0)
{
image = load_image (param[1].data.d_string);
@ -309,8 +315,8 @@ run (const gchar *name,
status = GIMP_PDB_EXECUTION_ERROR;
}
}
else if (strcmp (name, "file_tiff_save") == 0 ||
strcmp (name, "file_tiff_save2") == 0)
else if (strcmp (name, SAVE_PROC) == 0 ||
strcmp (name, SAVE2_PROC) == 0)
{
/* Plug-in is either file_tiff_save or file_tiff_save2 */
image = orig_image = param[1].data.d_int32;
@ -324,7 +330,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init ("tiff", FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
export = gimp_export_image (&image, &drawable, "TIFF",
(GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
@ -352,7 +358,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
/* Possibly retrieve data */
gimp_get_data ("file_tiff_save", &tsvals);
gimp_get_data (SAVE_PROC, &tsvals);
parasite = gimp_image_parasite_find (orig_image, "tiff-save-options");
if (parasite)
@ -396,7 +402,7 @@ run (const gchar *name,
case GIMP_RUN_WITH_LAST_VALS:
/* Possibly retrieve data */
gimp_get_data ("file_tiff_save", &tsvals);
gimp_get_data (SAVE_PROC, &tsvals);
parasite = gimp_image_parasite_find (orig_image, "tiff-save-options");
if (parasite)
@ -418,7 +424,7 @@ run (const gchar *name,
if (save_image (param[3].data.d_string, image, drawable, orig_image))
{
/* Store mvals data */
gimp_set_data ("file_tiff_save", &tsvals, sizeof (TiffSaveVals));
gimp_set_data (SAVE_PROC, &tsvals, sizeof (TiffSaveVals));
}
else
{
@ -2241,9 +2247,9 @@ save_dialog (gboolean alpha)
GtkWidget *toggle;
gboolean run;
dlg = gimp_dialog_new (_("Save as TIFF"), "tiff",
dlg = gimp_dialog_new (_("Save as TIFF"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "file-tiff-save",
gimp_standard_help_func, SAVE_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -2251,9 +2257,9 @@ save_dialog (gboolean alpha)
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dlg),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);

View File

@ -29,6 +29,10 @@
#include "libgimp/stdplugins-intl.h"
#define PLUG_IN_PROC "plug-in-tile"
#define PLUG_IN_BINARY "tile"
typedef struct
{
gint new_width;
@ -79,21 +83,21 @@ query (void)
{
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (unused)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_INT32, "new_width", "New (tiled) image width" },
{ GIMP_PDB_INT32, "new_height", "New (tiled) image height" },
{ GIMP_PDB_INT32, "new_image", "Create a new image?" }
{ GIMP_PDB_INT32, "new-width", "New (tiled) image width" },
{ GIMP_PDB_INT32, "new-height", "New (tiled) image height" },
{ GIMP_PDB_INT32, "new-image", "Create a new image?" }
};
static GimpParamDef return_vals[] =
{
{ GIMP_PDB_IMAGE, "new_image", "Output image (N/A if new_image == FALSE)" },
{ GIMP_PDB_LAYER, "new_layer", "Output layer (N/A if new_image == FALSE)" }
{ GIMP_PDB_IMAGE, "new-image", "Output image (N/A if new-image == FALSE)" },
{ GIMP_PDB_LAYER, "new-layer", "Output layer (N/A if new-image == FALSE)" }
};
gimp_install_procedure ("plug_in_tile",
gimp_install_procedure (PLUG_IN_PROC,
"Create a new image which is a tiled version of the "
"input drawable",
"This function creates a new image with a single "
@ -112,7 +116,7 @@ query (void)
G_N_ELEMENTS (return_vals),
args, return_vals);
gimp_plugin_menu_register ("plug_in_tile", "<Image>/Filters/Map");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Map");
}
static void
@ -148,7 +152,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
/* Possibly retrieve data */
gimp_get_data ("plug_in_tile", &tvals);
gimp_get_data (PLUG_IN_PROC, &tvals);
/* First acquire information with a dialog */
if (! tile_dialog (param[1].data.d_image,
@ -175,7 +179,7 @@ run (const gchar *name,
case GIMP_RUN_WITH_LAST_VALS:
/* Possibly retrieve data */
gimp_get_data ("plug_in_tile", &tvals);
gimp_get_data (PLUG_IN_PROC, &tvals);
break;
default:
@ -195,7 +199,7 @@ run (const gchar *name,
/* Store data */
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_set_data ("plug_in_tile", &tvals, sizeof (TileVals));
gimp_set_data (PLUG_IN_PROC, &tvals, sizeof (TileVals));
if (run_mode != GIMP_RUN_NONINTERACTIVE)
{
@ -377,7 +381,7 @@ tile_dialog (gint32 image_ID,
GimpUnit unit;
gboolean run;
gimp_ui_init ("tile", FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
width = gimp_drawable_width (drawable_ID);
height = gimp_drawable_height (drawable_ID);
@ -387,9 +391,9 @@ tile_dialog (gint32 image_ID,
tvals.new_width = width;
tvals.new_height = height;
dlg = gimp_dialog_new (_("Tile"), "tile",
dlg = gimp_dialog_new (_("Tile"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "plug-in-tile",
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -397,9 +401,9 @@ tile_dialog (gint32 image_ID,
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dlg),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);

View File

@ -45,7 +45,8 @@
#include "libgimp/stdplugins-intl.h"
#define PLUG_IN_NAME "plug_in_small_tiles"
#define PLUG_IN_PROC "plug-in-small-tiles"
#define PLUG_IN_BINARY "tileit"
/***** Magic numbers *****/
@ -205,13 +206,13 @@ query (void)
{
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (unused)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_INT32, "number_of_tiles", "Number of tiles to make" }
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (unused)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_INT32, "num-tiles", "Number of tiles to make" }
};
gimp_install_procedure (PLUG_IN_NAME,
gimp_install_procedure (PLUG_IN_PROC,
"Tiles image into smaller versions of the orginal",
"More here later",
"Andy Thomas",
@ -223,7 +224,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register (PLUG_IN_NAME, "<Image>/Filters/Map");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Map");
}
static void
@ -285,7 +286,7 @@ run (const gchar *name,
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
gimp_get_data (PLUG_IN_NAME, &itvals);
gimp_get_data (PLUG_IN_PROC, &itvals);
if (! tileit_dialog ())
{
gimp_drawable_detach (drawable);
@ -305,7 +306,7 @@ run (const gchar *name,
break;
case GIMP_RUN_WITH_LAST_VALS:
gimp_get_data (PLUG_IN_NAME, &itvals);
gimp_get_data (PLUG_IN_PROC, &itvals);
break;
default:
@ -325,7 +326,7 @@ run (const gchar *name,
gimp_displays_flush ();
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_set_data (PLUG_IN_NAME, &itvals, sizeof (TileItVals));
gimp_set_data (PLUG_IN_PROC, &itvals, sizeof (TileItVals));
}
else
{
@ -356,13 +357,13 @@ tileit_dialog (void)
GSList *orientation_group = NULL;
gboolean run;
gimp_ui_init ("tileit", TRUE);
gimp_ui_init (PLUG_IN_BINARY, TRUE);
cache_preview (); /* Get the preview image */
dlg = gimp_dialog_new (_("TileIt"), "tileit",
dlg = gimp_dialog_new (_("Small Tiles"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "plug-in-small-tiles",
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -370,9 +371,9 @@ tileit_dialog (void)
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dlg),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
main_vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);

View File

@ -29,6 +29,9 @@
#include "libgimp/stdplugins-intl.h"
#define PLUG_IN_PROC "plug-in-make-seamless"
/* Declare local functions.
*/
static void query (void);
@ -60,7 +63,7 @@ query (void)
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" }
};
gimp_install_procedure ("plug_in_make_seamless",
gimp_install_procedure (PLUG_IN_PROC,
"Seamless tile creation",
"This plugin creates a seamless tileable from "
"the input drawable",
@ -73,7 +76,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_make_seamless", "<Image>/Filters/Map");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Map");
}
@ -134,7 +137,7 @@ weld_pixels (guchar *dest1,
gdouble a = (ABS(x - width) - 1)/ (gdouble) (width - 1);
gdouble b = (ABS(y - height) - 1) / (gdouble) (height - 1);
gdouble w;
guint i;
guint i;
/* mimic ambiguous point handling in original algorithm */
if (a < 1e-8 && b > 0.99999999)
@ -151,11 +154,11 @@ weld_pixels (guchar *dest1,
static void
weld_pixels_alpha (guchar *dest1,
guchar *dest2,
gint width,
gint height,
gint x,
gint y,
guint bpp,
gint width,
gint height,
gint x,
gint y,
guint bpp,
guchar *src1,
guchar *src2)
{
@ -163,8 +166,8 @@ weld_pixels_alpha (guchar *dest1,
gdouble b = (ABS(y - height) - 1) / (gdouble) (height - 1);
gdouble w;
gdouble alpha;
guint ai = bpp-1;
guint i;
guint ai = bpp-1;
guint i;
/* mimic ambiguous point handling in original algorithm */
if (a < 1e-8 && b > 0.99999999)
@ -187,20 +190,24 @@ weld_pixels_alpha (guchar *dest1,
}
static void
tile_region (GimpDrawable *drawable, gboolean left,
gint x1, gint y1, gint x2, gint y2)
tile_region (GimpDrawable *drawable,
gboolean left,
gint x1,
gint y1,
gint x2,
gint y2)
{
glong width, height;
gint bpp;
gint wodd, hodd;
gint w, h, x, y;
gint rgn1_x, rgn2_x, off_x;
static gint progress = 0;
gint max_progress;
glong width, height;
gint bpp;
gint wodd, hodd;
gint w, h, x, y;
gint rgn1_x, rgn2_x, off_x;
static gint progress = 0;
gint max_progress;
GimpPixelRgn src1_rgn, src2_rgn, dest1_rgn, dest2_rgn;
gpointer pr;
gboolean has_alpha;
guint asymmetry_correction;
gpointer pr;
gboolean has_alpha;
guint asymmetry_correction;
bpp = gimp_drawable_bpp (drawable->drawable_id);
has_alpha = gimp_drawable_has_alpha (drawable->drawable_id);
@ -214,12 +221,12 @@ tile_region (GimpDrawable *drawable, gboolean left,
w = width / 2;
h = height / 2;
if (left)
if (left)
{
rgn1_x = x1;
rgn2_x = x1 + w + wodd;
off_x = w + wodd;
}
}
else
{
rgn1_x = x1 + w + wodd;
@ -231,9 +238,9 @@ tile_region (GimpDrawable *drawable, gboolean left,
gimp_pixel_rgn_init (&src1_rgn, drawable, rgn1_x, y1, w, h, FALSE, FALSE);
gimp_pixel_rgn_init (&dest1_rgn, drawable, rgn1_x, y1, w, h, TRUE, TRUE);
gimp_pixel_rgn_init (&src2_rgn, drawable, rgn2_x, y1 + h + hodd,
gimp_pixel_rgn_init (&src2_rgn, drawable, rgn2_x, y1 + h + hodd,
w, h, FALSE, FALSE);
gimp_pixel_rgn_init (&dest2_rgn, drawable, rgn2_x, y1 + h + hodd,
gimp_pixel_rgn_init (&dest2_rgn, drawable, rgn2_x, y1 + h + hodd,
w, h, TRUE, TRUE);
max_progress = width * height / 2;
@ -247,7 +254,7 @@ tile_region (GimpDrawable *drawable, gboolean left,
guchar *dest1 = dest1_rgn.data;
guchar *src2 = src2_rgn.data;
guchar *dest2 = dest2_rgn.data;
gint row = src1_rgn.y - y1;
gint row = src1_rgn.y - y1;
for (y = 0; y < src1_rgn.h; y++, row++)
{
@ -287,15 +294,20 @@ tile_region (GimpDrawable *drawable, gboolean left,
dest1 += dest1_rgn.rowstride;
dest2 += dest2_rgn.rowstride;
}
progress += src1_rgn.w * src1_rgn.h;
gimp_progress_update ((gdouble) progress / (gdouble) max_progress);
}
}
static void
copy_region (GimpDrawable *drawable, gint x, gint y, gint w, gint h)
copy_region (GimpDrawable *drawable,
gint x,
gint y,
gint w,
gint h)
{
GimpPixelRgn src_rgn, dest_rgn;
GimpPixelRgn src_rgn, dest_rgn;
gpointer pr;
gimp_pixel_rgn_init (&src_rgn, drawable, x, y, w, h, FALSE, FALSE);
@ -319,12 +331,12 @@ copy_region (GimpDrawable *drawable, gint x, gint y, gint w, gint h)
static void
tile (GimpDrawable *drawable)
{
glong width, height;
gint x1, y1, x2, y2;
glong width, height;
gint x1, y1, x2, y2;
gimp_drawable_mask_bounds (drawable->drawable_id, &x1, &y1, &x2, &y2);
gimp_progress_init (_("Tiler..."));
height = y2 - y1;
width = x2 - x1;

View File

@ -30,6 +30,8 @@
#include "libgimp/stdplugins-intl.h"
#define PLUG_IN_PROC "plug-in-unit-editor"
#define PLUG_IN_BINARY "uniteditor"
#define RESPONSE_REFRESH 1
enum
@ -137,10 +139,10 @@ query (void)
{
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive" }
{ GIMP_PDB_INT32, "run-mode", "Interactive" }
};
gimp_install_procedure ("plug_in_unit_editor",
gimp_install_procedure (PLUG_IN_PROC,
"The GIMP unit editor (runs in interactive mode only)",
"The GIMP unit editor (runs in interactive mode only)",
"Michael Natterer <mitch@gimp.org>",
@ -152,9 +154,8 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_unit_editor",
"<Toolbox>/Xtns/Extensions");
gimp_plugin_icon_register ("plug_in_unit_editor",
gimp_plugin_menu_register (PLUG_IN_PROC, "<Toolbox>/Xtns/Extensions");
gimp_plugin_icon_register (PLUG_IN_PROC,
GIMP_ICON_TYPE_STOCK_ID,
(const guchar *) GIMP_STOCK_TOOL_MEASURE);
}
@ -179,7 +180,7 @@ run (const gchar *name,
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = GIMP_PDB_CALLING_ERROR;
if (strcmp (name, "plug_in_unit_editor") == 0)
if (strcmp (name, PLUG_IN_PROC) == 0)
{
values[0].data.d_status = GIMP_PDB_SUCCESS;
@ -206,9 +207,9 @@ new_unit_dialog (GtkWidget *main_dialog,
GimpUnit unit = GIMP_UNIT_PIXEL;
dialog = gimp_dialog_new (_("New Unit"), "uniteditor",
dialog = gimp_dialog_new (_("New Unit"), PLUG_IN_BINARY,
main_dialog, GTK_DIALOG_MODAL,
gimp_standard_help_func, "plug-in-unit-editor",
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -216,9 +217,9 @@ new_unit_dialog (GtkWidget *main_dialog,
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
table = gtk_table_new (7, 2, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
@ -386,7 +387,7 @@ unit_editor_dialog (void)
GtkCellRenderer *rend;
gint i;
gimp_ui_init ("uniteditor", FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
list_store = gtk_list_store_new (NUM_COLUMNS,
G_TYPE_BOOLEAN, /* SAVE */
@ -404,9 +405,9 @@ unit_editor_dialog (void)
tv = gtk_tree_view_new_with_model (GTK_TREE_MODEL (list_store));
g_object_unref (list_store);
main_dialog = gimp_dialog_new (_("Unit Editor"), "uniteditor",
main_dialog = gimp_dialog_new (_("Unit Editor"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "plug-in-unit-editor",
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_REFRESH, RESPONSE_REFRESH,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,

View File

@ -28,6 +28,8 @@
#include "libgimp/stdplugins-intl.h"
#define PLUG_IN_PROC "plug-in-unsharp-mask"
#define PLUG_IN_BINARY "unsharp"
#define PLUG_IN_VERSION "0.10"
#define SCALE_WIDTH 120
@ -125,7 +127,7 @@ query (void)
{ GIMP_PDB_FLOAT, "threshold", "Threshold" }
};
gimp_install_procedure ("plug_in_unsharp_mask",
gimp_install_procedure (PLUG_IN_PROC,
"An unsharp mask filter",
"The unsharp mask is a sharpening filter that works "
"by comparing using the difference of the image and "
@ -142,8 +144,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_unsharp_mask",
"<Image>/Filters/Enhance");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Enhance");
}
static void
@ -180,7 +181,7 @@ run (const gchar *name,
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
gimp_get_data ("plug_in_unsharp_mask", &unsharp_params);
gimp_get_data (PLUG_IN_PROC, &unsharp_params);
/* Reset default values show preview unmodified */
/* initialize pixel regions and buffer */
@ -208,7 +209,7 @@ run (const gchar *name,
break;
case GIMP_RUN_WITH_LAST_VALS:
gimp_get_data ("plug_in_unsharp_mask", &unsharp_params);
gimp_get_data (PLUG_IN_PROC, &unsharp_params);
break;
default:
@ -225,7 +226,7 @@ run (const gchar *name,
gimp_displays_flush ();
/* set data for next use of filter */
gimp_set_data ("plug_in_unsharp_mask", &unsharp_params,
gimp_set_data (PLUG_IN_PROC, &unsharp_params,
sizeof (UnsharpMaskParams));
gimp_drawable_detach(drawable);
@ -626,11 +627,11 @@ unsharp_mask_dialog (GimpDrawable *drawable)
GtkObject *adj;
gboolean run;
gimp_ui_init ("unsharp", TRUE);
gimp_ui_init (PLUG_IN_BINARY, TRUE);
dialog = gimp_dialog_new (_("Unsharp Mask"), "unsharp",
dialog = gimp_dialog_new (_("Unsharp Mask"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "plug-in-unsharp-mask",
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -638,9 +639,9 @@ unsharp_mask_dialog (GimpDrawable *drawable)
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
main_vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);

View File

@ -28,8 +28,10 @@
#include "libgimp/stdplugins-intl.h"
#define MAX_PATTERNS 9
#define PLUG_IN_PROC "plug-in-video"
#define PLUG_IN_BINARY "video"
#define MAX_PATTERNS 9
#define MAX_PATTERN_SIZE 108
const gint pattern_width[MAX_PATTERNS] = { 2, 4, 1, 1, 2, 3, 6, 6, 5 };
@ -1792,15 +1794,15 @@ query (void)
{
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (unused)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_INT32, "pattern_number", "Type of RGB pattern to use" },
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (unused)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_INT32, "pattern-number", "Type of RGB pattern to use" },
{ GIMP_PDB_INT32, "additive", "Whether the function adds the result to the original image" },
{ GIMP_PDB_INT32, "rotated", "Whether to rotate the RGB pattern by ninety degrees" }
};
gimp_install_procedure ("plug_in_video",
gimp_install_procedure (PLUG_IN_PROC,
"Apply low-dotpitch RGB simulation to the "
"specified drawable",
"This function simulates the degradation of "
@ -1815,7 +1817,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_video", "<Image>/Filters/Distorts");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Distorts");
}
static void
@ -1844,7 +1846,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
/* Possibly retrieve data */
gimp_get_data ("plug_in_video", &vvals);
gimp_get_data (PLUG_IN_PROC, &vvals);
/* First acquire information with a dialog */
if (! video_dialog ())
@ -1865,7 +1867,7 @@ run (const gchar *name,
case GIMP_RUN_WITH_LAST_VALS:
/* Possibly retrieve data */
gimp_get_data ("plug_in_video", &vvals);
gimp_get_data (PLUG_IN_PROC, &vvals);
break;
default:
@ -1891,7 +1893,7 @@ run (const gchar *name,
/* Store vvals data */
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_set_data ("plug_in_video", &vvals, sizeof (VideoValues));
gimp_set_data (PLUG_IN_PROC, &vvals, sizeof (VideoValues));
}
else
{
@ -2010,11 +2012,11 @@ video_dialog (void)
gint y;
gboolean run;
gimp_ui_init ("video", TRUE);
gimp_ui_init (PLUG_IN_BINARY, TRUE);
dlg = gimp_dialog_new (_("Video"), "video",
dlg = gimp_dialog_new (_("Video"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "plug-in-video",
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -2022,9 +2024,9 @@ video_dialog (void)
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dlg),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
hbox = gtk_hbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);

View File

@ -27,6 +27,9 @@
#include "libgimp/stdplugins-intl.h"
#define PLUG_IN_PROC "plug-in-vinvert"
/* Declare local functions.
*/
static void query (void);
@ -60,12 +63,12 @@ query (void)
{
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (used for indexed images)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" }
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" }
};
gimp_install_procedure ("plug_in_vinvert",
gimp_install_procedure (PLUG_IN_PROC,
"Invert the 'value' component of an indexed/RGB "
"image in HSV colorspace",
"This function takes an indexed/RGB image and "
@ -84,7 +87,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_vinvert", "<Image>/Filters/Colors");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Colors");
}
static void

View File

@ -38,13 +38,11 @@
#include "libgimp/stdplugins-intl.h"
#define DEFAULT_PLUG_IN_NAME "plug_in_vpropagate"
#define VPROPAGATE_PROC "plug-in-vpropagate"
#define ERODE_PROC "plug-in-erode"
#define DILATE_PROC "plug-in-dilate"
#define PLUG_IN_BINARY "vpropagate"
#define PLUG_IN_IMAGE_TYPES "RGB*, GRAY*"
#define SHORT_NAME "vpropagate"
#define HELP_ID "plug-in-vpropagate"
#define ERODE_PLUG_IN_NAME "plug_in_erode"
#define DILATE_PLUG_IN_NAME "plug_in_dilate"
#define VP_RGB (1 << 0)
#define VP_GRAY (1 << 1)
@ -219,18 +217,18 @@ query (void)
{
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (not used)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_INT32, "propagate-mode", "propagate 0:white, 1:black, 2:middle value 3:foreground to peak, 4:foreground, 5:background, 6:opaque, 7:transparent" },
{ GIMP_PDB_INT32, "propagating-channel", "channels which values are propagated" },
{ GIMP_PDB_FLOAT, "propagating-rate", "0.0 <= propagatating_rate <= 1.0" },
{ GIMP_PDB_INT32, "direction-mask", "0 <= direction-mask <= 15" },
{ GIMP_PDB_INT32, "lower-limit", "0 <= lower-limit <= 255" },
{ GIMP_PDB_INT32, "upper-limit", "0 <= upper-limit <= 255" }
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (not used)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_INT32, "propagate-mode", "propagate 0:white, 1:black, 2:middle value 3:foreground to peak, 4:foreground, 5:background, 6:opaque, 7:transparent" },
{ GIMP_PDB_INT32, "propagating-channel", "channels which values are propagated" },
{ GIMP_PDB_FLOAT, "propagating-rate", "0.0 <= propagatating_rate <= 1.0" },
{ GIMP_PDB_INT32, "direction-mask", "0 <= direction-mask <= 15" },
{ GIMP_PDB_INT32, "lower-limit", "0 <= lower-limit <= 255" },
{ GIMP_PDB_INT32, "upper-limit", "0 <= upper-limit <= 255" }
};
gimp_install_procedure (DEFAULT_PLUG_IN_NAME,
gimp_install_procedure (VPROPAGATE_PROC,
"Propagate values of the layer",
"Propagate values of the layer",
"Shuji Narazaki (narazaki@InetQ.or.jp)",
@ -242,7 +240,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_install_procedure (ERODE_PLUG_IN_NAME,
gimp_install_procedure (ERODE_PROC,
"Erode image",
"Erode image",
"Shuji Narazaki (narazaki@InetQ.or.jp)",
@ -254,7 +252,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_install_procedure (DILATE_PLUG_IN_NAME,
gimp_install_procedure (DILATE_PROC,
"Dilate image",
"Dilate image",
"Shuji Narazaki (narazaki@InetQ.or.jp)",
@ -266,9 +264,9 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register (DEFAULT_PLUG_IN_NAME, "<Image>/Filters/Distorts");
gimp_plugin_menu_register (ERODE_PLUG_IN_NAME, "<Image>/Filters/Effects/Generic");
gimp_plugin_menu_register (DILATE_PLUG_IN_NAME, "<Image>/Filters/Effects/Generic");
gimp_plugin_menu_register (VPROPAGATE_PROC, "<Image>/Filters/Distorts");
gimp_plugin_menu_register (ERODE_PROC, "<Image>/Filters/Effects/Generic");
gimp_plugin_menu_register (DILATE_PROC, "<Image>/Filters/Effects/Generic");
}
static void
@ -297,9 +295,9 @@ run (const gchar *name,
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
if (strcmp (name, DEFAULT_PLUG_IN_NAME) == 0)
if (strcmp (name, VPROPAGATE_PROC) == 0)
{
gimp_get_data (DEFAULT_PLUG_IN_NAME, &vpvals);
gimp_get_data (VPROPAGATE_PROC, &vpvals);
/* building the values of dialog variables from vpvals. */
propagate_alpha =
(vpvals.propagating_channel & PROPAGATING_ALPHA) ? TRUE : FALSE;
@ -316,8 +314,8 @@ run (const gchar *name,
if (! vpropagate_dialog (drawable))
return;
}
else if (strcmp (name, ERODE_PLUG_IN_NAME) == 0 ||
strcmp (name, DILATE_PLUG_IN_NAME) == 0)
else if (strcmp (name, ERODE_PROC) == 0 ||
strcmp (name, DILATE_PROC) == 0)
{
vpvals.propagating_channel = PROPAGATING_VALUE;
vpvals.propagating_rate = 1.0;
@ -325,15 +323,15 @@ run (const gchar *name,
vpvals.lower_limit = 0;
vpvals.upper_limit = 255;
if (strcmp (name, ERODE_PLUG_IN_NAME) == 0)
if (strcmp (name, ERODE_PROC) == 0)
vpvals.propagate_mode = 0;
else if (strcmp (name, DILATE_PLUG_IN_NAME) == 0)
else if (strcmp (name, DILATE_PROC) == 0)
vpvals.propagate_mode = 1;
}
break;
case GIMP_RUN_NONINTERACTIVE:
if (strcmp (name, DEFAULT_PLUG_IN_NAME) == 0)
if (strcmp (name, VPROPAGATE_PROC) == 0)
{
vpvals.propagate_mode = param[3].data.d_int32;
vpvals.propagating_channel = param[4].data.d_int32;
@ -342,8 +340,8 @@ run (const gchar *name,
vpvals.lower_limit = param[7].data.d_int32;
vpvals.upper_limit = param[8].data.d_int32;
}
else if (strcmp (name, ERODE_PLUG_IN_NAME) == 0 ||
strcmp (name, DILATE_PLUG_IN_NAME) == 0)
else if (strcmp (name, ERODE_PROC) == 0 ||
strcmp (name, DILATE_PROC) == 0)
{
vpvals.propagating_channel = PROPAGATING_VALUE;
vpvals.propagating_rate = 1.0;
@ -351,9 +349,9 @@ run (const gchar *name,
vpvals.lower_limit = 0;
vpvals.upper_limit = 255;
if (strcmp (name, ERODE_PLUG_IN_NAME) == 0)
if (strcmp (name, ERODE_PROC) == 0)
vpvals.propagate_mode = 0;
else if (strcmp (name, DILATE_PLUG_IN_NAME) == 0)
else if (strcmp (name, DILATE_PROC) == 0)
vpvals.propagate_mode = 1;
}
break;
@ -1050,11 +1048,11 @@ vpropagate_dialog (GimpDrawable *drawable)
gint index = 0;
gboolean run;
gimp_ui_init ("vpropagate", FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
dialog = gimp_dialog_new (_("Value Propagate"), "vpropagate",
dialog = gimp_dialog_new (_("Value Propagate"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, HELP_ID,
gimp_standard_help_func, VPROPAGATE_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -1062,9 +1060,9 @@ vpropagate_dialog (GimpDrawable *drawable)
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
main_vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);

View File

@ -74,6 +74,8 @@
/* Some useful macros */
#define PLUG_IN_PROC "plug-in-warp"
#define PLUG_IN_BINARY "warp"
#define ENTRY_WIDTH 75
#define TILE_CACHE_SIZE 30 /* was 48. There is a cache flush problem in GIMP preventing sequential updates */
#define MIN_ARGS 6 /* minimum number of arguments required */
@ -211,26 +213,26 @@ query (void)
{
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (unused)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_FLOAT, "amount", "Pixel displacement multiplier" },
{ GIMP_PDB_DRAWABLE, "warp_map", "Displacement control map" },
{ GIMP_PDB_INT32, "iter", "Iteration count (last required argument)" },
{ GIMP_PDB_FLOAT, "dither", "Random dither amount (first optional argument)" },
{ GIMP_PDB_FLOAT, "angle", "Angle of gradient vector rotation" },
{ GIMP_PDB_INT32, "wrap_type", "Edge behavior: { WRAP (0), SMEAR (1), BLACK (2), COLOR (3) }" },
{ GIMP_PDB_DRAWABLE, "mag_map", "Magnitude control map" },
{ GIMP_PDB_INT32, "mag_use", "Use magnitude map: { FALSE (0), TRUE (1) }" },
{ GIMP_PDB_INT32, "substeps", "Substeps between image updates" },
{ GIMP_PDB_INT32, "grad_map", "Gradient control map" },
{ GIMP_PDB_FLOAT, "grad_scale", "Scaling factor for gradient map (0=don't use)" },
{ GIMP_PDB_INT32, "vector_map", "Fixed vector control map" },
{ GIMP_PDB_FLOAT, "vector_scale", "Scaling factor for fixed vector map (0=don't use)" },
{ GIMP_PDB_FLOAT, "vector_angle", "Angle for fixed vector map" }
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (unused)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_FLOAT, "amount", "Pixel displacement multiplier" },
{ GIMP_PDB_DRAWABLE, "warp-map", "Displacement control map" },
{ GIMP_PDB_INT32, "iter", "Iteration count (last required argument)" },
{ GIMP_PDB_FLOAT, "dither", "Random dither amount (first optional argument)" },
{ GIMP_PDB_FLOAT, "angle", "Angle of gradient vector rotation" },
{ GIMP_PDB_INT32, "wrap-type", "Edge behavior: { WRAP (0), SMEAR (1), BLACK (2), COLOR (3) }" },
{ GIMP_PDB_DRAWABLE, "mag-map", "Magnitude control map" },
{ GIMP_PDB_INT32, "mag-use", "Use magnitude map: { FALSE (0), TRUE (1) }" },
{ GIMP_PDB_INT32, "substeps", "Substeps between image updates" },
{ GIMP_PDB_INT32, "grad-map", "Gradient control map" },
{ GIMP_PDB_FLOAT, "grad-scale", "Scaling factor for gradient map (0=don't use)" },
{ GIMP_PDB_INT32, "vector-map", "Fixed vector control map" },
{ GIMP_PDB_FLOAT, "vector-scale", "Scaling factor for fixed vector map (0=don't use)" },
{ GIMP_PDB_FLOAT, "vector-angle", "Angle for fixed vector map" }
};
gimp_install_procedure ("plug_in_warp",
gimp_install_procedure (PLUG_IN_PROC,
"Twist or smear an image. (only first six "
"arguments are required)",
"Smears an image along vector paths calculated as "
@ -246,7 +248,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_warp", "<Image>/Filters/Map");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Map");
}
static void
@ -293,7 +295,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
/* Possibly retrieve data */
gimp_get_data ("plug_in_warp", &dvals);
gimp_get_data (PLUG_IN_PROC, &dvals);
/* First acquire information with a dialog */
if (! warp_dialog (drawable))
@ -330,7 +332,7 @@ run (const gchar *name,
case GIMP_RUN_WITH_LAST_VALS:
/* Possibly retrieve data */
gimp_get_data ("plug_in_warp", &dvals);
gimp_get_data (PLUG_IN_PROC, &dvals);
break;
default:
@ -347,7 +349,7 @@ run (const gchar *name,
/* Store data */
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_set_data ("plug_in_warp", &dvals, sizeof (WarpVals));
gimp_set_data (PLUG_IN_PROC, &dvals, sizeof (WarpVals));
}
values[0].data.d_status = status;
@ -385,11 +387,11 @@ warp_dialog (GimpDrawable *drawable)
GSList *group = NULL;
gboolean run;
gimp_ui_init ("warp", FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
dlg = gimp_dialog_new (_("Warp"), "warp",
dlg = gimp_dialog_new (_("Warp"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "plug-in-warp",
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -397,9 +399,9 @@ warp_dialog (GimpDrawable *drawable)
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dlg),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);

View File

@ -32,6 +32,9 @@
#include "libgimp/stdplugins-intl.h"
#define PLUG_IN_PROC "plug-in-waves"
#define PLUG_IN_BINARY "waves"
enum
{
MODE_SMEAR,
@ -102,7 +105,7 @@ query (void)
{
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "The Image" },
{ GIMP_PDB_DRAWABLE, "drawable", "The Drawable" },
{ GIMP_PDB_FLOAT, "amplitude", "The Amplitude of the Waves" },
@ -112,7 +115,7 @@ query (void)
{ GIMP_PDB_INT32, "reflective", "Use Reflection" }
};
gimp_install_procedure ("plug_in_waves",
gimp_install_procedure (PLUG_IN_PROC,
"Distort the image with waves",
"none yet",
"Eric L. Hernes, Stephen Norris",
@ -124,7 +127,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_waves", "<Image>/Filters/Distorts");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Distorts");
}
static void
@ -152,7 +155,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
gimp_get_data ("plug_in_waves", &wvals);
gimp_get_data (PLUG_IN_PROC, &wvals);
if (! waves_dialog (drawable))
return;
@ -175,7 +178,7 @@ run (const gchar *name,
break;
case GIMP_RUN_WITH_LAST_VALS:
gimp_get_data ("plug_in_waves", &wvals);
gimp_get_data (PLUG_IN_PROC, &wvals);
break;
default:
@ -186,7 +189,7 @@ run (const gchar *name,
{
waves (drawable);
gimp_set_data ("plug_in_waves", &wvals, sizeof (piArgs));
gimp_set_data (PLUG_IN_PROC, &wvals, sizeof (piArgs));
values[0].data.d_status = status;
}
}
@ -238,11 +241,11 @@ waves_dialog (GimpDrawable *drawable)
GtkObject *adj;
gboolean run;
gimp_ui_init ("waves", TRUE);
gimp_ui_init (PLUG_IN_BINARY, TRUE);
dialog = gimp_dialog_new (_("Waves"), "waves",
dialog = gimp_dialog_new (_("Waves"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "plug-in-waves",
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -250,9 +253,9 @@ waves_dialog (GimpDrawable *drawable)
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
main_vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);

View File

@ -33,7 +33,7 @@
#include <windows.h>
#endif
#define PLUG_IN_NAME "plug_in_web_browser"
#define PLUG_IN_PROC "plug-in-web-browser"
static void query (void);
@ -69,7 +69,7 @@ query (void)
{ GIMP_PDB_STRING, "url", "URL to open" }
};
gimp_install_procedure (PLUG_IN_NAME,
gimp_install_procedure (PLUG_IN_PROC,
"Open an URL in the user specified web browser",
"Opens the given URL in the user specified web browser.",
"Henrik Brix Andersen <brix@gimp.org>",

View File

@ -53,9 +53,9 @@
#include "libgimp/stdplugins-intl.h"
#define PLUG_IN_NAME "plug_in_whirl_pinch"
#define PLUG_IN_PROC "plug-in-whirl-pinch"
#define PLUG_IN_BINARY "whirlpinch"
#define PLUG_IN_VERSION "May 1997, 2.09"
#define HELP_ID "plug-in-whirl-pinch"
/***** Magic numbers *****/
@ -129,16 +129,15 @@ query (void)
{
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_FLOAT, "whirl", "Whirl angle (degrees)" },
{ GIMP_PDB_FLOAT, "pinch", "Pinch amount" },
{ GIMP_PDB_FLOAT, "radius", "Radius (1.0 is the largest circle that fits in the image, "
"and 2.0 goes all the way to the corners)" }
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_FLOAT, "whirl", "Whirl angle (degrees)" },
{ GIMP_PDB_FLOAT, "pinch", "Pinch amount" },
{ GIMP_PDB_FLOAT, "radius", "Radius (1.0 is the largest circle that fits in the image, and 2.0 goes all the way to the corners)" }
};
gimp_install_procedure (PLUG_IN_NAME,
gimp_install_procedure (PLUG_IN_PROC,
"Distort an image by whirling and pinching",
"Distorts the image by whirling and pinching, which "
"are two common center-based, circular distortions. "
@ -156,7 +155,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register (PLUG_IN_NAME, "<Image>/Filters/Distorts");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Distorts");
}
static void
@ -235,7 +234,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
/* Possibly retrieve data */
gimp_get_data (PLUG_IN_NAME, &wpvals);
gimp_get_data (PLUG_IN_PROC, &wpvals);
/* Get information from the dialog */
if (!whirl_pinch_dialog (drawable))
@ -260,7 +259,7 @@ run (const gchar *name,
case GIMP_RUN_WITH_LAST_VALS:
/* Possibly retrieve data */
gimp_get_data (PLUG_IN_NAME, &wpvals);
gimp_get_data (PLUG_IN_PROC, &wpvals);
break;
default:
@ -283,7 +282,7 @@ run (const gchar *name,
/* Store data */
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_set_data (PLUG_IN_NAME, &wpvals, sizeof (whirl_pinch_vals_t));
gimp_set_data (PLUG_IN_PROC, &wpvals, sizeof (whirl_pinch_vals_t));
}
else if (status == GIMP_PDB_SUCCESS)
status = GIMP_PDB_EXECUTION_ERROR;
@ -526,11 +525,11 @@ whirl_pinch_dialog (GimpDrawable *drawable)
GtkObject *adj;
gboolean run;
gimp_ui_init ("whirlpinch", TRUE);
gimp_ui_init (PLUG_IN_BINARY, TRUE);
dialog = gimp_dialog_new (_("Whirl and Pinch"), "whirlpinch",
dialog = gimp_dialog_new (_("Whirl and Pinch"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, HELP_ID,
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -538,9 +537,9 @@ whirl_pinch_dialog (GimpDrawable *drawable)
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
main_vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);
@ -732,4 +731,3 @@ dialog_update_preview (GimpDrawable *drawable,
g_free (src);
g_free (dest);
}

View File

@ -38,7 +38,8 @@
#include "libgimp/stdplugins-intl.h"
#define PLUG_IN_NAME "wind"
#define PLUG_IN_PROC "plug-in-wind"
#define PLUG_IN_BINARY "wind"
#define COMPARE_WIDTH 3
@ -162,17 +163,17 @@ query (void)
{
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (unused)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_INT32, "threshold", "Controls where blending will be done >= 0" },
{ GIMP_PDB_INT32, "direction", "Left or Right: 0 or 1" },
{ GIMP_PDB_INT32, "strength", "Controls the extent of the blending > 1" },
{ GIMP_PDB_INT32, "alg", "WIND, BLAST" },
{ GIMP_PDB_INT32, "algorithm", "WIND, BLAST" },
{ GIMP_PDB_INT32, "edge", "LEADING, TRAILING, or BOTH" }
};
gimp_install_procedure ("plug_in_wind",
gimp_install_procedure (PLUG_IN_PROC,
"Renders a wind effect.",
"Renders a wind effect.",
"Nigel Wetten",
@ -184,7 +185,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_wind", "<Image>/Filters/Distorts");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Distorts");
}
static void
@ -226,7 +227,7 @@ run (const gchar *name,
break;
case GIMP_RUN_INTERACTIVE:
gimp_get_data ("plug_in_wind", &config);
gimp_get_data (PLUG_IN_PROC, &config);
if (! dialog_box (drawable))
{
status = GIMP_PDB_CANCEL;
@ -237,12 +238,12 @@ run (const gchar *name,
status = GIMP_PDB_CALLING_ERROR;
break;
}
gimp_set_data ("plug_in_wind", &config, sizeof (config_t));
gimp_set_data (PLUG_IN_PROC, &config, sizeof (config_t));
gimp_displays_flush ();
break;
case GIMP_RUN_WITH_LAST_VALS:
gimp_get_data ("plug_in_wind", &config);
gimp_get_data (PLUG_IN_PROC, &config);
if (render_effect (drawable, NULL) == -1)
{
status = GIMP_PDB_EXECUTION_ERROR;
@ -875,11 +876,11 @@ dialog_box (GimpDrawable *drawable)
GtkWidget *edge3;
gboolean run;
gimp_ui_init ("wind", TRUE);
gimp_ui_init (PLUG_IN_BINARY, TRUE);
dialog = gimp_dialog_new (_("Wind"), "wind",
dialog = gimp_dialog_new (_("Wind"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "plug-in-wind",
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -887,9 +888,9 @@ dialog_box (GimpDrawable *drawable)
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
main_vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);

View File

@ -45,8 +45,8 @@
#include "libgimp/stdplugins-intl.h"
#define NAME_PRINT "file_print"
#define NAME_PAGE_SETUP "file_page_setup"
#define PRINT_PROC "file-print"
#define PAGE_SETUP_PROC "file-page-setup"
#define PING() g_message ("%s: %d", __FILE__, __LINE__)
@ -215,7 +215,7 @@ query (void)
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" }
};
gimp_install_procedure (NAME_PRINT,
gimp_install_procedure (PRINT_PROC,
"This plug-in prints images from the GIMP.",
"Prints images to any printer recognized by Windows.",
"Tor Lillqvist <tml@iki.fi>",
@ -227,7 +227,7 @@ query (void)
G_N_ELEMENTS (print_args), 0,
print_args, NULL);
gimp_install_procedure (NAME_PAGE_SETUP,
gimp_install_procedure (PAGE_SETUP_PROC,
"This plug-in sets up the page for printing from the GIMP.",
"Sets up the page parameters for printing to any Windows printer.",
"Tor Lillqvist <tml@iki.fi>",
@ -239,8 +239,8 @@ query (void)
G_N_ELEMENTS (pagesetup_args), 0,
pagesetup_args, NULL);
gimp_plugin_menu_register (NAME_PRINT, "<Image>/File/Send");
gimp_plugin_menu_register (NAME_PAGE_SETUP, "<Image>/File/Send");
gimp_plugin_menu_register (PRINT_PROC, "<Image>/File/Send");
gimp_plugin_menu_register (PAGE_SETUP_PROC, "<Image>/File/Send");
}
/*
@ -298,25 +298,25 @@ run (const gchar *name,
width = drawable->width;
height = drawable->height;
if (strcmp (name, NAME_PRINT) == 0)
if (strcmp (name, PRINT_PROC) == 0)
{
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
if (gimp_get_data_size (NAME_PRINT) > 0)
if (gimp_get_data_size (PRINT_PROC) > 0)
{
g_assert (gimp_get_data_size (NAME_PRINT) == sizeof (vars));
gimp_get_data (NAME_PRINT, &vars);
g_assert (gimp_get_data_size (PRINT_PROC) == sizeof (vars));
gimp_get_data (PRINT_PROC, &vars);
if (vars.devmodeSize > 0)
{
/* Restore saved DEVMODE. */
g_assert (gimp_get_data_size (NAME_PRINT "devmode")
g_assert (gimp_get_data_size (PRINT_PROC "devmode")
== vars.devmodeSize);
hDevMode = GlobalAlloc (GMEM_MOVEABLE, vars.devmodeSize);
g_assert (hDevMode != NULL);
dmp = GlobalLock (hDevMode);
g_assert (dmp != NULL);
gimp_get_data (NAME_PRINT "devmode", dmp);
gimp_get_data (PRINT_PROC "devmode", dmp);
GlobalUnlock (hDevMode);
vars.prDlg.hDevMode = hDevMode;
}
@ -596,25 +596,25 @@ run (const gchar *name,
DeleteDC (vars.prDlg.hDC);
}
else if (strcmp (name, NAME_PAGE_SETUP) == 0)
else if (strcmp (name, PAGE_SETUP_PROC) == 0)
{
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
if (gimp_get_data_size (NAME_PRINT) > 0)
if (gimp_get_data_size (PRINT_PROC) > 0)
{
g_assert (gimp_get_data_size (NAME_PRINT) == sizeof (vars));
gimp_get_data (NAME_PRINT, &vars);
g_assert (gimp_get_data_size (PRINT_PROC) == sizeof (vars));
gimp_get_data (PRINT_PROC, &vars);
if (vars.devmodeSize > 0)
{
/* Restore saved DEVMODE. */
g_assert (gimp_get_data_size (NAME_PRINT "devmode")
g_assert (gimp_get_data_size (PRINT_PROC "devmode")
== vars.devmodeSize);
hDevMode = GlobalAlloc (GMEM_MOVEABLE, vars.devmodeSize);
g_assert (hDevMode != NULL);
dmp = GlobalLock (hDevMode);
g_assert (dmp != NULL);
gimp_get_data (NAME_PRINT "devmode", dmp);
gimp_get_data (PRINT_PROC "devmode", dmp);
GlobalUnlock (hDevMode);
vars.psDlg.hDevMode = hDevMode;
}
@ -702,9 +702,9 @@ run (const gchar *name,
"?")))))));
#endif
gimp_set_data (NAME_PRINT "devmode", dmp, vars.devmodeSize);
gimp_set_data (PRINT_PROC "devmode", dmp, vars.devmodeSize);
GlobalUnlock (hDevMode);
gimp_set_data (NAME_PRINT, &vars, sizeof(vars));
gimp_set_data (PRINT_PROC, &vars, sizeof(vars));
}
if (hDevMode != NULL)

View File

@ -33,6 +33,10 @@
#include "libgimp/stdplugins-intl.h"
#define LOAD_PROC "file-wmf-load"
#define LOAD_THUMB_PROC "file-wmf-load-thumb"
#define PLUG_IN_BINARY "wmf"
#define WMF_DEFAULT_RESOLUTION 90.0
#define WMF_DEFAULT_SIZE 500
#define WMF_PREVIEW_SIZE 128
@ -87,36 +91,33 @@ static void
query (void)
{
static GimpParamDef load_args[] =
{
{ 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" },
{ GIMP_PDB_FLOAT, "resolution",
"Resolution to use for rendering the WMF (defaults to 72 dpi" },
{ GIMP_PDB_INT32, "width",
"Width (in pixels) to load the WMF in, 0 for original width" },
{ GIMP_PDB_INT32, "height",
"Height (in pixels) to load the WMF in, 0 for original height" }
};
{
{ 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" },
{ GIMP_PDB_FLOAT, "resolution", "Resolution to use for rendering the WMF (defaults to 72 dpi" },
{ GIMP_PDB_INT32, "width", "Width (in pixels) to load the WMF in, 0 for original width" },
{ GIMP_PDB_INT32, "height", "Height (in pixels) to load the WMF in, 0 for original height" }
};
static GimpParamDef load_return_vals[] =
{
{ GIMP_PDB_IMAGE, "image", "Output image" }
};
{
{ GIMP_PDB_IMAGE, "image", "Output image" }
};
static GimpParamDef thumb_args[] =
{
{ GIMP_PDB_STRING, "filename", "The name of the file to load" },
{ GIMP_PDB_INT32, "thumb_size", "Preferred thumbnail size" }
{ GIMP_PDB_INT32, "thumb-size", "Preferred thumbnail size" }
};
static GimpParamDef thumb_return_vals[] =
{
{ GIMP_PDB_IMAGE, "image", "Thumbnail image" },
{ GIMP_PDB_INT32, "image_width", "Width of full-sized image" },
{ GIMP_PDB_INT32, "image_height", "Height of full-sized image" }
{ GIMP_PDB_INT32, "image-width", "Width of full-sized image" },
{ GIMP_PDB_INT32, "image-height", "Height of full-sized image" }
};
gimp_install_procedure ("file_wmf_load",
gimp_install_procedure (LOAD_PROC,
"Loads files in the WMF file format",
"Loads files in the WMF file format",
"Dom Lachowicz <cinamod@hotmail.com>",
@ -129,12 +130,12 @@ query (void)
G_N_ELEMENTS (load_return_vals),
load_args, load_return_vals);
gimp_register_file_handler_mime ("file_wmf_load", "image/x-wmf");
gimp_register_magic_load_handler ("file_wmf_load",
gimp_register_file_handler_mime (LOAD_PROC, "image/x-wmf");
gimp_register_magic_load_handler (LOAD_PROC,
"wmf,apm", "",
"0,string,\\327\\315\\306\\232,0,string,\\1\\0\\11\\0");
gimp_install_procedure ("file_wmf_load_thumb",
gimp_install_procedure (LOAD_THUMB_PROC,
"Loads a small preview from a WMF image",
"",
"Dom Lachowicz <cinamod@hotmail.com>",
@ -146,7 +147,8 @@ query (void)
G_N_ELEMENTS (thumb_args),
G_N_ELEMENTS (thumb_return_vals),
thumb_args, thumb_return_vals);
gimp_register_thumbnail_loader ("file_wmf_load", "file_wmf_load_thumb");
gimp_register_thumbnail_loader (LOAD_PROC, LOAD_THUMB_PROC);
}
/*
@ -177,11 +179,11 @@ run (const gchar *name,
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
if (strcmp (name, "file_wmf_load") == 0)
if (strcmp (name, LOAD_PROC) == 0)
{
filename = param[1].data.d_string;
gimp_get_data ("file_wmf_load", &load_vals);
gimp_get_data (LOAD_PROC, &load_vals);
switch (run_mode)
{
@ -200,7 +202,7 @@ run (const gchar *name,
break;
}
}
else if (strcmp (name, "file_wmf_load_thumb") == 0)
else if (strcmp (name, LOAD_THUMB_PROC) == 0)
{
gint size = param[1].data.d_int32;
@ -259,7 +261,7 @@ run (const gchar *name,
if (status == GIMP_PDB_SUCCESS)
{
if (strcmp (name, "file_wmf_load_thumb") == 0)
if (strcmp (name, LOAD_THUMB_PROC) == 0)
{
*nreturn_vals = 4;
values[2].type = GIMP_PDB_INT32;
@ -269,7 +271,7 @@ run (const gchar *name,
}
else
{
gimp_set_data ("file_wmf_load", &load_vals, sizeof (load_vals));
gimp_set_data (LOAD_PROC, &load_vals, sizeof (load_vals));
}
}
@ -473,11 +475,11 @@ load_dialog (const gchar *filename)
WmfLoadVals vals = { WMF_DEFAULT_RESOLUTION,
- WMF_PREVIEW_SIZE, - WMF_PREVIEW_SIZE };
gimp_ui_init ("wmf", FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
dialog = gimp_dialog_new (_("Render Windows Metafile"), "wmf",
dialog = gimp_dialog_new (_("Render Windows Metafile"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "wmf",
gimp_standard_help_func, LOAD_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -485,9 +487,9 @@ load_dialog (const gchar *filename)
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);

View File

@ -49,6 +49,11 @@
#include "libgimp/stdplugins-intl.h"
#define LOAD_PROC "file-xbm-load"
#define SAVE_PROC "file-xbm-save"
#define PLUG_IN_BINARY "xbm"
/* Wear your GIMP with pride! */
#define DEFAULT_USE_COMMENT TRUE
#define MAX_COMMENT 72
@ -132,9 +137,9 @@ query (void)
{
static GimpParamDef load_args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ 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 entered" }
{ GIMP_PDB_STRING, "raw-filename", "The name entered" }
};
static GimpParamDef load_return_vals[] =
@ -144,21 +149,21 @@ query (void)
static GimpParamDef save_args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ 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" },
{ GIMP_PDB_STRING, "raw_filename", "The name entered" },
{ GIMP_PDB_STRING, "raw-filename", "The name entered" },
{ GIMP_PDB_STRING, "comment", "Image description (maximum 72 bytes)" },
{ GIMP_PDB_INT32, "x10", "Save in X10 format" },
{ GIMP_PDB_INT32, "x_hot", "X coordinate of hotspot" },
{ GIMP_PDB_INT32, "y_hot", "Y coordinate of hotspot" },
{ GIMP_PDB_INT32, "x-hot", "X coordinate of hotspot" },
{ GIMP_PDB_INT32, "y-hot", "Y coordinate of hotspot" },
{ GIMP_PDB_STRING, "prefix", "Identifier prefix [determined from filename]"},
{ GIMP_PDB_INT32, "write_mask", "(0 = ignore, 1 = save as extra file)" },
{ GIMP_PDB_STRING, "mask_extension", "Extension of the mask file" }
{ GIMP_PDB_INT32, "write-mask", "(0 = ignore, 1 = save as extra file)" },
{ GIMP_PDB_STRING, "mask-extension", "Extension of the mask file" }
} ;
gimp_install_procedure ("file_xbm_load",
gimp_install_procedure (LOAD_PROC,
"Load a file in X10 or X11 bitmap (XBM) file format",
"Load a file in X10 or X11 bitmap (XBM) file format. XBM is a lossless format for flat black-and-white (two color indexed) images.",
"Gordon Matzigkeit",
@ -171,12 +176,12 @@ query (void)
G_N_ELEMENTS (load_return_vals),
load_args, load_return_vals);
gimp_register_file_handler_mime ("file_xbm_load", "image/x-xbitmap");
gimp_register_load_handler ("file_xbm_load",
gimp_register_file_handler_mime (LOAD_PROC, "image/x-xbitmap");
gimp_register_load_handler (LOAD_PROC,
"xbm,icon,bitmap",
"");
gimp_install_procedure ("file_xbm_save",
gimp_install_procedure (SAVE_PROC,
"Save a file in X10 or X11 bitmap (XBM) file format",
"Save a file in X10 or X11 bitmap (XBM) file format. XBM is a lossless format for flat black-and-white (two color indexed) images.",
"Gordon Matzigkeit",
@ -188,8 +193,8 @@ query (void)
G_N_ELEMENTS (save_args), 0,
save_args, NULL);
gimp_register_file_handler_mime ("file_xbm_save", "image/x-xbitmap");
gimp_register_save_handler ("file_xbm_save", "xbm,icon,bitmap", "");
gimp_register_file_handler_mime (SAVE_PROC, "image/x-xbitmap");
gimp_register_save_handler (SAVE_PROC, "xbm,icon,bitmap", "");
}
static gchar *
@ -251,7 +256,7 @@ run (const gchar *name,
printf ("XBM: RUN %s\n", name);
#endif
if (strcmp (name, "file_xbm_load") == 0)
if (strcmp (name, LOAD_PROC) == 0)
{
image_ID = load_image (param[1].data.d_string);
@ -266,7 +271,7 @@ run (const gchar *name,
status = GIMP_PDB_EXECUTION_ERROR;
}
}
else if (strcmp (name, "file_xbm_save") == 0)
else if (strcmp (name, SAVE_PROC) == 0)
{
image_ID = param[1].data.d_int32;
drawable_ID = param[2].data.d_int32;
@ -275,7 +280,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init ("xbm", FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
export = gimp_export_image (&image_ID, &drawable_ID, "XBM",
GIMP_EXPORT_CAN_HANDLE_BITMAP |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
@ -296,7 +301,7 @@ run (const gchar *name,
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
/* Possibly retrieve data */
gimp_get_data ("file_xbm_save", &xsvals);
gimp_get_data (SAVE_PROC, &xsvals);
/* Always override the prefix with the filename. */
mask_filename = g_strdup (init_prefix (param[3].data.d_string));
@ -444,7 +449,7 @@ run (const gchar *name,
image_ID, drawable_ID)))
{
/* Store xsvals data */
gimp_set_data ("file_xbm_save", &xsvals, sizeof (xsvals));
gimp_set_data (SAVE_PROC, &xsvals, sizeof (xsvals));
}
else
{
@ -1147,9 +1152,9 @@ save_dialog (gint32 drawable_ID)
GtkObject *adj;
gboolean run;
dlg = gimp_dialog_new (_("Save as XBM"), "xbm",
dlg = gimp_dialog_new (_("Save as XBM"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "file-xbm-save",
gimp_standard_help_func, SAVE_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -1157,9 +1162,9 @@ save_dialog (gint32 drawable_ID)
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dlg),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
/* parameter settings */
frame = gimp_frame_new (_("XBM Options"));

View File

@ -69,7 +69,10 @@ static const gchar linenoise [] =
" .+@#$%&*=-;>,')!~{]^/(_:<[}|1234567890abcdefghijklmnopqrstuvwxyz\
ABCDEFGHIJKLMNOPQRSTUVWXYZ`";
#define SCALE_WIDTH 125
#define LOAD_PROC "file-xpm-load"
#define SAVE_PROC "file-xpm-save"
#define PLUG_IN_BINARY "xpm"
#define SCALE_WIDTH 125
/* Structs for the save dialog */
typedef struct
@ -135,9 +138,9 @@ query (void)
{
static GimpParamDef load_args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ 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 entered" }
{ GIMP_PDB_STRING, "raw-filename", "The name entered" }
};
static GimpParamDef load_return_vals[] =
@ -147,15 +150,15 @@ query (void)
static GimpParamDef save_args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ 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_STRING, "raw-filename", "The name of the file to save the image in" },
{ GIMP_PDB_INT32, "threshold", "Alpha threshold (0-255)" }
};
gimp_install_procedure ("file_xpm_load",
gimp_install_procedure (LOAD_PROC,
"Load files in XPM (X11 Pixmap) format.",
"Load files in XPM (X11 Pixmap) format. "
"XPM is a portable image format designed to be "
@ -174,13 +177,13 @@ query (void)
G_N_ELEMENTS (load_return_vals),
load_args, load_return_vals);
gimp_register_file_handler_mime ("file_xpm_load", "image/x-xpixmap");
gimp_register_magic_load_handler ("file_xpm_load",
gimp_register_file_handler_mime (LOAD_PROC, "image/x-xpixmap");
gimp_register_magic_load_handler (LOAD_PROC,
"xpm",
"",
"0, string,/*\\040XPM\\040*/");
gimp_install_procedure ("file_xpm_save",
gimp_install_procedure (SAVE_PROC,
"Save files in XPM (X11 Pixmap) format.",
"Save files in XPM (X11 Pixmap) format. "
"XPM is a portable image format designed to be "
@ -198,8 +201,8 @@ query (void)
G_N_ELEMENTS (save_args), 0,
save_args, NULL);
gimp_register_file_handler_mime ("file_xpm_save", "image/x-xpixmap");
gimp_register_save_handler ("file_xpm_save", "xpm", "");
gimp_register_file_handler_mime (SAVE_PROC, "image/x-xpixmap");
gimp_register_save_handler (SAVE_PROC, "xpm", "");
}
static void
@ -226,7 +229,7 @@ run (const gchar *name,
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
if (strcmp (name, "file_xpm_load") == 0)
if (strcmp (name, LOAD_PROC) == 0)
{
image_ID = load_image (param[1].data.d_string);
@ -241,9 +244,9 @@ run (const gchar *name,
status = GIMP_PDB_EXECUTION_ERROR;
}
}
else if (strcmp (name, "file_xpm_save") == 0)
else if (strcmp (name, SAVE_PROC) == 0)
{
gimp_ui_init ("xpm", FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
image_ID = param[1].data.d_int32;
drawable_ID = param[2].data.d_int32;
@ -768,9 +771,9 @@ save_dialog (void)
GtkObject *scale_data;
gboolean run;
dlg = gimp_dialog_new (_("Save as XPM"), "xpm",
dlg = gimp_dialog_new (_("Save as XPM"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "file-xpm-save",
gimp_standard_help_func, SAVE_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -778,9 +781,9 @@ save_dialog (void)
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dlg),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
table = gtk_table_new (1, 3, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 6);

View File

@ -62,6 +62,11 @@
#include "libgimp/stdplugins-intl.h"
#define LOAD_PROC "file-xwd-load"
#define SAVE_PROC "file-xwd-save"
#define PLUG_IN_BINARY "xwd"
typedef gulong L_CARD32;
typedef gushort L_CARD16;
typedef guchar L_CARD8;
@ -241,9 +246,9 @@ query (void)
{
static GimpParamDef load_args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ 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" }
{ GIMP_PDB_STRING, "raw-filename", "The name of the file to load" }
};
static GimpParamDef load_return_vals[] =
@ -253,14 +258,14 @@ query (void)
static GimpParamDef save_args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ 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_STRING, "raw-filename", "The name of the file to save the image in" }
};
gimp_install_procedure ("file_xwd_load",
gimp_install_procedure (LOAD_PROC,
"Loads files in the XWD (X Window Dump) format",
"Loads files in the XWD (X Window Dump) format. "
"XWD image files are produced by the program xwd. "
@ -275,13 +280,13 @@ query (void)
G_N_ELEMENTS (load_return_vals),
load_args, load_return_vals);
gimp_register_file_handler_mime ("file_xwd_load", "image/x-xwindowdump");
gimp_register_magic_load_handler ("file_xwd_load",
gimp_register_file_handler_mime (LOAD_PROC, "image/x-xwindowdump");
gimp_register_magic_load_handler (LOAD_PROC,
"xwd",
"",
"4,long,0x00000007");
gimp_install_procedure ("file_xwd_save",
gimp_install_procedure (SAVE_PROC,
"Saves files in the XWD (X Window Dump) format",
"XWD saving handles all image types except "
"those with alpha channels.",
@ -294,8 +299,8 @@ query (void)
G_N_ELEMENTS (save_args), 0,
save_args, NULL);
gimp_register_file_handler_mime ("file_xwd_save", "image/x-xwindowdump");
gimp_register_save_handler ("file_xwd_save", "xwd", "");
gimp_register_file_handler_mime (SAVE_PROC, "image/x-xwindowdump");
gimp_register_save_handler (SAVE_PROC, "xwd", "");
}
@ -323,7 +328,7 @@ run (const gchar *name,
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
if (strcmp (name, "file_xwd_load") == 0)
if (strcmp (name, LOAD_PROC) == 0)
{
image_ID = load_image (param[1].data.d_string);
@ -338,7 +343,7 @@ run (const gchar *name,
status = GIMP_PDB_EXECUTION_ERROR;
}
}
else if (strcmp (name, "file_xwd_save") == 0)
else if (strcmp (name, SAVE_PROC) == 0)
{
image_ID = param[1].data.d_int32;
drawable_ID = param[2].data.d_int32;
@ -348,7 +353,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init ("xwd", FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
export = gimp_export_image (&image_ID, &drawable_ID, "XWD",
(GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |

View File

@ -24,6 +24,9 @@
#include "libgimp/stdplugins-intl.h"
#define PLUG_IN_PROC "plug-in-zealouscrop"
/* Declare local functions. */
static void query (void);
static void run (const gchar *name,
@ -73,12 +76,12 @@ query (void)
{
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" }
};
gimp_install_procedure ("plug_in_zealouscrop",
gimp_install_procedure (PLUG_IN_PROC,
"Automagically crops unused space from the edges "
"and middle of a picture.",
"",
@ -91,7 +94,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_zealouscrop", "<Image>/Image/Crop");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Image/Crop");
}
static void
@ -110,7 +113,7 @@ run (const gchar *name,
INIT_I18N();
*nreturn_vals = 1;
*return_vals = values;
*return_vals = values;
run_mode = param[0].data.d_int32;