plug-ins/bmp/bmp.c plug-ins/faxg3/faxg3.c plug-ins/fits/fits.c

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

	* plug-ins/bmp/bmp.c
	* plug-ins/faxg3/faxg3.c
	* plug-ins/fits/fits.c
	* plug-ins/flame/flame.c
	* plug-ins/gfig/gfig-dialog.c
	* plug-ins/gfig/gfig.[ch]
	* plug-ins/gflare/gflare.c
	* plug-ins/gfli/gfli.c
	* plug-ins/help/help.c
	* plug-ins/helpbrowser/helpbrowser.c
	* plug-ins/ifscompose/ifscompose.c
	* plug-ins/jpeg/jpeg-save.c
	* plug-ins/jpeg/jpeg.[ch]
	* plug-ins/maze/maze.[ch]
	* plug-ins/maze/maze_face.c
	* plug-ins/pagecurl/pagecurl.c
	* plug-ins/rcm/rcm.[ch]
	* plug-ins/rcm/rcm_dialog.c
	* plug-ins/sel2path/sel2path.c
	* plug-ins/sgi/sgi.c
	* plug-ins/uri/uri.c
	* plug-ins/xjt/xjt.c: canonicalize procedure and parameter names.
	#define them instead of repeating the same string several times.
	Minor cleanups.
This commit is contained in:
Michael Natterer 2005-08-12 15:46:46 +00:00 committed by Michael Natterer
parent 7ed8c44389
commit b6b126903d
27 changed files with 646 additions and 584 deletions

View File

@ -1,3 +1,30 @@
2005-08-12 Michael Natterer <mitch@gimp.org>
* plug-ins/bmp/bmp.c
* plug-ins/faxg3/faxg3.c
* plug-ins/fits/fits.c
* plug-ins/flame/flame.c
* plug-ins/gfig/gfig-dialog.c
* plug-ins/gfig/gfig.[ch]
* plug-ins/gflare/gflare.c
* plug-ins/gfli/gfli.c
* plug-ins/help/help.c
* plug-ins/helpbrowser/helpbrowser.c
* plug-ins/ifscompose/ifscompose.c
* plug-ins/jpeg/jpeg-save.c
* plug-ins/jpeg/jpeg.[ch]
* plug-ins/maze/maze.[ch]
* plug-ins/maze/maze_face.c
* plug-ins/pagecurl/pagecurl.c
* plug-ins/rcm/rcm.[ch]
* plug-ins/rcm/rcm_dialog.c
* plug-ins/sel2path/sel2path.c
* plug-ins/sgi/sgi.c
* plug-ins/uri/uri.c
* plug-ins/xjt/xjt.c: canonicalize procedure and parameter names.
#define them instead of repeating the same string several times.
Minor cleanups.
2005-08-12 Michael Natterer <mitch@gimp.org>
* app/plug-in/plug-in-proc-def.c (plug_in_proc_def_get_help_id):

View File

