Commit 9b75bd64 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

plug-ins/common/decompose.c plug-ins/common/deinterlace.c

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

	* plug-ins/common/decompose.c
	* plug-ins/common/deinterlace.c
	* plug-ins/common/despeckle.c
	* plug-ins/common/destripe.c
	* plug-ins/common/dicom.c
	* plug-ins/common/diffraction.c
	* plug-ins/common/displace.c
	* plug-ins/common/dog.c
	* plug-ins/common/edge.c
	* plug-ins/common/emboss.c
	* plug-ins/common/engrave.c
	* plug-ins/common/exchange.c
	* plug-ins/common/film.c
	* plug-ins/common/flarefx.c
	* plug-ins/common/fp.c
	* plug-ins/common/fractaltrace.c: canonicalize procedure and
	parameter names. Misc cleanups.
parent 30d7b39a
2005-08-13 Michael Natterer <mitch@gimp.org>
* plug-ins/common/decompose.c
* plug-ins/common/deinterlace.c
* plug-ins/common/despeckle.c
* plug-ins/common/destripe.c
* plug-ins/common/dicom.c
* plug-ins/common/diffraction.c
* plug-ins/common/displace.c
* plug-ins/common/dog.c
* plug-ins/common/edge.c
* plug-ins/common/emboss.c
* plug-ins/common/engrave.c
* plug-ins/common/exchange.c
* plug-ins/common/film.c
* plug-ins/common/flarefx.c
* plug-ins/common/fp.c
* plug-ins/common/fractaltrace.c: canonicalize procedure and
parameter names. Misc cleanups.
2005-08-13 DindinX <dindinx@gimp.org>
* plug-ins/common/threshold_alpha.c: added a preview, and some minor
......
......@@ -42,6 +42,11 @@
#define cbrt(x) (pow(x, 1.0/3.0))
#endif
#define PLUG_IN_PROC "plug-in-decompose"
#define PLUG_IN_BINARY "decompose"
/* Declare local functions
*/
static void query (void);
......@@ -220,21 +225,21 @@ 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_STRING, "decompose_type", "What to decompose: RGB, Red, Green, Blue, RGBA, Red, Green, Blue, Alpha, HSV, Hue, Saturation, Value, CMY, Cyan, Magenta, Yellow, CMYK, Cyan_K, Magenta_K, Yellow_K, Alpha, LAB" },
{ GIMP_PDB_INT32, "layers_mode", "Create channels as layers in a single image" }
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (unused)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_STRING, "decompose-type", "What to decompose: RGB, Red, Green, Blue, RGBA, Red, Green, Blue, Alpha, HSV, Hue, Saturation, Value, CMY, Cyan, Magenta, Yellow, CMYK, Cyan_K, Magenta_K, Yellow_K, Alpha, LAB" },
{ GIMP_PDB_INT32, "layers-mode", "Create channels as layers in a single image" }
};
static GimpParamDef return_vals[] =
{
{ GIMP_PDB_IMAGE, "new_image", "Output gray image" },
{ GIMP_PDB_IMAGE, "new_image", "Output gray image (N/A for single channel extract)" },
{ GIMP_PDB_IMAGE, "new_image", "Output gray image (N/A for single channel extract)" },
{ GIMP_PDB_IMAGE, "new_image", "Output gray image (N/A for single channel extract)" }
{ GIMP_PDB_IMAGE, "new-image", "Output gray image" },
{ GIMP_PDB_IMAGE, "new-image", "Output gray image (N/A for single channel extract)" },
{ GIMP_PDB_IMAGE, "new-image", "Output gray image (N/A for single channel extract)" },
{ GIMP_PDB_IMAGE, "new-image", "Output gray image (N/A for single channel extract)" }
};
gimp_install_procedure ("plug_in_decompose",
gimp_install_procedure (PLUG_IN_PROC,
"Decompose an image into different types of channels",
"This function creates new gray images with "
"different channel information in each of them",
......@@ -248,8 +253,8 @@ query (void)
G_N_ELEMENTS (return_vals),
args, return_vals);
gimp_plugin_menu_register ("plug_in_decompose", "<Image>/Filters/Colors");
gimp_plugin_menu_register ("plug_in_decompose", "<Image>/Image/Mode");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Colors");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Image/Mode");
}
static void
......@@ -290,7 +295,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
/* Possibly retrieve data */
gimp_get_data ("plug_in_decompose", &decovals);
gimp_get_data (PLUG_IN_PROC, &decovals);
/* First acquire information with a dialog */
if (! decompose_dialog ())
......@@ -315,7 +320,7 @@ run (const gchar *name,
case GIMP_RUN_WITH_LAST_VALS:
/* Possibly retrieve data */
gimp_get_data ("plug_in_decompose", &decovals);
gimp_get_data (PLUG_IN_PROC, &decovals);
break;
default:
......@@ -368,7 +373,7 @@ run (const gchar *name,
/* Store data */
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_set_data ("plug_in_decompose", &decovals, sizeof (DecoVals));
gimp_set_data (PLUG_IN_PROC, &decovals, sizeof (DecoVals));
}
}
......@@ -1218,11 +1223,11 @@ decompose_dialog (void)
gint j;
gboolean run;
gimp_ui_init ("decompose", FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
dlg = gimp_dialog_new (_("Decompose"), "decompose",
dlg = gimp_dialog_new (_("Decompose"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "plug-in-decompose",
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
......@@ -1230,9 +1235,9 @@ decompose_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);
......
......@@ -29,6 +29,10 @@
#include "libgimp/stdplugins-intl.h"
#define PLUG_IN_PROC "plug-in-deinterlace"
#define PLUG_IN_BINARY "deinterlace"
enum
{
ODD_FIELDS,
......@@ -41,6 +45,7 @@ typedef struct
gboolean preview;
} DeinterlaceValues;
/* Declare local functions.
*/
static void query (void);
......@@ -78,13 +83,13 @@ 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, "evenodd", "0 = keep odd, 1 = keep even" }
};
gimp_install_procedure ("plug_in_deinterlace",
gimp_install_procedure (PLUG_IN_PROC,
"Deinterlace",
"Deinterlace is useful for processing images from "
"video capture cards. When only the odd or even "
......@@ -100,7 +105,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_deinterlace", "<Image>/Filters/Enhance");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Enhance");
}
static void
......@@ -125,7 +130,7 @@ run (const gchar *name,
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
gimp_get_data ("plug_in_deinterlace", &devals);
gimp_get_data (PLUG_IN_PROC, &devals);
if (! deinterlace_dialog (drawable))
status = GIMP_PDB_EXECUTION_ERROR;
break;
......@@ -138,7 +143,7 @@ run (const gchar *name,
break;
case GIMP_RUN_WITH_LAST_VALS:
gimp_get_data ("plug_in_deinterlace", &devals);
gimp_get_data (PLUG_IN_PROC, &devals);
break;
default:
......@@ -159,8 +164,7 @@ run (const gchar *name,
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_displays_flush ();
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_set_data ("plug_in_deinterlace",
&devals, sizeof (DeinterlaceValues));
gimp_set_data (PLUG_IN_PROC, &devals, sizeof (DeinterlaceValues));
}
else
{
......@@ -317,11 +321,11 @@ deinterlace_dialog (GimpDrawable *drawable)
GtkWidget *even;
gboolean run;
gimp_ui_init ("deinterlace", FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
dialog = gimp_dialog_new (_("Deinterlace"), "deinterlace",
dialog = gimp_dialog_new (_("Deinterlace"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "plug-in-deinterlace",
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
......@@ -329,9 +333,9 @@ deinterlace_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);
......
......@@ -33,9 +33,9 @@
* Constants...
*/
#define PLUG_IN_NAME "plug_in_despeckle"
#define PLUG_IN_PROC "plug-in-despeckle"
#define PLUG_IN_BINARY "despeckle"
#define PLUG_IN_VERSION "1.3.2 - 17 May 1998"
#define HELP_ID "plug-in-despeckle"
#define SCALE_WIDTH 100
#define ENTRY_WIDTH 3
#define MAX_RADIUS 20
......@@ -142,7 +142,7 @@ query (void)
{ GIMP_PDB_INT32, "white", "White level (0 to 255)" }
};
gimp_install_procedure (PLUG_IN_NAME,
gimp_install_procedure (PLUG_IN_PROC,
"Despeckle filter, typically used to \'despeckle\' "
"a photographic image.",
"This plug-in selectively performs a median or "
......@@ -156,7 +156,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register (PLUG_IN_NAME, "<Image>/Filters/Enhance");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Enhance");
}
......@@ -209,7 +209,7 @@ run (const gchar *name,
* Possibly retrieve data...
*/
gimp_get_data (PLUG_IN_NAME, &despeckle_radius);
gimp_get_data (PLUG_IN_PROC, &despeckle_radius);
/*
* Get information from the dialog...
......@@ -265,7 +265,7 @@ run (const gchar *name,
*/
INIT_I18N();
gimp_get_data (PLUG_IN_NAME, despeckle_vals);
gimp_get_data (PLUG_IN_PROC, despeckle_vals);
break;
default:
......@@ -301,7 +301,7 @@ run (const gchar *name,
*/
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_set_data (PLUG_IN_NAME,
gimp_set_data (PLUG_IN_PROC,
despeckle_vals, sizeof (despeckle_vals));
}
else
......@@ -388,11 +388,11 @@ despeckle_dialog (void)
GtkObject *adj;
gboolean run;
gimp_ui_init ("despeckle", TRUE);
gimp_ui_init (PLUG_IN_BINARY, TRUE);
dialog = gimp_dialog_new (_("Despeckle"), "despeckle",
dialog = gimp_dialog_new (_("Despeckle"), 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,
......@@ -400,9 +400,9 @@ despeckle_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);
main_vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);
......
......@@ -35,11 +35,11 @@
* Constants...
*/
#define PLUG_IN_NAME "plug_in_destripe"
#define PLUG_IN_VERSION "0.2"
#define HELP_ID "plug-in-destripe"
#define SCALE_WIDTH 140
#define MAX_AVG 100
#define PLUG_IN_PROC "plug-in-destripe"
#define PLUG_IN_BINARY "destripe"
#define PLUG_IN_VERSION "0.2"
#define SCALE_WIDTH 140
#define MAX_AVG 100
/*
......@@ -92,13 +92,13 @@ 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_INT32, "avg_width", "Averaging filter width (default = 36)" }
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_INT32, "avg-width", "Averaging filter width (default = 36)" }
};
gimp_install_procedure (PLUG_IN_NAME,
gimp_install_procedure (PLUG_IN_PROC,
"Destripe filter, used to remove vertical stripes "
"caused by cheap scanners.",
"This plug-in tries to remove vertical stripes from "
......@@ -112,7 +112,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register (PLUG_IN_NAME, "<Image>/Filters/Enhance");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Enhance");
}
static void
......@@ -158,7 +158,7 @@ run (const gchar *name,
/*
* Possibly retrieve data...
*/
gimp_get_data (PLUG_IN_NAME, &vals);
gimp_get_data (PLUG_IN_PROC, &vals);
/*
* Get information from the dialog...
......@@ -181,7 +181,7 @@ run (const gchar *name,
/*
* Possibly retrieve data...
*/
gimp_get_data (PLUG_IN_NAME, &vals);
gimp_get_data (PLUG_IN_PROC, &vals);
break;
default :
......@@ -219,7 +219,7 @@ run (const gchar *name,
* Store data...
*/
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_set_data (PLUG_IN_NAME, &vals, sizeof (vals));
gimp_set_data (PLUG_IN_PROC, &vals, sizeof (vals));
}
else
status = GIMP_PDB_EXECUTION_ERROR;
......@@ -433,11 +433,11 @@ destripe_dialog (GimpDrawable *drawable)
GtkObject *adj;
gboolean run;
gimp_ui_init ("destripe", TRUE);
gimp_ui_init (PLUG_IN_BINARY, TRUE);
dialog = gimp_dialog_new (_("Destripe"), "destripe",
dialog = gimp_dialog_new (_("Destripe"), 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,
......@@ -445,9 +445,9 @@ destripe_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);
......@@ -498,4 +498,3 @@ destripe_dialog (GimpDrawable *drawable)
return run;
}
......@@ -35,6 +35,11 @@
#include "libgimp/stdplugins-intl.h"
#define LOAD_PROC "file-dicom-load"
#define SAVE_PROC "file-dicom-save"
#define PLUG_IN_BINARY "dicom"
/* A lot of Dicom images are wrongly encoded. By guessing the endian
* we can get around this problem.
*/
......@@ -104,9 +109,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[] =
{
......@@ -115,14 +120,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" },
{ GIMP_PDB_STRING, "raw_filename", "The name of the file to save" },
{ GIMP_PDB_STRING, "raw-filename", "The name of the file to save" },
};
gimp_install_procedure ("file_dicom_load",
gimp_install_procedure (LOAD_PROC,
"loads files of the dicom file format",
"Load a file in the DICOM standard format."
"The standard is defined at "
......@@ -139,14 +144,14 @@ query (void)
G_N_ELEMENTS (load_return_vals),
load_args, load_return_vals);
gimp_register_file_handler_mime ("file_dicom_load", "image/x-dcm");
gimp_register_magic_load_handler ("file_dicom_load",
gimp_register_file_handler_mime (LOAD_PROC, "image/x-dcm");
gimp_register_magic_load_handler (LOAD_PROC,
"dcm,dicom",
"",
"128,string,DICM"
);
gimp_install_procedure ("file_dicom_save",
gimp_install_procedure (SAVE_PROC,
"Save file in the DICOM file format",
"Save an image in the medical standard DICOM image "
"formats. The standard is defined at "
......@@ -163,8 +168,8 @@ query (void)
G_N_ELEMENTS (save_args), 0,
save_args, NULL);
gimp_register_file_handler_mime ("file_dicom_save", "image/x-dcm");
gimp_register_save_handler ("file_dicom_save", "dcm,dicom", "");
gimp_register_file_handler_mime (SAVE_PROC, "image/x-dcm");
gimp_register_save_handler (SAVE_PROC, "dcm,dicom", "");
}
static void
......@@ -190,7 +195,7 @@ run (const gchar *name,
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
if (strcmp (name, "file_dicom_load") == 0)
if (strcmp (name, LOAD_PROC) == 0)
{
image_ID = load_image (param[1].data.d_string);
......@@ -206,7 +211,7 @@ run (const gchar *name,
status = GIMP_PDB_EXECUTION_ERROR;
}
}
else if (strcmp (name, "file_dicom_save") == 0)
else if (strcmp (name, SAVE_PROC) == 0)
{
image_ID = param[1].data.d_int32;
drawable_ID = param[2].data.d_int32;
......@@ -215,7 +220,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init ("dicom", FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
export = gimp_export_image (&image_ID, &drawable_ID, "DICOM",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY);
......
......@@ -29,6 +29,10 @@
#include "libgimp/stdplugins-intl.h"
#define PLUG_IN_PROC "plug-in-diffraction"
#define PLUG_IN_BINARY "diffraction"
/***** Magic numbers *****/
#define ITERATIONS 100
#define WEIRD_FACTOR 0.04
......@@ -142,26 +146,26 @@ 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_PDB_FLOAT, "lam_r", "Light frequency (red)" },
{ GIMP_PDB_FLOAT, "lam_g", "Light frequency (green)" },
{ GIMP_PDB_FLOAT, "lam_b", "Light frequency (blue)" },
{ GIMP_PDB_FLOAT, "contour_r", "Number of contours (red)" },
{ GIMP_PDB_FLOAT, "contour_g", "Number of contours (green)" },
{ GIMP_PDB_FLOAT, "contour_b", "Number of contours (blue)" },
{ GIMP_PDB_FLOAT, "edges_r", "Number of sharp edges (red)" },
{ GIMP_PDB_FLOAT, "edges_g", "Number of sharp edges (green)" },
{ GIMP_PDB_FLOAT, "edges_b", "Number of sharp edges (blue)" },
{ GIMP_PDB_FLOAT, "brightness", "Brightness and shifting/fattening of contours" },
{ GIMP_PDB_FLOAT, "scattering", "Scattering (Speed vs. quality)" },
{ GIMP_PDB_FLOAT, "polarization", "Polarization" }
{ GIMP_PDB_FLOAT, "lam-r", "Light frequency (red)" },
{ GIMP_PDB_FLOAT, "lam-g", "Light frequency (green)" },
{ GIMP_PDB_FLOAT, "lam-b", "Light frequency (blue)" },
{ GIMP_PDB_FLOAT, "contour-r", "Number of contours (red)" },
{ GIMP_PDB_FLOAT, "contour-g", "Number of contours (green)" },
{ GIMP_PDB_FLOAT, "contour-b", "Number of contours (blue)" },
{ GIMP_PDB_FLOAT, "edges-r", "Number of sharp edges (red)" },
{ GIMP_PDB_FLOAT, "edges-g", "Number of sharp edges (green)" },
{ GIMP_PDB_FLOAT, "edges-b", "Number of sharp edges (blue)" },
{ GIMP_PDB_FLOAT, "brightness", "Brightness and shifting/fattening of contours" },
{ GIMP_PDB_FLOAT, "scattering", "Scattering (Speed vs. quality)" },
{ GIMP_PDB_FLOAT, "polarization", "Polarization" }
};
gimp_install_procedure ("plug_in_diffraction",
gimp_install_procedure (PLUG_IN_PROC,
"Generate diffraction patterns",
"Help? What help? Real men do not need help :-)", /* FIXME */
"Help? What help? Real men do not need help :-)",
"Federico Mena Quintero",
"Federico Mena Quintero & David Bleecker",
"April 1997, 0.5",
......@@ -171,8 +175,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_diffraction",
"<Image>/Filters/Render/Pattern");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Render/Pattern");
}
static void
......@@ -208,7 +211,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
/* Possibly retrieve data */
gimp_get_data ("plug_in_diffraction", &dvals);
gimp_get_data (PLUG_IN_PROC, &dvals);
/* Get information from the dialog */
if (!diffraction_dialog ())
......@@ -241,7 +244,7 @@ run (const gchar *name,
case GIMP_RUN_WITH_LAST_VALS:
/* Possibly retrieve data */
gimp_get_data ("plug_in_diffraction", &dvals);
gimp_get_data (PLUG_IN_PROC, &dvals);
break;
default:
......@@ -252,7 +255,8 @@ run (const gchar *name,
active_drawable = gimp_drawable_get (param[2].data.d_drawable);
/* Create the diffraction pattern */
if ((status == GIMP_PDB_SUCCESS) && gimp_drawable_is_rgb(active_drawable->drawable_id))
if ((status == GIMP_PDB_SUCCESS) &&
gimp_drawable_is_rgb (active_drawable->drawable_id))
{
/* Set the tile cache size */
gimp_tile_cache_ntiles ((active_drawable->width + gimp_tile_width() - 1) /
......@@ -267,11 +271,12 @@ run (const gchar *name,
/* Store data */
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_set_data ("plug_in_diffraction",
&dvals, sizeof(diffraction_vals_t));
gimp_set_data (PLUG_IN_PROC, &dvals, sizeof (diffraction_vals_t));
}
else if (status == GIMP_PDB_SUCCESS)
status = GIMP_PDB_EXECUTION_ERROR;
{
status = GIMP_PDB_EXECUTION_ERROR;
}
values[0].data.d_status = status;
......@@ -424,11 +429,11 @@ diffraction_dialog (void)
GtkObject *adj;
gboolean run;
gimp_ui_init ("diffraction", TRUE);
gimp_ui_init (PLUG_IN_BINARY, TRUE);
dialog = gimp_dialog_new (_("Diffraction Patterns"), "diffraction",
dialog = gimp_dialog_new (_("Diffraction Patterns"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "plug-in-diffraction",
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
......@@ -436,9 +441,9 @@ diffraction_dialog (void)
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,