Commit ee0ebc09 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

made it a GObject. Removed member "static_proc". Renamed

2006-04-04  Michael Natterer  <mitch@gimp.org>

	* app/pdb/gimpprocedure.[ch]: made it a GObject. Removed member
	"static_proc". Renamed gimp_procedure_init() to
	gimp_procedure_initialize().

	* app/pdb/gimp-pdb.c
	* app/plug-in/plug-in-message.c
	* app/plug-in/plug-in-proc-def.c
	* app/plug-in/plug-in-rc.c
	* app/xcf/xcf.c: changed accordingly.

	* tools/pdbgen/app.pl: register all internal procs
	dynamically. The static proc structs are gone.

	* tools/pdbgen/pdb/fileops.pdb: cosmetic change.

	* app/pdb/*_cmds.c: regenerated.
parent ef505d97
2006-04-04 Michael Natterer <mitch@gimp.org>
* app/pdb/gimpprocedure.[ch]: made it a GObject. Removed member
"static_proc". Renamed gimp_procedure_init() to
gimp_procedure_initialize().
* app/pdb/gimp-pdb.c
* app/plug-in/plug-in-message.c
* app/plug-in/plug-in-proc-def.c
* app/plug-in/plug-in-rc.c
* app/xcf/xcf.c: changed accordingly.
* tools/pdbgen/app.pl: register all internal procs
dynamically. The static proc structs are gone.
* tools/pdbgen/pdb/fileops.pdb: cosmetic change.
* app/pdb/*_cmds.c: regenerated.
2006-04-04 Michael Natterer <mitch@gimp.org>
* app/pdb/Makefile.am
......
This diff is collapsed.
......@@ -31,114 +31,6 @@
#include "core/gimp.h"
#include "core/gimpdatafactory.h"
static GimpProcedure brushes_popup_proc;
static GimpProcedure brushes_close_popup_proc;
static GimpProcedure brushes_set_popup_proc;
void
register_brush_select_procs (Gimp *gimp)
{
GimpProcedure *procedure;
/*
* brushes_popup
*/
procedure = gimp_procedure_init (&brushes_popup_proc, 6, 0);
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("brush-callback",
"brush callback",
"The callback PDB proc to call when brush selection is made",
FALSE, FALSE,
NULL,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("popup-title",
"popup title",
"Title to give the brush popup window",
FALSE, FALSE,
NULL,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("initial-brush",
"initial brush",
"The name of the brush to set as the first selected",
FALSE, TRUE,
NULL,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("opacity",
"opacity",
"The initial opacity of the brush",
0, 100, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("spacing",
"spacing",
"The initial spacing of the brush (if < 0 then use brush default spacing)",
G_MININT32, 1000, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_enum ("paint-mode",
"paint mode",
"The initial paint mode: { GIMP_NORMAL_MODE (0), GIMP_DISSOLVE_MODE (1), GIMP_BEHIND_MODE (2), GIMP_MULTIPLY_MODE (3), GIMP_SCREEN_MODE (4), GIMP_OVERLAY_MODE (5), GIMP_DIFFERENCE_MODE (6), GIMP_ADDITION_MODE (7), GIMP_SUBTRACT_MODE (8), GIMP_DARKEN_ONLY_MODE (9), GIMP_LIGHTEN_ONLY_MODE (10), GIMP_HUE_MODE (11), GIMP_SATURATION_MODE (12), GIMP_COLOR_MODE (13), GIMP_VALUE_MODE (14), GIMP_DIVIDE_MODE (15), GIMP_DODGE_MODE (16), GIMP_BURN_MODE (17), GIMP_HARDLIGHT_MODE (18), GIMP_SOFTLIGHT_MODE (19), GIMP_GRAIN_EXTRACT_MODE (20), GIMP_GRAIN_MERGE_MODE (21), GIMP_COLOR_ERASE_MODE (22) }",
GIMP_TYPE_LAYER_MODE_EFFECTS,
GIMP_NORMAL_MODE,
GIMP_PARAM_READWRITE));
gimp_pdb_register (gimp, procedure);
/*
* brushes_close_popup
*/
procedure = gimp_procedure_init (&brushes_close_popup_proc, 1, 0);
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("brush-callback",
"brush callback",
"The name of the callback registered for this popup",
FALSE, FALSE,
NULL,
GIMP_PARAM_READWRITE));
gimp_pdb_register (gimp, procedure);
/*
* brushes_set_popup
*/
procedure = gimp_procedure_init (&brushes_set_popup_proc, 5, 0);
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("brush-callback",
"brush callback",
"The name of the callback registered for this popup",
FALSE, FALSE,
NULL,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("brush-name",
"brush name",
"The name of the brush to set as selected",
FALSE, FALSE,
NULL,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("opacity",
"opacity",
"The initial opacity of the brush",
0, 100, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("spacing",
"spacing",
"The initial spacing of the brush (if < 0 then use brush default spacing)",
G_MININT32, 1000, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_enum ("paint-mode",
"paint mode",
"The initial paint mode: { GIMP_NORMAL_MODE (0), GIMP_DISSOLVE_MODE (1), GIMP_BEHIND_MODE (2), GIMP_MULTIPLY_MODE (3), GIMP_SCREEN_MODE (4), GIMP_OVERLAY_MODE (5), GIMP_DIFFERENCE_MODE (6), GIMP_ADDITION_MODE (7), GIMP_SUBTRACT_MODE (8), GIMP_DARKEN_ONLY_MODE (9), GIMP_LIGHTEN_ONLY_MODE (10), GIMP_HUE_MODE (11), GIMP_SATURATION_MODE (12), GIMP_COLOR_MODE (13), GIMP_VALUE_MODE (14), GIMP_DIVIDE_MODE (15), GIMP_DODGE_MODE (16), GIMP_BURN_MODE (17), GIMP_HARDLIGHT_MODE (18), GIMP_SOFTLIGHT_MODE (19), GIMP_GRAIN_EXTRACT_MODE (20), GIMP_GRAIN_MERGE_MODE (21), GIMP_COLOR_ERASE_MODE (22) }",
GIMP_TYPE_LAYER_MODE_EFFECTS,
GIMP_NORMAL_MODE,
GIMP_PARAM_READWRITE));
gimp_pdb_register (gimp, procedure);
}
static GValueArray *
brushes_popup_invoker (GimpProcedure *procedure,
......@@ -178,22 +70,6 @@ brushes_popup_invoker (GimpProcedure *procedure,
return gimp_procedure_get_return_values (procedure, success);
}
static GimpProcedure brushes_popup_proc =
{
TRUE, TRUE,
"gimp-brushes-popup",
"gimp-brushes-popup",
"Invokes the Gimp brush selection.",
"This procedure popups the brush selection dialog.",
"Andy Thomas",
"Andy Thomas",
"1998",
NULL,
GIMP_INTERNAL,
0, NULL, 0, NULL,
{ { brushes_popup_invoker } }
};
static GValueArray *
brushes_close_popup_invoker (GimpProcedure *procedure,
Gimp *gimp,
......@@ -218,22 +94,6 @@ brushes_close_popup_invoker (GimpProcedure *procedure,
return gimp_procedure_get_return_values (procedure, success);
}
static GimpProcedure brushes_close_popup_proc =
{
TRUE, TRUE,
"gimp-brushes-close-popup",
"gimp-brushes-close-popup",
"Popdown the Gimp brush selection.",
"This procedure closes an opened brush selection dialog.",
"Andy Thomas",
"Andy Thomas",
"1998",
NULL,
GIMP_INTERNAL,
0, NULL, 0, NULL,
{ { brushes_close_popup_invoker } }
};
static GValueArray *
brushes_set_popup_invoker (GimpProcedure *procedure,
Gimp *gimp,
......@@ -270,18 +130,143 @@ brushes_set_popup_invoker (GimpProcedure *procedure,
return gimp_procedure_get_return_values (procedure, success);
}
static GimpProcedure brushes_set_popup_proc =
void
register_brush_select_procs (Gimp *gimp)
{
TRUE, TRUE,
"gimp-brushes-set-popup",
"gimp-brushes-set-popup",
"Sets the current brush selection in a popup.",
"Sets the current brush selection in a popup.",
"Andy Thomas",
"Andy Thomas",
"1998",
NULL,
GIMP_INTERNAL,
0, NULL, 0, NULL,
{ { brushes_set_popup_invoker } }
};
GimpProcedure *procedure;
/*
* gimp-brushes-popup
*/
procedure = gimp_procedure_new ();
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 6, 0,
brushes_popup_invoker);
gimp_procedure_set_static_strings (procedure,
"gimp-brushes-popup",
"gimp-brushes-popup",
"Invokes the Gimp brush selection.",
"This procedure popups the brush selection dialog.",
"Andy Thomas",
"Andy Thomas",
"1998",
NULL);
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("brush-callback",
"brush callback",
"The callback PDB proc to call when brush selection is made",
FALSE, FALSE,
NULL,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("popup-title",
"popup title",
"Title to give the brush popup window",
FALSE, FALSE,
NULL,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("initial-brush",
"initial brush",
"The name of the brush to set as the first selected",
FALSE, TRUE,
NULL,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("opacity",
"opacity",
"The initial opacity of the brush",
0, 100, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("spacing",
"spacing",
"The initial spacing of the brush (if < 0 then use brush default spacing)",
G_MININT32, 1000, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_enum ("paint-mode",
"paint mode",
"The initial paint mode: { GIMP_NORMAL_MODE (0), GIMP_DISSOLVE_MODE (1), GIMP_BEHIND_MODE (2), GIMP_MULTIPLY_MODE (3), GIMP_SCREEN_MODE (4), GIMP_OVERLAY_MODE (5), GIMP_DIFFERENCE_MODE (6), GIMP_ADDITION_MODE (7), GIMP_SUBTRACT_MODE (8), GIMP_DARKEN_ONLY_MODE (9), GIMP_LIGHTEN_ONLY_MODE (10), GIMP_HUE_MODE (11), GIMP_SATURATION_MODE (12), GIMP_COLOR_MODE (13), GIMP_VALUE_MODE (14), GIMP_DIVIDE_MODE (15), GIMP_DODGE_MODE (16), GIMP_BURN_MODE (17), GIMP_HARDLIGHT_MODE (18), GIMP_SOFTLIGHT_MODE (19), GIMP_GRAIN_EXTRACT_MODE (20), GIMP_GRAIN_MERGE_MODE (21), GIMP_COLOR_ERASE_MODE (22) }",
GIMP_TYPE_LAYER_MODE_EFFECTS,
GIMP_NORMAL_MODE,
GIMP_PARAM_READWRITE));
gimp_pdb_register (gimp, procedure);
/*
* gimp-brushes-close-popup
*/
procedure = gimp_procedure_new ();
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
brushes_close_popup_invoker);
gimp_procedure_set_static_strings (procedure,
"gimp-brushes-close-popup",
"gimp-brushes-close-popup",
"Popdown the Gimp brush selection.",
"This procedure closes an opened brush selection dialog.",
"Andy Thomas",
"Andy Thomas",
"1998",
NULL);
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("brush-callback",
"brush callback",
"The name of the callback registered for this popup",
FALSE, FALSE,
NULL,
GIMP_PARAM_READWRITE));
gimp_pdb_register (gimp, procedure);
/*
* gimp-brushes-set-popup
*/
procedure = gimp_procedure_new ();
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 5, 0,
brushes_set_popup_invoker);
gimp_procedure_set_static_strings (procedure,
"gimp-brushes-set-popup",
"gimp-brushes-set-popup",
"Sets the current brush selection in a popup.",
"Sets the current brush selection in a popup.",
"Andy Thomas",
"Andy Thomas",
"1998",
NULL);
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("brush-callback",
"brush callback",
"The name of the callback registered for this popup",
FALSE, FALSE,
NULL,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("brush-name",
"brush name",
"The name of the brush to set as selected",
FALSE, FALSE,
NULL,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("opacity",
"opacity",
"The initial opacity of the brush",
0, 100, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("spacing",
"spacing",
"The initial spacing of the brush (if < 0 then use brush default spacing)",
G_MININT32, 1000, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_enum ("paint-mode",
"paint mode",
"The initial paint mode: { GIMP_NORMAL_MODE (0), GIMP_DISSOLVE_MODE (1), GIMP_BEHIND_MODE (2), GIMP_MULTIPLY_MODE (3), GIMP_SCREEN_MODE (4), GIMP_OVERLAY_MODE (5), GIMP_DIFFERENCE_MODE (6), GIMP_ADDITION_MODE (7), GIMP_SUBTRACT_MODE (8), GIMP_DARKEN_ONLY_MODE (9), GIMP_LIGHTEN_ONLY_MODE (10), GIMP_HUE_MODE (11), GIMP_SATURATION_MODE (12), GIMP_COLOR_MODE (13), GIMP_VALUE_MODE (14), GIMP_DIVIDE_MODE (15), GIMP_DODGE_MODE (16), GIMP_BURN_MODE (17), GIMP_HARDLIGHT_MODE (18), GIMP_SOFTLIGHT_MODE (19), GIMP_GRAIN_EXTRACT_MODE (20), GIMP_GRAIN_MERGE_MODE (21), GIMP_COLOR_ERASE_MODE (22) }",
GIMP_TYPE_LAYER_MODE_EFFECTS,
GIMP_NORMAL_MODE,
GIMP_PARAM_READWRITE));
gimp_pdb_register (gimp, procedure);
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -35,91 +35,6 @@
#include "core/gimpimage.h"
#include "core/gimppalette.h"
static GimpProcedure image_convert_rgb_proc;
static GimpProcedure image_convert_grayscale_proc;
static GimpProcedure image_convert_indexed_proc;
void
register_convert_procs (Gimp *gimp)
{
GimpProcedure *procedure;
/*
* image_convert_rgb
*/
procedure = gimp_procedure_init (&image_convert_rgb_proc, 1, 0);
gimp_procedure_add_argument (procedure,
gimp_param_spec_image_id ("image",
"image",
"The image",
gimp,
GIMP_PARAM_READWRITE));
gimp_pdb_register (gimp, procedure);
/*
* image_convert_grayscale
*/
procedure = gimp_procedure_init (&image_convert_grayscale_proc, 1, 0);
gimp_procedure_add_argument (procedure,
gimp_param_spec_image_id ("image",
"image",
"The image",
gimp,
GIMP_PARAM_READWRITE));
gimp_pdb_register (gimp, procedure);
/*
* image_convert_indexed
*/
procedure = gimp_procedure_init (&image_convert_indexed_proc, 7, 0);
gimp_procedure_add_argument (procedure,
gimp_param_spec_image_id ("image",
"image",
"The image",
gimp,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_enum ("dither-type",
"dither type",
"The dither type to use: { GIMP_NO_DITHER (0), GIMP_FS_DITHER (1), GIMP_FSLOWBLEED_DITHER (2), GIMP_FIXED_DITHER (3) }",
GIMP_TYPE_CONVERT_DITHER_TYPE,
GIMP_NO_DITHER,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_enum ("palette-type",
"palette type",
"The type of palette to use: { GIMP_MAKE_PALETTE (0), GIMP_REUSE_PALETTE (1), GIMP_WEB_PALETTE (2), GIMP_MONO_PALETTE (3), GIMP_CUSTOM_PALETTE (4) }",
GIMP_TYPE_CONVERT_PALETTE_TYPE,
GIMP_MAKE_PALETTE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("num-cols",
"num cols",
"The number of colors to quantize to, ignored unless (palette_type == GIMP_MAKE_PALETTE)",
G_MININT32, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("alpha-dither",
"alpha dither",
"Dither transparency to fake partial opacity",
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("remove-unused",
"remove unused",
"Remove unused or duplicate color entries from final palette, ignored if (palette_type == GIMP_MAKE_PALETTE)",
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("palette",
"palette",
"The name of the custom palette to use, ignored unless (palette_type == GIMP_CUSTOM_PALETTE)",
FALSE, FALSE,
NULL,
GIMP_PARAM_READWRITE));
gimp_pdb_register (gimp, procedure);
}
static GValueArray *
image_convert_rgb_invoker (GimpProcedure *procedure,
......@@ -144,22 +59,6 @@ image_convert_rgb_invoker (GimpProcedure *procedure,
return gimp_procedure_get_return_values (procedure, success);
}
static GimpProcedure image_convert_rgb_proc =
{
TRUE, TRUE,
"gimp-image-convert-rgb",
"gimp-image-convert-rgb",
"Convert specified image to RGB color",
"This procedure converts the specified image to RGB color. This process requires an image of type GIMP_GRAY or GIMP_INDEXED. No image content is lost in this process aside from the colormap for an indexed image.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
NULL,
GIMP_INTERNAL,
0, NULL, 0, NULL,
{ { image_convert_rgb_invoker } }
};
static GValueArray *
image_convert_grayscale_invoker (GimpProcedure *procedure,
Gimp *gimp,
......@@ -183,22 +82,6 @@ image_convert_grayscale_invoker (GimpProcedure *procedure,
return gimp_procedure_get_return_values (procedure, success);
}
static GimpProcedure image_convert_grayscale_proc =
{
TRUE, TRUE,
"gimp-image-convert-grayscale",
"gimp-image-convert-grayscale",
"Convert specified image to grayscale (256 intensity levels)",
"This procedure converts the specified image to grayscale with 8 bits per pixel (256 intensity levels). This process requires an image of type GIMP_RGB or GIMP_INDEXED.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
NULL,
GIMP_INTERNAL,
0, NULL, 0, NULL,
{ { image_convert_grayscale_invoker } }
};
static GValueArray *
image_convert_indexed_invoker (GimpProcedure *procedure,
Gimp *gimp,
......@@ -260,18 +143,120 @@ image_convert_indexed_invoker (GimpProcedure *procedure,
return gimp_procedure_get_return_values (procedure, success);
}
static GimpProcedure image_convert_indexed_proc =
void
register_convert_procs (Gimp *gimp)
{
TRUE, TRUE,
"gimp-image-convert-indexed",
"gimp-image-convert-indexed",
"Convert specified image to and Indexed image",
"This procedure converts the specified image to 'indexed' color. This process requires an image of type GIMP_GRAY or GIMP_RGB. The 'palette_type' specifies what kind of palette to use, A type of '0' means to use an optimal palette of 'num_cols' generated from the colors in the image. A type of '1' means to re-use the previous palette (not currently implemented). A type of '2' means to use the so-called WWW-optimized palette. Type '3' means to use only black and white colors. A type of '4' means to use a palette from the gimp palettes directories. The 'dither type' specifies what kind of dithering to use. '0' means no dithering, '1' means standard Floyd-Steinberg error diffusion, '2' means Floyd-Steinberg error diffusion with reduced bleeding, '3' means dithering based on pixel location ('Fixed' dithering).",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
NULL,
GIMP_INTERNAL,
0, NULL, 0, NULL,
{ { image_convert_indexed_invoker } }
};
GimpProcedure *procedure;
/*
* gimp-image-convert-rgb
*/
procedure = gimp_procedure_new ();
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
image_convert_rgb_invoker);
gimp_procedure_set_static_strings (procedure,
"gimp-image-convert-rgb",
"gimp-image-convert-rgb",
"Convert specified image to RGB color",
"This procedure converts the specified image to RGB color. This process requires an image of type GIMP_GRAY or GIMP_INDEXED. No image content is lost in this process aside from the colormap for an indexed image.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
NULL);
gimp_procedure_add_argument (procedure,
gimp_param_spec_image_id ("image",
"image",
"The image",
gimp,
GIMP_PARAM_READWRITE));
gimp_pdb_register (gimp, procedure);
/*
* gimp-image-convert-grayscale
*/
procedure = gimp_procedure_new ();
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
image_convert_grayscale_invoker);
gimp_procedure_set_static_strings (procedure,
"gimp-image-convert-grayscale",
"gimp-image-convert-grayscale",
"Convert specified image to grayscale (256 intensity levels)",
"This procedure converts the specified image to grayscale with 8 bits per pixel (256 intensity levels). This process requires an image of type GIMP_RGB or GIMP_INDEXED.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
NULL);
gimp_procedure_add_argument (procedure,
gimp_param_spec_image_id ("image",
"image",
"The image",
gimp,
GIMP_PARAM_READWRITE));
gimp_pdb_register (gimp, procedure);
/*
* gimp-image-convert-indexed
*/
procedure = gimp_procedure_new ();
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 7, 0,
image_convert_indexed_invoker);
gimp_procedure_set_static_strings (procedure,
"gimp-image-convert-indexed",
"gimp-image-convert-indexed",
"Convert specified image to and Indexed image",
"This procedure converts the specified image to 'indexed' color. This process requires an image of type GIMP_GRAY or GIMP_RGB. The 'palette_type' specifies what kind of palette to use, A type of '0' means to use an optimal palette of 'num_cols' generated from the colors in the image. A type of '1' means to re-use the previous palette (not currently implemented). A type of '2' means to use the so-called WWW-optimized palette. Type '3' means to use only black and white colors. A type of '4' means to use a palette from the gimp palettes directories. The 'dither type' specifies what kind of dithering to use. '0' means no dithering, '1' means standard Floyd-Steinberg error diffusion, '2' means Floyd-Steinberg error diffusion with reduced bleeding, '3' means dithering based on pixel location ('Fixed' dithering).",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
NULL);
gimp_procedure_add_argument (procedure,
gimp_param_spec_image_id ("image",
"image",
"The image",
gimp,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_enum ("dither-type",
"dither type",
"The dither type to use: { GIMP_NO_DITHER (0), GIMP_FS_DITHER (1), GIMP_FSLOWBLEED_DITHER (2), GIMP_FIXED_DITHER (3) }",
GIMP_TYPE_CONVERT_DITHER_TYPE,
GIMP_NO_DITHER,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_enum ("palette-type",
"palette type",
"The type of palette to use: { GIMP_MAKE_PALETTE (0), GIMP_REUSE_PALETTE (1), GIMP_WEB_PALETTE (2), GIMP_MONO_PALETTE (3), GIMP_CUSTOM_PALETTE (4) }",
GIMP_TYPE_CONVERT_PALETTE_TYPE,
GIMP_MAKE_PALETTE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("num-cols",
"num cols",
"The number of colors to quantize to, ignored unless (palette_type == GIMP_MAKE_PALETTE)",
G_MININT32, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("alpha-dither",
"alpha dither",
"Dither transparency to fake partial opacity",
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("remove-unused",
"remove unused",
"Remove unused or duplicate color entries from final palette, ignored if (palette_type == GIMP_MAKE_PALETTE)",
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("palette",
"palette",
"The name of the custom palette to use, ignored unless (palette_type == GIMP_CUSTOM_PALETTE)",
FALSE, FALSE,
NULL,
GIMP_PARAM_READWRITE));
gimp_pdb_register (gimp, procedure);
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -160,10 +160,19 @@ gimp_pdb_init_procs (Gimp *gimp)
{ "gimp-layer-set-preserve-trans", "gimp-drawable-set-lock-alpha" }
};
GTimer *timer;
g_return_if_fail (GIMP_IS_GIMP (gimp));
timer = g_timer_new ();
g_timer_start (timer);
internal_procs_init (gimp);
g_printerr ("internal_procs_init took %f secs\n",
g_timer_elapsed (timer, NULL));
g_timer_destroy (timer);
if (gimp->pdb_compat_mode != GIMP_PDB_COMPAT_OFF)
{
gint i;
......@@ -245,7 +254,6 @@ gimp_pdb_execute (Gimp *gimp,
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
g_return_val_if_fail (procedure_name != NULL, NULL);
g_return_val_if_fail (args != NULL, NULL);
list = g_hash_table_lookup (gimp->procedural_ht, procedure_name);
......@@ -260,6 +268,8 @@ gimp_pdb_execute (Gimp *gimp,
return return_vals;
}
g_return_val_if_fail (args != NULL, NULL);
for (; list; list = g_list_next (list))
{
GimpProcedure *procedure = list->data;
......@@ -392,7 +402,7 @@ gimp_pdb_free_entry (gpointer key,
{
if (value)
{
g_list_foreach (value, (GFunc) gimp_procedure_free, NULL);
g_list_foreach (value, (GFunc) g_object_unref, NULL);
g_list_free (value);
}
}
......@@ -160,10 +160,19 @@ gimp_pdb_init_procs (Gimp *gimp)
{ "gimp-layer-set-preserve-trans", "gimp-drawable-set-lock-alpha" }
};
GTimer *timer;
g_return_if_fail (GIMP_IS_GIMP (gimp));
timer = g_timer_new ();
g_timer_start (timer);
internal_procs_init (gimp);
g_printerr ("internal_procs_init took %f secs\n",
g_timer_elapsed (timer, NULL));
g_timer_destroy (timer);
if (gimp->pdb_compat_mode != GIMP_PDB_COMPAT_OFF)
{
gint i;
......@@ -245,7 +254,6 @@ gimp_pdb_execute (Gimp *gimp,
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
g_return_val_if_fail (procedure_name != NULL, NULL);
g_return_val_if_fail (args != NULL, NULL);
list = g_hash_table_lookup (gimp->procedural_ht, procedure_name);
......@@ -260,6 +268,8 @@ gimp_pdb_execute (Gimp *gimp,
return return_vals;
}
g_return_val_if_fail (args != NULL, NULL);
for (; list; list = g_list_next (list))
{
GimpProcedure *procedure = list->data;
......@@ -392,7 +402,7 @@ gimp_pdb_free_entry (gpointer key,
{
if (value)