@ -61,6 +61,10 @@
#include "libgimp/stdplugins-intl.h"
#define LOAD_PROC "file-bmp-load"
#define SAVE_PROC "file-bmp-save"
const gchar *filename = NULL;
gboolean interactive_bmp;
@ -91,9 +95,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[] =
{
@ -102,14 +106,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 entered" },
{ GIMP_PDB_STRING, "raw-filename", "The name entered" },
};
gimp_install_procedure ("file_bmp_load",
gimp_install_procedure (LOAD_PROC,
"Loads files of Windows BMP file format",
"Loads files of Windows BMP file format",
"Alexander Schulz",
@ -122,13 +126,13 @@ query (void)
G_N_ELEMENTS (load_return_vals),
load_args, load_return_vals);
gimp_register_file_handler_mime ("file_bmp_load", "image/bmp");
gimp_register_magic_load_handler ("file_bmp_load",
gimp_register_file_handler_mime (LOAD_PROC, "image/bmp");
gimp_register_magic_load_handler (LOAD_PROC,
"bmp",
"",
"0,string,BM");
gimp_install_procedure ("file_bmp_save",
gimp_install_procedure (SAVE_PROC,
"Saves files in Windows BMP file format",
"Saves files in Windows BMP file format",
"Alexander Schulz",
@ -140,8 +144,8 @@ query (void)
G_N_ELEMENTS (save_args), 0,
save_args, NULL);
gimp_register_file_handler_mime ("file_bmp_save", "image/bmp");
gimp_register_save_handler ("file_bmp_save", "bmp", "");
gimp_register_file_handler_mime (SAVE_PROC, "image/bmp");
gimp_register_save_handler (SAVE_PROC, "bmp", "");
}
static void
@ -167,7 +171,7 @@ run (const gchar *name,
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
if (strcmp (name, "file_bmp_load") == 0)
if (strcmp (name, LOAD_PROC) == 0)
{
switch (run_mode)
{
@ -202,7 +206,7 @@ run (const gchar *name,
}
}
}
else if (strcmp (name, "file_bmp_save") == 0)
else if (strcmp (name, SAVE_PROC) == 0)
{
image_ID = param[1].data.d_int32;
drawable_ID = param[2].data.d_int32;

View File

@ -48,7 +48,8 @@
#include "libgimp/stdplugins-intl.h"
#define VERSION "0.6"
#define LOAD_PROC "file-faxg3-load"
#define VERSION "0.6"
/* Declare local functions.
*/
@ -83,16 +84,16 @@ 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_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[] =
{
{ GIMP_PDB_IMAGE, "image", "Output image" },
};
gimp_install_procedure ("file_faxg3_load",
gimp_install_procedure (LOAD_PROC,
"loads g3 fax files",
"This plug-in loads Fax G3 Image files.",
"Jochen Friedrich",
@ -105,8 +106,8 @@ void query (void)
G_N_ELEMENTS (load_return_vals),
load_args, load_return_vals);
gimp_register_file_handler_mime ("file_faxg3_load", "image/g3-fax");
gimp_register_magic_load_handler ("file_faxg3_load",
gimp_register_file_handler_mime (LOAD_PROC, "image/g3-fax");
gimp_register_magic_load_handler (LOAD_PROC,
"g3",
"",
"0,short,0x0001,0,short,0x0014");
@ -130,7 +131,7 @@ run (const gchar *name,
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = GIMP_PDB_CALLING_ERROR;
if (strcmp (name, "file_faxg3_load") == 0)
if (strcmp (name, LOAD_PROC) == 0)
{
INIT_I18N();

View File

@ -47,6 +47,11 @@
#include "libgimp/stdplugins-intl.h"
#define LOAD_PROC "file-fits-load"
#define SAVE_PROC "file-fits-save"
#define PLUG_IN_BINARY "fits"
/* Load info */
typedef struct
{
@ -71,7 +76,9 @@ static gint save_image (const gchar *filename,
gint32 drawable_ID);
static FITS_HDU_LIST *create_fits_header (FITS_FILE *ofp,
guint width, guint height, guint bpp);
guint width,
guint height,
guint bpp);
static gint save_index (FITS_FILE *ofp,
gint32 image_ID,
gint32 drawable_ID);
@ -128,9 +135,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[] =
{
@ -139,16 +146,17 @@ 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_fits_load",
gimp_install_procedure (LOAD_PROC,
"load file of the FITS file format",
"load file of the FITS file format (Flexible Image Transport System)",
"load file of the FITS file format "
"(Flexible Image Transport System)",
"Peter Kirchgessner",
"Peter Kirchgessner (peter@kirchgessner.net)",
"1997",
@ -159,15 +167,16 @@ query (void)
G_N_ELEMENTS (load_return_vals),
load_args, load_return_vals);
gimp_register_file_handler_mime ("file_fits_load", "image/x-fits");
gimp_register_magic_load_handler ("file_fits_load",
gimp_register_file_handler_mime (LOAD_PROC, "image/x-fits");
gimp_register_magic_load_handler (LOAD_PROC,
"fit,fits",
"",
"0,string,SIMPLE");
gimp_install_procedure ("file_fits_save",
gimp_install_procedure (SAVE_PROC,
"save file in the FITS file format",
"FITS saving handles all image types except those with alpha channels.",
"FITS saving handles all image types except "
"those with alpha channels.",
"Peter Kirchgessner",
"Peter Kirchgessner (peter@kirchgessner.net)",
"1997",
@ -177,8 +186,8 @@ query (void)
G_N_ELEMENTS (save_args), 0,
save_args, NULL);
gimp_register_file_handler_mime ("file_fits_save", "image/x-fits");
gimp_register_save_handler ("file_fits_save", "fit,fits", "");
gimp_register_file_handler_mime (SAVE_PROC, "image/x-fits");
gimp_register_save_handler (SAVE_PROC, "fit,fits", "");
}
@ -205,13 +214,13 @@ run (const gchar *name,
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
if (strcmp (name, "file_fits_load") == 0)
if (strcmp (name, LOAD_PROC) == 0)
{
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
/* Possibly retrieve data */
gimp_get_data ("file_fits_load", &plvals);
gimp_get_data (LOAD_PROC, &plvals);
if (!load_dialog ())
status = GIMP_PDB_CANCEL;
@ -224,7 +233,7 @@ run (const gchar *name,
case GIMP_RUN_WITH_LAST_VALS:
/* Possibly retrieve data */
gimp_get_data ("file_fits_load", &plvals);
gimp_get_data (LOAD_PROC, &plvals);
break;
default:
@ -252,10 +261,10 @@ run (const gchar *name,
/* Store plvals data */
if (status == GIMP_PDB_SUCCESS)
gimp_set_data ("file_fits_load", &plvals, sizeof (FITSLoadVals));
gimp_set_data (LOAD_PROC, &plvals, sizeof (FITSLoadVals));
}
}
else if (strcmp (name, "file_fits_save") == 0)
else if (strcmp (name, SAVE_PROC) == 0)
{
image_ID = param[1].data.d_int32;
drawable_ID = param[2].data.d_int32;
@ -265,7 +274,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init ("fits", FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
export = gimp_export_image (&image_ID, &drawable_ID, "FITS",
(GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
@ -958,11 +967,11 @@ load_dialog (void)
GtkWidget *frame;
gboolean run;
gimp_ui_init ("fits", FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
dialog = gimp_dialog_new (_("Load FITS File"), "fits",
dialog = gimp_dialog_new (_("Load FITS File"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "file-fits-load",
gimp_standard_help_func, LOAD_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -970,9 +979,9 @@ load_dialog (void)
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
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

@ -35,9 +35,9 @@
#include "libgimp/stdplugins-intl.h"
#define VARIATION_SAME (-2)
#define PLUG_IN_PROC "plug-in-flame"
#define HELP_ID "plug-in-flame"
#define VARIATION_SAME (-2)
#define BUFFER_SIZE 10000
@ -119,12 +119,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 (unused)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" }
};
gimp_install_procedure ("plug_in_flame",
gimp_install_procedure (PLUG_IN_PROC,
"Creates cosmic recursive fractal flames",
"Creates cosmic recursive fractal flames",
"Scott Draves",
@ -136,8 +136,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_flame",
"<Image>/Filters/Render/Nature");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Render/Nature");
}
static void
@ -195,7 +194,7 @@ run (const gchar *name,
}
else
{
gimp_get_data ("plug_in_flame", &config);
gimp_get_data (PLUG_IN_PROC, &config);
maybe_init_cp ();
drawable = gimp_drawable_get (param[2].data.d_drawable);
@ -233,7 +232,7 @@ run (const gchar *name,
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_displays_flush ();
gimp_set_data ("plug_in_flame", &config, sizeof (config));
gimp_set_data (PLUG_IN_PROC, &config, sizeof (config));
}
else
{
@ -641,7 +640,7 @@ edit_callback (GtkWidget *widget,
edit_dlg = gimp_dialog_new (_("Edit Flame"), "flame",
parent, GTK_DIALOG_DESTROY_WITH_PARENT,
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,
@ -940,7 +939,7 @@ dialog (void)
dlg = gimp_dialog_new (_("Flame"), "flame",
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

@ -222,7 +222,7 @@ gfig_dialog (void)
GtkWidget *empty_label;
gchar *path;
gimp_ui_init ("gfig", TRUE);
gimp_ui_init (PLUG_IN_BINARY, TRUE);
img_width = gimp_drawable_width (gfig_context->drawable_id);
img_height = gimp_drawable_height (gfig_context->drawable_id);
@ -291,9 +291,9 @@ gfig_dialog (void)
}
/* Start building the dialog up */
top_level_dlg = gimp_dialog_new (_("Gfig"), "gfig",
top_level_dlg = gimp_dialog_new (_("Gfig"), 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_CLOSE, GTK_RESPONSE_OK,

View File

@ -56,8 +56,6 @@
#include "libgimp/stdplugins-intl.h"
/***** Magic numbers *****/
#define GFIG_HEADER "GFIG Version 0.2\n"
static void query (void);
@ -115,7 +113,7 @@ query (void)
{ GIMP_PDB_INT32, "dummy", "dummy" }
};
gimp_install_procedure ("plug_in_gfig",
gimp_install_procedure (PLUG_IN_PROC,
"Create Geometrical shapes with the Gimp",
"Draw Vector Graphics and paint them onto your images. "
"Gfig allows you to draw many types of objects "
@ -133,7 +131,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_gfig", "<Image>/Filters/Render");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Render");
}
static void
@ -216,7 +214,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
/*gimp_get_data ("plug_in_gfig", &selvals);*/
/*gimp_get_data (PLUG_IN_PROC, &selvals);*/
if (! gfig_dialog ())
{
gimp_drawable_detach (gfig_drawable);
@ -243,7 +241,7 @@ run (const gchar *name,
else
#if 0
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_set_data ("plug_in_gfig", &selvals, sizeof (SelectItVals));
gimp_set_data (PLUG_IN_PROC, &selvals, sizeof (SelectItVals));
else
#endif /* 0 */
{

View File

@ -67,7 +67,8 @@ void object_end (GdkPoint *pnt, gint shift_down);
#define MAX_LOAD_LINE 256
#define SQ_SIZE 8
#define HELP_ID "plug-in-gfig"
#define PLUG_IN_PROC "plug-in-gfig"
#define PLUG_IN_BINARY "gfig"
extern gint line_no;
extern gint preview_width, preview_height;

View File

@ -63,7 +63,8 @@
#define RESPONSE_RESCAN 1
#define HELP_ID "plug-in-gflare"
#define PLUG_IN_PROC "plug-in-gflare"
#define PLUG_IN_BINARY "gflare"
#define GRADIENT_NAME_MAX 256
#define GRADIENT_RESOLUTION 360
@ -784,10 +785,10 @@ plugin_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_STRING, "gflare_name", "The name of GFlare" },
{ GIMP_PDB_STRING, "gflare-name", "The name of GFlare" },
{ GIMP_PDB_INT32, "xcenter", "X coordinate of center of GFlare" },
{ GIMP_PDB_INT32, "ycenter", "Y coordinate of center of GFlare" },
{ GIMP_PDB_FLOAT, "radius", "Radius of GFlare (pixel)" },
@ -795,9 +796,9 @@ plugin_query (void)
{ GIMP_PDB_FLOAT, "hue", "Hue rotation of GFlare (degree)" },
{ GIMP_PDB_FLOAT, "vangle", "Vector angle for second flares (degree)" },
{ GIMP_PDB_FLOAT, "vlength", "Vector length for second flares (percentage to Radius)" },
{ GIMP_PDB_INT32, "use_asupsample", "Whether it uses or not adaptive supersampling while rendering (boolean)" },
{ GIMP_PDB_INT32, "asupsample_max_depth", "Max depth for adaptive supersampling"},
{ GIMP_PDB_FLOAT, "asupsample_threshold", "Threshold for adaptive supersampling"}
{ GIMP_PDB_INT32, "use-asupsample", "Whether it uses or not adaptive supersampling while rendering (boolean)" },
{ GIMP_PDB_INT32, "asupsample-max-depth", "Max depth for adaptive supersampling"},
{ GIMP_PDB_FLOAT, "asupsample-threshold", "Threshold for adaptive supersampling"}
};
const gchar *help_string =
@ -808,7 +809,7 @@ plugin_query (void)
"In non-interactive call, the user can only render one of GFlare "
"which has been stored in gflare-path already.";
gimp_install_procedure ("plug_in_gflare",
gimp_install_procedure (PLUG_IN_PROC,
"Produce lense flare effect using custom gradients",
help_string,
"Eiichi Takamori",
@ -820,7 +821,7 @@ plugin_query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_gflare",
gimp_plugin_menu_register (PLUG_IN_PROC,
"<Image>/Filters/Light and Shadow/Light");
}
@ -904,7 +905,7 @@ plugin_run (const gchar *name,
case GIMP_RUN_INTERACTIVE:
/* Possibly retrieve data */
gimp_get_data ("plug_in_gflare", &pvals);
gimp_get_data (PLUG_IN_PROC, &pvals);
/* First acquire information with a dialog */
if (! dlg_run ())
@ -940,7 +941,7 @@ plugin_run (const gchar *name,
case GIMP_RUN_WITH_LAST_VALS:
/* Possibly retrieve data */
gimp_get_data ("plug_in_gflare", &pvals);
gimp_get_data (PLUG_IN_PROC, &pvals);
break;
default:
@ -961,7 +962,7 @@ plugin_run (const gchar *name,
/* Store data */
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_set_data ("plug_in_gflare", &pvals, sizeof (PluginValues));
gimp_set_data (PLUG_IN_PROC, &pvals, sizeof (PluginValues));
}
else
{
@ -2266,7 +2267,7 @@ dlg_run (void)
GtkWidget *notebook;
gboolean run = FALSE;
gimp_ui_init ("gflare", TRUE);
gimp_ui_init (PLUG_IN_BINARY, TRUE);
/*
* Init Main Dialog
@ -2287,9 +2288,9 @@ dlg_run (void)
* Dialog Shell
*/
shell = dlg->shell = gimp_dialog_new (_("GFlare"), "gflare",
shell = dlg->shell = gimp_dialog_new (_("GFlare"), 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,
@ -2987,7 +2988,7 @@ dlg_selector_new_callback (GtkWidget *widget,
query_box = gimp_query_string_box (_("New GFlare"),
gtk_widget_get_toplevel (widget),
gimp_standard_help_func, HELP_ID,
gimp_standard_help_func, PLUG_IN_PROC,
_("Enter a name for the new GFlare"),
_("Unnamed"),
NULL, NULL,
@ -3066,7 +3067,7 @@ dlg_selector_copy_callback (GtkWidget *widget,
query_box = gimp_query_string_box (_("Copy GFlare"),
gtk_widget_get_toplevel (widget),
gimp_standard_help_func, HELP_ID,
gimp_standard_help_func, PLUG_IN_PROC,
_("Enter a name for the copied GFlare"),
name,
NULL, NULL,
@ -3132,7 +3133,7 @@ dlg_selector_delete_callback (GtkWidget *widget,
dialog = gimp_query_boolean_box (_("Delete GFlare"),
dlg->shell,
gimp_standard_help_func, HELP_ID,
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_DIALOG_QUESTION,
str,
GTK_STOCK_DELETE, GTK_STOCK_CANCEL,
@ -3243,9 +3244,9 @@ ed_run (GtkWindow *parent,
* Dialog Shell
*/
ed->shell =
shell = gimp_dialog_new (_("GFlare Editor"), "gflare",
shell = gimp_dialog_new (_("GFlare Editor"), PLUG_IN_BINARY,
GTK_WIDGET (parent), 0,
gimp_standard_help_func, HELP_ID,
gimp_standard_help_func, PLUG_IN_PROC,
_("Rescan Gradients"), RESPONSE_RESCAN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,

View File

@ -65,6 +65,12 @@
#include "libgimp/stdplugins-intl.h"
#define LOAD_PROC "file-fli-load"
#define SAVE_PROC "file-fli-save"
#define INFO_PROC "file-fli-info"
#define PLUG_IN_BINARY "gfli"
static void query (void);
static void run (const gchar *name,
gint nparams,
@ -147,7 +153,7 @@ query (void)
/*
* Load/save procedures
*/
gimp_install_procedure ("file_fli_load",
gimp_install_procedure (LOAD_PROC,
"load FLI-movies",
"This is an experimantal plug-in to handle FLI movies",
"Jens Ch. Restemeier",
@ -161,13 +167,13 @@ query (void)
load_args,
load_return_vals);
gimp_register_file_handler_mime ("file_fli_load", "image/x-flic");
gimp_register_magic_load_handler ("file_fli_load",
gimp_register_file_handler_mime (LOAD_PROC, "image/x-flic");
gimp_register_magic_load_handler (LOAD_PROC,
"fli,flc",
"",
"");
gimp_install_procedure ("file_fli_save",
gimp_install_procedure (SAVE_PROC,
"save FLI-movies",
"This is an experimantal plug-in to handle FLI movies",
"Jens Ch. Restemeier",
@ -179,15 +185,15 @@ query (void)
G_N_ELEMENTS (save_args), 0,
save_args, NULL);
gimp_register_file_handler_mime ("file_fli_save", "image/x-flic");
gimp_register_save_handler ("file_fli_save",
gimp_register_file_handler_mime (SAVE_PROC, "image/x-flic");
gimp_register_save_handler (SAVE_PROC,
"fli,flc",
"");
/*
* Utility functions:
*/
gimp_install_procedure ("file_fli_info",
gimp_install_procedure (INFO_PROC,
"Get info about a Fli movie",
"This is a experimantal plug-in to handle FLI movies",
"Jens Ch. Restemeier",
@ -229,7 +235,7 @@ run (const gchar *name,
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
if (strcmp (name, "file_fli_load") == 0)
if (strcmp (name, LOAD_PROC) == 0)
{
switch (run_mode)
{
@ -303,7 +309,7 @@ run (const gchar *name,
break;
}
}
else if (strcmp (name, "file_fli_save") == 0)
else if (strcmp (name, SAVE_PROC) == 0)
{
image_ID = orig_image_ID = param[1].data.d_int32;
drawable_ID = param[2].data.d_int32;
@ -332,7 +338,7 @@ run (const gchar *name,
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init ("gfli", FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
export = gimp_export_image (&image_ID, &drawable_ID, "FLI",
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_GRAY |
@ -357,7 +363,7 @@ run (const gchar *name,
if (export == GIMP_EXPORT_EXPORT)
gimp_image_delete (image_ID);
}
else if (strcmp (name, "file_fli_info") == 0)
else if (strcmp (name, INFO_PROC) == 0)
{
gint32 width, height, frames;
@ -801,11 +807,11 @@ load_dialog (const gchar *name)
from_frame = 1;
to_frame = nframes;
gimp_ui_init ("gfli", FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
dialog = gimp_dialog_new (_("GFLI 1.3 - Load framestack"), "gfli",
dialog = gimp_dialog_new (_("GFLI 1.3 - Load framestack"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "file-gfli-load",
gimp_standard_help_func, LOAD_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -871,9 +877,9 @@ save_dialog (gint32 image_id)
from_frame = 1;
to_frame = nframes;
dialog = gimp_dialog_new (_("GFLI 1.3 - Save framestack"), "gfli",
dialog = gimp_dialog_new (_("GFLI 1.3 - Save framestack"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "file-gfli-save",
gimp_standard_help_func, SAVE_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,

View File

@ -38,8 +38,8 @@
/* defines */
#define GIMP_HELP_EXT_NAME "extension_gimp_help"
#define GIMP_HELP_TEMP_EXT_NAME "extension_gimp_help_temp"
#define GIMP_HELP_EXT_PROC "extension-gimp-help"
#define GIMP_HELP_TEMP_EXT_PROC "extension-gimp-help-temp"
typedef struct
@ -102,13 +102,13 @@ query (void)
{
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "num_domain_names", "" },
{ GIMP_PDB_STRINGARRAY, "domain_names", "" },
{ GIMP_PDB_INT32, "num_domain_uris", "" },
{ GIMP_PDB_STRINGARRAY, "domain_uris", "" }
{ GIMP_PDB_INT32, "num-domain-names", "" },
{ GIMP_PDB_STRINGARRAY, "domain-names", "" },
{ GIMP_PDB_INT32, "num-domain-uris", "" },
{ GIMP_PDB_STRINGARRAY, "domain-uris", "" }
};
gimp_install_procedure (GIMP_HELP_EXT_NAME,
gimp_install_procedure (GIMP_HELP_EXT_PROC,
"", /* FIXME */
"", /* FIXME */
"Sven Neumann <sven@gimp.org>, "
@ -204,7 +204,7 @@ run (const gchar *name,
g_main_loop_unref (main_loop);
main_loop = NULL;
gimp_uninstall_temp_proc (GIMP_HELP_TEMP_EXT_NAME);
gimp_uninstall_temp_proc (GIMP_HELP_TEMP_EXT_PROC);
}
values[0].type = GIMP_PDB_STATUS;
@ -220,12 +220,12 @@ temp_proc_install (void)
static GimpParamDef args[] =
{
{ GIMP_PDB_STRING, "procedure", "The procedure of the browser to use" },
{ GIMP_PDB_STRING, "help_domain", "Help domain to use" },
{ GIMP_PDB_STRING, "help_locales", "Language to use" },
{ GIMP_PDB_STRING, "help_id", "Help ID to open" }
{ GIMP_PDB_STRING, "help-domain", "Help domain to use" },
{ GIMP_PDB_STRING, "help-locales", "Language to use" },
{ GIMP_PDB_STRING, "help-id", "Help ID to open" }
};
gimp_install_temp_proc (GIMP_HELP_TEMP_EXT_NAME,
gimp_install_temp_proc (GIMP_HELP_TEMP_EXT_PROC,
"DON'T USE THIS ONE",
"(Temporary procedure)",
"Sven Neumann <sven@gimp.org>, "

View File

@ -38,8 +38,8 @@
/* defines */
#define GIMP_HELP_BROWSER_EXT_NAME "extension_gimp_help_browser"
#define GIMP_HELP_BROWSER_TEMP_EXT_NAME "extension_gimp_help_browser_temp"
#define GIMP_HELP_BROWSER_EXT_PROC "extension-gimp-help-browser"
#define GIMP_HELP_BROWSER_TEMP_EXT_PROC "extension-gimp-help-browser-temp"
/* forward declarations */
@ -77,10 +77,10 @@ query (void)
{
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive" },
{ GIMP_PDB_INT32, "run-mode", "Interactive" },
};
gimp_install_procedure (GIMP_HELP_BROWSER_EXT_NAME,
gimp_install_procedure (GIMP_HELP_BROWSER_EXT_PROC,
"Browse the GIMP help pages",
"A small and simple HTML browser optimized for "
"browsing the GIMP help pages.",
@ -158,7 +158,7 @@ temp_proc_install (void)
{ GIMP_PDB_STRING, "uri", "Full uri of the file to open" }
};
gimp_install_temp_proc (GIMP_HELP_BROWSER_TEMP_EXT_NAME,
gimp_install_temp_proc (GIMP_HELP_BROWSER_TEMP_EXT_PROC,
"DON'T USE THIS ONE",
"(Temporary procedure)",
"Sven Neumann <sven@gimp.org>, "

View File

@ -56,8 +56,7 @@
#define UNDO_LEVELS 24
#define IFSCOMPOSE_PARASITE "ifscompose-parasite"
#define IFSCOMPOSE_DATA "plug_in_ifscompose"
#define HELP_ID "plug-in-ifs-compose"
#define IFSCOMPOSE_PROC "plug-in-ifscompose"
typedef enum
{
@ -324,7 +323,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", "Input image" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
};
@ -332,7 +331,7 @@ query (void)
static GimpParamDef *return_vals = NULL;
static int nreturn_vals = 0;
gimp_install_procedure ("plug_in_ifs_compose",
gimp_install_procedure (IFSCOMPOSE_PROC,
"Create an Iterated Function System (IFS) Fractal",
"Interactively create an Iterated Function System "
"fractal. Use the window on the upper left to adjust "
@ -351,7 +350,7 @@ query (void)
G_N_ELEMENTS (args), nreturn_vals,
args, return_vals);
gimp_plugin_menu_register ("plug_in_ifs_compose",
gimp_plugin_menu_register (IFSCOMPOSE_PROC,
"<Image>/Filters/Render/Nature");
}
@ -400,13 +399,13 @@ run (const gchar *name,
if (!found_parasite)
{
gint length = gimp_get_data_size (IFSCOMPOSE_DATA);
gint length = gimp_get_data_size (IFSCOMPOSE_PROC);
if (length > 0)
{
gchar *data = g_new (gchar, length);
gimp_get_data (IFSCOMPOSE_DATA, data);
gimp_get_data (IFSCOMPOSE_PROC, data);
ifsvals_parse_string (data, &ifsvals, &elements);
g_free (data);
}
@ -426,13 +425,13 @@ run (const gchar *name,
case GIMP_RUN_WITH_LAST_VALS:
{
gint length = gimp_get_data_size (IFSCOMPOSE_DATA);
gint length = gimp_get_data_size (IFSCOMPOSE_PROC);
if (length > 0)
{
gchar *data = g_new (gchar, length);
gimp_get_data (IFSCOMPOSE_DATA, data);
gimp_get_data (IFSCOMPOSE_PROC, data);
ifsvals_parse_string (data, &ifsvals, &elements);
g_free (data);
}
@ -471,7 +470,7 @@ run (const gchar *name,
*/
str = ifsvals_stringify (&ifsvals, elements);
gimp_set_data (IFSCOMPOSE_DATA, str, strlen (str) + 1);
gimp_set_data (IFSCOMPOSE_PROC, str, strlen (str) + 1);
parasite = gimp_parasite_new (IFSCOMPOSE_PARASITE,
GIMP_PARASITE_PERSISTENT |
@ -771,7 +770,7 @@ ifs_compose_dialog (GimpDrawable *drawable)
dialog = gimp_dialog_new (_("IFS Fractal"), "ifscompose",
NULL, 0,
gimp_standard_help_func, HELP_ID,
gimp_standard_help_func, IFSCOMPOSE_PROC,
GTK_STOCK_OPEN, RESPONSE_OPEN,
GTK_STOCK_SAVE, RESPONSE_SAVE,
@ -782,12 +781,12 @@ ifs_compose_dialog (GimpDrawable *drawable)
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
RESPONSE_OPEN,
RESPONSE_SAVE,
RESPONSE_RESET,
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
RESPONSE_OPEN,
RESPONSE_SAVE,
RESPONSE_RESET,
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
g_object_add_weak_pointer (G_OBJECT (dialog), (gpointer) &dialog);

View File

@ -712,9 +712,9 @@ save_dialog (void)
gchar *text;
gboolean run;
dialog = gimp_dialog_new (_("Save as JPEG"), "jpeg",
dialog = gimp_dialog_new (_("Save as JPEG"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "file-jpeg-save",
gimp_standard_help_func, SAVE_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,

View File

@ -39,6 +39,7 @@
#include "jpeg-save.h"
#include "gimpexif.h"
/* Declare local functions.
*/
@ -67,9 +68,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[] =
{
@ -81,24 +82,24 @@ query (void)
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" }
};
#endif /* HAVE_EXIF */
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_FLOAT, "quality", "Quality of saved image (0 <= quality <= 1)" },
{ GIMP_PDB_FLOAT, "smoothing", "Smoothing factor for saved image (0 <= smoothing <= 1)" },
{ GIMP_PDB_INT32, "optimize", "Optimization of entropy encoding parameters (0/1)" },
@ -110,7 +111,7 @@ query (void)
{ GIMP_PDB_INT32, "dct", "DCT algorithm to use (speed/quality tradeoff)" }
};
gimp_install_procedure ("file_jpeg_load",
gimp_install_procedure (LOAD_PROC,
"loads files in the JPEG file format",
"loads files in the JPEG file format",
"Spencer Kimball, Peter Mattis & others",
@ -123,15 +124,15 @@ query (void)
G_N_ELEMENTS (load_return_vals),
load_args, load_return_vals);
gimp_register_file_handler_mime ("file_jpeg_load", "image/jpeg");
gimp_register_magic_load_handler ("file_jpeg_load",
gimp_register_file_handler_mime (LOAD_PROC, "image/jpeg");
gimp_register_magic_load_handler (LOAD_PROC,
"jpg,jpeg,jpe",
"",
"6,string,JFIF,6,string,Exif");
#ifdef HAVE_EXIF
gimp_install_procedure ("file_jpeg_load_thumb",
gimp_install_procedure (LOAD_THUMB_PROC,
"Loads a thumbnail from a JPEG image",
"Loads a thumbnail from a JPEG image (only if it exists)",
"S. Mukund <muks@mukund.org>, Sven Neumann <sven@gimp.org>",
@ -144,11 +145,11 @@ query (void)
G_N_ELEMENTS (thumb_return_vals),
thumb_args, thumb_return_vals);
gimp_register_thumbnail_loader ("file_jpeg_load", "file_jpeg_load_thumb");
gimp_register_thumbnail_loader (LOAD_PROC, LOAD_THUMB_PROC);
#endif /* HAVE_EXIF */
gimp_install_procedure ("file_jpeg_save",
gimp_install_procedure (SAVE_PROC,
"saves files in the JPEG file format",
"saves files in the lossy, widely supported JPEG format",
"Spencer Kimball, Peter Mattis & others",
@ -160,8 +161,8 @@ query (void)
G_N_ELEMENTS (save_args), 0,
save_args, NULL);
gimp_register_file_handler_mime ("file_jpeg_save", "image/jpeg");
gimp_register_save_handler ("file_jpeg_save", "jpg,jpeg,jpe", "");
gimp_register_file_handler_mime (SAVE_PROC, "image/jpeg");
gimp_register_save_handler (SAVE_PROC, "jpg,jpeg,jpe", "");
}
static void
@ -190,13 +191,13 @@ run (const gchar *name,
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
if (strcmp (name, "file_jpeg_load") == 0)
if (strcmp (name, LOAD_PROC) == 0)
{
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init ("jpeg", FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
load_interactive = TRUE;
break;
default:
@ -221,7 +222,7 @@ run (const gchar *name,
#ifdef HAVE_EXIF
else if (strcmp (name, "file_jpeg_load_thumb") == 0)
else if (strcmp (name, LOAD_THUMB_PROC) == 0)
{
if (nparams < 2)
{
@ -255,7 +256,7 @@ run (const gchar *name,
#endif /* HAVE_EXIF */
else if (strcmp (name, "file_jpeg_save") == 0)
else if (strcmp (name, SAVE_PROC) == 0)
{
image_ID = orig_image_ID = param[1].data.d_int32;
drawable_ID = param[2].data.d_int32;
@ -265,7 +266,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init ("jpeg", FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
export = gimp_export_image (&image_ID, &drawable_ID, "JPEG",
(GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY));
@ -339,7 +340,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
/* Possibly retrieve data */
gimp_get_data ("file_jpeg_save", &jsvals);
gimp_get_data (SAVE_PROC, &jsvals);
/* load up the previously used values */
parasite = gimp_image_parasite_find (orig_image_ID,
@ -435,7 +436,7 @@ run (const gchar *name,
case GIMP_RUN_WITH_LAST_VALS:
/* Possibly retrieve data */
gimp_get_data ("file_jpeg_save", &jsvals);
gimp_get_data (SAVE_PROC, &jsvals);
parasite = gimp_image_parasite_find (orig_image_ID,
"jpeg-save-options");
@ -470,7 +471,7 @@ run (const gchar *name,
FALSE))
{
/* Store mvals data */
gimp_set_data ("file_jpeg_save", &jsvals, sizeof (JpegSaveVals));
gimp_set_data (SAVE_PROC, &jsvals, sizeof (JpegSaveVals));
}
else
{

View File

@ -16,6 +16,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#define LOAD_PROC "file-jpeg-load"
#define LOAD_THUMB_PROC "file-jpeg-load-thumb"
#define SAVE_PROC "file-jpeg-save"
#define PLUG_IN_BINARY "jpeg"
/* headers used in some APPn markers */
#define JPEG_APP_HEADER_EXIF "Exif"
#define JPEG_APP_HEADER_XMP "http://ns.adobe.com/xap/1.0/"

View File

@ -135,21 +135,21 @@ query (void)
{
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image_ID", "(unused)" },
{ GIMP_PDB_DRAWABLE, "drawable_ID", "ID of drawable" },
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "(unused)" },
{ GIMP_PDB_DRAWABLE, "drawable", "ID of drawable" },
/* If we did have parameters, these be them: */
{ GIMP_PDB_INT16, "width", "Width of the passages" },
{ GIMP_PDB_INT16, "height", "Height of the passages"},
{ GIMP_PDB_INT8, "tileable", "Tileable maze?"},
{ GIMP_PDB_INT8, "algorithm", "Generation algorithm"
"(0=DEPTH FIRST, 1=PRIM'S ALGORITHM)" },
{ GIMP_PDB_INT32, "seed", "Random Seed"},
{ GIMP_PDB_INT16, "multiple", "Multiple (use 57)" },
{ GIMP_PDB_INT16, "offset", "Offset (use 1)" }
{ GIMP_PDB_INT16, "width", "Width of the passages" },
{ GIMP_PDB_INT16, "height", "Height of the passages"},
{ GIMP_PDB_INT8, "tileable", "Tileable maze?"},
{ GIMP_PDB_INT8, "algorithm", "Generation algorithm"
"(0=DEPTH FIRST, 1=PRIM'S ALGORITHM)" },
{ GIMP_PDB_INT32, "seed", "Random Seed"},
{ GIMP_PDB_INT16, "multiple", "Multiple (use 57)" },
{ GIMP_PDB_INT16, "offset", "Offset (use 1)" }
};
gimp_install_procedure ("plug_in_maze",
gimp_install_procedure (PLUG_IN_PROC,
"Draws a maze.",
"Generates a maze using either the depth-first "
"search method or Prim's algorithm. Can make "
@ -163,7 +163,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_maze",
gimp_plugin_menu_register (PLUG_IN_PROC,
"<Image>/Filters/Render/Pattern");
}
@ -201,7 +201,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
/* Possibly retrieve data */
gimp_get_data ("plug_in_maze", &mvals);
gimp_get_data (PLUG_IN_PROC, &mvals);
/* The interface needs to know the dimensions of the image... */
gimp_drawable_mask_bounds (drawable->drawable_id, &x1, &y1, &x2, &y2);
@ -237,7 +237,7 @@ run (const gchar *name,
case GIMP_RUN_WITH_LAST_VALS:
/* Possibly retrieve data */
gimp_get_data ("plug_in_maze", &mvals);
gimp_get_data (PLUG_IN_PROC, &mvals);
if (mvals.random_seed)
mvals.seed = g_random_int ();
@ -259,7 +259,7 @@ run (const gchar *name,
if (run_mode == GIMP_RUN_INTERACTIVE ||
(run_mode == GIMP_RUN_WITH_LAST_VALS))
gimp_set_data ("plug_in_maze", &mvals, sizeof (MazeValues));
gimp_set_data (PLUG_IN_PROC, &mvals, sizeof (MazeValues));
}
else
{

View File

@ -18,6 +18,9 @@
#include "glib.h"
#define PLUG_IN_PROC "plug-in-maze"
#define PLUG_IN_BINARY "maze"
typedef enum {
DEPTH_FIRST,
PRIMS_ALGORITHM

View File

@ -175,21 +175,21 @@ maze_dialog (void)
gboolean run;
gint trow = 0;
gimp_ui_init ("maze", FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
dialog = gimp_dialog_new (_(MAZE_TITLE), "maze",
NULL, 0,
gimp_standard_help_func, "plug-in-maze",
dialog = gimp_dialog_new (_(MAZE_TITLE), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
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

@ -51,9 +51,9 @@
#include "pagecurl-icons.h"
#define PLUG_IN_NAME "plug_in_pagecurl"
#define PLUG_IN_PROC "plug-in-pagecurl"
#define PLUG_IN_BINARY "pagecurl"
#define PLUG_IN_VERSION "July 2004, 1.0"
#define HELP_ID "plug-in-pagecurl"
#define NGRADSAMPLES 256
@ -212,7 +212,7 @@ query (void)
{ GIMP_PDB_LAYER, "Curl Layer", "The new layer with the curl." }
};
gimp_install_procedure (PLUG_IN_NAME,
gimp_install_procedure (PLUG_IN_PROC,
"Pagecurl effect",
"This plug-in creates a pagecurl-effect.",
"Federico Mena Quintero and Simon Budig",
@ -226,7 +226,7 @@ query (void)
args,
return_vals);
gimp_plugin_menu_register (PLUG_IN_NAME, "<Image>/Filters/Distorts");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Distorts");
}
static void
@ -248,7 +248,7 @@ run (const gchar *name,
set_default_params ();
/* Possibly retrieve data */
gimp_get_data (PLUG_IN_NAME, &curl);
gimp_get_data (PLUG_IN_PROC, &curl);
*nreturn_vals = 2;
*return_vals = values;
@ -305,7 +305,7 @@ run (const gchar *name,
gimp_displays_flush ();
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_set_data (PLUG_IN_NAME, &curl, sizeof (CurlParams));
gimp_set_data (PLUG_IN_PROC, &curl, sizeof (CurlParams));
}
}
else
@ -435,11 +435,11 @@ dialog (void)
GtkObject *adjustment;
gboolean run;
gimp_ui_init ("pagecurl", FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
dialog = gimp_dialog_new (_("Pagecurl Effect"), "pagecurl",
dialog = gimp_dialog_new (_("Pagecurl Effect"), 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

@ -87,12 +87,12 @@ query (void)
{
GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (used for indexed images)" },
{ 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_install_procedure ("plug_in_rotate_colormap",
gimp_install_procedure (PLUG_IN_PROC,
"Colormap rotation as in xv",
"Exchanges two color ranges. "
"Based on code from Pavel Grinfeld (pavel@ml.com). "
@ -106,8 +106,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_rotate_colormap",
"<Image>/Filters/Colors/Map");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Colors/Map");
}
@ -159,7 +158,7 @@ rcm_row (const guchar *src_row,
if (! skip)
{
H = rcm_linear( rcm_left_end (Current.From->angle),
H = rcm_linear (rcm_left_end (Current.From->angle),
rcm_right_end (Current.From->angle),
rcm_left_end (Current.To->angle),
rcm_right_end (Current.To->angle),

View File

@ -39,7 +39,9 @@
/* Global defines */
#define TP (2*G_PI)
#define PLUG_IN_PROC "plug-in-rotate-colormap"
#define PLUG_IN_BINARY "rcm"
#define TP (2*G_PI)
/* Typedefs */

View File

@ -634,15 +634,15 @@ rcm_dialog (void)
Current.Bna = g_new (RcmBna, 1);
/* init GTK and install colormap */
gimp_ui_init ("rcm", TRUE);
gimp_ui_init (PLUG_IN_BINARY, TRUE);
/* init stock icons */
rcm_stock_init ();
/* Create dialog */
dlg = gimp_dialog_new (_("Colormap Rotation"), "rcm",
dlg = gimp_dialog_new (_("Colormap Rotation"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "plug-in-rotate-colormap",
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,

View File

@ -55,15 +55,15 @@
static void query (void);
static void run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static gint sel2path_dialog (SELVALS *sels);
static void sel2path_response (GtkWidget *widget,
gint response_id,
gpointer data);
gpointer data);
static void dialog_print_selVals (SELVALS *sels);
gboolean do_sel2path (gint32 image_ID);
@ -89,61 +89,61 @@ 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 (unused)" },
};
static GimpParamDef advanced_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 (unused)" },
{ GIMP_PDB_FLOAT, "align_threshold", "align_threshold"},
{ GIMP_PDB_FLOAT, "corner_always_threshold", "corner_always_threshold"},
{ GIMP_PDB_INT8, "corner_surround", "corner_surround"},
{ GIMP_PDB_FLOAT, "corner_threshold", "corner_threshold"},
{ GIMP_PDB_FLOAT, "error_threshold", "error_threshold"},
{ GIMP_PDB_INT8, "filter_alternative_surround", "filter_alternative_surround"},
{ GIMP_PDB_FLOAT, "filter_epsilon", "filter_epsilon"},
{ GIMP_PDB_INT8, "filter_iteration_count", "filter_iteration_count"},
{ GIMP_PDB_FLOAT, "filter_percent", "filter_percent"},
{ GIMP_PDB_INT8, "filter_secondary_surround", "filter_secondary_surround"},
{ GIMP_PDB_INT8, "filter_surround", "filter_surround"},
{ GIMP_PDB_INT8, "keep_knees", "{1-Yes, 0-No}"},
{ GIMP_PDB_FLOAT, "line_reversion_threshold", "line_reversion_threshold"},
{ GIMP_PDB_FLOAT, "line_threshold", "line_threshold"},
{ GIMP_PDB_FLOAT, "reparameterize_improvement", "reparameterize_improvement"},
{ GIMP_PDB_FLOAT, "reparameterize_threshold", "reparameterize_threshold"},
{ GIMP_PDB_FLOAT, "subdivide_search", "subdivide_search"},
{ GIMP_PDB_INT8, "subdivide_surround", "subdivide_surround"},
{ GIMP_PDB_FLOAT, "subdivide_threshold", "subdivide_threshold"},
{ GIMP_PDB_INT8, "tangent_surround", "tangent_surround"},
{ GIMP_PDB_FLOAT, "align-threshold", "align_threshold"},
{ GIMP_PDB_FLOAT, "corner-always-threshold", "corner_always_threshold"},
{ GIMP_PDB_INT8, "corner-surround", "corner_surround"},
{ GIMP_PDB_FLOAT, "corner-threshold", "corner_threshold"},
{ GIMP_PDB_FLOAT, "error-threshold", "error_threshold"},
{ GIMP_PDB_INT8, "filter-alternative-surround", "filter_alternative_surround"},
{ GIMP_PDB_FLOAT, "filter-epsilon", "filter_epsilon"},
{ GIMP_PDB_INT8, "filter-iteration-count", "filter_iteration_count"},
{ GIMP_PDB_FLOAT, "filter-percent", "filter_percent"},
{ GIMP_PDB_INT8, "filter-secondary-surround", "filter_secondary_surround"},
{ GIMP_PDB_INT8, "filter-surround", "filter_surround"},
{ GIMP_PDB_INT8, "keep-knees", "{1-Yes, 0-No}"},
{ GIMP_PDB_FLOAT, "line-reversion-threshold", "line_reversion_threshold"},
{ GIMP_PDB_FLOAT, "line-threshold", "line_threshold"},
{ GIMP_PDB_FLOAT, "reparameterize-improvement", "reparameterize_improvement"},
{ GIMP_PDB_FLOAT, "reparameterize-threshold", "reparameterize_threshold"},
{ GIMP_PDB_FLOAT, "subdivide-search", "subdivide_search"},
{ GIMP_PDB_INT8, "subdivide-surround", "subdivide_surround"},
{ GIMP_PDB_FLOAT, "subdivide-threshold", "subdivide_threshold"},
{ GIMP_PDB_INT8, "tangent-surround", "tangent_surround"},
};
gimp_install_procedure ("plug_in_sel2path",
"Converts a selection to a path",
"Converts a selection to a path",
"Andy Thomas",
"Andy Thomas",
"1999",
NULL,
"RGB*, INDEXED*, GRAY*",
GIMP_PLUGIN,
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_install_procedure ("plug-in-sel2path",
"Converts a selection to a path",
"Converts a selection to a path",
"Andy Thomas",
"Andy Thomas",
"1999",
NULL,
"RGB*, INDEXED*, GRAY*",
GIMP_PLUGIN,
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_install_procedure ("plug_in_sel2path_advanced",
"Converts a selection to a path (with advanced user menu)",
"Converts a selection to a path (with advanced user menu)",
"Andy Thomas",
"Andy Thomas",
"1999",
NULL,
"RGB*, INDEXED*, GRAY*",
GIMP_PLUGIN,
G_N_ELEMENTS (advanced_args), 0,
advanced_args, NULL);
gimp_install_procedure ("plug-in-sel2path-advanced",
"Converts a selection to a path (with advanced user menu)",
"Converts a selection to a path (with advanced user menu)",
"Andy Thomas",
"Andy Thomas",
"1999",
NULL,
"RGB*, INDEXED*, GRAY*",
GIMP_PLUGIN,
G_N_ELEMENTS (advanced_args), 0,
advanced_args, NULL);
}
static void
@ -163,7 +163,7 @@ run (const gchar *name,
INIT_I18N ();
no_dialog = (strcmp (name, "plug_in_sel2path") == 0);
no_dialog = (strcmp (name, "plug-in-sel2path") == 0);
*nreturn_vals = 1;
*return_vals = values;
@ -174,7 +174,7 @@ run (const gchar *name,
image_ID = param[1].data.d_image;
if (image_ID < 0)
{
g_warning ("plug_in_sel2path needs a valid image ID");
g_warning ("plug-in-sel2path needs a valid image ID");
return;
}
@ -189,63 +189,63 @@ run (const gchar *name,
if (!no_dialog)
{
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
if (gimp_get_data_size ("plug_in_sel2path_advanced") > 0)
{
gimp_get_data ("plug_in_sel2path_advanced", &selVals);
}
{
case GIMP_RUN_INTERACTIVE:
if (gimp_get_data_size ("plug-in-sel2path-advanced") > 0)
{
gimp_get_data ("plug-in-sel2path-advanced", &selVals);
}
if (!sel2path_dialog (&selVals))
if (!sel2path_dialog (&selVals))
return;
/* Get the current settings */
fit_set_params (&selVals);
break;
/* Get the current settings */
fit_set_params (&selVals);
break;
case GIMP_RUN_NONINTERACTIVE:
if (nparams != 23)
status = GIMP_PDB_CALLING_ERROR;
case GIMP_RUN_NONINTERACTIVE:
if (nparams != 23)
status = GIMP_PDB_CALLING_ERROR;
if (status == GIMP_PDB_SUCCESS)
{
selVals.align_threshold = param[3].data.d_float;
selVals.corner_always_threshold = param[4].data.d_float;
selVals.corner_surround = param[5].data.d_int8;
selVals.corner_threshold = param[6].data.d_float;
selVals.error_threshold = param[7].data.d_float;
selVals.filter_alternative_surround = param[8].data.d_int8;
selVals.filter_epsilon = param[9].data.d_float;
selVals.filter_iteration_count = param[10].data.d_int8;
selVals.filter_percent = param[11].data.d_float;
selVals.filter_secondary_surround = param[12].data.d_int8;
selVals.filter_surround = param[13].data.d_int8;
selVals.keep_knees = param[14].data.d_int8;
selVals.line_reversion_threshold = param[15].data.d_float;
selVals.line_threshold = param[16].data.d_float;
selVals.reparameterize_improvement = param[17].data.d_float;
selVals.reparameterize_threshold = param[18].data.d_float;
selVals.subdivide_search = param[19].data.d_float;
selVals.subdivide_surround = param[20].data.d_int8;
selVals.subdivide_threshold = param[21].data.d_float;
selVals.tangent_surround = param[22].data.d_int8;
fit_set_params (&selVals);
if (status == GIMP_PDB_SUCCESS)
{
selVals.align_threshold = param[3].data.d_float;
selVals.corner_always_threshold = param[4].data.d_float;
selVals.corner_surround = param[5].data.d_int8;
selVals.corner_threshold = param[6].data.d_float;
selVals.error_threshold = param[7].data.d_float;
selVals.filter_alternative_surround = param[8].data.d_int8;
selVals.filter_epsilon = param[9].data.d_float;
selVals.filter_iteration_count = param[10].data.d_int8;
selVals.filter_percent = param[11].data.d_float;
selVals.filter_secondary_surround = param[12].data.d_int8;
selVals.filter_surround = param[13].data.d_int8;
selVals.keep_knees = param[14].data.d_int8;
selVals.line_reversion_threshold = param[15].data.d_float;
selVals.line_threshold = param[16].data.d_float;
selVals.reparameterize_improvement = param[17].data.d_float;
selVals.reparameterize_threshold = param[18].data.d_float;
selVals.subdivide_search = param[19].data.d_float;
selVals.subdivide_surround = param[20].data.d_int8;
selVals.subdivide_threshold = param[21].data.d_float;
selVals.tangent_surround = param[22].data.d_int8;
fit_set_params (&selVals);
}
break;
break;
case GIMP_RUN_WITH_LAST_VALS:
if(gimp_get_data_size ("plug_in_sel2path_advanced") > 0)
{
gimp_get_data ("plug_in_sel2path_advanced", &selVals);
case GIMP_RUN_WITH_LAST_VALS:
if(gimp_get_data_size ("plug-in-sel2path-advanced") > 0)
{
gimp_get_data ("plug-in-sel2path-advanced", &selVals);
/* Set up the last values */
fit_set_params (&selVals);
}
break;
/* Set up the last values */
fit_set_params (&selVals);
}
break;
default:
break;
}
default:
break;
}
}
do_sel2path (image_ID);
@ -255,7 +255,7 @@ run (const gchar *name,
{
dialog_print_selVals(&selVals);
if (run_mode == GIMP_RUN_INTERACTIVE && !no_dialog)
gimp_set_data ("plug_in_sel2path_advanced", &selVals, sizeof(SELVALS));
gimp_set_data ("plug-in-sel2path-advanced", &selVals, sizeof(SELVALS));
}
}
@ -299,19 +299,19 @@ sel2path_dialog (SELVALS *sels)
dlg = gimp_dialog_new (_("Selection To Path Advanced Settings"), "sel2path",
NULL, 0,
gimp_standard_help_func, "plug-in-sel2path-advanced",
gimp_standard_help_func, "plug-in-sel2path-advanced",
GIMP_STOCK_RESET, RESPONSE_RESET,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
GIMP_STOCK_RESET, RESPONSE_RESET,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dlg),
RESPONSE_RESET,
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
RESPONSE_RESET,
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
g_signal_connect (dlg, "response",
G_CALLBACK (sel2path_response),
@ -355,7 +355,7 @@ sel2path_response (GtkWidget *widget,
guchar
sel_pixel_value (gint row,
gint col)
gint col)
{
guchar ret;
@ -372,7 +372,7 @@ sel_pixel_value (gint row,
gboolean
sel_pixel_is_white (gint row,
gint col)
gint col)
{
if (sel_pixel_value (row, col) < MID_POINT)
return TRUE;
@ -394,22 +394,22 @@ sel_get_height (void)
gint
sel_valid_pixel (gint row,
gint col)
gint col)
{
return (0 <= (row) && (row) < sel_get_height ()
&& 0 <= (col) && (col) < sel_get_width ());
&& 0 <= (col) && (col) < sel_get_width ());
}
void
gen_anchor (gdouble *p,
gdouble x,
gdouble y,
gboolean is_newcurve)
gdouble x,
gdouble y,
gboolean is_newcurve)
{
/* printf("TYPE: %s X: %d Y: %d\n", */
/* (is_newcurve)?"3":"1", */
/* sel_x1+(int)RINT(x), */
/* sel_y1 + sel_height - (int)RINT(y)+1); */
/* (is_newcurve)?"3":"1", */
/* sel_x1+(int)RINT(x), */
/* sel_y1 + sel_height - (int)RINT(y)+1); */
*p++ = (sel_x1 + (gint)RINT(x));
*p++ = sel_y1 + sel_height - (gint)RINT(y) + 1;
@ -419,12 +419,12 @@ gen_anchor (gdouble *p,
void
gen_control (gdouble *p,
gdouble x,
gdouble y)
gdouble x,
gdouble y)
{
/* printf("TYPE: 2 X: %d Y: %d\n", */
/* sel_x1+(int)RINT(x), */
/* sel_y1 + sel_height - (int)RINT(y)+1); */
/* sel_x1+(int)RINT(x), */
/* sel_y1 + sel_height - (int)RINT(y)+1); */
*p++ = sel_x1 + (gint)RINT(x);
*p++ = sel_y1 + sel_height - (gint)RINT(y) + 1;
@ -434,7 +434,7 @@ gen_control (gdouble *p,
void
do_points (spline_list_array_type in_splines,
gint32 image_ID)
gint32 image_ID)
{
unsigned this_list;
gint seg_count = 0;
@ -450,7 +450,7 @@ do_points (spline_list_array_type in_splines,
spline_list_type in_list = SPLINE_LIST_ARRAY_ELT (in_splines, this_list);
/* Ignore single points that are on their own */
if(SPLINE_LIST_LENGTH (in_list) < 2)
continue;
continue;
point_count += SPLINE_LIST_LENGTH (in_list);
}
@ -473,55 +473,55 @@ do_points (spline_list_array_type in_splines,
spline_list_type in_list = SPLINE_LIST_ARRAY_ELT (in_splines, this_list);
/* if(seg_count > 0 && point_count > 0) */
/* gen_anchor(last_x,last_y,0); */
/* gen_anchor(last_x,last_y,0); */
point_count = 0;
/* Ignore single points that are on their own */
if(SPLINE_LIST_LENGTH (in_list) < 2)
continue;
continue;
for (this_spline = 0; this_spline < SPLINE_LIST_LENGTH (in_list);
this_spline++)
{
spline_type s = SPLINE_LIST_ELT (in_list, this_spline);
this_spline++)
{
spline_type s = SPLINE_LIST_ELT (in_list, this_spline);
if (SPLINE_DEGREE (s) == LINEAR)
{
gen_anchor (cur_parray,
START_POINT (s).x, START_POINT (s).y,
seg_count && !point_count);
cur_parray += 3;
gen_control (cur_parray, START_POINT (s).x, START_POINT (s).y);
cur_parray += 3;
gen_control (cur_parray,END_POINT (s).x, END_POINT (s).y);
cur_parray += 3;
last_x = END_POINT (s).x;
last_y = END_POINT (s).y;
}
else if (SPLINE_DEGREE (s) == CUBIC)
{
gen_anchor (cur_parray,
START_POINT (s).x, START_POINT (s).y,
seg_count && !point_count);
cur_parray += 3;
gen_control (cur_parray,CONTROL1 (s).x, CONTROL1 (s).y);
cur_parray += 3;
gen_control (cur_parray,CONTROL2 (s).x, CONTROL2 (s).y);
cur_parray += 3;
last_x = END_POINT (s).x;
last_y = END_POINT (s).y;
}
else
g_warning ("print_spline: strange degree (%d)", SPLINE_DEGREE (s));
if (SPLINE_DEGREE (s) == LINEAR)
{
gen_anchor (cur_parray,
START_POINT (s).x, START_POINT (s).y,
seg_count && !point_count);
cur_parray += 3;
gen_control (cur_parray, START_POINT (s).x, START_POINT (s).y);
cur_parray += 3;
gen_control (cur_parray,END_POINT (s).x, END_POINT (s).y);
cur_parray += 3;
last_x = END_POINT (s).x;
last_y = END_POINT (s).y;
}
else if (SPLINE_DEGREE (s) == CUBIC)
{
gen_anchor (cur_parray,
START_POINT (s).x, START_POINT (s).y,
seg_count && !point_count);
cur_parray += 3;
gen_control (cur_parray,CONTROL1 (s).x, CONTROL1 (s).y);
cur_parray += 3;
gen_control (cur_parray,CONTROL2 (s).x, CONTROL2 (s).y);
cur_parray += 3;
last_x = END_POINT (s).x;
last_y = END_POINT (s).y;
}
else
g_warning ("print_spline: strange degree (%d)", SPLINE_DEGREE (s));
point_count++;
}
point_count++;
}
seg_count++;
}
gimp_path_set_points (image_ID,
"selection_to_path",
"selection_to_path",
1,
path_point_count,
parray);
@ -537,7 +537,7 @@ do_sel2path (gint32 image_ID)
spline_list_array_type splines;
gimp_selection_bounds (image_ID, &has_sel,
&sel_x1, &sel_y1, &sel_x2, &sel_y2);
&sel_x1, &sel_y1, &sel_x2, &sel_y2);
sel_width = sel_x2 - sel_x1;
sel_height = sel_y2 - sel_y1;
@ -558,11 +558,11 @@ do_sel2path (gint32 image_ID)
}
gimp_pixel_rgn_init (&selection_rgn, sel_drawable,
sel_x1, sel_y1, sel_width, sel_height,
FALSE, FALSE);
sel_x1, sel_y1, sel_width, sel_height,
FALSE, FALSE);
gimp_tile_cache_ntiles (2 * (sel_drawable->width + gimp_tile_width () - 1) /
gimp_tile_width ());
gimp_tile_width ());
olt = find_outline_pixels ();

View File

@ -36,7 +36,7 @@
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include "sgi.h" /* SGI image library definitions */
#include "sgi.h" /* SGI image library definitions */
#include "libgimp/stdplugins-intl.h"
@ -45,6 +45,9 @@
* Constants...
*/
#define LOAD_PROC "file-sgi-load"
#define SAVE_PROC "file-sgi-save"
#define PLUG_IN_BINARY "sgi"
#define PLUG_IN_VERSION "1.1.1 - 17 May 1998"
@ -52,17 +55,17 @@
* Local functions...
*/
static void query (void);
static void run (const gchar *name,
gint nparams,
const 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 gint32 load_image (const gchar *filename);
static gint save_image (const gchar *filename,
gint32 image_ID,
gint32 drawable_ID);
static gint32 load_image (const gchar *filename);
static gint save_image (const gchar *filename,
gint32 image_ID,
gint32 drawable_ID);
static gboolean save_dialog (void);
@ -70,7 +73,7 @@ static gboolean save_dialog (void);
* Globals...
*/
GimpPlugInInfo PLUG_IN_INFO =
GimpPlugInInfo PLUG_IN_INFO =
{
NULL, /* init_proc */
NULL, /* quit_proc */
@ -88,9 +91,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[] =
{
@ -99,50 +102,50 @@ 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, "compression", "Compression level (0 = none, 1 = RLE, 2 = ARLE)" }
{ 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 level (0 = none, 1 = RLE, 2 = ARLE)" }
};
gimp_install_procedure ("file_sgi_load",
"Loads files in SGI image file format",
"This plug-in loads SGI image files.",
"Michael Sweet <mike@easysw.com>",
"Copyright 1997-1998 by Michael Sweet",
PLUG_IN_VERSION,
N_("Silicon Graphics IRIS image"),
NULL,
GIMP_PLUGIN,
G_N_ELEMENTS (load_args),
G_N_ELEMENTS (load_return_vals),
load_args,
load_return_vals);
gimp_install_procedure (LOAD_PROC,
"Loads files in SGI image file format",
"This plug-in loads SGI image files.",
"Michael Sweet <mike@easysw.com>",
"Copyright 1997-1998 by Michael Sweet",
PLUG_IN_VERSION,
N_("Silicon Graphics IRIS image"),
NULL,
GIMP_PLUGIN,
G_N_ELEMENTS (load_args),
G_N_ELEMENTS (load_return_vals),
load_args,
load_return_vals);
gimp_register_file_handler_mime ("file_sgi_load", "image/x-sgi");
gimp_register_magic_load_handler ("file_sgi_load",
"sgi,rgb,bw,icon",
"",
"0,short,474");
gimp_register_file_handler_mime (LOAD_PROC, "image/x-sgi");
gimp_register_magic_load_handler (LOAD_PROC,
"sgi,rgb,bw,icon",
"",
"0,short,474");
gimp_install_procedure ("file_sgi_save",
"Saves files in SGI image file format",
"This plug-in saves SGI image files.",
"Michael Sweet <mike@easysw.com>",
"Copyright 1997-1998 by Michael Sweet",
PLUG_IN_VERSION,
N_("Silicon Graphics IRIS image"),
"RGB*,GRAY*",
GIMP_PLUGIN,
G_N_ELEMENTS (save_args),
0,
save_args,
NULL);
gimp_install_procedure (SAVE_PROC,
"Saves files in SGI image file format",
"This plug-in saves SGI image files.",
"Michael Sweet <mike@easysw.com>",
"Copyright 1997-1998 by Michael Sweet",
PLUG_IN_VERSION,
N_("Silicon Graphics IRIS image"),
"RGB*,GRAY*",
GIMP_PLUGIN,
G_N_ELEMENTS (save_args),
0,
save_args,
NULL);
gimp_register_file_handler_mime ("file_sgi_save", "image/x-sgi");
gimp_register_save_handler ("file_sgi_save", "sgi,rgb,bw,icon", "");
gimp_register_file_handler_mime (SAVE_PROC, "image/x-sgi");
gimp_register_save_handler (SAVE_PROC, "sgi,rgb,bw,icon", "");
}
static void
@ -155,7 +158,7 @@ run (const gchar *name,
static GimpParam values[2];
GimpRunMode run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
gint32 image_ID;
gint32 image_ID;
gint32 drawable_ID;
GimpExportReturn export = GIMP_EXPORT_CANCEL;
@ -168,104 +171,103 @@ run (const gchar *name,
INIT_I18N ();
if (strcmp (name, "file_sgi_load") == 0)
if (strcmp (name, LOAD_PROC) == 0)
{
image_ID = load_image (param[1].data.d_string);
if (image_ID != -1)
{
*nreturn_vals = 2;
values[1].type = GIMP_PDB_IMAGE;
values[1].data.d_image = image_ID;
}
{
*nreturn_vals = 2;
values[1].type = GIMP_PDB_IMAGE;
values[1].data.d_image = image_ID;
}
else
{
status = GIMP_PDB_EXECUTION_ERROR;
}
{
status = GIMP_PDB_EXECUTION_ERROR;
}
}
else if (strcmp (name, "file_sgi_save") == 0)
else if (strcmp (name, LOAD_PROC) == 0)
{
image_ID = param[1].data.d_int32;
drawable_ID = param[2].data.d_int32;
/* eventually export the image */
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init ("sgi", FALSE);
export = gimp_export_image (&image_ID, &drawable_ID, "SGI",
(GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_ALPHA));
if (export == GIMP_EXPORT_CANCEL)
{
values[0].data.d_status = GIMP_PDB_CANCEL;
return;
}
break;
default:
break;
}
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY, FALSE);
export = gimp_export_image (&image_ID, &drawable_ID, "SGI",
(GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_ALPHA));
if (export == GIMP_EXPORT_CANCEL)
{
values[0].data.d_status = GIMP_PDB_CANCEL;
return;
}
break;
default:
break;
}
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
/*
* Possibly retrieve data...
*/
gimp_get_data ("file_sgi_save", &compression);
{
case GIMP_RUN_INTERACTIVE:
/*
* Possibly retrieve data...
*/
gimp_get_data (SAVE_PROC, &compression);
/*
* Then acquire information with a dialog...
*/
/*
* Then acquire information with a dialog...
*/
if (!save_dialog ())
status = GIMP_PDB_CANCEL;
break;
case GIMP_RUN_NONINTERACTIVE:
/*
* Make sure all the arguments are there!
*/
case GIMP_RUN_NONINTERACTIVE:
/*
* Make sure all the arguments are there!
*/
if (nparams != 6)
{
status = GIMP_PDB_CALLING_ERROR;
}
{
status = GIMP_PDB_CALLING_ERROR;
}
else
{
compression = param[5].data.d_int32;
{
compression = param[5].data.d_int32;
if (compression < 0 || compression > 2)
status = GIMP_PDB_CALLING_ERROR;
};
if (compression < 0 || compression > 2)
status = GIMP_PDB_CALLING_ERROR;
};
break;
case GIMP_RUN_WITH_LAST_VALS:
/*
* Possibly retrieve data...
*/
gimp_get_data ("file_sgi_save", &compression);
case GIMP_RUN_WITH_LAST_VALS:
/*
* Possibly retrieve data...
*/
gimp_get_data (SAVE_PROC, &compression);
break;
default:
default:
break;
};
};
if (status == GIMP_PDB_SUCCESS)
{
if (save_image (param[3].data.d_string, image_ID, drawable_ID))
{
gimp_set_data ("file_sgi_save",
&compression, sizeof (compression));
}
else
{
status = GIMP_PDB_EXECUTION_ERROR;
}
}
{
if (save_image (param[3].data.d_string, image_ID, drawable_ID))
{
gimp_set_data (SAVE_PROC, &compression, sizeof (compression));
}
else
{
status = GIMP_PDB_EXECUTION_ERROR;
}
}
if (export == GIMP_EXPORT_EXPORT)
gimp_image_delete (image_ID);
gimp_image_delete (image_ID);
}
else
{
@ -325,22 +327,22 @@ load_image (const gchar *filename) /* I - File to load */
switch (sgip->zsize)
{
case 1 : /* Grayscale */
case 1 : /* Grayscale */
image_type = GIMP_GRAY;
layer_type = GIMP_GRAY_IMAGE;
break;
case 2 : /* Grayscale + alpha */
case 2 : /* Grayscale + alpha */
image_type = GIMP_GRAY;
layer_type = GIMP_GRAYA_IMAGE;
break;
case 3 : /* RGB */
case 3 : /* RGB */
image_type = GIMP_RGB;
layer_type = GIMP_RGB_IMAGE;
break;
case 4 : /* RGBA */
case 4 : /* RGBA */
image_type = GIMP_RGB;
layer_type = GIMP_RGBA_IMAGE;
break;
@ -366,7 +368,7 @@ load_image (const gchar *filename) /* I - File to load */
*/
layer = gimp_layer_new (image, _("Background"), sgip->xsize, sgip->ysize,
layer_type, 100, GIMP_NORMAL_MODE);
layer_type, 100, GIMP_NORMAL_MODE);
gimp_image_add_layer (image, layer, 0);
/*
@ -404,39 +406,39 @@ load_image (const gchar *filename) /* I - File to load */
y ++, count ++)
{
if (count >= tile_height)
{
gimp_pixel_rgn_set_rect (&pixel_rgn, pixel,
0, y - count, drawable->width, count);
count = 0;
{
gimp_pixel_rgn_set_rect (&pixel_rgn, pixel,
0, y - count, drawable->width, count);
count = 0;
gimp_progress_update ((double) y / (double) sgip->ysize);
}
gimp_progress_update ((double) y / (double) sgip->ysize);
}
for (i = 0; i < sgip->zsize; i ++)
if (sgiGetRow (sgip, rows[i], sgip->ysize - 1 - y, i) < 0)
printf("sgiGetRow(sgip, rows[i], %d, %d) failed!\n",
sgip->ysize - 1 - y, i);
if (sgiGetRow (sgip, rows[i], sgip->ysize - 1 - y, i) < 0)
printf("sgiGetRow(sgip, rows[i], %d, %d) failed!\n",
sgip->ysize - 1 - y, i);
if (sgip->bpp == 1)
{
/*
* 8-bit (unsigned) pixels...
*/
{
/*
* 8-bit (unsigned) pixels...
*/
for (x = 0, pptr = pixels[count]; x < sgip->xsize; x ++)
for (i = 0; i < bytes; i ++, pptr ++)
*pptr = rows[i][x];
}
for (x = 0, pptr = pixels[count]; x < sgip->xsize; x ++)
for (i = 0; i < bytes; i ++, pptr ++)
*pptr = rows[i][x];
}
else
{
/*
* 16-bit (unsigned) pixels...
*/
{
/*
* 16-bit (unsigned) pixels...
*/
for (x = 0, pptr = pixels[count]; x < sgip->xsize; x ++)
for (i = 0; i < bytes; i ++, pptr ++)
*pptr = rows[i][x] >> 8;
}
for (x = 0, pptr = pixels[count]; x < sgip->xsize; x ++)
for (i = 0; i < bytes; i ++, pptr ++)
*pptr = rows[i][x] >> 8;
}
}
/*
@ -444,7 +446,7 @@ load_image (const gchar *filename) /* I - File to load */
*/
gimp_pixel_rgn_set_rect (&pixel_rgn, pixel, 0,
y - count, drawable->width, count);
y - count, drawable->width, count);
/*
* Done with the file...
@ -474,8 +476,8 @@ load_image (const gchar *filename) /* I - File to load */
static gint
save_image (const gchar *filename,
gint32 image_ID,
gint32 drawable_ID)
gint32 image_ID,
gint32 drawable_ID)
{
gint i, j, /* Looping var */
x, /* Current X coordinate */
@ -483,7 +485,7 @@ save_image (const gchar *filename,
tile_height, /* Height of tile in GIMP */
count, /* Count of rows to put in image */
zsize; /* Number of channels in file */
sgi_t *sgip; /* File pointer */
sgi_t *sgip; /* File pointer */
GimpDrawable *drawable; /* Drawable for layer */
GimpPixelRgn pixel_rgn; /* Pixel region for layer */
guchar **pixels, /* Pixel rows */
@ -498,7 +500,7 @@ save_image (const gchar *filename,
drawable = gimp_drawable_get (drawable_ID);
gimp_pixel_rgn_init (&pixel_rgn, drawable, 0, 0, drawable->width,
drawable->height, FALSE, FALSE);
drawable->height, FALSE, FALSE);
zsize = 0;
switch (gimp_drawable_type (drawable_ID))
@ -525,7 +527,7 @@ save_image (const gchar *filename,
*/
sgip = sgiOpen ((char *) filename, SGI_WRITE, compression, 1,
drawable->width, drawable->height, zsize);
drawable->width, drawable->height, zsize);
if (sgip == NULL)
{
g_message (_("Could not open '%s' for writing."),
@ -565,9 +567,9 @@ save_image (const gchar *filename,
*/
if ((y + tile_height) >= drawable->height)
count = drawable->height - y;
count = drawable->height - y;
else
count = tile_height;
count = tile_height;
gimp_pixel_rgn_get_rect (&pixel_rgn, pixel, 0, y, drawable->width, count);
@ -576,14 +578,14 @@ save_image (const gchar *filename,
*/
for (i = 0, pptr = pixels[0]; i < count; i ++)
{
for (x = 0; x < drawable->width; x ++)
for (j = 0; j < zsize; j ++, pptr ++)
rows[j][x] = *pptr;
{
for (x = 0; x < drawable->width; x ++)
for (j = 0; j < zsize; j ++, pptr ++)
rows[j][x] = *pptr;
for (j = 0; j < zsize; j ++)
sgiPutRow (sgip, rows[j], drawable->height - 1 - y - i, j);
};
for (j = 0; j < zsize; j ++)
sgiPutRow (sgip, rows[j], drawable->height - 1 - y - i, j);
};
gimp_progress_update ((double) y / (double) drawable->height);
};
@ -609,14 +611,14 @@ save_dialog (void)
GtkWidget *frame;
gboolean run;
dlg = gimp_dialog_new (_("Save as SGI"), "sgi",
dlg = gimp_dialog_new (_("Save as SGI"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "file-sgi-save",
gimp_standard_help_func, SAVE_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dlg),
GTK_RESPONSE_OK,
@ -624,17 +626,17 @@ save_dialog (void)
-1);
frame = gimp_int_radio_group_new (TRUE, _("Compression type"),
G_CALLBACK (gimp_radio_button_update),
&compression, compression,
G_CALLBACK (gimp_radio_button_update),
&compression, compression,
_("No compression"),
SGI_COMP_NONE, NULL,
_("RLE compression"),
SGI_COMP_RLE, NULL,
_("Aggressive RLE\n(not supported by SGI)"),
SGI_COMP_ARLE, NULL,
_("No compression"),
SGI_COMP_NONE, NULL,
_("RLE compression"),
SGI_COMP_RLE, NULL,
_("Aggressive RLE\n(not supported by SGI)"),
SGI_COMP_ARLE, NULL,
NULL);
NULL);
gtk_container_set_border_width (GTK_CONTAINER (frame), 12);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), frame, TRUE, TRUE, 0);

View File

@ -38,6 +38,10 @@
#include "libgimp/stdplugins-intl.h"
#define LOAD_PROC "file-uri-load"
#define SAVE_PROC "file-uri-save"
static void query (void);
static void run (const gchar *name,
gint nparams,
@ -72,9 +76,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[] =
@ -84,11 +88,11 @@ 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" }
};
GError *error = NULL;
@ -103,7 +107,7 @@ query (void)
if (uri_backend_get_load_protocols ())
{
gimp_install_procedure ("file_uri_load",
gimp_install_procedure (LOAD_PROC,
"loads files given an URI",
"You need to have GNU Wget or GnomeVFS installed.",
"Spencer Kimball & Peter Mattis",
@ -116,15 +120,15 @@ query (void)
G_N_ELEMENTS (load_return_vals),
load_args, load_return_vals);
gimp_plugin_icon_register ("file_uri_load",
gimp_plugin_icon_register (LOAD_PROC,
GIMP_ICON_TYPE_STOCK_ID, GIMP_STOCK_WEB);
gimp_register_load_handler ("file_uri_load",
gimp_register_load_handler (LOAD_PROC,
"", uri_backend_get_load_protocols ());
}
if (uri_backend_get_save_protocols ())
{
gimp_install_procedure ("file_uri_save",
gimp_install_procedure (SAVE_PROC,
"saves files given an URI",
"You need to have GNU Wget or GnomeVFS installed.",
"Michael Natterer",
@ -136,9 +140,9 @@ query (void)
G_N_ELEMENTS (save_args), 0,
save_args, NULL);
gimp_plugin_icon_register ("file_uri_save",
gimp_plugin_icon_register (SAVE_PROC,
GIMP_ICON_TYPE_STOCK_ID, GIMP_STOCK_WEB);
gimp_register_save_handler ("file_uri_save",
gimp_register_save_handler (SAVE_PROC,
"", uri_backend_get_save_protocols ());
}
@ -174,8 +178,7 @@ run (const gchar *name,
return;
}
if (! strcmp (name, "file_uri_load") &&
uri_backend_get_load_protocols ())
if (! strcmp (name, LOAD_PROC) && uri_backend_get_load_protocols ())
{
image_ID = load_image (param[2].data.d_string, run_mode);
@ -188,8 +191,7 @@ run (const gchar *name,
values[1].data.d_image = image_ID;
}
}
else if (! strcmp (name, "file_uri_save") &&
uri_backend_get_save_protocols ())
else if (! strcmp (name, SAVE_PROC) && uri_backend_get_save_protocols ())
{
status = save_image (param[3].data.d_string,
param[1].data.d_int32,

View File

@ -79,6 +79,9 @@
/* XJT includes */
#include "xjpeg.h"
#define LOAD_PROC "file-xjt-load"
#define SAVE_PROC "file-xjt-save"
#define GIMP_XJ_IMAGE "GIMP_XJ_IMAGE"
#define SCALE_WIDTH 125
@ -441,9 +444,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[] =
{
@ -452,18 +455,18 @@ query (void)
static GimpParamDef save_args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image" },
{ GIMP_PDB_DRAWABLE, "drawable", "is ignored" },
{ 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_FLOAT, "quality", "Quality of saved image (0 <= quality <= 1)" },
{ GIMP_PDB_FLOAT, "smoothing", "Smoothing factor for saved image (0 <= smoothing <= 1)" },
{ GIMP_PDB_INT32, "optimize", "Optimization of entropy encoding parameters" },
{ GIMP_PDB_INT32, "clr_transparent", "set all full-transparent pixels to 0" },
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image" },
{ GIMP_PDB_DRAWABLE, "drawable", "is ignored" },
{ 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_FLOAT, "quality", "Quality of saved image (0 <= quality <= 1)" },
{ GIMP_PDB_FLOAT, "smoothing", "Smoothing factor for saved image (0 <= smoothing <= 1)" },
{ GIMP_PDB_INT32, "optimize", "Optimization of entropy encoding parameters" },
{ GIMP_PDB_INT32, "clr-transparent", "set all full-transparent pixels to 0" },
};
gimp_install_procedure ("file_xjt_load",
gimp_install_procedure (LOAD_PROC,
"loads files of the jpeg-tar file format",
"loads files of the jpeg-tar file format",
"Wolfgang Hofer",
@ -476,12 +479,12 @@ query (void)
G_N_ELEMENTS (load_return_vals),
load_args, load_return_vals);
gimp_register_magic_load_handler ("file_xjt_load",
gimp_register_magic_load_handler (LOAD_PROC,
"xjt,xjtgz,xjtbz2",
"",
"");
gimp_install_procedure ("file_xjt_save",
gimp_install_procedure (SAVE_PROC,
"saves files in the jpeg-tar file format",
"saves files in the jpeg-tar file format",
"Wolfgang Hofer",
@ -493,7 +496,7 @@ query (void)
G_N_ELEMENTS (save_args), 0,
save_args, NULL);
gimp_register_save_handler ("file_xjt_save", "xjt,xjtgz,xjtbz2", "");
gimp_register_save_handler (SAVE_PROC, "xjt,xjtgz,xjtbz2", "");
}
static void
@ -527,7 +530,7 @@ run (const gchar *name,
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
if (strcmp (name, "file_xjt_load") == 0)
if (strcmp (name, LOAD_PROC) == 0)
{
image_ID = load_xjt_image (param[1].data.d_string);
@ -542,13 +545,13 @@ run (const gchar *name,
status = GIMP_PDB_EXECUTION_ERROR;
}
}
else if (strcmp (name, "file_xjt_save") == 0)
else if (strcmp (name, SAVE_PROC) == 0)
{
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
/* Possibly retrieve data */
gimp_get_data ("file_xjt_save", &jsvals);
gimp_get_data (SAVE_PROC, &jsvals);
/* First acquire information with a dialog */
if (! save_dialog ())
@ -583,7 +586,7 @@ run (const gchar *name,
case GIMP_RUN_WITH_LAST_VALS:
/* Possibly retrieve data */
gimp_get_data ("file_xjt_save", &jsvals);
gimp_get_data (SAVE_PROC, &jsvals);
break;
default:
@ -601,7 +604,7 @@ run (const gchar *name,
else
{
/* Store mvals data */
gimp_set_data ("file_xjt_save", &jsvals, sizeof (t_JpegSaveVals));
gimp_set_data (SAVE_PROC, &jsvals, sizeof (t_JpegSaveVals));
}
}
}