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.
This commit is contained in:
Michael Natterer 2005-08-13 21:39:56 +00:00 committed by Michael Natterer
parent 30d7b39aa8
commit 9b75bd64ba
17 changed files with 372 additions and 320 deletions

View File

@ -1,3 +1,23 @@
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

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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;
}

View File

@ -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);

View File

@ -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,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
hbox = gtk_hbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
@ -682,14 +687,15 @@ dialog_update_preview (void)
px += dx;
}
if ((y%10)==0)
{
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (dint.progress),
(gdouble) y /
(gdouble) (PREVIEW_HEIGHT - 1));
while (gtk_events_pending ())
gtk_main_iteration ();
}
if ((y % 10) == 0)
{
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (dint.progress),
(gdouble) y /
(gdouble) (PREVIEW_HEIGHT - 1));
while (gtk_events_pending ())
gtk_main_iteration ();
}
py += dy;
}

View File

@ -52,6 +52,9 @@
/* Some useful macros */
#define PLUG_IN_PROC "plug-in-displace"
#define PLUG_IN_BINARY "displace"
#define ENTRY_WIDTH 75
#define TILE_CACHE_SIZE 48
@ -151,27 +154,20 @@ 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_FLOAT, "amount_x",
"Displace multiplier for X or radial direction" },
{ GIMP_PDB_FLOAT, "amount_y",
"Displace multiplier for Y or tangent (degrees) direction" },
{ GIMP_PDB_INT32, "do_x",
"Displace in X or radial direction?" },
{ GIMP_PDB_INT32, "do_y",
"Displace in Y or tangent direction?" },
{ GIMP_PDB_DRAWABLE, "displace_map_x",
"Displacement map for X or radial direction" },
{ GIMP_PDB_DRAWABLE, "displace_map_y",
"Displacement map for Y or tangent direction" },
{ GIMP_PDB_INT32, "displace_type", "Edge behavior: { WRAP (0), SMEAR (1), BLACK (2) }" },
{ GIMP_PDB_INT32, "mode",
"Mode of displacement: { CARTESIAN (0), POLAR (1) }"}
{ GIMP_PDB_FLOAT, "amount-x", "Displace multiplier for X or radial direction" },
{ GIMP_PDB_FLOAT, "amount-y", "Displace multiplier for Y or tangent (degrees) direction" },
{ GIMP_PDB_INT32, "do-x", "Displace in X or radial direction?" },
{ GIMP_PDB_INT32, "do-y", "Displace in Y or tangent direction?" },
{ GIMP_PDB_DRAWABLE, "displace-map-x", "Displacement map for X or radial direction" },
{ GIMP_PDB_DRAWABLE, "displace-map-y", "Displacement map for Y or tangent direction" },
{ GIMP_PDB_INT32, "displace-type", "Edge behavior: { WRAP (0), SMEAR (1), BLACK (2) }" },
{ GIMP_PDB_INT32, "mode", "Mode of displacement: { CARTESIAN (0), POLAR (1) }"}
};
gimp_install_procedure ("plug_in_displace",
gimp_install_procedure (PLUG_IN_PROC,
"Displace the contents of the specified drawable",
"Displaces the contents of the specified drawable "
"by the amounts specified by 'amount_x' and "
@ -189,7 +185,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_displace", "<Image>/Filters/Map");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Map");
}
static void
@ -224,7 +220,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
/* Possibly retrieve data */
gimp_get_data ("plug_in_displace", &dvals);
gimp_get_data (PLUG_IN_PROC, &dvals);
/* First acquire information with a dialog */
if (! displace_dialog (drawable))
@ -256,7 +252,7 @@ run (const gchar *name,
case GIMP_RUN_WITH_LAST_VALS:
/* Possibly retrieve data */
gimp_get_data ("plug_in_displace", &dvals);
gimp_get_data (PLUG_IN_PROC, &dvals);
break;
default:
@ -275,7 +271,7 @@ run (const gchar *name,
/* Store data */
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_set_data ("plug_in_displace", &dvals, sizeof (DisplaceVals));
gimp_set_data (PLUG_IN_PROC, &dvals, sizeof (DisplaceVals));
}
values[0].data.d_status = status;
@ -299,11 +295,11 @@ displace_dialog (GimpDrawable *drawable)
GtkWidget *black;
gboolean run;
gimp_ui_init ("displace", FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
dialog = gimp_dialog_new (_("Displace"), "displace",
dialog = gimp_dialog_new (_("Displace"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "plug-in-displace",
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -311,9 +307,9 @@ displace_dialog (GimpDrawable *drawable)
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
main_vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);

View File

@ -34,6 +34,11 @@
#include "libgimp/stdplugins-intl.h"
#define PLUG_IN_PROC "plug-in-dog"
#define PLUG_IN_BINARY "dog"
typedef struct
{
gdouble inner;
@ -43,6 +48,7 @@ typedef struct
gboolean preview;
} DoGValues;
/* Declare local functions.
*/
static void query (void);
@ -116,16 +122,16 @@ query (void)
{
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_FLOAT, "inner", "Radius of inner gaussian blur (in pixels, > 0.0)" },
{ GIMP_PDB_FLOAT, "outer", "Radius of outer gaussian blur (in pixels, > 0.0)" },
{ GIMP_PDB_INT32, "normalize", "True, False" },
{ GIMP_PDB_INT32, "invert", "True, False" }
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_FLOAT, "inner", "Radius of inner gaussian blur (in pixels, > 0.0)" },
{ GIMP_PDB_FLOAT, "outer", "Radius of outer gaussian blur (in pixels, > 0.0)" },
{ GIMP_PDB_INT32, "normalize", "True, False" },
{ GIMP_PDB_INT32, "invert", "True, False" }
};
gimp_install_procedure ("plug_in_dog",
gimp_install_procedure (PLUG_IN_PROC,
"Edge detection using difference of Gaussians.",
"Applies two Gaussian blurs to the drawable, and "
"subtracts the results. This is robust and widely "
@ -140,7 +146,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_dog", "<Image>/Filters/Edge-Detect");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Edge-Detect");
}
static void
@ -175,13 +181,13 @@ run (const gchar *name,
(MAX (drawable->width, drawable->height) /
gimp_tile_width () + 1));
if (strcmp (name, "plug_in_dog") == 0)
if (strcmp (name, PLUG_IN_PROC) == 0)
{
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
/* Possibly retrieve data */
gimp_get_data ("plug_in_dog", &dogvals);
gimp_get_data (PLUG_IN_PROC, &dogvals);
/* First acquire information with a dialog */
if (! dog_dialog (image_ID, drawable))
@ -206,7 +212,7 @@ run (const gchar *name,
case GIMP_RUN_WITH_LAST_VALS:
/* Possibly retrieve data */
gimp_get_data ("plug_in_dog", &dogvals);
gimp_get_data (PLUG_IN_PROC, &dogvals);
break;
default:
@ -233,10 +239,8 @@ run (const gchar *name,
/* Store data */
if (run_mode == GIMP_RUN_INTERACTIVE)
{
gimp_set_data ("plug_in_dog",
&dogvals, sizeof (DoGValues));
}
gimp_set_data (PLUG_IN_PROC, &dogvals, sizeof (DoGValues));
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_displays_flush ();
}
@ -267,11 +271,11 @@ dog_dialog (gint32 image_ID,
gdouble yres;
gboolean run;
gimp_ui_init ("dog", FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
dialog = gimp_dialog_new (_("DoG Edge Detect"), "dog",
dialog = gimp_dialog_new (_("DoG Edge Detect"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "plug-in-dog",
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -279,9 +283,9 @@ dog_dialog (gint32 image_ID,
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
main_vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);

View File

@ -62,6 +62,8 @@ static gchar rcsid[] = "$Id$";
/* Some useful macros */
#define PLUG_IN_PROC "plug-in-edge"
#define PLUG_IN_BINARY "edge"
#define TILE_CACHE_SIZE 48
enum
@ -132,12 +134,12 @@ query (void)
{
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (unused)" },
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (unused)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_FLOAT, "amount", "Edge detection amount" },
{ GIMP_PDB_INT32, "wrapmode", "Edge detection behavior: { WRAP (0), SMEAR (1), BLACK (2) }" },
{ GIMP_PDB_INT32, "edgemode", "Edge detection algorithm: { SOBEL (0), PREWITT (1), GRADIENT (2), ROBERTS (3), DIFFERENTIAL (4), LAPLACE (5) }" }
{ GIMP_PDB_FLOAT, "amount", "Edge detection amount" },
{ GIMP_PDB_INT32, "wrapmode", "Edge detection behavior: { WRAP (0), SMEAR (1), BLACK (2) }" },
{ GIMP_PDB_INT32, "edgemode", "Edge detection algorithm: { SOBEL (0), PREWITT (1), GRADIENT (2), ROBERTS (3), DIFFERENTIAL (4), LAPLACE (5) }" }
};
const gchar *help_string =
@ -147,7 +149,7 @@ query (void)
"transform applied to the pixels, SOBEL was the method used in older "
"versions.";
gimp_install_procedure ("plug_in_edge",
gimp_install_procedure (PLUG_IN_PROC,
"Perform edge detection on the contents of the specified drawable",
help_string,
"Peter Mattis & (ported to 1.0 by) Eiichi Takamori",
@ -159,7 +161,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_edge", "<Image>/Filters/Edge-Detect");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Edge-Detect");
}
static void
@ -191,7 +193,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
/* Possibly retrieve data */
gimp_get_data ("plug_in_edge", &evals);
gimp_get_data (PLUG_IN_PROC, &evals);
/* First acquire information with a dialog */
if (! edge_dialog (drawable))
@ -214,7 +216,7 @@ run (const gchar *name,
case GIMP_RUN_WITH_LAST_VALS:
/* Possibly retrieve data */
gimp_get_data ("plug_in_edge", &evals);
gimp_get_data (PLUG_IN_PROC, &evals);
break;
default:
@ -238,7 +240,7 @@ run (const gchar *name,
/* Store data */
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_set_data ("plug_in_edge", &evals, sizeof (EdgeVals));
gimp_set_data (PLUG_IN_PROC, &evals, sizeof (EdgeVals));
}
else
{
@ -637,11 +639,11 @@ edge_dialog (GimpDrawable *drawable)
gboolean use_smear = (evals.wrapmode == GIMP_PIXEL_FETCHER_EDGE_SMEAR);
gboolean use_black = (evals.wrapmode == GIMP_PIXEL_FETCHER_EDGE_BLACK);
gimp_ui_init ("edge", FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
dialog = gimp_dialog_new (_("Edge Detection"), "edge",
dialog = gimp_dialog_new (_("Edge Detection"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "plug-in-edge",
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -649,9 +651,9 @@ edge_dialog (GimpDrawable *drawable)
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
main_vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);

View File

@ -36,6 +36,10 @@
#include "libgimp/stdplugins-intl.h"
#define PLUG_IN_PROC "plug-in-emboss"
#define PLUG_IN_BINARY "emboss"
enum
{
FUNCTION_BUMPMAP = 0,
@ -109,16 +113,16 @@ query (void)
{
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "img", "The Image" },
{ GIMP_PDB_DRAWABLE, "drw", "The Drawable" },
{ GIMP_PDB_FLOAT, "azimuth", "The Light Angle (degrees)" },
{ GIMP_PDB_FLOAT, "elevation", "The Elevation Angle (degrees)" },
{ GIMP_PDB_INT32, "depth", "The Filter Width" },
{ GIMP_PDB_INT32, "embossp", "Emboss or Bumpmap" }
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "The Image" },
{ GIMP_PDB_DRAWABLE, "drawable", "The Drawable" },
{ GIMP_PDB_FLOAT, "azimuth", "The Light Angle (degrees)" },
{ GIMP_PDB_FLOAT, "elevation", "The Elevation Angle (degrees)" },
{ GIMP_PDB_INT32, "depth", "The Filter Width" },
{ GIMP_PDB_INT32, "embossp", "Emboss or Bumpmap" }
};
gimp_install_procedure ("plug_in_emboss",
gimp_install_procedure (PLUG_IN_PROC,
"Emboss filter",
"Emboss or Bumpmap the given drawable, specifying "
"the angle and elevation for the light source.",
@ -131,7 +135,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_emboss", "<Image>/Filters/Distorts");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Distorts");
}
static void
@ -159,7 +163,7 @@ run (const gchar *name,
switch (param[0].data.d_int32)
{
case GIMP_RUN_INTERACTIVE:
gimp_get_data ("plug_in_emboss", &evals);
gimp_get_data (PLUG_IN_PROC, &evals);
if (emboss_dialog (drawable) == -1)
{
@ -167,7 +171,7 @@ run (const gchar *name,
}
else
{
gimp_set_data ("plug_in_emboss", &evals, sizeof (piArgs));
gimp_set_data (PLUG_IN_PROC, &evals, sizeof (piArgs));
}
break;
@ -192,7 +196,7 @@ run (const gchar *name,
break;
case GIMP_RUN_WITH_LAST_VALS:
gimp_get_data ("plug_in_emboss", &evals);
gimp_get_data (PLUG_IN_PROC, &evals);
/* use this image and drawable, even with last args */
if (emboss (drawable, NULL)==-1)
{
@ -442,11 +446,11 @@ emboss_dialog (GimpDrawable *drawable)
GtkObject *adj;
gboolean run;
gimp_ui_init ("emboss", TRUE);
gimp_ui_init (PLUG_IN_BINARY, TRUE);
dialog = gimp_dialog_new (_("Emboss"), "emboss",
dialog = gimp_dialog_new (_("Emboss"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "plug-in-emboss",
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -454,9 +458,9 @@ emboss_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);
@ -540,7 +544,6 @@ emboss_dialog (GimpDrawable *drawable)
if (run)
return emboss (drawable, NULL);
else
return -1;
}
return -1;
}

View File

@ -28,6 +28,8 @@
/* Some useful macros */
#define PLUG_IN_PROC "plug-in-engrave"
#define PLUG_IN_BINARY "engrave"
#define SCALE_WIDTH 125
#define TILE_CACHE_SIZE 16
@ -90,14 +92,14 @@ query (void)
{
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (unused)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_INT32, "height", "Resolution in pixels" },
{ GIMP_PDB_INT32, "limit", "If true, limit line width" }
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (unused)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_INT32, "height", "Resolution in pixels" },
{ GIMP_PDB_INT32, "limit", "If true, limit line width" }
};
gimp_install_procedure ("plug_in_engrave",
gimp_install_procedure (PLUG_IN_PROC,
"Engrave the contents of the specified drawable",
"Creates a black-and-white 'engraved' version of an image as seen in old illustrations",
"Spencer Kimball & Peter Mattis, Eiichi Takamori, Torsten Martinsen",
@ -109,7 +111,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_engrave", "<Image>/Filters/Distorts");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Distorts");
}
static void
@ -142,7 +144,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
/* Possibly retrieve data */
gimp_get_data ("plug_in_engrave", &pvals);
gimp_get_data (PLUG_IN_PROC, &pvals);
/* First acquire information with a dialog */
if (!engrave_dialog (drawable))
@ -168,7 +170,7 @@ run (const gchar *name,
case GIMP_RUN_WITH_LAST_VALS:
/* Possibly retrieve data */
gimp_get_data ("plug_in_engrave", &pvals);
gimp_get_data (PLUG_IN_PROC, &pvals);
break;
default:
@ -186,7 +188,7 @@ run (const gchar *name,
/* Store data */
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_set_data ("plug_in_engrave", &pvals, sizeof (EngraveValues));
gimp_set_data (PLUG_IN_PROC, &pvals, sizeof (EngraveValues));
}
values[0].data.d_status = status;
@ -204,11 +206,11 @@ engrave_dialog (GimpDrawable *drawable)
GtkObject *adj;
gboolean run;
gimp_ui_init ("engrave", FALSE);
gimp_ui_init (PLUG_IN_BINARY, FALSE);
dialog = gimp_dialog_new (_("Engrave"), "engrave",
dialog = gimp_dialog_new (_("Engrave"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "plug-in-engrave",
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -216,9 +218,9 @@ engrave_dialog (GimpDrawable *drawable)
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
main_vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);

View File

@ -43,8 +43,10 @@
#include "libgimp/stdplugins-intl.h"
#define SCALE_WIDTH 128
#define PREVIEW_SIZE 128
#define PLUG_IN_PROC "plug-in-exchange"
#define PLUG_IN_BINARY "exchange"
#define SCALE_WIDTH 128
#define PREVIEW_SIZE 128
/* datastructure to store parameters in */
typedef struct
@ -103,21 +105,21 @@ query (void)
{
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_INT8, "fromred", "Red value (from)" },
{ GIMP_PDB_INT8, "fromgreen", "Green value (from)" },
{ GIMP_PDB_INT8, "fromblue", "Blue value (from)" },
{ GIMP_PDB_INT8, "tored", "Red value (to)" },
{ GIMP_PDB_INT8, "togreen", "Green value (to)" },
{ GIMP_PDB_INT8, "toblue", "Blue value (to)" },
{ GIMP_PDB_INT8, "red_threshold", "Red threshold" },
{ GIMP_PDB_INT8, "green_threshold", "Green threshold" },
{ GIMP_PDB_INT8, "blue_threshold", "Blue threshold" }
{ GIMP_PDB_INT32, "run-mode", "Interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_INT8, "from-red", "Red value (from)" },
{ GIMP_PDB_INT8, "from-green", "Green value (from)" },
{ GIMP_PDB_INT8, "from-blue", "Blue value (from)" },
{ GIMP_PDB_INT8, "to-red", "Red value (to)" },
{ GIMP_PDB_INT8, "to-green", "Green value (to)" },
{ GIMP_PDB_INT8, "to-blue", "Blue value (to)" },
{ GIMP_PDB_INT8, "red-threshold", "Red threshold" },
{ GIMP_PDB_INT8, "green-threshold", "Green threshold" },
{ GIMP_PDB_INT8, "blue-threshold", "Blue threshold" }
};
gimp_install_procedure ("plug_in_exchange",
gimp_install_procedure (PLUG_IN_PROC,
"Color Exchange",
"Exchange one color with another, optionally setting a threshold "
"to convert from one shade to another",
@ -130,7 +132,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_exchange", "<Image>/Filters/Colors/Map");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Colors/Map");
}
/* main function */
@ -161,7 +163,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
/* retrieve stored arguments (if any) */
gimp_get_data ("plug_in_exchange", &xargs);
gimp_get_data (PLUG_IN_PROC, &xargs);
/* initialize using foreground color */
gimp_context_get_foreground (&xargs.from);
@ -170,7 +172,7 @@ run (const gchar *name,
break;
case GIMP_RUN_WITH_LAST_VALS:
gimp_get_data ("plug_in_exchange", &xargs);
gimp_get_data (PLUG_IN_PROC, &xargs);
/*
* instead of recalling the last-set values,
* run with the current foreground as 'from'
@ -217,7 +219,7 @@ run (const gchar *name,
/* store our settings */
if (runmode == GIMP_RUN_INTERACTIVE)
gimp_set_data ("plug_in_exchange", &xargs, sizeof (myParams));
gimp_set_data (PLUG_IN_PROC, &xargs, sizeof (myParams));
/* and flush */
if (runmode != GIMP_RUN_NONINTERACTIVE)
@ -281,12 +283,11 @@ exchange_dialog (GimpDrawable *drawable)
gint framenumber;
gboolean run;
gimp_ui_init ("exchange", TRUE);
gimp_ui_init (PLUG_IN_BINARY, TRUE);
/* set up the dialog */
dialog = gimp_dialog_new (_("Color Exchange"), "exchange",
dialog = gimp_dialog_new (_("Color Exchange"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "plug-in-exchange",
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -294,9 +295,9 @@ exchange_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);
/* do some boxes here */
main_vbox = gtk_vbox_new (FALSE, 12);
@ -472,7 +473,6 @@ exchange_dialog (GimpDrawable *drawable)
G_CALLBACK (gimp_preview_invalidate),
preview);
scale = GTK_WIDGET (GIMP_SCALE_ENTRY_SCALE (adj));
gtk_range_set_update_policy (GTK_RANGE (scale), GTK_UPDATE_DELAYED);
gtk_size_group_add_widget (group, GIMP_SCALE_ENTRY_LABEL (adj));

View File

@ -32,6 +32,9 @@
#include "libgimp/stdplugins-intl.h"
#define PLUG_IN_PROC "plug-in-film"
#define PLUG_IN_BINARY "film"
/* Maximum number of pictures per film */
#define MAX_FILM_PICTURES 64
#define COLOR_BUTTON_WIDTH 50
@ -207,26 +210,26 @@ query (void)
{
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (only used as default image in interactive mode)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable (not used)" },
{ GIMP_PDB_INT32, "film_height", "Height of film (0: fit to images)" },
{ GIMP_PDB_COLOR, "film_color", "Color of the film" },
{ GIMP_PDB_INT32, "number_start", "Start index for numbering" },
{ GIMP_PDB_STRING, "number_font", "Font for drawing numbers" },
{ GIMP_PDB_COLOR, "number_color", "Color for numbers" },
{ GIMP_PDB_INT32, "at_top", "Flag for drawing numbers at top of film" },
{ GIMP_PDB_INT32, "at_bottom", "Flag for drawing numbers at bottom of film" },
{ GIMP_PDB_INT32, "num_images", "Number of images to be used for film" },
{ GIMP_PDB_INT32ARRAY, "image_ids", "num_images image IDs to be used for film"}
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (only used as default image in interactive mode)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable (not used)" },
{ GIMP_PDB_INT32, "film-height", "Height of film (0: fit to images)" },
{ GIMP_PDB_COLOR, "film-color", "Color of the film" },
{ GIMP_PDB_INT32, "number-start", "Start index for numbering" },
{ GIMP_PDB_STRING, "number-font", "Font for drawing numbers" },
{ GIMP_PDB_COLOR, "number-color", "Color for numbers" },
{ GIMP_PDB_INT32, "at-top", "Flag for drawing numbers at top of film" },
{ GIMP_PDB_INT32, "at-bottom", "Flag for drawing numbers at bottom of film" },
{ GIMP_PDB_INT32, "num-images", "Number of images to be used for film" },
{ GIMP_PDB_INT32ARRAY, "image-ids", "num_images image IDs to be used for film"}
};
static GimpParamDef return_vals[] =
{
{ GIMP_PDB_IMAGE, "new_image", "Output image" }
{ GIMP_PDB_IMAGE, "new-image", "Output image" }
};
gimp_install_procedure ("plug_in_film",
gimp_install_procedure (PLUG_IN_PROC,
"Compose several images to a roll film",
"Compose several images to a roll film",
"Peter Kirchgessner",
@ -239,7 +242,7 @@ query (void)
G_N_ELEMENTS (return_vals),
args, return_vals);
gimp_plugin_menu_register ("plug_in_film", "<Image>/Filters/Effects/Combine");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Effects/Combine");
}
static void
@ -270,7 +273,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
/* Possibly retrieve data */
gimp_get_data ("plug_in_film", &filmvals);
gimp_get_data (PLUG_IN_PROC, &filmvals);
/* First acquire information with a dialog */
if (! film_dialog (param[1].data.d_int32))
@ -305,7 +308,7 @@ run (const gchar *name,
case GIMP_RUN_WITH_LAST_VALS:
/* Possibly retrieve data */
gimp_get_data ("plug_in_film", &filmvals);
gimp_get_data (PLUG_IN_PROC, &filmvals);
break;
default:
@ -336,7 +339,7 @@ run (const gchar *name,
/* Store data */
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_set_data ("plug_in_film", &filmvals, sizeof (FilmVals));
gimp_set_data (PLUG_IN_PROC, &filmvals, sizeof (FilmVals));
}
values[0].data.d_status = status;
@ -1438,11 +1441,11 @@ film_dialog (gint32 image_ID)
GtkWidget *notebook;
gboolean run;
gimp_ui_init ("film", TRUE);
gimp_ui_init (PLUG_IN_BINARY, TRUE);
dlg = gimp_dialog_new (_("Filmstrip"), "film",
dlg = gimp_dialog_new (_("Filmstrip"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "plug-in-film",
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -1450,9 +1453,9 @@ film_dialog (gint32 image_ID)
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dlg),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
main_vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);

View File

@ -53,6 +53,9 @@
#include "libgimp/stdplugins-intl.h"
#define PLUG_IN_PROC "plug-in-flarefx"
#define PLUG_IN_BINARY "flarefx"
/* --- Typedefs --- */
typedef struct
{
@ -176,14 +179,14 @@ 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, "posx", "X-position" },
{ GIMP_PDB_INT32, "posy", "Y-position" }
{ GIMP_PDB_INT32, "pos-x", "X-position" },
{ GIMP_PDB_INT32, "pos-y", "Y-position" }
};
gimp_install_procedure ("plug_in_flarefx",
gimp_install_procedure (PLUG_IN_PROC,
"Add lens flare effects",
"Adds a lens flare effects. Makes your image look "
"like it was snapped with a cheap camera with a lot "
@ -197,7 +200,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_flarefx",
gimp_plugin_menu_register (PLUG_IN_PROC,
"<Image>/Filters/Light and Shadow/Light");
}
@ -230,7 +233,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
/* Possibly retrieve data */
gimp_get_data ("plug_in_flarefx", &fvals);
gimp_get_data (PLUG_IN_PROC, &fvals);
/* First acquire information with a dialog */
if (! flare_dialog (drawable))
@ -253,7 +256,7 @@ run (const gchar *name,
case GIMP_RUN_WITH_LAST_VALS:
/* Possibly retrieve data */
gimp_get_data ("plug_in_flarefx", &fvals);
gimp_get_data (PLUG_IN_PROC, &fvals);
break;
default:
@ -277,7 +280,7 @@ run (const gchar *name,
/* Store data */
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_set_data ("plug_in_flarefx", &fvals, sizeof (FlareValues));
gimp_set_data (PLUG_IN_PROC, &fvals, sizeof (FlareValues));
}
else
{
@ -301,11 +304,11 @@ flare_dialog (GimpDrawable *drawable)
GtkWidget *frame;
gboolean run;
gimp_ui_init ("flarefx", TRUE);
gimp_ui_init (PLUG_IN_BINARY, TRUE);
dialog = gimp_dialog_new (_("FlareFX"), "flarefx",
dialog = gimp_dialog_new (_("FlareFX"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, "plug-in-flarefx",
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
@ -313,9 +316,9 @@ flare_dialog (GimpDrawable *drawable)
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
main_vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);

View File

@ -30,6 +30,9 @@
#include "libgimp/stdplugins-intl.h"
#define PLUG_IN_PROC "plug-in-filter-pack"
#define PLUG_IN_BINARY "fp"
#define MAX_PREVIEW_SIZE 125
#define MAX_ROUGHNESS 128
#define RANGE_HEIGHT 15
@ -37,14 +40,12 @@
#define ALL 255
#define MARGIN 4
#define HELP_ID "plug-in-filter-pack"
#define RANGE_ADJUST_MASK GDK_EXPOSURE_MASK | \
GDK_ENTER_NOTIFY_MASK | \
GDK_BUTTON_PRESS_MASK | \
GDK_BUTTON_RELEASE_MASK | \
GDK_BUTTON1_MOTION_MASK | \
GDK_POINTER_MOTION_HINT_MASK
GDK_ENTER_NOTIFY_MASK | \
GDK_BUTTON_PRESS_MASK | \
GDK_BUTTON_RELEASE_MASK | \
GDK_BUTTON1_MOTION_MASK | \
GDK_POINTER_MOTION_HINT_MASK
typedef struct
@ -314,12 +315,12 @@ query (void)
{
GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (used for indexed images)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" }
};
gimp_install_procedure ("plug_in_filter_pack",
gimp_install_procedure (PLUG_IN_PROC,
"Allows the user to change H, S, or C with many previews",
"No help available",
"Pavel Grinfeld (pavel@ml.com)",
@ -331,7 +332,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_filter_pack", "<Image>/Filters/Colors");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Colors");
}
/********************************STANDARD RUN*************************/
@ -366,7 +367,7 @@ run (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
/* Possibly retrieve data */
gimp_get_data ("plug_in_filter_pack", &fpvals);
gimp_get_data (PLUG_IN_PROC, &fpvals);
if (gimp_drawable_is_indexed (drawable->drawable_id) ||
gimp_drawable_is_gray (drawable->drawable_id) )
@ -387,7 +388,7 @@ run (const gchar *name,
case GIMP_RUN_WITH_LAST_VALS:
/* Possibly retrieve data */
gimp_get_data ("plug_in_filter_pack", &fpvals);
gimp_get_data (PLUG_IN_PROC, &fpvals);
break;
default:
@ -405,8 +406,7 @@ run (const gchar *name,
/* Store data */
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_set_data ("plug_in_filter_pack",
&fpvals, sizeof (FPValues));
gimp_set_data (PLUG_IN_PROC, &fpvals, sizeof (FPValues));
gimp_displays_flush ();
}
@ -569,7 +569,7 @@ fp_create_circle_palette (void)
win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gimp_help_connect (win, gimp_standard_help_func, HELP_ID, NULL);
gimp_help_connect (win, gimp_standard_help_func, PLUG_IN_PROC, NULL);
gtk_window_set_title (GTK_WINDOW (win), _("Hue Variations"));
@ -724,7 +724,7 @@ fp_create_lnd (void)
win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gimp_help_connect (win, gimp_standard_help_func, HELP_ID, NULL);
gimp_help_connect (win, gimp_standard_help_func, PLUG_IN_PROC, NULL);
gtk_window_set_title (GTK_WINDOW (win), _("Value Variations"));
@ -768,7 +768,7 @@ fp_create_msnls (void)
win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gimp_help_connect (win, gimp_standard_help_func, HELP_ID, NULL);
gimp_help_connect (win, gimp_standard_help_func, PLUG_IN_PROC, NULL);
gtk_window_set_title (GTK_WINDOW (win), _("Saturation Variations"));
@ -1175,11 +1175,11 @@ fp_dialog (void)
fpvals.preview_size,
fpvals.selection_only);
gimp_ui_init ("fp", TRUE);
gimp_ui_init (PLUG_IN_BINARY, TRUE);
dlg = gimp_dialog_new (_("Filter Pack Simulation"), "fp",
dlg = gimp_dialog_new (_("Filter Pack Simulation"), PLUG_IN_BINARY,
NULL, 0,
gimp_standard_help_func, HELP_ID,
gimp_standard_help_func, PLUG_IN_PROC,
GIMP_STOCK_RESET, RESPONSE_RESET,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
@ -1304,7 +1304,7 @@ fp_advanced_dialog (void)
AW.window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gimp_help_connect (AW.window, gimp_standard_help_func, HELP_ID, NULL);
gimp_help_connect (AW.window, gimp_standard_help_func, PLUG_IN_PROC, NULL);
gtk_window_set_title (GTK_WINDOW (AW.window),
_("Advanced Filter Pack Options"));

View File

@ -21,9 +21,9 @@
******************************************************************************/
#define PLUG_IN_NAME "plug_in_fractal_trace"
#define PLUG_IN_PROC "plug-in-fractal-trace"
#define PLUG_IN_BINARY "fractaltrace"
#define PLUG_IN_VERSION "v0.4 test version (Dec. 25 1997)"
#define HELP_ID "plug-in-fractal-trace"
/*****************************************************************************/
@ -112,7 +112,7 @@ query (void)
"(0=WRAP/1=TRANS/2=BLACK/3=WHITE)" }
};
gimp_install_procedure (PLUG_IN_NAME,
gimp_install_procedure (PLUG_IN_PROC,
"transform image with the Mandelbrot Fractal",
"transform image with the Mandelbrot Fractal",
"Hirotsuna Mizuno <s1041150@u-aizu.ac.jp>",
@ -124,7 +124,7 @@ query (void)
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register (PLUG_IN_NAME, "<Image>/Filters/Map");
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Map");
}
/******************************************************************************/
@ -195,17 +195,17 @@ run (const gchar *name,
switch (run_mode)
{
case GIMP_RUN_WITH_LAST_VALS:
gimp_get_data (PLUG_IN_NAME, &parameters);
gimp_get_data (PLUG_IN_PROC, &parameters);
break;
case GIMP_RUN_INTERACTIVE:
gimp_get_data (PLUG_IN_NAME, &parameters);
gimp_get_data (PLUG_IN_PROC, &parameters);
if (!dialog_show ())
{
status = GIMP_PDB_EXECUTION_ERROR;
break;
}
gimp_set_data (PLUG_IN_NAME, &parameters, sizeof (parameter_t));
gimp_set_data (PLUG_IN_PROC, &parameters, sizeof (parameter_t));
break;
case GIMP_RUN_NONINTERACTIVE:
@ -682,11 +682,11 @@ dialog_show (void)
GtkObject *adj;
gboolean run;
gimp_ui_init ("fractaltrace", TRUE);
gimp_ui_init (PLUG_IN_BINARY, TRUE);
dialog = gimp_dialog_new (_("Fractal Trace"), "fractaltrace",
dialog = gimp_dialog_new (_("Fractal Trace"), 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,
@ -694,9 +694,9 @@ dialog_show (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);
mainbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (mainbox), 12);