remove lots of perl crack: - create almost all parameter arrays manually

2006-03-14  Michael Natterer  <mitch@gimp.org>

	* tools/pdbgen/pdb/*.pdb: remove lots of perl crack:
	- create almost	all parameter arrays manually instead of
	  generating them from utility functions
	- removed lots of other utility functions
	- moved variable declarations into the enclosed code snippets
	  where possible
	- some cleanup and API doc fixes

	* tools/pdbgen/stddefs.pdb: added some perl crack:
	define utility functions for all contributors which own more than
	some functions, so they can change their names and email addresses
	at a central place.

	* app/pdb/[many].c: regenerated.

	* libgimp/gimpcolor_pdb.c
	* libgimp/gimpdrawabletransform_pdb.c
	* libgimp/gimptransformtools_pdb.c
	* libgimp/gimpvectors_pdb.c: ditto. Changed affect only API docs.
This commit is contained in:
Michael Natterer 2006-03-14 21:35:50 +00:00 committed by Michael Natterer
parent d845e06893
commit 2ff56f8dee
82 changed files with 2519 additions and 2653 deletions

View File

@ -1,3 +1,25 @@
2006-03-14 Michael Natterer <mitch@gimp.org>
* tools/pdbgen/pdb/*.pdb: remove lots of perl crack:
- create almost all parameter arrays manually instead of
generating them from utility functions
- removed lots of other utility functions
- moved variable declarations into the enclosed code snippets
where possible
- some cleanup and API doc fixes
* tools/pdbgen/stddefs.pdb: added some perl crack:
define utility functions for all contributors which own more than
some functions, so they can change their names and email addresses
at a central place.
* app/pdb/[many].c: regenerated.
* libgimp/gimpcolor_pdb.c
* libgimp/gimpdrawabletransform_pdb.c
* libgimp/gimptransformtools_pdb.c
* libgimp/gimpvectors_pdb.c: ditto. Changed affect only API docs.
2006-03-13 Michael Natterer <mitch@gimp.org> 2006-03-13 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-guides.[ch]: added gimp_image_get_guide() and * app/core/gimpimage-guides.[ch]: added gimp_image_get_guide() and

View File

@ -287,7 +287,7 @@ static ProcRecord brush_is_generated_proc =
"gimp-brush-is-generated", "gimp-brush-is-generated",
"Tests if generated", "Tests if generated",
"Returns True if this brush is parametric, False for other types", "Returns True if this brush is parametric, False for other types",
"Bill Skaggs <weskaggs@primate.ucdavis.edu", "Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"Bill Skaggs", "Bill Skaggs",
"2004", "2004",
NULL, NULL,
@ -504,7 +504,7 @@ static ProcRecord brush_is_editable_proc =
"gimp-brush-is-editable", "gimp-brush-is-editable",
"Tests if brush can be edited", "Tests if brush can be edited",
"Returns True if you have permission to change the brush", "Returns True if you have permission to change the brush",
"Bill Skaggs <weskaggs@primate.ucdavis.edu", "Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"Bill Skaggs", "Bill Skaggs",
"2004", "2004",
NULL, NULL,
@ -855,7 +855,7 @@ static ProcRecord brush_set_spacing_proc =
"gimp-brush-set-spacing", "gimp-brush-set-spacing",
"Set the brush spacing.", "Set the brush spacing.",
"This procedure modifies the spacing setting for the specified brush. The value should be a integer between 0 and 1000.", "This procedure modifies the spacing setting for the specified brush. The value should be a integer between 0 and 1000.",
"Bill Skaggs <weskaggs@primate.ucdavis.edu", "Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"Bill Skaggs", "Bill Skaggs",
"2004", "2004",
NULL, NULL,
@ -922,7 +922,7 @@ static ProcRecord brush_get_shape_proc =
"gimp-brush-get-shape", "gimp-brush-get-shape",
"Get the shape of a generated brush.", "Get the shape of a generated brush.",
"This procedure gets the shape value for a generated brush. If called for any other type of brush, it does not succeed. The current possibilities are Circle (GIMP_BRUSH_GENERATED_CIRCLE), Square (GIMP_BRUSH_GENERATED_SQUARE), and Diamond (GIMP_BRUSH_GENERATED_DIAMOND). Other shapes are likely to be added in the future.", "This procedure gets the shape value for a generated brush. If called for any other type of brush, it does not succeed. The current possibilities are Circle (GIMP_BRUSH_GENERATED_CIRCLE), Square (GIMP_BRUSH_GENERATED_SQUARE), and Diamond (GIMP_BRUSH_GENERATED_DIAMOND). Other shapes are likely to be added in the future.",
"Bill Skaggs <weskaggs@primate.ucdavis.edu", "Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"Bill Skaggs", "Bill Skaggs",
"2004", "2004",
NULL, NULL,
@ -989,7 +989,7 @@ static ProcRecord brush_get_radius_proc =
"gimp-brush-get-radius", "gimp-brush-get-radius",
"Get the radius of a generated brush.", "Get the radius of a generated brush.",
"This procedure gets the radius value for a generated brush. If called for any other type of brush, it does not succeed.", "This procedure gets the radius value for a generated brush. If called for any other type of brush, it does not succeed.",
"Bill Skaggs <weskaggs@primate.ucdavis.edu", "Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"Bill Skaggs", "Bill Skaggs",
"2004", "2004",
NULL, NULL,
@ -1056,7 +1056,7 @@ static ProcRecord brush_get_spikes_proc =
"gimp-brush-get-spikes", "gimp-brush-get-spikes",
"Get the number of spikes for a generated brush.", "Get the number of spikes for a generated brush.",
"This procedure gets the number of spikes for a generated brush. If called for any other type of brush, it does not succeed.", "This procedure gets the number of spikes for a generated brush. If called for any other type of brush, it does not succeed.",
"Bill Skaggs <weskaggs@primate.ucdavis.edu", "Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"Bill Skaggs", "Bill Skaggs",
"2004", "2004",
NULL, NULL,
@ -1123,7 +1123,7 @@ static ProcRecord brush_get_hardness_proc =
"gimp-brush-get-hardness", "gimp-brush-get-hardness",
"Get the hardness of a generated brush.", "Get the hardness of a generated brush.",
"This procedure gets the hardness of a generated brush. The hardness of a brush is the amount its intensity fades at the outside edge. If called for any other type of brush, the function does not succeed.", "This procedure gets the hardness of a generated brush. The hardness of a brush is the amount its intensity fades at the outside edge. If called for any other type of brush, the function does not succeed.",
"Bill Skaggs <weskaggs@primate.ucdavis.edu", "Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"Bill Skaggs", "Bill Skaggs",
"2004", "2004",
NULL, NULL,
@ -1190,7 +1190,7 @@ static ProcRecord brush_get_aspect_ratio_proc =
"gimp-brush-get-aspect-ratio", "gimp-brush-get-aspect-ratio",
"Get the aspect ratio of a generated brush.", "Get the aspect ratio of a generated brush.",
"This procedure gets the aspect ratio of a generated brush. If called for any other type of brush, it does not succeed.", "This procedure gets the aspect ratio of a generated brush. If called for any other type of brush, it does not succeed.",
"Bill Skaggs <weskaggs@primate.ucdavis.edu", "Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"Bill Skaggs", "Bill Skaggs",
"2004", "2004",
NULL, NULL,
@ -1257,7 +1257,7 @@ static ProcRecord brush_get_angle_proc =
"gimp-brush-get-angle", "gimp-brush-get-angle",
"Get the rotation angle of a generated brush.", "Get the rotation angle of a generated brush.",
"This procedure gets the angle of rotation for a generated brush. If called for any other type of brush, it does not succeed.", "This procedure gets the angle of rotation for a generated brush. If called for any other type of brush, it does not succeed.",
"Bill Skaggs <weskaggs@primate.ucdavis.edu", "Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"Bill Skaggs", "Bill Skaggs",
"2004", "2004",
NULL, NULL,
@ -1335,7 +1335,7 @@ static ProcRecord brush_set_shape_proc =
"gimp-brush-set-shape", "gimp-brush-set-shape",
"Set the shape of a generated brush.", "Set the shape of a generated brush.",
"This procedure sets the shape value for a generated brush. If called for any other type of brush, it does not succeed. The current possibilities are Circle (GIMP_BRUSH_GENERATED_CIRCLE), Square (GIMP_BRUSH_GENERATED_SQUARE), and Diamond (GIMP_BRUSH_GENERATED_DIAMOND). Other shapes are likely to be added in the future.", "This procedure sets the shape value for a generated brush. If called for any other type of brush, it does not succeed. The current possibilities are Circle (GIMP_BRUSH_GENERATED_CIRCLE), Square (GIMP_BRUSH_GENERATED_SQUARE), and Diamond (GIMP_BRUSH_GENERATED_DIAMOND). Other shapes are likely to be added in the future.",
"Bill Skaggs <weskaggs@primate.ucdavis.edu", "Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"Bill Skaggs", "Bill Skaggs",
"2004", "2004",
NULL, NULL,
@ -1413,7 +1413,7 @@ static ProcRecord brush_set_radius_proc =
"gimp-brush-set-radius", "gimp-brush-set-radius",
"Set the radius of a generated brush.", "Set the radius of a generated brush.",
"This procedure sets the radius for a generated brush. If called for any other type of brush, it does not succeed.", "This procedure sets the radius for a generated brush. If called for any other type of brush, it does not succeed.",
"Bill Skaggs <weskaggs@primate.ucdavis.edu", "Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"Bill Skaggs", "Bill Skaggs",
"2004", "2004",
NULL, NULL,
@ -1491,7 +1491,7 @@ static ProcRecord brush_set_spikes_proc =
"gimp-brush-set-spikes", "gimp-brush-set-spikes",
"Set the number of spikes for a generated brush.", "Set the number of spikes for a generated brush.",
"This procedure sets the number of spikes for a generated brush. If called for any other type of brush, it does not succeed.", "This procedure sets the number of spikes for a generated brush. If called for any other type of brush, it does not succeed.",
"Bill Skaggs <weskaggs@primate.ucdavis.edu", "Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"Bill Skaggs", "Bill Skaggs",
"2004", "2004",
NULL, NULL,
@ -1569,7 +1569,7 @@ static ProcRecord brush_set_hardness_proc =
"gimp-brush-set-hardness", "gimp-brush-set-hardness",
"Set the hardness of a generated brush.", "Set the hardness of a generated brush.",
"This procedure sets the hardness for a generated brush. If called for any other type of brush, it does not succeed.", "This procedure sets the hardness for a generated brush. If called for any other type of brush, it does not succeed.",
"Bill Skaggs <weskaggs@primate.ucdavis.edu", "Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"Bill Skaggs", "Bill Skaggs",
"2004", "2004",
NULL, NULL,
@ -1647,7 +1647,7 @@ static ProcRecord brush_set_aspect_ratio_proc =
"gimp-brush-set-aspect-ratio", "gimp-brush-set-aspect-ratio",
"Set the aspect ratio of a generated brush.", "Set the aspect ratio of a generated brush.",
"This procedure sets the aspect ratio for a generated brush. If called for any other type of brush, it does not succeed.", "This procedure sets the aspect ratio for a generated brush. If called for any other type of brush, it does not succeed.",
"Bill Skaggs <weskaggs@primate.ucdavis.edu", "Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"Bill Skaggs", "Bill Skaggs",
"2004", "2004",
NULL, NULL,
@ -1725,7 +1725,7 @@ static ProcRecord brush_set_angle_proc =
"gimp-brush-set-angle", "gimp-brush-set-angle",
"Set the rotation angle of a generated brush.", "Set the rotation angle of a generated brush.",
"This procedure sets the rotation angle for a generated brush. If called for any other type of brush, it does not succeed.", "This procedure sets the rotation angle for a generated brush. If called for any other type of brush, it does not succeed.",
"Bill Skaggs <weskaggs@primate.ucdavis.edu", "Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"Bill Skaggs", "Bill Skaggs",
"2004", "2004",
NULL, NULL,

View File

@ -171,7 +171,7 @@ brushes_get_brush_invoker (Gimp *gimp,
return_args[1].value.pdb_pointer = g_strdup (GIMP_OBJECT (brush)->name); return_args[1].value.pdb_pointer = g_strdup (GIMP_OBJECT (brush)->name);
return_args[2].value.pdb_int = brush->mask->width; return_args[2].value.pdb_int = brush->mask->width;
return_args[3].value.pdb_int = brush->mask->height; return_args[3].value.pdb_int = brush->mask->height;
return_args[4].value.pdb_int = brush->spacing; return_args[4].value.pdb_int = gimp_brush_get_spacing (brush);
} }
return return_args; return return_args;
@ -350,7 +350,7 @@ brushes_get_brush_data_invoker (Gimp *gimp,
{ {
return_args[1].value.pdb_pointer = g_strdup (GIMP_OBJECT (brush)->name); return_args[1].value.pdb_pointer = g_strdup (GIMP_OBJECT (brush)->name);
return_args[2].value.pdb_float = 1.0; return_args[2].value.pdb_float = 1.0;
return_args[3].value.pdb_int = brush->spacing; return_args[3].value.pdb_int = gimp_brush_get_spacing (brush);
return_args[4].value.pdb_int = 0; return_args[4].value.pdb_int = 0;
return_args[5].value.pdb_int = brush->mask->width; return_args[5].value.pdb_int = brush->mask->width;
return_args[6].value.pdb_int = brush->mask->height; return_args[6].value.pdb_int = brush->mask->height;

View File

@ -113,7 +113,7 @@ static ProcRecord buffers_get_list_proc =
"Retrieve a complete listing of the available buffers.", "Retrieve a complete listing of the available buffers.",
"This procedure returns a complete listing of available named buffers.", "This procedure returns a complete listing of available named buffers.",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer",
"2005", "2005",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
@ -146,9 +146,7 @@ buffer_rename_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpBuffer *buffer; GimpBuffer *buffer = (GimpBuffer *)
buffer = (GimpBuffer *)
gimp_container_get_child_by_name (gimp->named_buffers, buffer_name); gimp_container_get_child_by_name (gimp->named_buffers, buffer_name);
success = (buffer != NULL && strlen (new_name) > 0); success = (buffer != NULL && strlen (new_name) > 0);
@ -198,7 +196,7 @@ static ProcRecord buffer_rename_proc =
"Renames a named buffer.", "Renames a named buffer.",
"This procedure renames a named buffer.", "This procedure renames a named buffer.",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer",
"2005", "2005",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
@ -224,9 +222,7 @@ buffer_delete_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpBuffer *buffer; GimpBuffer *buffer = (GimpBuffer *)
buffer = (GimpBuffer *)
gimp_container_get_child_by_name (gimp->named_buffers, buffer_name); gimp_container_get_child_by_name (gimp->named_buffers, buffer_name);
success = (buffer != NULL); success = (buffer != NULL);
@ -274,7 +270,7 @@ buffer_get_width_invoker (Gimp *gimp,
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
gchar *buffer_name; gchar *buffer_name;
GimpBuffer *buffer = NULL; gint32 width = 0;
buffer_name = (gchar *) args[0].value.pdb_pointer; buffer_name = (gchar *) args[0].value.pdb_pointer;
if (buffer_name == NULL || !g_utf8_validate (buffer_name, -1, NULL)) if (buffer_name == NULL || !g_utf8_validate (buffer_name, -1, NULL))
@ -282,16 +278,19 @@ buffer_get_width_invoker (Gimp *gimp,
if (success) if (success)
{ {
buffer = (GimpBuffer *) GimpBuffer *buffer = (GimpBuffer *)
gimp_container_get_child_by_name (gimp->named_buffers, buffer_name); gimp_container_get_child_by_name (gimp->named_buffers, buffer_name);
success = (buffer != NULL); if (buffer)
width = gimp_buffer_get_width (buffer);
else
success = FALSE;
} }
return_args = procedural_db_return_args (&buffer_get_width_proc, success); return_args = procedural_db_return_args (&buffer_get_width_proc, success);
if (success) if (success)
return_args[1].value.pdb_int = gimp_buffer_get_width (buffer); return_args[1].value.pdb_int = width;
return return_args; return return_args;
} }
@ -321,7 +320,7 @@ static ProcRecord buffer_get_width_proc =
"Retrieves the specified buffer's width.", "Retrieves the specified buffer's width.",
"This procedure retrieves the specified named buffer's width.", "This procedure retrieves the specified named buffer's width.",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer",
"2005", "2005",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
@ -341,7 +340,7 @@ buffer_get_height_invoker (Gimp *gimp,
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
gchar *buffer_name; gchar *buffer_name;
GimpBuffer *buffer = NULL; gint32 height = 0;
buffer_name = (gchar *) args[0].value.pdb_pointer; buffer_name = (gchar *) args[0].value.pdb_pointer;
if (buffer_name == NULL || !g_utf8_validate (buffer_name, -1, NULL)) if (buffer_name == NULL || !g_utf8_validate (buffer_name, -1, NULL))
@ -349,16 +348,19 @@ buffer_get_height_invoker (Gimp *gimp,
if (success) if (success)
{ {
buffer = (GimpBuffer *) GimpBuffer *buffer = (GimpBuffer *)
gimp_container_get_child_by_name (gimp->named_buffers, buffer_name); gimp_container_get_child_by_name (gimp->named_buffers, buffer_name);
success = (buffer != NULL); if (buffer)
height = gimp_buffer_get_height (buffer);
else
success = FALSE;
} }
return_args = procedural_db_return_args (&buffer_get_height_proc, success); return_args = procedural_db_return_args (&buffer_get_height_proc, success);
if (success) if (success)
return_args[1].value.pdb_int = gimp_buffer_get_height (buffer); return_args[1].value.pdb_int = height;
return return_args; return return_args;
} }
@ -388,7 +390,7 @@ static ProcRecord buffer_get_height_proc =
"Retrieves the specified buffer's height.", "Retrieves the specified buffer's height.",
"This procedure retrieves the specified named buffer's height.", "This procedure retrieves the specified named buffer's height.",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer",
"2005", "2005",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
@ -408,7 +410,7 @@ buffer_get_bytes_invoker (Gimp *gimp,
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
gchar *buffer_name; gchar *buffer_name;
GimpBuffer *buffer = NULL; gint32 bytes = 0;
buffer_name = (gchar *) args[0].value.pdb_pointer; buffer_name = (gchar *) args[0].value.pdb_pointer;
if (buffer_name == NULL || !g_utf8_validate (buffer_name, -1, NULL)) if (buffer_name == NULL || !g_utf8_validate (buffer_name, -1, NULL))
@ -416,16 +418,19 @@ buffer_get_bytes_invoker (Gimp *gimp,
if (success) if (success)
{ {
buffer = (GimpBuffer *) GimpBuffer *buffer = (GimpBuffer *)
gimp_container_get_child_by_name (gimp->named_buffers, buffer_name); gimp_container_get_child_by_name (gimp->named_buffers, buffer_name);
success = (buffer != NULL); if (buffer)
bytes = gimp_buffer_get_bytes (buffer);
else
success = FALSE;
} }
return_args = procedural_db_return_args (&buffer_get_bytes_proc, success); return_args = procedural_db_return_args (&buffer_get_bytes_proc, success);
if (success) if (success)
return_args[1].value.pdb_int = gimp_buffer_get_bytes (buffer); return_args[1].value.pdb_int = bytes;
return return_args; return return_args;
} }
@ -455,7 +460,7 @@ static ProcRecord buffer_get_bytes_proc =
"Retrieves the specified buffer's bytes.", "Retrieves the specified buffer's bytes.",
"This procedure retrieves the specified named buffer's bytes.", "This procedure retrieves the specified named buffer's bytes.",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer",
"2005", "2005",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
@ -475,7 +480,7 @@ buffer_get_image_type_invoker (Gimp *gimp,
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
gchar *buffer_name; gchar *buffer_name;
GimpBuffer *buffer = NULL; gint32 image_type = 0;
buffer_name = (gchar *) args[0].value.pdb_pointer; buffer_name = (gchar *) args[0].value.pdb_pointer;
if (buffer_name == NULL || !g_utf8_validate (buffer_name, -1, NULL)) if (buffer_name == NULL || !g_utf8_validate (buffer_name, -1, NULL))
@ -483,16 +488,19 @@ buffer_get_image_type_invoker (Gimp *gimp,
if (success) if (success)
{ {
buffer = (GimpBuffer *) GimpBuffer *buffer = (GimpBuffer *)
gimp_container_get_child_by_name (gimp->named_buffers, buffer_name); gimp_container_get_child_by_name (gimp->named_buffers, buffer_name);
success = (buffer != NULL); if (buffer)
image_type = gimp_buffer_get_image_type (buffer);
else
success = FALSE;
} }
return_args = procedural_db_return_args (&buffer_get_image_type_proc, success); return_args = procedural_db_return_args (&buffer_get_image_type_proc, success);
if (success) if (success)
return_args[1].value.pdb_int = gimp_buffer_get_image_type (buffer); return_args[1].value.pdb_int = image_type;
return return_args; return return_args;
} }
@ -522,7 +530,7 @@ static ProcRecord buffer_get_image_type_proc =
"Retrieves the specified buffer's image type.", "Retrieves the specified buffer's image type.",
"This procedure retrieves the specified named buffer's image type.", "This procedure retrieves the specified named buffer's image type.",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer",
"2005", "2005",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,

View File

@ -1225,8 +1225,8 @@ static ProcRecord colorize_proc =
"gimp-colorize", "gimp-colorize",
"Render the drawable as a grayscale image seen through a colored glass.", "Render the drawable as a grayscale image seen through a colored glass.",
"Desatures the drawable, then tints it with the specified color. This tool is only valid on RGB color images. It will not operate on grayscale or indexed drawables.", "Desatures the drawable, then tints it with the specified color. This tool is only valid on RGB color images. It will not operate on grayscale or indexed drawables.",
"Spencer Kimball & Peter Mattis", "Sven Neumann <sven@gimp.org>",
"Spencer Kimball & Peter Mattis", "Sven Neumann",
"2004", "2004",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
@ -1489,12 +1489,12 @@ static ProcArg hue_saturation_inargs[] =
{ {
GIMP_PDB_FLOAT, GIMP_PDB_FLOAT,
"lightness", "lightness",
"lightness modification: (-100 <= lightness <= 100)" "Lightness modification: (-100 <= lightness <= 100)"
}, },
{ {
GIMP_PDB_FLOAT, GIMP_PDB_FLOAT,
"saturation", "saturation",
"saturation modification: (-100 <= saturation <= 100)" "Saturation modification: (-100 <= saturation <= 100)"
} }
}; };

View File

@ -212,7 +212,7 @@ static ProcRecord display_get_window_handle_proc =
"gimp-display-get-window-handle", "gimp-display-get-window-handle",
"Get a handle to the native window for an image display.", "Get a handle to the native window for an image display.",
"This procedure returns a handle to the native window for a given image display. For example in the X backend of GDK, a native window handle is an Xlib XID. A value of 0 is returned for an invalid display or if this function is unimplemented for the windowing system that is being used.", "This procedure returns a handle to the native window for a given image display. For example in the X backend of GDK, a native window handle is an Xlib XID. A value of 0 is returned for an invalid display or if this function is unimplemented for the windowing system that is being used.",
"Sven Neumann", "Sven Neumann <sven@gimp.org>",
"Sven Neumann", "Sven Neumann",
"2005", "2005",
NULL, NULL,

View File

@ -2526,7 +2526,7 @@ static ProcRecord drawable_sub_thumbnail_proc =
"Get a thumbnail of a sub-area of a drawable drawable.", "Get a thumbnail of a sub-area of a drawable drawable.",
"This function gets data from which a thumbnail of a drawable preview can be created. Maximum x or y dimension is 512 pixels. The pixels are returned in RGB[A] or GRAY[A] format. The bpp return value gives the number of bytes in the image.", "This function gets data from which a thumbnail of a drawable preview can be created. Maximum x or y dimension is 512 pixels. The pixels are returned in RGB[A] or GRAY[A] format. The bpp return value gives the number of bytes in the image.",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer",
"2004", "2004",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,

View File

@ -1386,22 +1386,22 @@ static ProcArg drawable_transform_scale_inargs[] =
{ {
GIMP_PDB_FLOAT, GIMP_PDB_FLOAT,
"x0", "x0",
"The new x coordinate of upper-left corner of newly scaled region" "The new x coordinate of the upper-left corner of the scaled region"
}, },
{ {
GIMP_PDB_FLOAT, GIMP_PDB_FLOAT,
"y0", "y0",
"The new y coordinate of upper-left corner of newly scaled region" "The new y coordinate of the upper-left corner of the scaled region"
}, },
{ {
GIMP_PDB_FLOAT, GIMP_PDB_FLOAT,
"x1", "x1",
"The new x coordinate of lower-right corner of newly scaled region" "The new x coordinate of the lower-right corner of the scaled region"
}, },
{ {
GIMP_PDB_FLOAT, GIMP_PDB_FLOAT,
"y1", "y1",
"The new y coordinate of lower-right corner of newly scaled region" "The new y coordinate of the lower-right corner of the scaled region"
}, },
{ {
GIMP_PDB_INT32, GIMP_PDB_INT32,
@ -1545,22 +1545,22 @@ static ProcArg drawable_transform_scale_default_inargs[] =
{ {
GIMP_PDB_FLOAT, GIMP_PDB_FLOAT,
"x0", "x0",
"The new x coordinate of upper-left corner of newly scaled region" "The new x coordinate of the upper-left corner of the scaled region"
}, },
{ {
GIMP_PDB_FLOAT, GIMP_PDB_FLOAT,
"y0", "y0",
"The new y coordinate of upper-left corner of newly scaled region" "The new y coordinate of the upper-left corner of the scaled region"
}, },
{ {
GIMP_PDB_FLOAT, GIMP_PDB_FLOAT,
"x1", "x1",
"The new x coordinate of lower-right corner of newly scaled region" "The new x coordinate of the lower-right corner of the scaled region"
}, },
{ {
GIMP_PDB_FLOAT, GIMP_PDB_FLOAT,
"y1", "y1",
"The new y coordinate of lower-right corner of newly scaled region" "The new y coordinate of the lower-right corner of the scaled region"
}, },
{ {
GIMP_PDB_INT32, GIMP_PDB_INT32,

View File

@ -271,7 +271,7 @@ static ProcRecord edit_copy_visible_proc =
"Copy from the projection.", "Copy from the projection.",
"If there is a selection in the image, then the area specified by the selection is copied from the projection and placed in an internal GIMP edit buffer. It can subsequently be retrieved using the 'gimp-edit-paste' command. If there is no selection, then the projection's contents will be stored in the internal GIMP edit buffer.", "If there is a selection in the image, then the area specified by the selection is copied from the projection and placed in an internal GIMP edit buffer. It can subsequently be retrieved using the 'gimp-edit-paste' command. If there is no selection, then the projection's contents will be stored in the internal GIMP edit buffer.",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer",
"2004", "2004",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
@ -407,7 +407,7 @@ static ProcRecord edit_paste_as_new_proc =
"Paste buffer to a new image.", "Paste buffer to a new image.",
"This procedure pastes a copy of the internal GIMP edit buffer to a new image. The GIMP edit buffer will be empty unless a call was previously made to either 'gimp-edit-cut' or 'gimp-edit-copy'. This procedure returns the new image.", "This procedure pastes a copy of the internal GIMP edit buffer to a new image. The GIMP edit buffer will be empty unless a call was previously made to either 'gimp-edit-cut' or 'gimp-edit-copy'. This procedure returns the new image.",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer",
"2005", "2005",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
@ -495,7 +495,7 @@ static ProcRecord edit_named_cut_proc =
"Cut into a named buffer.", "Cut into a named buffer.",
"This procedure works like gimp-edit-cut, but additionally stores the cut buffer into a named buffer that will stay available for later pasting, regardless of any intermediate copy or cut operations.", "This procedure works like gimp-edit-cut, but additionally stores the cut buffer into a named buffer that will stay available for later pasting, regardless of any intermediate copy or cut operations.",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer",
"2005", "2005",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
@ -583,7 +583,7 @@ static ProcRecord edit_named_copy_proc =
"Copy into a named buffer.", "Copy into a named buffer.",
"This procedure works like gimp-edit-copy, but additionally stores the copied buffer into a named buffer that will stay available for later pasting, regardless of any intermediate copy or cut operations.", "This procedure works like gimp-edit-copy, but additionally stores the copied buffer into a named buffer that will stay available for later pasting, regardless of any intermediate copy or cut operations.",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer",
"2005", "2005",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
@ -668,7 +668,7 @@ static ProcRecord edit_named_copy_visible_proc =
"Copy from the projection into a named buffer.", "Copy from the projection into a named buffer.",
"This procedure works like gimp-edit-copy-visible, but additionally stores the copied buffer into a named buffer that will stay available for later pasting, regardless of any intermediate copy or cut operations.", "This procedure works like gimp-edit-copy-visible, but additionally stores the copied buffer into a named buffer that will stay available for later pasting, regardless of any intermediate copy or cut operations.",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer",
"2005", "2005",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
@ -764,7 +764,7 @@ static ProcRecord edit_named_paste_proc =
"Paste named buffer to the specified drawable.", "Paste named buffer to the specified drawable.",
"This procedure works like gimp-edit-paste but pastes a named buffer instead of the global buffer.", "This procedure works like gimp-edit-paste but pastes a named buffer instead of the global buffer.",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer",
"2005", "2005",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
@ -840,7 +840,7 @@ static ProcRecord edit_named_paste_as_new_proc =
"Paste named buffer to a new image.", "Paste named buffer to a new image.",
"This procedure works like gimp-edit-paste-as-new but pastes a named buffer instead of the global buffer.", "This procedure works like gimp-edit-paste-as-new but pastes a named buffer instead of the global buffer.",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer",
"2005", "2005",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
@ -932,7 +932,8 @@ edit_fill_invoker (Gimp *gimp,
{ {
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable)); GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
success = gimp_edit_fill (image, drawable, context, (GimpFillType) fill_type); success = gimp_edit_fill (image, drawable, context,
(GimpFillType) fill_type);
} }
} }

View File

@ -92,10 +92,11 @@ file_load_invoker (Gimp *gimp,
{ {
Argument *new_args; Argument *new_args;
Argument *return_vals; Argument *return_vals;
PlugInProcDef *file_proc;
PlugInProcDef *file_proc;
const ProcRecord *proc; const ProcRecord *proc;
gchar *uri; gchar *uri;
gint i; gint i;
uri = file_utils_filename_to_uri (gimp->load_procs, (gchar *) args[1].value.pdb_pointer, NULL); uri = file_utils_filename_to_uri (gimp->load_procs, (gchar *) args[1].value.pdb_pointer, NULL);
@ -185,8 +186,6 @@ file_load_layer_invoker (Gimp *gimp,
GimpImage *image; GimpImage *image;
gchar *filename; gchar *filename;
GimpLayer *layer = NULL; GimpLayer *layer = NULL;
GimpPDBStatusType status;
gchar *uri;
run_mode = args[0].value.pdb_int; run_mode = args[0].value.pdb_int;
if (run_mode < GIMP_RUN_INTERACTIVE || run_mode > GIMP_RUN_NONINTERACTIVE) if (run_mode < GIMP_RUN_INTERACTIVE || run_mode > GIMP_RUN_NONINTERACTIVE)
@ -202,6 +201,9 @@ file_load_layer_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpPDBStatusType status;
gchar *uri;
uri = file_utils_filename_to_uri (gimp->load_procs, filename, NULL); uri = file_utils_filename_to_uri (gimp->load_procs, filename, NULL);
if (! uri) if (! uri)
success = FALSE; success = FALSE;
@ -255,7 +257,7 @@ static ProcRecord file_load_layer_proc =
"gimp-file-load-layer", "gimp-file-load-layer",
"Loads an image file as a layer into an already opened image.", "Loads an image file as a layer into an already opened image.",
"This procedure behaves like the file-load procedure but opens the specified image as a layer into an already opened image.", "This procedure behaves like the file-load procedure but opens the specified image as a layer into an already opened image.",
"Sven Neumann", "Sven Neumann <sven@gimp.org>",
"Sven Neumann", "Sven Neumann",
"2005", "2005",
NULL, NULL,
@ -280,9 +282,6 @@ file_load_thumbnail_invoker (Gimp *gimp,
gint32 height = 0; gint32 height = 0;
gint32 num_bytes = 0; gint32 num_bytes = 0;
guint8 *thumb_data = NULL; guint8 *thumb_data = NULL;
gchar *uri;
GimpThumbnail *thumbnail = NULL;
GdkPixbuf *pixbuf = NULL;
filename = (gchar *) args[0].value.pdb_pointer; filename = (gchar *) args[0].value.pdb_pointer;
if (filename == NULL) if (filename == NULL)
@ -290,6 +289,10 @@ file_load_thumbnail_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpThumbnail *thumbnail = NULL;
GdkPixbuf *pixbuf = NULL;
gchar *uri;
uri = g_filename_to_uri (filename, NULL, NULL); uri = g_filename_to_uri (filename, NULL, NULL);
if (uri) if (uri)
@ -409,10 +412,11 @@ file_save_invoker (Gimp *gimp,
{ {
Argument *new_args; Argument *new_args;
Argument *return_vals; Argument *return_vals;
PlugInProcDef *file_proc;
PlugInProcDef *file_proc;
const ProcRecord *proc; const ProcRecord *proc;
gchar *uri; gchar *uri;
gint i; gint i;
uri = file_utils_filename_to_uri (gimp->load_procs, (gchar *) args[3].value.pdb_pointer, NULL); uri = file_utils_filename_to_uri (gimp->load_procs, (gchar *) args[3].value.pdb_pointer, NULL);
@ -500,9 +504,6 @@ file_save_thumbnail_invoker (Gimp *gimp,
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
gchar *filename; gchar *filename;
GimpImagefile *imagefile;
gchar *uri;
const gchar *image_uri;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (gimage))
@ -514,13 +515,15 @@ file_save_thumbnail_invoker (Gimp *gimp,
if (success) if (success)
{ {
image_uri = gimp_object_get_name (GIMP_OBJECT (gimage)); const gchar *image_uri = gimp_object_get_name (GIMP_OBJECT (gimage));
if (! image_uri) if (! image_uri)
success = FALSE; success = FALSE;
if (success) if (success)
{ {
uri = g_filename_to_uri (filename, NULL, NULL); gchar *uri = g_filename_to_uri (filename, NULL, NULL);
if (! uri) if (! uri)
success = FALSE; success = FALSE;
@ -531,6 +534,8 @@ file_save_thumbnail_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpImagefile *imagefile;
imagefile = gimp_imagefile_new (gimp, uri); imagefile = gimp_imagefile_new (gimp, uri);
success = gimp_imagefile_save_thumbnail (imagefile, NULL, gimage); success = gimp_imagefile_save_thumbnail (imagefile, NULL, gimage);
g_object_unref (imagefile); g_object_unref (imagefile);
@ -586,10 +591,6 @@ temp_name_invoker (Gimp *gimp,
Argument *return_args; Argument *return_args;
gchar *extension; gchar *extension;
gchar *name = NULL; gchar *name = NULL;
static gint id = 0;
static gint pid;
gchar *filename;
gchar *path;
extension = (gchar *) args[0].value.pdb_pointer; extension = (gchar *) args[0].value.pdb_pointer;
if (extension == NULL) if (extension == NULL)
@ -597,6 +598,11 @@ temp_name_invoker (Gimp *gimp,
if (success) if (success)
{ {
static gint id = 0;
static gint pid;
gchar *filename;
gchar *path;
if (id == 0) if (id == 0)
pid = getpid (); pid = getpid ();
@ -667,8 +673,6 @@ register_magic_load_handler_invoker (Gimp *gimp,
gchar *extensions; gchar *extensions;
gchar *prefixes; gchar *prefixes;
gchar *magics; gchar *magics;
ProcRecord *proc;
PlugInProcDef *file_proc;
name = (gchar *) args[0].value.pdb_pointer; name = (gchar *) args[0].value.pdb_pointer;
if (name == NULL || !g_utf8_validate (name, -1, NULL)) if (name == NULL || !g_utf8_validate (name, -1, NULL))
@ -682,7 +686,9 @@ register_magic_load_handler_invoker (Gimp *gimp,
if (success) if (success)
{ {
gchar *canonical; ProcRecord *proc;
PlugInProcDef *file_proc;
gchar *canonical;
success = FALSE; success = FALSE;
@ -831,8 +837,6 @@ register_save_handler_invoker (Gimp *gimp,
gchar *name; gchar *name;
gchar *extensions; gchar *extensions;
gchar *prefixes; gchar *prefixes;
ProcRecord *proc;
PlugInProcDef *file_proc;
name = (gchar *) args[0].value.pdb_pointer; name = (gchar *) args[0].value.pdb_pointer;
if (name == NULL || !g_utf8_validate (name, -1, NULL)) if (name == NULL || !g_utf8_validate (name, -1, NULL))
@ -844,7 +848,9 @@ register_save_handler_invoker (Gimp *gimp,
if (success) if (success)
{ {
gchar *canonical; ProcRecord *proc;
PlugInProcDef *file_proc;
gchar *canonical;
success = FALSE; success = FALSE;
@ -975,7 +981,7 @@ static ProcRecord register_file_handler_mime_proc =
"gimp-register-file-handler-mime", "gimp-register-file-handler-mime",
"Associates a MIME type with a file handler procedure.", "Associates a MIME type with a file handler procedure.",
"Registers a MIME type for a file handler procedure. This allows GIMP to determine the MIME type of the file opened or saved using this procedure.", "Registers a MIME type for a file handler procedure. This allows GIMP to determine the MIME type of the file opened or saved using this procedure.",
"Sven Neumann", "Sven Neumann <sven@gimp.org>",
"Sven Neumann", "Sven Neumann",
"2004", "2004",
NULL, NULL,
@ -1040,7 +1046,7 @@ static ProcRecord register_thumbnail_loader_proc =
"gimp-register-thumbnail-loader", "gimp-register-thumbnail-loader",
"Associates a thumbnail loader with a file load procedure.", "Associates a thumbnail loader with a file load procedure.",
"Some file formats allow for embedded thumbnails, other file formats contain a scalable image or provide the image data in different resolutions. A file plug-in for such a format may register a special procedure that allows GIMP to load a thumbnail preview of the image. This procedure is then associated with the standard load procedure using this function.", "Some file formats allow for embedded thumbnails, other file formats contain a scalable image or provide the image data in different resolutions. A file plug-in for such a format may register a special procedure that allows GIMP to load a thumbnail preview of the image. This procedure is then associated with the standard load procedure using this function.",
"Sven Neumann", "Sven Neumann <sven@gimp.org>",
"Sven Neumann", "Sven Neumann",
"2004", "2004",
NULL, NULL,

View File

@ -221,10 +221,10 @@ floating_sel_attach_invoker (Gimp *gimp,
if (success) if (success)
{ {
success = gimp_item_is_attached (GIMP_ITEM (drawable)); if (gimp_item_is_attached (GIMP_ITEM (drawable)))
if (success)
floating_sel_attach (layer, drawable); floating_sel_attach (layer, drawable);
else
success = FALSE;
} }
return procedural_db_return_args (&floating_sel_attach_proc, success); return procedural_db_return_args (&floating_sel_attach_proc, success);

View File

@ -57,7 +57,7 @@ static ProcRecord fonts_refresh_proc =
"gimp-fonts-refresh", "gimp-fonts-refresh",
"Refresh current fonts. This function always succeeds.", "Refresh current fonts. This function always succeeds.",
"This procedure retrieves all fonts currently in the user's font path and updates the font dialogs accordingly.", "This procedure retrieves all fonts currently in the user's font path and updates the font dialogs accordingly.",
"Sven Neumann", "Sven Neumann <sven@gimp.org>",
"Sven Neumann", "Sven Neumann",
"2003", "2003",
NULL, NULL,
@ -128,7 +128,7 @@ static ProcRecord fonts_get_list_proc =
"gimp-fonts-get-list", "gimp-fonts-get-list",
"Retrieve the list of loaded fonts.", "Retrieve the list of loaded fonts.",
"This procedure returns a list of the fonts that are currently available.", "This procedure returns a list of the fonts that are currently available.",
"Sven Neumann", "Sven Neumann <sven@gimp.org>",
"Sven Neumann", "Sven Neumann",
"2003", "2003",
NULL, NULL,

View File

@ -30,8 +30,6 @@
#include "pdb-types.h" #include "pdb-types.h"
#include "procedural_db.h" #include "procedural_db.h"
#include "config/gimpcoreconfig.h"
#include "config/gimpdisplayconfig.h"
#include "config/gimprc.h" #include "config/gimprc.h"
#include "core/gimp.h" #include "core/gimp.h"
#include "core/gimptemplate.h" #include "core/gimptemplate.h"
@ -363,7 +361,7 @@ static ProcRecord get_color_configuration_proc =
"gimp-get-color-configuration", "gimp-get-color-configuration",
"Get a serialized version of the color management configuration.", "Get a serialized version of the color management configuration.",
"Returns a string that can be deserialized into a GimpColorConfig object representing the current color management configuration.", "Returns a string that can be deserialized into a GimpColorConfig object representing the current color management configuration.",
"Sven Neumann", "Sven Neumann <sven@gimp.org>",
"Sven Neumann", "Sven Neumann",
"2005", "2005",
NULL, NULL,

View File

@ -157,7 +157,7 @@ static ProcRecord gradient_new_proc =
"gimp-gradient-new", "gimp-gradient-new",
"Creates a new gradient", "Creates a new gradient",
"This procedure creates a new, uninitialized gradient", "This procedure creates a new, uninitialized gradient",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -234,7 +234,7 @@ static ProcRecord gradient_duplicate_proc =
"gimp-gradient-duplicate", "gimp-gradient-duplicate",
"Duplicates a gradient", "Duplicates a gradient",
"This procedure creates an identical gradient by a different name", "This procedure creates an identical gradient by a different name",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -304,7 +304,7 @@ static ProcRecord gradient_is_editable_proc =
"gimp-gradient-is-editable", "gimp-gradient-is-editable",
"Tests if gradient can be edited", "Tests if gradient can be edited",
"Returns True if you have permission to change the gradient", "Returns True if you have permission to change the gradient",
"Bill Skaggs <weskaggs@primate.ucdavis.edu", "Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"Bill Skaggs", "Bill Skaggs",
"2004", "2004",
NULL, NULL,
@ -384,7 +384,7 @@ static ProcRecord gradient_rename_proc =
"gimp-gradient-rename", "gimp-gradient-rename",
"Rename a gradient", "Rename a gradient",
"This procedure renames a gradient", "This procedure renames a gradient",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -451,7 +451,7 @@ static ProcRecord gradient_delete_proc =
"gimp-gradient-delete", "gimp-gradient-delete",
"Deletes a gradient", "Deletes a gradient",
"This procedure deletes a gradient", "This procedure deletes a gradient",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -801,7 +801,7 @@ static ProcRecord gradient_segment_get_left_color_proc =
"gimp-gradient-segment-get-left-color", "gimp-gradient-segment-get-left-color",
"Retrieves the left endpoint color of the specified gradient and segment", "Retrieves the left endpoint color of the specified gradient and segment",
"This procedure retrieves the left endpoint color of the specified segment of the specified gradient.", "This procedure retrieves the left endpoint color of the specified segment of the specified gradient.",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -896,7 +896,7 @@ static ProcRecord gradient_segment_set_left_color_proc =
"gimp-gradient-segment-set-left-color", "gimp-gradient-segment-set-left-color",
"Retrieves the left endpoint color of the specified gradient and segment", "Retrieves the left endpoint color of the specified gradient and segment",
"This procedure retrieves the left endpoint color of the specified segment of the specified gradient.", "This procedure retrieves the left endpoint color of the specified segment of the specified gradient.",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -998,7 +998,7 @@ static ProcRecord gradient_segment_get_right_color_proc =
"gimp-gradient-segment-get-right-color", "gimp-gradient-segment-get-right-color",
"Retrieves the right endpoint color of the specified gradient and segment", "Retrieves the right endpoint color of the specified gradient and segment",
"This procedure retrieves the right endpoint color of the specified segment of the specified gradient.", "This procedure retrieves the right endpoint color of the specified segment of the specified gradient.",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -1093,7 +1093,7 @@ static ProcRecord gradient_segment_set_right_color_proc =
"gimp-gradient-segment-set-right-color", "gimp-gradient-segment-set-right-color",
"Retrieves the right endpoint color of the specified gradient and segment", "Retrieves the right endpoint color of the specified gradient and segment",
"This procedure retrieves the right endpoint color of the specified segment of the specified gradient.", "This procedure retrieves the right endpoint color of the specified segment of the specified gradient.",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -1185,7 +1185,7 @@ static ProcRecord gradient_segment_get_left_pos_proc =
"gimp-gradient-segment-get-left-pos", "gimp-gradient-segment-get-left-pos",
"Retrieves the left endpoint position of the specified gradient and segment", "Retrieves the left endpoint position of the specified gradient and segment",
"This procedure retrieves the left endpoint position of the specified segment of the specified gradient.", "This procedure retrieves the left endpoint position of the specified segment of the specified gradient.",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -1288,7 +1288,7 @@ static ProcRecord gradient_segment_set_left_pos_proc =
"gimp-gradient-segment-set-left-pos", "gimp-gradient-segment-set-left-pos",
"Sets the left endpoint position of the specified gradient and segment", "Sets the left endpoint position of the specified gradient and segment",
"This procedure sets the left endpoint position of the specified segment of the specified gradient. The final position will be between the position of the middle point to the left to the middle point of the current segement. This procedure returns the final position.", "This procedure sets the left endpoint position of the specified segment of the specified gradient. The final position will be between the position of the middle point to the left to the middle point of the current segement. This procedure returns the final position.",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -1380,7 +1380,7 @@ static ProcRecord gradient_segment_get_middle_pos_proc =
"gimp-gradient-segment-get-middle-pos", "gimp-gradient-segment-get-middle-pos",
"Retrieves the middle point position of the specified gradient and segment", "Retrieves the middle point position of the specified gradient and segment",
"This procedure retrieves the middle point position of the specified segment of the specified gradient.", "This procedure retrieves the middle point position of the specified segment of the specified gradient.",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -1483,7 +1483,7 @@ static ProcRecord gradient_segment_set_middle_pos_proc =
"gimp-gradient-segment-set-middle-pos", "gimp-gradient-segment-set-middle-pos",
"Sets the middle point position of the specified gradient and segment", "Sets the middle point position of the specified gradient and segment",
"This procedure sets the middle point position of the specified segment of the specified gradient. The final position will be between the two endpoints of the segment. This procedure returns the final position.", "This procedure sets the middle point position of the specified segment of the specified gradient. The final position will be between the two endpoints of the segment. This procedure returns the final position.",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -1575,7 +1575,7 @@ static ProcRecord gradient_segment_get_right_pos_proc =
"gimp-gradient-segment-get-right-pos", "gimp-gradient-segment-get-right-pos",
"Retrieves the right endpoint position of the specified gradient and segment", "Retrieves the right endpoint position of the specified gradient and segment",
"This procedure retrieves the right endpoint position of the specified segment of the specified gradient.", "This procedure retrieves the right endpoint position of the specified segment of the specified gradient.",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -1678,7 +1678,7 @@ static ProcRecord gradient_segment_set_right_pos_proc =
"gimp-gradient-segment-set-right-pos", "gimp-gradient-segment-set-right-pos",
"Sets the right endpoint position of the specified gradient and segment", "Sets the right endpoint position of the specified gradient and segment",
"This procedure sets the right endpoint position of the specified segment of the specified gradient. The final position will be between the position of the middle point of the current segment and the middle point of the segment to the right. This procedure returns the final position.", "This procedure sets the right endpoint position of the specified segment of the specified gradient. The final position will be between the position of the middle point of the current segment and the middle point of the segment to the right. This procedure returns the final position.",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -1771,7 +1771,7 @@ static ProcRecord gradient_segment_get_blending_function_proc =
"gimp-gradient-segment-get-blending-function", "gimp-gradient-segment-get-blending-function",
"Retrieves the gradient segment's blending function", "Retrieves the gradient segment's blending function",
"This procedure retrieves the blending function of the segment at the specified gradient name and segment index.", "This procedure retrieves the blending function of the segment at the specified gradient name and segment index.",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -1864,7 +1864,7 @@ static ProcRecord gradient_segment_get_coloring_type_proc =
"gimp-gradient-segment-get-coloring-type", "gimp-gradient-segment-get-coloring-type",
"Retrieves the gradient segment's coloring type", "Retrieves the gradient segment's coloring type",
"This procedure retrieves the coloring type of the segment at the specified gradient name and segment index.", "This procedure retrieves the coloring type of the segment at the specified gradient name and segment index.",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -1911,6 +1911,7 @@ gradient_segment_range_set_blending_function_invoker (Gimp *gimp,
if (gradient) if (gradient)
{ {
GimpGradientSegment *start_seg, *end_seg; GimpGradientSegment *start_seg, *end_seg;
start_seg = gimp_gradient_segment_get_nth (gradient->segments, start_seg = gimp_gradient_segment_get_nth (gradient->segments,
start_segment); start_segment);
if (start_seg) if (start_seg)
@ -1980,7 +1981,7 @@ static ProcRecord gradient_segment_range_set_blending_function_proc =
"gimp-gradient-segment-range-set-blending-function", "gimp-gradient-segment-range-set-blending-function",
"Change the blending function of a segments range", "Change the blending function of a segments range",
"This function changes the blending function of a segment range to the specified blending function.", "This function changes the blending function of a segment range to the specified blending function.",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -2027,6 +2028,7 @@ gradient_segment_range_set_coloring_type_invoker (Gimp *gimp,
if (gradient) if (gradient)
{ {
GimpGradientSegment *start_seg, *end_seg; GimpGradientSegment *start_seg, *end_seg;
start_seg = gimp_gradient_segment_get_nth (gradient->segments, start_seg = gimp_gradient_segment_get_nth (gradient->segments,
start_segment); start_segment);
if (start_seg) if (start_seg)
@ -2096,7 +2098,7 @@ static ProcRecord gradient_segment_range_set_coloring_type_proc =
"gimp-gradient-segment-range-set-coloring-type", "gimp-gradient-segment-range-set-coloring-type",
"Change the coloring type of a segments range", "Change the coloring type of a segments range",
"This function changes the coloring type of a segment range to the specified coloring type.", "This function changes the coloring type of a segment range to the specified coloring type.",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -2138,6 +2140,7 @@ gradient_segment_range_flip_invoker (Gimp *gimp,
if (gradient) if (gradient)
{ {
GimpGradientSegment *start_seg, *end_seg; GimpGradientSegment *start_seg, *end_seg;
start_seg = gimp_gradient_segment_get_nth (gradient->segments, start_seg = gimp_gradient_segment_get_nth (gradient->segments,
start_segment); start_segment);
if (start_seg) if (start_seg)
@ -2202,7 +2205,7 @@ static ProcRecord gradient_segment_range_flip_proc =
"gimp-gradient-segment-range-flip", "gimp-gradient-segment-range-flip",
"Flip the segment range", "Flip the segment range",
"This function flips a segment range.", "This function flips a segment range.",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -2249,6 +2252,7 @@ gradient_segment_range_replicate_invoker (Gimp *gimp,
if (gradient) if (gradient)
{ {
GimpGradientSegment *start_seg, *end_seg; GimpGradientSegment *start_seg, *end_seg;
start_seg = gimp_gradient_segment_get_nth (gradient->segments, start_seg = gimp_gradient_segment_get_nth (gradient->segments,
start_segment); start_segment);
if (start_seg) if (start_seg)
@ -2319,7 +2323,7 @@ static ProcRecord gradient_segment_range_replicate_proc =
"gimp-gradient-segment-range-replicate", "gimp-gradient-segment-range-replicate",
"Replicate the segment range", "Replicate the segment range",
"This function replicates a segment range a given number of times. Instead of the original segment range, several smaller scaled copies of it will appear in equal widths.", "This function replicates a segment range a given number of times. Instead of the original segment range, several smaller scaled copies of it will appear in equal widths.",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -2361,6 +2365,7 @@ gradient_segment_range_split_midpoint_invoker (Gimp *gimp,
if (gradient) if (gradient)
{ {
GimpGradientSegment *start_seg, *end_seg; GimpGradientSegment *start_seg, *end_seg;
start_seg = gimp_gradient_segment_get_nth (gradient->segments, start_seg = gimp_gradient_segment_get_nth (gradient->segments,
start_segment); start_segment);
if (start_seg) if (start_seg)
@ -2425,7 +2430,7 @@ static ProcRecord gradient_segment_range_split_midpoint_proc =
"gimp-gradient-segment-range-split-midpoint", "gimp-gradient-segment-range-split-midpoint",
"Splits each segment in the segment range at midpoint", "Splits each segment in the segment range at midpoint",
"This function splits each segment in the segment range at its midpoint.", "This function splits each segment in the segment range at its midpoint.",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -2472,6 +2477,7 @@ gradient_segment_range_split_uniform_invoker (Gimp *gimp,
if (gradient) if (gradient)
{ {
GimpGradientSegment *start_seg, *end_seg; GimpGradientSegment *start_seg, *end_seg;
start_seg = gimp_gradient_segment_get_nth (gradient->segments, start_seg = gimp_gradient_segment_get_nth (gradient->segments,
start_segment); start_segment);
if (start_seg) if (start_seg)
@ -2542,7 +2548,7 @@ static ProcRecord gradient_segment_range_split_uniform_proc =
"gimp-gradient-segment-range-split-uniform", "gimp-gradient-segment-range-split-uniform",
"Splits each segment in the segment range uniformly", "Splits each segment in the segment range uniformly",
"This function splits each segment in the segment range uniformly according to the number of times specified by the parameter.", "This function splits each segment in the segment range uniformly according to the number of times specified by the parameter.",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -2584,6 +2590,7 @@ gradient_segment_range_delete_invoker (Gimp *gimp,
if (gradient) if (gradient)
{ {
GimpGradientSegment *start_seg, *end_seg; GimpGradientSegment *start_seg, *end_seg;
start_seg = gimp_gradient_segment_get_nth (gradient->segments, start_seg = gimp_gradient_segment_get_nth (gradient->segments,
start_segment); start_segment);
if (start_seg) if (start_seg)
@ -2648,7 +2655,7 @@ static ProcRecord gradient_segment_range_delete_proc =
"gimp-gradient-segment-range-delete", "gimp-gradient-segment-range-delete",
"Delete the segment range", "Delete the segment range",
"This function deletes a segment range.", "This function deletes a segment range.",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -2690,6 +2697,7 @@ gradient_segment_range_redistribute_handles_invoker (Gimp *gimp,
if (gradient) if (gradient)
{ {
GimpGradientSegment *start_seg, *end_seg; GimpGradientSegment *start_seg, *end_seg;
start_seg = gimp_gradient_segment_get_nth (gradient->segments, start_seg = gimp_gradient_segment_get_nth (gradient->segments,
start_segment); start_segment);
if (start_seg) if (start_seg)
@ -2753,7 +2761,7 @@ static ProcRecord gradient_segment_range_redistribute_handles_proc =
"gimp-gradient-segment-range-redistribute-handles", "gimp-gradient-segment-range-redistribute-handles",
"Uniformly redistribute the segment range's handles", "Uniformly redistribute the segment range's handles",
"This function redistributes the handles of the specified segment range of the specified gradient, so they'll be evenly spaced.", "This function redistributes the handles of the specified segment range of the specified gradient, so they'll be evenly spaced.",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -2795,6 +2803,7 @@ gradient_segment_range_blend_colors_invoker (Gimp *gimp,
if (gradient) if (gradient)
{ {
GimpGradientSegment *start_seg, *end_seg; GimpGradientSegment *start_seg, *end_seg;
start_seg = gimp_gradient_segment_get_nth (gradient->segments, start_seg = gimp_gradient_segment_get_nth (gradient->segments,
start_segment); start_segment);
if (start_seg) if (start_seg)
@ -2860,7 +2869,7 @@ static ProcRecord gradient_segment_range_blend_colors_proc =
"gimp-gradient-segment-range-blend-colors", "gimp-gradient-segment-range-blend-colors",
"Blend the colors of the segment range.", "Blend the colors of the segment range.",
"This function blends the colors (but not the opacity) of the segments' range of the gradient. Using it, the colors' transition will be uniform across the range.", "This function blends the colors (but not the opacity) of the segments' range of the gradient. Using it, the colors' transition will be uniform across the range.",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -2902,6 +2911,7 @@ gradient_segment_range_blend_opacity_invoker (Gimp *gimp,
if (gradient) if (gradient)
{ {
GimpGradientSegment *start_seg, *end_seg; GimpGradientSegment *start_seg, *end_seg;
start_seg = gimp_gradient_segment_get_nth (gradient->segments, start_seg = gimp_gradient_segment_get_nth (gradient->segments,
start_segment); start_segment);
if (start_seg) if (start_seg)
@ -2967,7 +2977,7 @@ static ProcRecord gradient_segment_range_blend_opacity_proc =
"gimp-gradient-segment-range-blend-opacity", "gimp-gradient-segment-range-blend-opacity",
"Blend the opacity of the segment range.", "Blend the opacity of the segment range.",
"This function blends the opacity (but not the colors) of the segments' range of the gradient. Using it, the opacity's transition will be uniform across the range.", "This function blends the opacity (but not the colors) of the segments' range of the gradient. Using it, the opacity's transition will be uniform across the range.",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,
@ -3019,6 +3029,7 @@ gradient_segment_range_move_invoker (Gimp *gimp,
if (gradient) if (gradient)
{ {
GimpGradientSegment *start_seg, *end_seg; GimpGradientSegment *start_seg, *end_seg;
start_seg = gimp_gradient_segment_get_nth (gradient->segments, start_seg = gimp_gradient_segment_get_nth (gradient->segments,
start_segment); start_segment);
if (start_seg) if (start_seg)
@ -3109,7 +3120,7 @@ static ProcRecord gradient_segment_range_move_proc =
"gimp-gradient-segment-range-move", "gimp-gradient-segment-range-move",
"Move the position of an entire segment range by a delta.", "Move the position of an entire segment range by a delta.",
"This funtions moves the position of an entire segment range by a delta. The actual delta (which is returned) will be limited by the control points of the neighboring segments.", "This funtions moves the position of an entire segment range by a delta. The actual delta (which is returned) will be limited by the control points of the neighboring segments.",
"Shlomi Fish", "Shlomi Fish <shlomif@iglu.org.il>",
"Shlomi Fish", "Shlomi Fish",
"2003", "2003",
NULL, NULL,

View File

@ -66,7 +66,7 @@ static ProcRecord gradients_refresh_proc =
"gimp-gradients-refresh", "gimp-gradients-refresh",
"Refresh current gradients. This function always succeeds.", "Refresh current gradients. This function always succeeds.",
"This procedure retrieves all gradients currently in the user's gradient path and updates the gradient dialogs accordingly.", "This procedure retrieves all gradients currently in the user's gradient path and updates the gradient dialogs accordingly.",
"Michael Natterer", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer", "Michael Natterer",
"2002", "2002",
NULL, NULL,
@ -161,10 +161,6 @@ gradients_sample_uniform_invoker (Gimp *gimp,
gboolean reverse; gboolean reverse;
gint32 array_length = 0; gint32 array_length = 0;
gdouble *color_samples = NULL; gdouble *color_samples = NULL;
GimpGradient *gradient;
gdouble pos, delta;
GimpRGB color;
gdouble *pv;
i = args[0].value.pdb_int; i = args[0].value.pdb_int;
if (i < 2) if (i < 2)
@ -174,7 +170,11 @@ gradients_sample_uniform_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpGradient *gradient;
GimpGradientSegment *seg = NULL; GimpGradientSegment *seg = NULL;
gdouble pos, delta;
GimpRGB color;
gdouble *pv;
pos = 0.0; pos = 0.0;
delta = 1.0 / (i - 1); delta = 1.0 / (i - 1);
@ -268,9 +268,6 @@ gradients_sample_custom_invoker (Gimp *gimp,
gboolean reverse; gboolean reverse;
gint32 array_length = 0; gint32 array_length = 0;
gdouble *color_samples = NULL; gdouble *color_samples = NULL;
GimpGradient *gradient;
GimpRGB color;
gdouble *pv;
i = args[0].value.pdb_int; i = args[0].value.pdb_int;
if (i <= 0) if (i <= 0)
@ -282,7 +279,10 @@ gradients_sample_custom_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpGradient *gradient;
GimpGradientSegment *seg = NULL; GimpGradientSegment *seg = NULL;
GimpRGB color;
gdouble *pv;
array_length = i * 4; array_length = i * 4;

View File

@ -89,7 +89,7 @@ static ProcRecord help_proc =
"Load a help page.", "Load a help page.",
"This procedure loads the specified help page into the helpbrowser or what ever is configured as help viewer. The help page is identified by its domain and ID: if help_domain is NULL, we use the help_domain which was registered using the gimp-plugin-help-register procedure. If help_domain is NULL and no help domain was registered, the help domain of the main GIMP installation is used.", "This procedure loads the specified help page into the helpbrowser or what ever is configured as help viewer. The help page is identified by its domain and ID: if help_domain is NULL, we use the help_domain which was registered using the gimp-plugin-help-register procedure. If help_domain is NULL and no help domain was registered, the help domain of the main GIMP installation is used.",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer",
"2000", "2000",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,

View File

@ -222,15 +222,18 @@ image_list_invoker (Gimp *gimp,
Argument *return_args; Argument *return_args;
gint32 num_images = 0; gint32 num_images = 0;
gint32 *image_ids = NULL; gint32 *image_ids = NULL;
GList *list = NULL; GList *list = NULL;
gint i;
list = GIMP_LIST (gimp->images)->list; list = GIMP_LIST (gimp->images)->list;
num_images = g_list_length (list); num_images = g_list_length (list);
if (num_images) if (num_images)
{ {
gint i;
image_ids = g_new (gint32, num_images); image_ids = g_new (gint32, num_images);
for (i = 0; i < num_images; i++, list = g_list_next (list)) for (i = 0; i < num_images; i++, list = g_list_next (list))
image_ids[i] = gimp_image_get_ID (GIMP_IMAGE (list->data)); image_ids[i] = gimp_image_get_ID (GIMP_IMAGE (list->data));
} }
@ -1100,7 +1103,7 @@ static ProcRecord image_rotate_proc =
"gimp-image-rotate", "gimp-image-rotate",
"Rotates the image by the specified degrees.", "Rotates the image by the specified degrees.",
"This procedure rotates the image.", "This procedure rotates the image.",
"Michael Natterer", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer", "Michael Natterer",
"2003", "2003",
NULL, NULL,
@ -1123,8 +1126,6 @@ image_get_layers_invoker (Gimp *gimp,
GimpImage *gimage; GimpImage *gimage;
gint32 num_layers = 0; gint32 num_layers = 0;
gint32 *layer_ids = NULL; gint32 *layer_ids = NULL;
GList *list = NULL;
gint i;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (gimage))
@ -1132,12 +1133,17 @@ image_get_layers_invoker (Gimp *gimp,
if (success) if (success)
{ {
GList *list = NULL;
list = GIMP_LIST (gimage->layers)->list; list = GIMP_LIST (gimage->layers)->list;
num_layers = g_list_length (list); num_layers = g_list_length (list);
if (num_layers) if (num_layers)
{ {
gint i;
layer_ids = g_new (gint32, num_layers); layer_ids = g_new (gint32, num_layers);
for (i = 0; i < num_layers; i++, list = g_list_next (list)) for (i = 0; i < num_layers; i++, list = g_list_next (list))
layer_ids[i] = gimp_item_get_ID (GIMP_ITEM (list->data)); layer_ids[i] = gimp_item_get_ID (GIMP_ITEM (list->data));
} }
@ -1206,8 +1212,6 @@ image_get_channels_invoker (Gimp *gimp,
GimpImage *gimage; GimpImage *gimage;
gint32 num_channels = 0; gint32 num_channels = 0;
gint32 *channel_ids = NULL; gint32 *channel_ids = NULL;
GList *list = NULL;
gint i;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (gimage))
@ -1215,12 +1219,17 @@ image_get_channels_invoker (Gimp *gimp,
if (success) if (success)
{ {
GList *list = NULL;
list = GIMP_LIST (gimage->channels)->list; list = GIMP_LIST (gimage->channels)->list;
num_channels = g_list_length (list); num_channels = g_list_length (list);
if (num_channels) if (num_channels)
{ {
gint i;
channel_ids = g_new (gint32, num_channels); channel_ids = g_new (gint32, num_channels);
for (i = 0; i < num_channels; i++, list = g_list_next (list)) for (i = 0; i < num_channels; i++, list = g_list_next (list))
channel_ids[i] = gimp_item_get_ID (GIMP_ITEM (list->data)); channel_ids[i] = gimp_item_get_ID (GIMP_ITEM (list->data));
} }
@ -1289,8 +1298,6 @@ image_get_vectors_invoker (Gimp *gimp,
GimpImage *gimage; GimpImage *gimage;
gint32 num_vectors = 0; gint32 num_vectors = 0;
gint32 *vector_ids = NULL; gint32 *vector_ids = NULL;
GList *list = NULL;
gint i;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (gimage))
@ -1298,12 +1305,17 @@ image_get_vectors_invoker (Gimp *gimp,
if (success) if (success)
{ {
GList *list = NULL;
list = GIMP_LIST (gimage->vectors)->list; list = GIMP_LIST (gimage->vectors)->list;
num_vectors = g_list_length (list); num_vectors = g_list_length (list);
if (num_vectors) if (num_vectors)
{ {
gint i;
vector_ids = g_new (gint32, num_vectors); vector_ids = g_new (gint32, num_vectors);
for (i = 0; i < num_vectors; i++, list = g_list_next (list)) for (i = 0; i < num_vectors; i++, list = g_list_next (list))
vector_ids[i] = gimp_item_get_ID (GIMP_ITEM (list->data)); vector_ids[i] = gimp_item_get_ID (GIMP_ITEM (list->data));
} }
@ -1541,7 +1553,6 @@ image_floating_sel_attached_to_invoker (Gimp *gimp,
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *gimage;
GimpDrawable *drawable = NULL; GimpDrawable *drawable = NULL;
GimpLayer *floating_sel;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (gimage))
@ -1549,7 +1560,7 @@ image_floating_sel_attached_to_invoker (Gimp *gimp,
if (success) if (success)
{ {
floating_sel = gimp_image_floating_sel (gimage); GimpLayer *floating_sel = gimp_image_floating_sel (gimage);
if (floating_sel) if (floating_sel)
drawable = GIMP_DRAWABLE (GIMP_LAYER (floating_sel)->fs.drawable); drawable = GIMP_DRAWABLE (GIMP_LAYER (floating_sel)->fs.drawable);
@ -2213,7 +2224,7 @@ static ProcRecord image_raise_vectors_proc =
"Raise the specified vectors in the image's vectors stack", "Raise the specified vectors in the image's vectors stack",
"This procedure raises the specified vectors one step in the existing vectors stack. It will not move the vectors if there is no vectors above it.", "This procedure raises the specified vectors one step in the existing vectors stack. It will not move the vectors if there is no vectors above it.",
"Simon Budig", "Simon Budig",
"Spencer Kimball & Peter Mattis", "Simon Budig",
"2005", "2005",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
@ -2269,7 +2280,7 @@ static ProcRecord image_lower_vectors_proc =
"Lower the specified vectors in the image's vectors stack", "Lower the specified vectors in the image's vectors stack",
"This procedure lowers the specified vectors one step in the existing vectors stack. It will not move the vectors if there is no vectors below it.", "This procedure lowers the specified vectors one step in the existing vectors stack. It will not move the vectors if there is no vectors below it.",
"Simon Budig", "Simon Budig",
"Spencer Kimball & Peter Mattis", "Simon Budig",
"2005", "2005",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
@ -2325,7 +2336,7 @@ static ProcRecord image_raise_vectors_to_top_proc =
"Raise the specified vectors in the image's vectors stack to top of stack", "Raise the specified vectors in the image's vectors stack to top of stack",
"This procedure raises the specified vectors to top of the existing vectors stack. It will not move the vectors if there is no vectors above it.", "This procedure raises the specified vectors to top of the existing vectors stack. It will not move the vectors if there is no vectors above it.",
"Simon Budig", "Simon Budig",
"Spencer Kimball & Peter Mattis", "Simon Budig",
"2005", "2005",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
@ -2381,7 +2392,7 @@ static ProcRecord image_lower_vectors_to_bottom_proc =
"Lower the specified vectors in the image's vectors stack to bottom of stack", "Lower the specified vectors in the image's vectors stack to bottom of stack",
"This procedure lowers the specified vectors to bottom of the existing vectors stack. It will not move the vectors if there is no vectors below it.", "This procedure lowers the specified vectors to bottom of the existing vectors stack. It will not move the vectors if there is no vectors below it.",
"Simon Budig", "Simon Budig",
"Spencer Kimball & Peter Mattis", "Simon Budig",
"2005", "2005",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
@ -2628,7 +2639,7 @@ static ProcRecord image_remove_vectors_proc =
"Remove the specified path from the image.", "Remove the specified path from the image.",
"This procedure removes the specified path from the image. If the path doesn't exist, an error is returned.", "This procedure removes the specified path from the image. If the path doesn't exist, an error is returned.",
"Simon Budig", "Simon Budig",
"Spencer Kimball & Peter Mattis", "Simon Budig",
"2005", "2005",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
@ -4615,7 +4626,7 @@ static ProcRecord image_get_unit_proc =
"gimp-image-get-unit", "gimp-image-get-unit",
"Returns the specified image's unit.", "Returns the specified image's unit.",
"This procedure returns the specified image's unit. This value is independent of any of the layers in this image. See the gimp_unit_* procedure definitions for the valid range of unit IDs and a description of the unit system.", "This procedure returns the specified image's unit. This value is independent of any of the layers in this image. See the gimp_unit_* procedure definitions for the valid range of unit IDs and a description of the unit system.",
"Michael Natterer", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer", "Michael Natterer",
"1998", "1998",
NULL, NULL,
@ -4671,7 +4682,7 @@ static ProcRecord image_set_unit_proc =
"gimp-image-set-unit", "gimp-image-set-unit",
"Sets the specified image's unit.", "Sets the specified image's unit.",
"This procedure sets the specified image's unit. No scaling or resizing is performed. This value is independent of any of the layers in this image. See the gimp_unit_* procedure definitions for the valid range of unit IDs and a description of the unit system.", "This procedure sets the specified image's unit. No scaling or resizing is performed. This value is independent of any of the layers in this image. See the gimp_unit_* procedure definitions for the valid range of unit IDs and a description of the unit system.",
"Michael Natterer", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer", "Michael Natterer",
"1998", "1998",
NULL, NULL,

View File

@ -144,10 +144,7 @@ layer_new_invoker (Gimp *gimp,
if (success) if (success)
{ {
layer = gimp_layer_new (gimage, layer = gimp_layer_new (gimage, width, height, type, name,
width, height,
type,
name,
opacity / 100.0, mode); opacity / 100.0, mode);
success = (layer != NULL); success = (layer != NULL);
} }

View File

@ -124,7 +124,7 @@ static ProcRecord getpid_proc =
"gimp-getpid", "gimp-getpid",
"Returns the PID of the host gimp process.", "Returns the PID of the host gimp process.",
"This procedure returns the process ID of the currently running gimp.", "This procedure returns the process ID of the currently running gimp.",
"Michael Natterer", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer", "Michael Natterer",
"2005", "2005",
NULL, NULL,

View File

@ -145,7 +145,6 @@ palette_duplicate_invoker (Gimp *gimp,
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
gchar *name; gchar *name;
GimpPalette *palette = NULL;
GimpPalette *palette_copy = NULL; GimpPalette *palette_copy = NULL;
name = (gchar *) args[0].value.pdb_pointer; name = (gchar *) args[0].value.pdb_pointer;
@ -154,7 +153,7 @@ palette_duplicate_invoker (Gimp *gimp,
if (success) if (success)
{ {
palette = (GimpPalette *) GimpPalette *palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container, name); gimp_container_get_child_by_name (gimp->palette_factory->container, name);
if (palette) if (palette)
@ -182,7 +181,7 @@ static ProcArg palette_duplicate_inargs[] =
{ {
GIMP_PDB_STRING, GIMP_PDB_STRING,
"name", "name",
"The palette name." "The palette name"
} }
}; };
@ -257,7 +256,7 @@ static ProcArg palette_rename_inargs[] =
{ {
GIMP_PDB_STRING, GIMP_PDB_STRING,
"name", "name",
"The palette name." "The palette name"
}, },
{ {
GIMP_PDB_STRING, GIMP_PDB_STRING,
@ -301,7 +300,6 @@ palette_delete_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *name; gchar *name;
GimpPalette *palette = NULL;
name = (gchar *) args[0].value.pdb_pointer; name = (gchar *) args[0].value.pdb_pointer;
if (name == NULL || !g_utf8_validate (name, -1, NULL)) if (name == NULL || !g_utf8_validate (name, -1, NULL))
@ -309,7 +307,7 @@ palette_delete_invoker (Gimp *gimp,
if (success) if (success)
{ {
palette = (GimpPalette *) GimpPalette *palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container, name); gimp_container_get_child_by_name (gimp->palette_factory->container, name);
if (palette && GIMP_DATA (palette)->deletable) if (palette && GIMP_DATA (palette)->deletable)
@ -338,7 +336,7 @@ static ProcArg palette_delete_inargs[] =
{ {
GIMP_PDB_STRING, GIMP_PDB_STRING,
"name", "name",
"The palette name." "The palette name"
} }
}; };
@ -399,7 +397,7 @@ static ProcArg palette_is_editable_inargs[] =
{ {
GIMP_PDB_STRING, GIMP_PDB_STRING,
"name", "name",
"The palette name." "The palette name"
} }
}; };
@ -418,7 +416,7 @@ static ProcRecord palette_is_editable_proc =
"gimp-palette-is-editable", "gimp-palette-is-editable",
"Tests if palette can be edited", "Tests if palette can be edited",
"Returns True if you have permission to change the palette", "Returns True if you have permission to change the palette",
"Bill Skaggs <weskaggs@primate.ucdavis.edu", "Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"Bill Skaggs", "Bill Skaggs",
"2004", "2004",
NULL, NULL,
@ -466,7 +464,7 @@ static ProcArg palette_get_info_inargs[] =
{ {
GIMP_PDB_STRING, GIMP_PDB_STRING,
"name", "name",
"The palette name." "The palette name"
} }
}; };
@ -533,7 +531,7 @@ static ProcArg palette_get_columns_inargs[] =
{ {
GIMP_PDB_STRING, GIMP_PDB_STRING,
"name", "name",
"The palette name." "The palette name"
} }
}; };
@ -573,7 +571,6 @@ palette_set_columns_invoker (Gimp *gimp,
gboolean success = TRUE; gboolean success = TRUE;
gchar *name; gchar *name;
gint32 columns; gint32 columns;
GimpPalette *palette = NULL;
name = (gchar *) args[0].value.pdb_pointer; name = (gchar *) args[0].value.pdb_pointer;
if (name == NULL || !g_utf8_validate (name, -1, NULL)) if (name == NULL || !g_utf8_validate (name, -1, NULL))
@ -585,7 +582,7 @@ palette_set_columns_invoker (Gimp *gimp,
if (success) if (success)
{ {
palette = (GimpPalette *) GimpPalette *palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container, name); gimp_container_get_child_by_name (gimp->palette_factory->container, name);
if (palette && GIMP_DATA (palette)->writable) if (palette && GIMP_DATA (palette)->writable)
@ -602,7 +599,7 @@ static ProcArg palette_set_columns_inargs[] =
{ {
GIMP_PDB_STRING, GIMP_PDB_STRING,
"name", "name",
"The palette name." "The palette name"
}, },
{ {
GIMP_PDB_INT32, GIMP_PDB_INT32,
@ -640,7 +637,6 @@ palette_add_entry_invoker (Gimp *gimp,
gchar *name; gchar *name;
gchar *entry_name; gchar *entry_name;
GimpRGB color; GimpRGB color;
GimpPalette *palette = NULL;
GimpPaletteEntry *entry = NULL; GimpPaletteEntry *entry = NULL;
name = (gchar *) args[0].value.pdb_pointer; name = (gchar *) args[0].value.pdb_pointer;
@ -655,7 +651,7 @@ palette_add_entry_invoker (Gimp *gimp,
if (success) if (success)
{ {
palette = (GimpPalette *) GimpPalette *palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container, name); gimp_container_get_child_by_name (gimp->palette_factory->container, name);
if (palette && GIMP_DATA (palette)->writable) if (palette && GIMP_DATA (palette)->writable)
@ -677,7 +673,7 @@ static ProcArg palette_add_entry_inargs[] =
{ {
GIMP_PDB_STRING, GIMP_PDB_STRING,
"name", "name",
"The palette name." "The palette name"
}, },
{ {
GIMP_PDB_STRING, GIMP_PDB_STRING,
@ -727,8 +723,6 @@ palette_delete_entry_invoker (Gimp *gimp,
gboolean success = TRUE; gboolean success = TRUE;
gchar *name; gchar *name;
gint32 entry_num; gint32 entry_num;
GimpPalette *palette = NULL;
GimpPaletteEntry *entry = NULL;
name = (gchar *) args[0].value.pdb_pointer; name = (gchar *) args[0].value.pdb_pointer;
if (name == NULL || !g_utf8_validate (name, -1, NULL)) if (name == NULL || !g_utf8_validate (name, -1, NULL))
@ -738,14 +732,14 @@ palette_delete_entry_invoker (Gimp *gimp,
if (success) if (success)
{ {
palette = (GimpPalette *) GimpPalette *palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container, name); gimp_container_get_child_by_name (gimp->palette_factory->container, name);
if (palette && GIMP_DATA (palette)->writable) if (palette && GIMP_DATA (palette)->writable)
{ {
if (entry_num >= 0 && entry_num < palette->n_colors) if (entry_num >= 0 && entry_num < palette->n_colors)
{ {
entry = g_list_nth_data (palette->colors, entry_num); GimpPaletteEntry *entry = g_list_nth_data (palette->colors, entry_num);
gimp_palette_delete_entry (palette, entry); gimp_palette_delete_entry (palette, entry);
} }
@ -764,7 +758,7 @@ static ProcArg palette_delete_entry_inargs[] =
{ {
GIMP_PDB_STRING, GIMP_PDB_STRING,
"name", "name",
"The palette name." "The palette name"
}, },
{ {
GIMP_PDB_INT32, GIMP_PDB_INT32,
@ -802,8 +796,6 @@ palette_entry_get_color_invoker (Gimp *gimp,
gchar *name; gchar *name;
gint32 entry_num; gint32 entry_num;
GimpRGB color; GimpRGB color;
GimpPalette *palette = NULL;
GimpPaletteEntry *entry = NULL;
name = (gchar *) args[0].value.pdb_pointer; name = (gchar *) args[0].value.pdb_pointer;
if (name == NULL || !g_utf8_validate (name, -1, NULL)) if (name == NULL || !g_utf8_validate (name, -1, NULL))
@ -813,14 +805,14 @@ palette_entry_get_color_invoker (Gimp *gimp,
if (success) if (success)
{ {
palette = (GimpPalette *) GimpPalette *palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container, name); gimp_container_get_child_by_name (gimp->palette_factory->container, name);
if (palette) if (palette)
{ {
if (entry_num >= 0 && entry_num < palette->n_colors) if (entry_num >= 0 && entry_num < palette->n_colors)
{ {
entry = g_list_nth_data (palette->colors, entry_num); GimpPaletteEntry *entry = g_list_nth_data (palette->colors, entry_num);
color = entry->color; color = entry->color;
} }
@ -844,7 +836,7 @@ static ProcArg palette_entry_get_color_inargs[] =
{ {
GIMP_PDB_STRING, GIMP_PDB_STRING,
"name", "name",
"The palette name." "The palette name"
}, },
{ {
GIMP_PDB_INT32, GIMP_PDB_INT32,
@ -890,8 +882,6 @@ palette_entry_set_color_invoker (Gimp *gimp,
gchar *name; gchar *name;
gint32 entry_num; gint32 entry_num;
GimpRGB color; GimpRGB color;
GimpPalette *palette = NULL;
GimpPaletteEntry *entry = NULL;
name = (gchar *) args[0].value.pdb_pointer; name = (gchar *) args[0].value.pdb_pointer;
if (name == NULL || !g_utf8_validate (name, -1, NULL)) if (name == NULL || !g_utf8_validate (name, -1, NULL))
@ -903,14 +893,14 @@ palette_entry_set_color_invoker (Gimp *gimp,
if (success) if (success)
{ {
palette = (GimpPalette *) GimpPalette *palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container, name); gimp_container_get_child_by_name (gimp->palette_factory->container, name);
if (palette && GIMP_DATA (palette)->writable) if (palette && GIMP_DATA (palette)->writable)
{ {
if (entry_num >= 0 && entry_num < palette->n_colors) if (entry_num >= 0 && entry_num < palette->n_colors)
{ {
entry = g_list_nth_data (palette->colors, entry_num); GimpPaletteEntry *entry = g_list_nth_data (palette->colors, entry_num);
entry->color = color; entry->color = color;
@ -931,7 +921,7 @@ static ProcArg palette_entry_set_color_inargs[] =
{ {
GIMP_PDB_STRING, GIMP_PDB_STRING,
"name", "name",
"The palette name." "The palette name"
}, },
{ {
GIMP_PDB_INT32, GIMP_PDB_INT32,
@ -973,7 +963,6 @@ palette_entry_get_name_invoker (Gimp *gimp,
Argument *return_args; Argument *return_args;
gchar *name; gchar *name;
gint32 entry_num; gint32 entry_num;
GimpPalette *palette = NULL;
GimpPaletteEntry *entry = NULL; GimpPaletteEntry *entry = NULL;
name = (gchar *) args[0].value.pdb_pointer; name = (gchar *) args[0].value.pdb_pointer;
@ -984,7 +973,7 @@ palette_entry_get_name_invoker (Gimp *gimp,
if (success) if (success)
{ {
palette = (GimpPalette *) GimpPalette *palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container, name); gimp_container_get_child_by_name (gimp->palette_factory->container, name);
if (palette) if (palette)
@ -1011,7 +1000,7 @@ static ProcArg palette_entry_get_name_inargs[] =
{ {
GIMP_PDB_STRING, GIMP_PDB_STRING,
"name", "name",
"The palette name." "The palette name"
}, },
{ {
GIMP_PDB_INT32, GIMP_PDB_INT32,
@ -1057,8 +1046,6 @@ palette_entry_set_name_invoker (Gimp *gimp,
gchar *name; gchar *name;
gint32 entry_num; gint32 entry_num;
gchar *entry_name; gchar *entry_name;
GimpPalette *palette = NULL;
GimpPaletteEntry *entry = NULL;
name = (gchar *) args[0].value.pdb_pointer; name = (gchar *) args[0].value.pdb_pointer;
if (name == NULL || !g_utf8_validate (name, -1, NULL)) if (name == NULL || !g_utf8_validate (name, -1, NULL))
@ -1072,14 +1059,14 @@ palette_entry_set_name_invoker (Gimp *gimp,
if (success) if (success)
{ {
palette = (GimpPalette *) GimpPalette *palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container, name); gimp_container_get_child_by_name (gimp->palette_factory->container, name);
if (palette && GIMP_DATA (palette)->writable) if (palette && GIMP_DATA (palette)->writable)
{ {
if (entry_num >= 0 && entry_num < palette->n_colors) if (entry_num >= 0 && entry_num < palette->n_colors)
{ {
entry = g_list_nth_data (palette->colors, entry_num); GimpPaletteEntry *entry = g_list_nth_data (palette->colors, entry_num);
g_free (entry->name); g_free (entry->name);
entry->name = g_strdup (entry_name); entry->name = g_strdup (entry_name);
@ -1101,7 +1088,7 @@ static ProcArg palette_entry_set_name_inargs[] =
{ {
GIMP_PDB_STRING, GIMP_PDB_STRING,
"name", "name",
"The palette name." "The palette name"
}, },
{ {
GIMP_PDB_INT32, GIMP_PDB_INT32,

View File

@ -226,15 +226,15 @@ palettes_get_palette_entry_invoker (Gimp *gimp,
if (success) if (success)
{ {
if (name && strlen (name)) if (name && strlen (name))
{ {
palette = (GimpPalette *) palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container, gimp_container_get_child_by_name (gimp->palette_factory->container,
name); name);
} }
else else
{ {
palette = gimp_context_get_palette (context); palette = gimp_context_get_palette (context);
} }
if (palette) if (palette)
{ {

View File

@ -162,7 +162,6 @@ path_get_current_invoker (Gimp *gimp,
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *gimage;
gchar *name = NULL; gchar *name = NULL;
GimpVectors *vectors;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (gimage))
@ -170,7 +169,7 @@ path_get_current_invoker (Gimp *gimp,
if (success) if (success)
{ {
vectors = gimp_image_get_active_vectors (gimage); GimpVectors *vectors = gimp_image_get_active_vectors (gimage);
if (vectors) if (vectors)
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors))); name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors)));
@ -231,7 +230,6 @@ path_set_current_invoker (Gimp *gimp,
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
gchar *name; gchar *name;
GimpVectors *vectors;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (gimage))
@ -243,7 +241,7 @@ path_set_current_invoker (Gimp *gimp,
if (success) if (success)
{ {
vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors) if (vectors)
gimp_image_set_active_vectors (gimage, vectors); gimp_image_set_active_vectors (gimage, vectors);
@ -295,7 +293,6 @@ path_delete_invoker (Gimp *gimp,
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
gchar *name; gchar *name;
GimpVectors *vectors;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (gimage))
@ -307,7 +304,7 @@ path_delete_invoker (Gimp *gimp,
if (success) if (success)
{ {
vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors) if (vectors)
gimp_image_remove_vectors (gimage, vectors); gimp_image_remove_vectors (gimage, vectors);
@ -496,7 +493,6 @@ path_set_points_invoker (Gimp *gimp,
gint32 ptype; gint32 ptype;
gint32 num_path_points = 0; gint32 num_path_points = 0;
gdouble *points_pairs; gdouble *points_pairs;
gboolean closed = FALSE;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (gimage))
@ -516,6 +512,8 @@ path_set_points_invoker (Gimp *gimp,
if (success) if (success)
{ {
gboolean closed = FALSE;
if ((num_path_points / 3) % 3 == 0) if ((num_path_points / 3) % 3 == 0)
closed = TRUE; closed = TRUE;
else if ((num_path_points / 3) % 3 != 2) else if ((num_path_points / 3) % 3 != 2)
@ -680,12 +678,6 @@ path_get_point_at_dist_invoker (Gimp *gimp,
gint32 x_point = 0; gint32 x_point = 0;
gint32 y_point = 0; gint32 y_point = 0;
gdouble slope = 0; gdouble slope = 0;
GimpVectors *vectors;
GimpStroke *stroke;
gdouble distance_along;
gdouble stroke_length;
gdouble stroke_distance;
GimpCoords position;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (gimage))
@ -695,6 +687,13 @@ path_get_point_at_dist_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpVectors *vectors;
GimpStroke *stroke;
gdouble distance_along;
gdouble stroke_length;
gdouble stroke_distance;
GimpCoords position;
vectors = gimp_image_get_active_vectors (gimage); vectors = gimp_image_get_active_vectors (gimage);
if (vectors) if (vectors)
@ -813,7 +812,6 @@ path_get_tattoo_invoker (Gimp *gimp,
GimpImage *gimage; GimpImage *gimage;
gchar *name; gchar *name;
gint32 tattoo = 0; gint32 tattoo = 0;
GimpVectors *vectors;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (gimage))
@ -825,7 +823,7 @@ path_get_tattoo_invoker (Gimp *gimp,
if (success) if (success)
{ {
vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors) if (vectors)
tattoo = gimp_item_get_tattoo (GIMP_ITEM (vectors)); tattoo = gimp_item_get_tattoo (GIMP_ITEM (vectors));
@ -892,7 +890,6 @@ path_set_tattoo_invoker (Gimp *gimp,
GimpImage *gimage; GimpImage *gimage;
gchar *name; gchar *name;
gint32 tattovalue = 0; gint32 tattovalue = 0;
GimpVectors *vectors;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (gimage))
@ -906,7 +903,7 @@ path_set_tattoo_invoker (Gimp *gimp,
if (success) if (success)
{ {
vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors) if (vectors)
gimp_item_set_tattoo (GIMP_ITEM (vectors), tattovalue); gimp_item_set_tattoo (GIMP_ITEM (vectors), tattovalue);
@ -965,7 +962,6 @@ get_path_by_tattoo_invoker (Gimp *gimp,
GimpImage *gimage; GimpImage *gimage;
gint32 tattoo; gint32 tattoo;
gchar *name = NULL; gchar *name = NULL;
GimpVectors *vectors;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (gimage))
@ -975,7 +971,7 @@ get_path_by_tattoo_invoker (Gimp *gimp,
if (success) if (success)
{ {
vectors = gimp_image_get_vectors_by_tattoo (gimage, tattoo); GimpVectors *vectors = gimp_image_get_vectors_by_tattoo (gimage, tattoo);
if (vectors) if (vectors)
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors))); name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors)));
@ -1043,7 +1039,6 @@ path_get_locked_invoker (Gimp *gimp,
GimpImage *gimage; GimpImage *gimage;
gchar *name; gchar *name;
gboolean locked = FALSE; gboolean locked = FALSE;
GimpVectors *vectors;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (gimage))
@ -1055,7 +1050,7 @@ path_get_locked_invoker (Gimp *gimp,
if (success) if (success)
{ {
vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors) if (vectors)
locked = gimp_item_get_linked (GIMP_ITEM (vectors)); locked = gimp_item_get_linked (GIMP_ITEM (vectors));
@ -1122,7 +1117,6 @@ path_set_locked_invoker (Gimp *gimp,
GimpImage *gimage; GimpImage *gimage;
gchar *name; gchar *name;
gboolean locked = FALSE; gboolean locked = FALSE;
GimpVectors *vectors;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (gimage))
@ -1136,7 +1130,7 @@ path_set_locked_invoker (Gimp *gimp,
if (success) if (success)
{ {
vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors) if (vectors)
gimp_item_set_linked (GIMP_ITEM (vectors), locked, TRUE); gimp_item_set_linked (GIMP_ITEM (vectors), locked, TRUE);
@ -1195,7 +1189,6 @@ path_get_visible_invoker (Gimp *gimp,
GimpImage *gimage; GimpImage *gimage;
gchar *name; gchar *name;
gboolean visible = FALSE; gboolean visible = FALSE;
GimpVectors *vectors;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (gimage))
@ -1207,7 +1200,7 @@ path_get_visible_invoker (Gimp *gimp,
if (success) if (success)
{ {
vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors) if (vectors)
visible = gimp_item_get_visible (GIMP_ITEM (vectors)); visible = gimp_item_get_visible (GIMP_ITEM (vectors));
@ -1274,7 +1267,6 @@ path_set_visible_invoker (Gimp *gimp,
GimpImage *gimage; GimpImage *gimage;
gchar *name; gchar *name;
gboolean visible = FALSE; gboolean visible = FALSE;
GimpVectors *vectors;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (gimage))
@ -1288,7 +1280,7 @@ path_set_visible_invoker (Gimp *gimp,
if (success) if (success)
{ {
vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors) if (vectors)
gimp_item_set_visible (GIMP_ITEM (vectors), visible, TRUE); gimp_item_set_visible (GIMP_ITEM (vectors), visible, TRUE);
@ -1324,7 +1316,7 @@ static ProcRecord path_set_visible_proc =
"gimp-path-set-visible", "gimp-path-set-visible",
"Sets the visibility of the named path.", "Sets the visibility of the named path.",
"This procedure sets the specified path's visibility.", "This procedure sets the specified path's visibility.",
"Sven Neumann", "Sven Neumann <sven@gimp.org>",
"Sven Neumann", "Sven Neumann",
"2005", "2005",
NULL, NULL,
@ -1350,7 +1342,6 @@ path_to_selection_invoker (Gimp *gimp,
gboolean feather; gboolean feather;
gdouble feather_radius_x; gdouble feather_radius_x;
gdouble feather_radius_y; gdouble feather_radius_y;
GimpVectors *vectors;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (gimage))
@ -1374,7 +1365,7 @@ path_to_selection_invoker (Gimp *gimp,
if (success) if (success)
{ {
vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors) if (vectors)
gimp_channel_select_vectors (gimp_image_get_mask (gimage), gimp_channel_select_vectors (gimp_image_get_mask (gimage),
@ -1437,8 +1428,8 @@ static ProcRecord path_to_selection_proc =
"gimp-path-to-selection", "gimp-path-to-selection",
"Transforms the active path into a selection", "Transforms the active path into a selection",
"This procedure renders the desired path into the current selection.", "This procedure renders the desired path into the current selection.",
"Joao S. O. Bueno", "Jo\xc3\xa3o S. O. Bueno Calligaris",
"Joao S. O. Bueno", "Jo\xc3\xa3o S. O. Bueno Calligaris",
"2003", "2003",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
@ -1509,7 +1500,7 @@ static ProcRecord path_import_proc =
"gimp-path-import", "gimp-path-import",
"Import paths from an SVG file.", "Import paths from an SVG file.",
"This procedure imports paths from an SVG file. SVG elements other than paths and basic shapes are ignored.", "This procedure imports paths from an SVG file. SVG elements other than paths and basic shapes are ignored.",
"Sven Neumann", "Sven Neumann <sven@gimp.org>",
"Sven Neumann", "Sven Neumann",
"2003", "2003",
NULL, NULL,
@ -1589,7 +1580,7 @@ static ProcRecord path_import_string_proc =
"gimp-path-import-string", "gimp-path-import-string",
"Import paths from an SVG string.", "Import paths from an SVG string.",
"This procedure works like gimp_path_import() but takes a string rather than reading the SVG from a file. This allows you to write scripts that generate SVG and feed it to GIMP.", "This procedure works like gimp_path_import() but takes a string rather than reading the SVG from a file. This allows you to write scripts that generate SVG and feed it to GIMP.",
"Sven Neumann", "Sven Neumann <sven@gimp.org>",
"Sven Neumann", "Sven Neumann",
"2005", "2005",
NULL, NULL,

View File

@ -65,7 +65,7 @@ static ProcRecord patterns_refresh_proc =
"gimp-patterns-refresh", "gimp-patterns-refresh",
"Refresh current patterns. This function always succeeds.", "Refresh current patterns. This function always succeeds.",
"This procedure retrieves all patterns currently in the user's pattern path and updates all pattern dialogs accordingly.", "This procedure retrieves all patterns currently in the user's pattern path and updates all pattern dialogs accordingly.",
"Michael Natterer", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer", "Michael Natterer",
"2002", "2002",
NULL, NULL,

View File

@ -244,7 +244,7 @@ static ProcRecord plugin_domain_register_proc =
"gimp-plugin-domain-register", "gimp-plugin-domain-register",
"Registers a textdomain for localisation.", "Registers a textdomain for localisation.",
"This procedure adds a textdomain to the list of domains Gimp searches for strings when translating its menu entries. There is no need to call this function for plug-ins that have their strings included in the gimp-std-plugins domain as that is used by default. If the compiled message catalog is not in the standard location, you may specify an absolute path to another location. This procedure can only be called in the query function of a plug-in and it has to be called before any procedure is installed.", "This procedure adds a textdomain to the list of domains Gimp searches for strings when translating its menu entries. There is no need to call this function for plug-ins that have their strings included in the gimp-std-plugins domain as that is used by default. If the compiled message catalog is not in the standard location, you may specify an absolute path to another location. This procedure can only be called in the query function of a plug-in and it has to be called before any procedure is installed.",
"Sven Neumann", "Sven Neumann <sven@gimp.org>",
"Sven Neumann", "Sven Neumann",
"2000", "2000",
NULL, NULL,
@ -311,7 +311,7 @@ static ProcRecord plugin_help_register_proc =
"Register a help path for a plug-in.", "Register a help path for a plug-in.",
"This procedure changes the help rootdir for the plug-in which calls it. All subsequent calls of gimp_help from this plug-in will be interpreted relative to this rootdir.", "This procedure changes the help rootdir for the plug-in which calls it. All subsequent calls of gimp_help from this plug-in will be interpreted relative to this rootdir.",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer",
"2000", "2000",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
@ -380,7 +380,7 @@ static ProcRecord plugin_menu_register_proc =
"Register an additional menu path for a plug-in procedure.", "Register an additional menu path for a plug-in procedure.",
"This procedure installs an additional menu entry for the given procedure.", "This procedure installs an additional menu entry for the given procedure.",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer",
"2004", "2004",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
@ -452,7 +452,7 @@ static ProcRecord plugin_menu_branch_register_proc =
"Register a sub-menu.", "Register a sub-menu.",
"This procedure installs an sub-menu which does not belong to any procedure.", "This procedure installs an sub-menu which does not belong to any procedure.",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer",
"2005", "2005",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
@ -547,7 +547,7 @@ static ProcRecord plugin_icon_register_proc =
"Register an icon for a plug-in procedure.", "Register an icon for a plug-in procedure.",
"This procedure installs an icon for the given procedure.", "This procedure installs an icon for the given procedure.",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>", "Michael Natterer",
"2004", "2004",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,

View File

@ -64,6 +64,7 @@ procedural_db_temp_name_invoker (Gimp *gimp,
{ {
Argument *return_args; Argument *return_args;
gchar *temp_name; gchar *temp_name;
static gint proc_number = 0; static gint proc_number = 0;
temp_name = g_strdup_printf ("temp-procedure-number-%d", proc_number++); temp_name = g_strdup_printf ("temp-procedure-number-%d", proc_number++);
@ -636,7 +637,6 @@ procedural_db_get_data_invoker (Gimp *gimp,
gchar *identifier; gchar *identifier;
gint32 bytes; gint32 bytes;
guint8 *data_copy = NULL; guint8 *data_copy = NULL;
const guint8 *data;
identifier = (gchar *) args[0].value.pdb_pointer; identifier = (gchar *) args[0].value.pdb_pointer;
if (identifier == NULL || !g_utf8_validate (identifier, -1, NULL)) if (identifier == NULL || !g_utf8_validate (identifier, -1, NULL))
@ -644,7 +644,8 @@ procedural_db_get_data_invoker (Gimp *gimp,
if (success) if (success)
{ {
gchar *canonical; const guint8 *data;
gchar *canonical;
canonical = gimp_canonicalize_identifier (identifier); canonical = gimp_canonicalize_identifier (identifier);
@ -719,7 +720,6 @@ procedural_db_get_data_size_invoker (Gimp *gimp,
Argument *return_args; Argument *return_args;
gchar *identifier; gchar *identifier;
gint32 bytes; gint32 bytes;
const guint8 *data;
identifier = (gchar *) args[0].value.pdb_pointer; identifier = (gchar *) args[0].value.pdb_pointer;
if (identifier == NULL || !g_utf8_validate (identifier, -1, NULL)) if (identifier == NULL || !g_utf8_validate (identifier, -1, NULL))
@ -727,7 +727,8 @@ procedural_db_get_data_size_invoker (Gimp *gimp,
if (success) if (success)
{ {
gchar *canonical; const guint8 *data;
gchar *canonical;
canonical = gimp_canonicalize_identifier (identifier); canonical = gimp_canonicalize_identifier (identifier);

View File

@ -867,7 +867,6 @@ selection_layer_alpha_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpLayer *layer; GimpLayer *layer;
GimpImage *gimage;
layer = (GimpLayer *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); layer = (GimpLayer *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_LAYER (layer) && ! gimp_item_is_removed (GIMP_ITEM (layer)))) if (! (GIMP_IS_LAYER (layer) && ! gimp_item_is_removed (GIMP_ITEM (layer))))
@ -875,7 +874,8 @@ selection_layer_alpha_invoker (Gimp *gimp,
if (success) if (success)
{ {
gimage = gimp_item_get_image (GIMP_ITEM (layer)); GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (layer));
gimp_channel_select_alpha (gimp_image_get_mask (gimage), gimp_channel_select_alpha (gimp_image_get_mask (gimage),
GIMP_DRAWABLE (layer), GIMP_DRAWABLE (layer),
GIMP_CHANNEL_OP_REPLACE, FALSE, 0.0, 0.0); GIMP_CHANNEL_OP_REPLACE, FALSE, 0.0, 0.0);

View File

@ -64,7 +64,6 @@ by_color_select_invoker (Gimp *gimp,
gboolean feather; gboolean feather;
gdouble feather_radius; gdouble feather_radius;
gboolean sample_merged; gboolean sample_merged;
GimpImage *gimage;
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable)))) if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable))))
@ -90,7 +89,7 @@ by_color_select_invoker (Gimp *gimp,
if (success) if (success)
{ {
gimage = gimp_item_get_image (GIMP_ITEM (drawable)); GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable));
gimp_channel_select_by_color (gimp_image_get_mask (gimage), drawable, gimp_channel_select_by_color (gimp_image_get_mask (gimage), drawable,
sample_merged, sample_merged,
@ -213,14 +212,16 @@ ellipse_select_invoker (Gimp *gimp,
feather_radius = args[8].value.pdb_float; feather_radius = args[8].value.pdb_float;
if (success) if (success)
gimp_channel_select_ellipse (gimp_image_get_mask (gimage), {
(gint) x, (gint) y, gimp_channel_select_ellipse (gimp_image_get_mask (gimage),
(gint) width, (gint) height, (gint) x, (gint) y,
operation, (gint) width, (gint) height,
antialias, operation,
feather, antialias,
feather_radius, feather,
feather_radius); feather_radius,
feather_radius);
}
return procedural_db_return_args (&ellipse_select_proc, success); return procedural_db_return_args (&ellipse_select_proc, success);
} }
@ -330,15 +331,17 @@ free_select_invoker (Gimp *gimp,
feather_radius = args[6].value.pdb_float; feather_radius = args[6].value.pdb_float;
if (success) if (success)
gimp_channel_select_polygon (gimp_image_get_mask (gimage), {
_("Free Select"), gimp_channel_select_polygon (gimp_image_get_mask (gimage),
num_segs, _("Free Select"),
(GimpVector2 *) segs, num_segs,
operation, (GimpVector2 *) segs,
antialias, operation,
feather, antialias,
feather_radius, feather,
feather_radius); feather_radius,
feather_radius);
}
return procedural_db_return_args (&free_select_proc, success); return procedural_db_return_args (&free_select_proc, success);
} }
@ -416,7 +419,6 @@ fuzzy_select_invoker (Gimp *gimp,
gboolean feather; gboolean feather;
gdouble feather_radius; gdouble feather_radius;
gboolean sample_merged; gboolean sample_merged;
GimpImage *gimage;
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable)))) if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable))))
@ -444,7 +446,7 @@ fuzzy_select_invoker (Gimp *gimp,
if (success) if (success)
{ {
gimage = gimp_item_get_image (GIMP_ITEM (drawable)); GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable));
gimp_channel_select_fuzzy (gimp_image_get_mask (gimage), gimp_channel_select_fuzzy (gimp_image_get_mask (gimage),
drawable, drawable,
@ -571,13 +573,15 @@ rect_select_invoker (Gimp *gimp,
feather_radius = args[7].value.pdb_float; feather_radius = args[7].value.pdb_float;
if (success) if (success)
gimp_channel_select_rectangle (gimp_image_get_mask (gimage), {
(gint) x, (gint) y, gimp_channel_select_rectangle (gimp_image_get_mask (gimage),
(gint) width, (gint) height, (gint) x, (gint) y,
operation, (gint) width, (gint) height,
feather, operation,
feather_radius, feather,
feather_radius); feather_radius,
feather_radius);
}
return procedural_db_return_args (&rect_select_proc, success); return procedural_db_return_args (&rect_select_proc, success);
} }

View File

@ -221,7 +221,6 @@ text_get_extents_fontname_invoker (Gimp *gimp,
gint32 height; gint32 height;
gint32 ascent; gint32 ascent;
gint32 descent; gint32 descent;
gchar *real_fontname;
text = (gchar *) args[0].value.pdb_pointer; text = (gchar *) args[0].value.pdb_pointer;
if (text == NULL || !g_utf8_validate (text, -1, NULL)) if (text == NULL || !g_utf8_validate (text, -1, NULL))
@ -241,7 +240,7 @@ text_get_extents_fontname_invoker (Gimp *gimp,
if (success) if (success)
{ {
real_fontname = g_strdup_printf ("%s %d", fontname, (gint) size); gchar *real_fontname = g_strdup_printf ("%s %d", fontname, (gint) size);
success = text_get_extents (real_fontname, text, success = text_get_extents (real_fontname, text,
&width, &height, &width, &height,
@ -580,7 +579,6 @@ text_get_extents_invoker (Gimp *gimp,
gint32 height; gint32 height;
gint32 ascent; gint32 ascent;
gint32 descent; gint32 descent;
gchar *real_fontname;
text = (gchar *) args[0].value.pdb_pointer; text = (gchar *) args[0].value.pdb_pointer;
if (text == NULL || !g_utf8_validate (text, -1, NULL)) if (text == NULL || !g_utf8_validate (text, -1, NULL))
@ -628,7 +626,7 @@ text_get_extents_invoker (Gimp *gimp,
if (success) if (success)
{ {
real_fontname = g_strdup_printf ("%s %d", family, (gint) size); gchar *real_fontname = g_strdup_printf ("%s %d", family, (gint) size);
success = text_get_extents (real_fontname, text, success = text_get_extents (real_fontname, text,
&width, &height, &width, &height,

View File

@ -498,22 +498,22 @@ static ProcArg scale_inargs[] =
{ {
GIMP_PDB_FLOAT, GIMP_PDB_FLOAT,
"x0", "x0",
"The new x coordinate of upper-left corner of newly scaled region" "The new x coordinate of the upper-left corner of the scaled region"
}, },
{ {
GIMP_PDB_FLOAT, GIMP_PDB_FLOAT,
"y0", "y0",
"The new y coordinate of upper-left corner of newly scaled region" "The new y coordinate of the upper-left corner of the scaled region"
}, },
{ {
GIMP_PDB_FLOAT, GIMP_PDB_FLOAT,
"x1", "x1",
"The new x coordinate of lower-right corner of newly scaled region" "The new x coordinate of the lower-right corner of the scaled region"
}, },
{ {
GIMP_PDB_FLOAT, GIMP_PDB_FLOAT,
"y1", "y1",
"The new y coordinate of lower-right corner of newly scaled region" "The new y coordinate of the lower-right corner of the scaled region"
} }
}; };

View File

@ -59,7 +59,6 @@ image_undo_group_start_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
gchar *undo_desc = NULL;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (gimage))
@ -67,6 +66,8 @@ image_undo_group_start_invoker (Gimp *gimp,
if (success) if (success)
{ {
gchar *undo_desc = NULL;
if (gimp->current_plug_in) if (gimp->current_plug_in)
undo_desc = plug_in_get_undo_desc (gimp->current_plug_in); undo_desc = plug_in_get_undo_desc (gimp->current_plug_in);

View File

@ -89,7 +89,7 @@ static ProcRecord unit_get_number_of_units_proc =
"gimp-unit-get-number-of-units", "gimp-unit-get-number-of-units",
"Returns the number of units.", "Returns the number of units.",
"This procedure returns the number of defined units.", "This procedure returns the number of defined units.",
"Michael Natterer", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer", "Michael Natterer",
"1999", "1999",
NULL, NULL,
@ -130,7 +130,7 @@ static ProcRecord unit_get_number_of_built_in_units_proc =
"gimp-unit-get-number-of-built-in-units", "gimp-unit-get-number-of-built-in-units",
"Returns the number of built-in units.", "Returns the number of built-in units.",
"This procedure returns the number of defined units built-in to the GIMP.", "This procedure returns the number of defined units built-in to the GIMP.",
"Michael Natterer", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer", "Michael Natterer",
"1999", "1999",
NULL, NULL,
@ -184,8 +184,10 @@ unit_new_invoker (Gimp *gimp,
success = FALSE; success = FALSE;
if (success) if (success)
unit = _gimp_unit_new (gimp, identifier, factor, digits, symbol, abbreviation, {
singular, plural); unit = _gimp_unit_new (gimp, identifier, factor, digits, symbol, abbreviation,
singular, plural);
}
return_args = procedural_db_return_args (&unit_new_proc, success); return_args = procedural_db_return_args (&unit_new_proc, success);
@ -249,7 +251,7 @@ static ProcRecord unit_new_proc =
"gimp-unit-new", "gimp-unit-new",
"Creates a new unit and returns it's integer ID.", "Creates a new unit and returns it's integer ID.",
"This procedure creates a new unit and returns it's integer ID. Note that the new unit will have it's deletion flag set to TRUE, so you will have to set it to FALSE with gimp_unit_set_deletion_flag to make it persistent.", "This procedure creates a new unit and returns it's integer ID. Note that the new unit will have it's deletion flag set to TRUE, so you will have to set it to FALSE with gimp_unit_set_deletion_flag to make it persistent.",
"Michael Natterer", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer", "Michael Natterer",
"1999", "1999",
NULL, NULL,
@ -307,7 +309,7 @@ static ProcRecord unit_get_deletion_flag_proc =
"gimp-unit-get-deletion-flag", "gimp-unit-get-deletion-flag",
"Returns the deletion flag of the unit.", "Returns the deletion flag of the unit.",
"This procedure returns the deletion flag of the unit. If this value is TRUE the unit's definition will not be saved in the user's unitrc file on gimp exit.", "This procedure returns the deletion flag of the unit. If this value is TRUE the unit's definition will not be saved in the user's unitrc file on gimp exit.",
"Michael Natterer", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer", "Michael Natterer",
"1999", "1999",
NULL, NULL,
@ -361,7 +363,7 @@ static ProcRecord unit_set_deletion_flag_proc =
"gimp-unit-set-deletion-flag", "gimp-unit-set-deletion-flag",
"Sets the deletion flag of a unit.", "Sets the deletion flag of a unit.",
"This procedure sets the unit's deletion flag. If the deletion flag of a unit is TRUE on gimp exit, this unit's definition will not be saved in the user's unitrc.", "This procedure sets the unit's deletion flag. If the deletion flag of a unit is TRUE on gimp exit, this unit's definition will not be saved in the user's unitrc.",
"Michael Natterer", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer", "Michael Natterer",
"1999", "1999",
NULL, NULL,
@ -419,7 +421,7 @@ static ProcRecord unit_get_identifier_proc =
"gimp-unit-get-identifier", "gimp-unit-get-identifier",
"Returns the textual identifier of the unit.", "Returns the textual identifier of the unit.",
"This procedure returns the textual identifier of the unit. For built-in units it will be the english singular form of the unit's name. For user-defined units this should equal to the singular form.", "This procedure returns the textual identifier of the unit. For built-in units it will be the english singular form of the unit's name. For user-defined units this should equal to the singular form.",
"Michael Natterer", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer", "Michael Natterer",
"1999", "1999",
NULL, NULL,
@ -477,7 +479,7 @@ static ProcRecord unit_get_factor_proc =
"gimp-unit-get-factor", "gimp-unit-get-factor",
"Returns the factor of the unit.", "Returns the factor of the unit.",
"This procedure returns the unit's factor which indicates how many units make up an inch. Note that asking for the factor of \"pixels\" will produce an error.", "This procedure returns the unit's factor which indicates how many units make up an inch. Note that asking for the factor of \"pixels\" will produce an error.",
"Michael Natterer", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer", "Michael Natterer",
"1999", "1999",
NULL, NULL,
@ -535,7 +537,7 @@ static ProcRecord unit_get_digits_proc =
"gimp-unit-get-digits", "gimp-unit-get-digits",
"Returns the number of digits of the unit.", "Returns the number of digits of the unit.",
"This procedure returns the number of digits you should provide in input or output functions to get approximately the same accuracy as with two digits and inches. Note that asking for the digits of \"pixels\" will produce an error.", "This procedure returns the number of digits you should provide in input or output functions to get approximately the same accuracy as with two digits and inches. Note that asking for the digits of \"pixels\" will produce an error.",
"Michael Natterer", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer", "Michael Natterer",
"1999", "1999",
NULL, NULL,
@ -593,7 +595,7 @@ static ProcRecord unit_get_symbol_proc =
"gimp-unit-get-symbol", "gimp-unit-get-symbol",
"Returns the symbol of the unit.", "Returns the symbol of the unit.",
"This procedure returns the symbol of the unit (\"''\" for inches).", "This procedure returns the symbol of the unit (\"''\" for inches).",
"Michael Natterer", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer", "Michael Natterer",
"1999", "1999",
NULL, NULL,
@ -651,7 +653,7 @@ static ProcRecord unit_get_abbreviation_proc =
"gimp-unit-get-abbreviation", "gimp-unit-get-abbreviation",
"Returns the abbreviation of the unit.", "Returns the abbreviation of the unit.",
"This procedure returns the abbreviation of the unit (\"in\" for inches).", "This procedure returns the abbreviation of the unit (\"in\" for inches).",
"Michael Natterer", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer", "Michael Natterer",
"1999", "1999",
NULL, NULL,
@ -709,7 +711,7 @@ static ProcRecord unit_get_singular_proc =
"gimp-unit-get-singular", "gimp-unit-get-singular",
"Returns the singular form of the unit.", "Returns the singular form of the unit.",
"This procedure returns the singular form of the unit.", "This procedure returns the singular form of the unit.",
"Michael Natterer", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer", "Michael Natterer",
"1999", "1999",
NULL, NULL,
@ -767,7 +769,7 @@ static ProcRecord unit_get_plural_proc =
"gimp-unit-get-plural", "gimp-unit-get-plural",
"Returns the plural form of the unit.", "Returns the plural form of the unit.",
"This procedure returns the plural form of the unit.", "This procedure returns the plural form of the unit.",
"Michael Natterer", "Michael Natterer <mitch@gimp.org>",
"Michael Natterer", "Michael Natterer",
"1999", "1999",
NULL, NULL,

View File

@ -97,7 +97,7 @@ vectors_new_invoker (Gimp *gimp,
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *gimage;
gchar *name = NULL; gchar *name;
GimpVectors *vectors = NULL; GimpVectors *vectors = NULL;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
@ -173,8 +173,6 @@ vectors_get_strokes_invoker (Gimp *gimp,
GimpVectors *vectors; GimpVectors *vectors;
gint32 num_strokes = 0; gint32 num_strokes = 0;
gint32 *stroke_ids = NULL; gint32 *stroke_ids = NULL;
gint i = 0;
GimpStroke *cur_stroke = NULL;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors)))) if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
@ -186,6 +184,9 @@ vectors_get_strokes_invoker (Gimp *gimp,
if (num_strokes) if (num_strokes)
{ {
GimpStroke *cur_stroke;
gint i = 0;
stroke_ids = g_new (gint32, num_strokes); stroke_ids = g_new (gint32, num_strokes);
for (cur_stroke = gimp_vectors_stroke_get_next (vectors, NULL); for (cur_stroke = gimp_vectors_stroke_get_next (vectors, NULL);
@ -386,7 +387,7 @@ vectors_set_linked_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpVectors *vectors; GimpVectors *vectors;
gboolean linked = FALSE; gboolean linked;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors)))) if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
@ -506,7 +507,7 @@ vectors_set_visible_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpVectors *vectors; GimpVectors *vectors;
gboolean visible = FALSE; gboolean visible;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors)))) if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
@ -626,7 +627,7 @@ vectors_set_name_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpVectors *vectors; GimpVectors *vectors;
gchar *name = NULL; gchar *name;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors)))) if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
@ -749,7 +750,7 @@ vectors_set_tattoo_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpVectors *vectors; GimpVectors *vectors;
gint32 tattoo = 0; gint32 tattoo;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors)))) if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
@ -808,8 +809,7 @@ vectors_stroke_get_length_invoker (Gimp *gimp,
GimpVectors *vectors; GimpVectors *vectors;
gint32 stroke_id; gint32 stroke_id;
gdouble prescision; gdouble prescision;
gdouble length; gdouble length = 0;
GimpStroke *stroke;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors)))) if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
@ -821,16 +821,12 @@ vectors_stroke_get_length_invoker (Gimp *gimp,
if (success) if (success)
{ {
stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id); GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
if (!stroke) if (stroke)
{ length = gimp_stroke_get_length (stroke, prescision);
success = FALSE;
}
else else
{ success = FALSE;
length = gimp_stroke_get_length (stroke, prescision);
}
} }
return_args = procedural_db_return_args (&vectors_stroke_get_length_proc, success); return_args = procedural_db_return_args (&vectors_stroke_get_length_proc, success);
@ -873,7 +869,7 @@ static ProcRecord vectors_stroke_get_length_proc =
{ {
"gimp-vectors-stroke-get-length", "gimp-vectors-stroke-get-length",
"gimp-vectors-stroke-get-length", "gimp-vectors-stroke-get-length",
"measures the length of the given stroke.", "Measure the length of the given stroke.",
"Measure the length of the given stroke.", "Measure the length of the given stroke.",
"Simon Budig", "Simon Budig",
"Simon Budig", "Simon Budig",
@ -903,8 +899,6 @@ vectors_stroke_get_point_at_dist_invoker (Gimp *gimp,
gdouble y_point = 0; gdouble y_point = 0;
gdouble slope = 0; gdouble slope = 0;
gboolean valid = FALSE; gboolean valid = FALSE;
GimpStroke *stroke;
GimpCoords coord;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors)))) if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
@ -918,10 +912,12 @@ vectors_stroke_get_point_at_dist_invoker (Gimp *gimp,
if (success) if (success)
{ {
stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id); GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
if (stroke) if (stroke)
{ {
GimpCoords coord;
valid = gimp_stroke_get_point_at_dist (stroke, dist, prescision, valid = gimp_stroke_get_point_at_dist (stroke, dist, prescision,
&coord, &slope); &coord, &slope);
x_point = valid ? coord.x : 0; x_point = valid ? coord.x : 0;
@ -1021,7 +1017,6 @@ vectors_stroke_remove_invoker (Gimp *gimp,
gboolean success = TRUE; gboolean success = TRUE;
GimpVectors *vectors; GimpVectors *vectors;
gint32 stroke_id; gint32 stroke_id;
GimpStroke *stroke;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors)))) if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
@ -1031,7 +1026,7 @@ vectors_stroke_remove_invoker (Gimp *gimp,
if (success) if (success)
{ {
stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id); GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
if (stroke) if (stroke)
gimp_vectors_stroke_remove (vectors, stroke); gimp_vectors_stroke_remove (vectors, stroke);
@ -1083,7 +1078,6 @@ vectors_stroke_close_invoker (Gimp *gimp,
gboolean success = TRUE; gboolean success = TRUE;
GimpVectors *vectors; GimpVectors *vectors;
gint32 stroke_id; gint32 stroke_id;
GimpStroke *stroke;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors)))) if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
@ -1093,7 +1087,7 @@ vectors_stroke_close_invoker (Gimp *gimp,
if (success) if (success)
{ {
stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id); GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
if (stroke) if (stroke)
gimp_stroke_close (stroke); gimp_stroke_close (stroke);
@ -1147,7 +1141,6 @@ vectors_stroke_translate_invoker (Gimp *gimp,
gint32 stroke_id; gint32 stroke_id;
gint32 off_x; gint32 off_x;
gint32 off_y; gint32 off_y;
GimpStroke *stroke;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors)))) if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
@ -1161,7 +1154,7 @@ vectors_stroke_translate_invoker (Gimp *gimp,
if (success) if (success)
{ {
stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id); GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
if (stroke) if (stroke)
gimp_stroke_translate (stroke, off_x, off_y); gimp_stroke_translate (stroke, off_x, off_y);
@ -1225,7 +1218,6 @@ vectors_stroke_scale_invoker (Gimp *gimp,
gint32 stroke_id; gint32 stroke_id;
gdouble scale_x; gdouble scale_x;
gdouble scale_y; gdouble scale_y;
GimpStroke *stroke;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors)))) if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
@ -1239,7 +1231,7 @@ vectors_stroke_scale_invoker (Gimp *gimp,
if (success) if (success)
{ {
stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id); GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
if (stroke) if (stroke)
gimp_stroke_scale (stroke, scale_x, scale_y); gimp_stroke_scale (stroke, scale_x, scale_y);
@ -1306,9 +1298,6 @@ vectors_stroke_interpolate_invoker (Gimp *gimp,
gboolean closed; gboolean closed;
gint32 num_coords = 0; gint32 num_coords = 0;
gdouble *coords = NULL; gdouble *coords = NULL;
GimpStroke *stroke;
GArray *coords_array;
gint i;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors)))) if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
@ -1320,11 +1309,15 @@ vectors_stroke_interpolate_invoker (Gimp *gimp,
if (success) if (success)
{ {
stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id); GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
if (stroke) if (stroke)
{ {
GArray *coords_array;
gint i;
coords_array = gimp_stroke_interpolate (stroke, prescision, &closed); coords_array = gimp_stroke_interpolate (stroke, prescision, &closed);
if (coords_array) if (coords_array)
{ {
num_coords = coords_array->len; num_coords = coords_array->len;
@ -1429,8 +1422,6 @@ vectors_bezier_stroke_new_moveto_invoker (Gimp *gimp,
gdouble x0 = 0; gdouble x0 = 0;
gdouble y0 = 0; gdouble y0 = 0;
gint32 stroke_id = 0; gint32 stroke_id = 0;
GimpStroke *stroke;
GimpCoords coord0;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors)))) if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
@ -1442,12 +1433,15 @@ vectors_bezier_stroke_new_moveto_invoker (Gimp *gimp,
if (success) if (success)
{ {
coord0.x = x0; GimpStroke *stroke;
coord0.y = y0; GimpCoords coord0;
coord0.x = x0;
coord0.y = y0;
coord0.pressure = GIMP_COORDS_DEFAULT_PRESSURE; coord0.pressure = GIMP_COORDS_DEFAULT_PRESSURE;
coord0.xtilt = GIMP_COORDS_DEFAULT_TILT; coord0.xtilt = GIMP_COORDS_DEFAULT_TILT;
coord0.ytilt = GIMP_COORDS_DEFAULT_TILT; coord0.ytilt = GIMP_COORDS_DEFAULT_TILT;
coord0.wheel = GIMP_COORDS_DEFAULT_WHEEL; coord0.wheel = GIMP_COORDS_DEFAULT_WHEEL;
stroke = gimp_bezier_stroke_new_moveto (&coord0); stroke = gimp_bezier_stroke_new_moveto (&coord0);
gimp_vectors_stroke_add (vectors, stroke); gimp_vectors_stroke_add (vectors, stroke);
@ -1519,8 +1513,6 @@ vectors_bezier_stroke_lineto_invoker (Gimp *gimp,
gint32 stroke_id; gint32 stroke_id;
gdouble x0 = 0; gdouble x0 = 0;
gdouble y0 = 0; gdouble y0 = 0;
GimpStroke *stroke;
GimpCoords coord0;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors)))) if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
@ -1534,18 +1526,25 @@ vectors_bezier_stroke_lineto_invoker (Gimp *gimp,
if (success) if (success)
{ {
coord0.x = x0; GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
coord0.y = y0;
coord0.pressure = GIMP_COORDS_DEFAULT_PRESSURE;
coord0.xtilt = GIMP_COORDS_DEFAULT_TILT;
coord0.ytilt = GIMP_COORDS_DEFAULT_TILT;
coord0.wheel = GIMP_COORDS_DEFAULT_WHEEL;
stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
if (stroke) if (stroke)
gimp_bezier_stroke_lineto (stroke, &coord0); {
GimpCoords coord0;
coord0.x = x0;
coord0.y = y0;
coord0.pressure = GIMP_COORDS_DEFAULT_PRESSURE;
coord0.xtilt = GIMP_COORDS_DEFAULT_TILT;
coord0.ytilt = GIMP_COORDS_DEFAULT_TILT;
coord0.wheel = GIMP_COORDS_DEFAULT_WHEEL;
gimp_bezier_stroke_lineto (stroke, &coord0);
}
else else
success = FALSE; {
success = FALSE;
}
} }
return procedural_db_return_args (&vectors_bezier_stroke_lineto_proc, success); return procedural_db_return_args (&vectors_bezier_stroke_lineto_proc, success);
@ -1602,12 +1601,10 @@ vectors_bezier_stroke_conicto_invoker (Gimp *gimp,
gboolean success = TRUE; gboolean success = TRUE;
GimpVectors *vectors; GimpVectors *vectors;
gint32 stroke_id; gint32 stroke_id;
gdouble x0 = 0; gdouble x0;
gdouble y0 = 0; gdouble y0;
gdouble x1 = 0; gdouble x1;
gdouble y1 = 0; gdouble y1;
GimpStroke *stroke;
GimpCoords coord0, coord1;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors)))) if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
@ -1625,22 +1622,29 @@ vectors_bezier_stroke_conicto_invoker (Gimp *gimp,
if (success) if (success)
{ {
coord0.x = x0; GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
coord0.y = y0;
coord0.pressure = GIMP_COORDS_DEFAULT_PRESSURE;
coord0.xtilt = GIMP_COORDS_DEFAULT_TILT;
coord0.ytilt = GIMP_COORDS_DEFAULT_TILT;
coord0.wheel = GIMP_COORDS_DEFAULT_WHEEL;
coord1 = coord0;
coord1.x = x1;
coord1.y = y1;
stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
if (stroke) if (stroke)
gimp_bezier_stroke_conicto (stroke, &coord0, &coord1); {
GimpCoords coord0, coord1;
coord0.x = x0;
coord0.y = y0;
coord0.pressure = GIMP_COORDS_DEFAULT_PRESSURE;
coord0.xtilt = GIMP_COORDS_DEFAULT_TILT;
coord0.ytilt = GIMP_COORDS_DEFAULT_TILT;
coord0.wheel = GIMP_COORDS_DEFAULT_WHEEL;
coord1 = coord0;
coord1.x = x1;
coord1.y = y1;
gimp_bezier_stroke_conicto (stroke, &coord0, &coord1);
}
else else
success = FALSE; {
success = FALSE;
}
} }
return procedural_db_return_args (&vectors_bezier_stroke_conicto_proc, success); return procedural_db_return_args (&vectors_bezier_stroke_conicto_proc, success);
@ -1707,14 +1711,12 @@ vectors_bezier_stroke_cubicto_invoker (Gimp *gimp,
gboolean success = TRUE; gboolean success = TRUE;
GimpVectors *vectors; GimpVectors *vectors;
gint32 stroke_id; gint32 stroke_id;
gdouble x0 = 0; gdouble x0;
gdouble y0 = 0; gdouble y0;
gdouble x1 = 0; gdouble x1;
gdouble y1 = 0; gdouble y1;
gdouble x2 = 0; gdouble x2;
gdouble y2 = 0; gdouble y2;
GimpStroke *stroke;
GimpCoords coord0, coord1, coord2;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors)))) if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
@ -1736,26 +1738,33 @@ vectors_bezier_stroke_cubicto_invoker (Gimp *gimp,
if (success) if (success)
{ {
coord0.x = x0; GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
coord0.y = y0;
coord0.pressure = GIMP_COORDS_DEFAULT_PRESSURE;
coord0.xtilt = GIMP_COORDS_DEFAULT_TILT;
coord0.ytilt = GIMP_COORDS_DEFAULT_TILT;
coord0.wheel = GIMP_COORDS_DEFAULT_WHEEL;
coord1 = coord0;
coord1.x = x1;
coord1.y = y1;
coord2 = coord0;
coord2.x = x2;
coord2.y = y2;
stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
if (stroke) if (stroke)
gimp_bezier_stroke_cubicto (stroke, &coord0, &coord1, &coord2); {
GimpCoords coord0, coord1, coord2;
coord0.x = x0;
coord0.y = y0;
coord0.pressure = GIMP_COORDS_DEFAULT_PRESSURE;
coord0.xtilt = GIMP_COORDS_DEFAULT_TILT;
coord0.ytilt = GIMP_COORDS_DEFAULT_TILT;
coord0.wheel = GIMP_COORDS_DEFAULT_WHEEL;
coord1 = coord0;
coord1.x = x1;
coord1.y = y1;
coord2 = coord0;
coord2.x = x2;
coord2.y = y2;
gimp_bezier_stroke_cubicto (stroke, &coord0, &coord1, &coord2);
}
else else
success = FALSE; {
success = FALSE;
}
} }
return procedural_db_return_args (&vectors_bezier_stroke_cubicto_proc, success); return procedural_db_return_args (&vectors_bezier_stroke_cubicto_proc, success);
@ -1832,14 +1841,12 @@ vectors_bezier_stroke_new_ellipse_invoker (Gimp *gimp,
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpVectors *vectors; GimpVectors *vectors;
gdouble x0 = 0; gdouble x0;
gdouble y0 = 0; gdouble y0;
gdouble radius_x = 0; gdouble radius_x;
gdouble radius_y = 0; gdouble radius_y;
gdouble angle = 0; gdouble angle;
gint32 stroke_id = 0; gint32 stroke_id = 0;
GimpStroke *stroke;
GimpCoords coord0;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors)))) if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
@ -1857,12 +1864,15 @@ vectors_bezier_stroke_new_ellipse_invoker (Gimp *gimp,
if (success) if (success)
{ {
coord0.x = x0; GimpStroke *stroke;
coord0.y = y0; GimpCoords coord0;
coord0.x = x0;
coord0.y = y0;
coord0.pressure = GIMP_COORDS_DEFAULT_PRESSURE; coord0.pressure = GIMP_COORDS_DEFAULT_PRESSURE;
coord0.xtilt = GIMP_COORDS_DEFAULT_TILT; coord0.xtilt = GIMP_COORDS_DEFAULT_TILT;
coord0.ytilt = GIMP_COORDS_DEFAULT_TILT; coord0.ytilt = GIMP_COORDS_DEFAULT_TILT;
coord0.wheel = GIMP_COORDS_DEFAULT_WHEEL; coord0.wheel = GIMP_COORDS_DEFAULT_WHEEL;
stroke = gimp_bezier_stroke_new_ellipse (&coord0, radius_x, radius_y, angle); stroke = gimp_bezier_stroke_new_ellipse (&coord0, radius_x, radius_y, angle);
gimp_vectors_stroke_add (vectors, stroke); gimp_vectors_stroke_add (vectors, stroke);

View File

@ -618,8 +618,8 @@ gimp_histogram (gint32 drawable_ID,
* @drawable_ID: The drawable. * @drawable_ID: The drawable.
* @hue_range: Range of affected hues. * @hue_range: Range of affected hues.
* @hue_offset: Hue offset in degrees. * @hue_offset: Hue offset in degrees.
* @lightness: lightness modification. * @lightness: Lightness modification.
* @saturation: saturation modification. * @saturation: Saturation modification.
* *
* Modify hue, lightness, and saturation in the specified drawable. * Modify hue, lightness, and saturation in the specified drawable.
* *

View File

@ -524,10 +524,10 @@ gimp_drawable_transform_rotate_default (gint32 drawable_ID,
/** /**
* gimp_drawable_transform_scale: * gimp_drawable_transform_scale:
* @drawable_ID: The affected drawable. * @drawable_ID: The affected drawable.
* @x0: The new x coordinate of upper-left corner of newly scaled region. * @x0: The new x coordinate of the upper-left corner of the scaled region.
* @y0: The new y coordinate of upper-left corner of newly scaled region. * @y0: The new y coordinate of the upper-left corner of the scaled region.
* @x1: The new x coordinate of lower-right corner of newly scaled region. * @x1: The new x coordinate of the lower-right corner of the scaled region.
* @y1: The new y coordinate of lower-right corner of newly scaled region. * @y1: The new y coordinate of the lower-right corner of the scaled region.
* @transform_direction: Direction of Transformation. * @transform_direction: Direction of Transformation.
* @interpolation: Type of interpolation. * @interpolation: Type of interpolation.
* @supersample: Whether to perform supersample. * @supersample: Whether to perform supersample.
@ -589,10 +589,10 @@ gimp_drawable_transform_scale (gint32 drawable_ID,
/** /**
* gimp_drawable_transform_scale_default: * gimp_drawable_transform_scale_default:
* @drawable_ID: The affected drawable. * @drawable_ID: The affected drawable.
* @x0: The new x coordinate of upper-left corner of newly scaled region. * @x0: The new x coordinate of the upper-left corner of the scaled region.
* @y0: The new y coordinate of upper-left corner of newly scaled region. * @y0: The new y coordinate of the upper-left corner of the scaled region.
* @x1: The new x coordinate of lower-right corner of newly scaled region. * @x1: The new x coordinate of the lower-right corner of the scaled region.
* @y1: The new y coordinate of lower-right corner of newly scaled region. * @y1: The new y coordinate of the lower-right corner of the scaled region.
* @interpolate: Whether to use interpolation and supersampling. * @interpolate: Whether to use interpolation and supersampling.
* @clip_result: Whether to clip results. * @clip_result: Whether to clip results.
* *

View File

@ -152,10 +152,10 @@ gimp_rotate (gint32 drawable_ID,
* gimp_scale: * gimp_scale:
* @drawable_ID: The affected drawable. * @drawable_ID: The affected drawable.
* @interpolation: Whether to use interpolation. * @interpolation: Whether to use interpolation.
* @x0: The new x coordinate of upper-left corner of newly scaled region. * @x0: The new x coordinate of the upper-left corner of the scaled region.
* @y0: The new y coordinate of upper-left corner of newly scaled region. * @y0: The new y coordinate of the upper-left corner of the scaled region.
* @x1: The new x coordinate of lower-right corner of newly scaled region. * @x1: The new x coordinate of the lower-right corner of the scaled region.
* @y1: The new y coordinate of lower-right corner of newly scaled region. * @y1: The new y coordinate of the lower-right corner of the scaled region.
* *
* This procedure is deprecated! Use * This procedure is deprecated! Use
* gimp_drawable_transform_scale_default() instead. * gimp_drawable_transform_scale_default() instead.

View File

@ -408,7 +408,7 @@ gimp_vectors_set_tattoo (gint32 vectors_ID,
* @stroke_id: The stroke ID. * @stroke_id: The stroke ID.
* @prescision: The prescision used for the approximation. * @prescision: The prescision used for the approximation.
* *
* measures the length of the given stroke. * Measure the length of the given stroke.
* *
* Measure the length of the given stroke. * Measure the length of the given stroke.
* *

View File

@ -17,32 +17,12 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub mitch_misc {
$author = 'Michael Natterer <mitch@gimp.org>';
$copyright = 'Michael Natterer';
$date = '2004';
$since = '2.2';
}
sub bill_misc {
$author = 'Bill Skaggs <weskaggs@primate.ucdavis.edu';
$copyright = 'Bill Skaggs';
$date = '2004';
$since = '2.4';
}
sub brush_arg () {{ sub brush_arg () {{
name => 'name', name => 'name',
type => 'string', type => 'string',
desc => 'The brush name' desc => 'The brush name'
}} }}
sub spacing_arg () {{
name => 'spacing',
type => '0 <= int32 <= 1000',
desc => 'The brush spacing: %%desc%%'
}}
# The defs # The defs
@ -50,7 +30,7 @@ sub brush_new {
$blurb = "Creates a new brush"; $blurb = "Creates a new brush";
$help = "This procedure creates a new, uninitialized brush"; $help = "This procedure creates a new, uninitialized brush";
&mitch_misc; &mitch_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
{ name => 'name', type => 'string', { name => 'name', type => 'string',
@ -80,7 +60,7 @@ sub brush_duplicate {
$blurb = "Duplicates a brush"; $blurb = "Duplicates a brush";
$help = "This procedure creates an identical brush by a different name"; $help = "This procedure creates an identical brush by a different name";
&mitch_misc; &mitch_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&brush_arg &brush_arg
@ -120,7 +100,7 @@ sub brush_is_generated {
$blurb = "Tests if generated"; $blurb = "Tests if generated";
$help = "Returns True if this brush is parametric, False for other types"; $help = "Returns True if this brush is parametric, False for other types";
&bill_misc; &bill_pdb_misc('2004', '2.4');
@inargs = ( @inargs = (
&brush_arg &brush_arg
@ -153,7 +133,7 @@ sub brush_is_editable {
$blurb = "Tests if brush can be edited"; $blurb = "Tests if brush can be edited";
$help = "Returns True if you have permission to change the brush"; $help = "Returns True if you have permission to change the brush";
&bill_misc; &bill_pdb_misc('2004', '2.4');
@inargs = ( @inargs = (
&brush_arg &brush_arg
@ -186,7 +166,7 @@ sub brush_rename {
$blurb = "Rename a brush"; $blurb = "Rename a brush";
$help = "This procedure renames a brush"; $help = "This procedure renames a brush";
&mitch_misc; &mitch_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&brush_arg, &brush_arg,
@ -220,7 +200,7 @@ sub brush_delete {
$blurb = "Deletes a brush"; $blurb = "Deletes a brush";
$help = "This procedure deletes a brush"; $help = "This procedure deletes a brush";
&mitch_misc; &mitch_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&brush_arg &brush_arg
@ -261,7 +241,7 @@ This procedure retrieves information about the specified brush. This
includes the brush name, and the brush extents (width and height). includes the brush name, and the brush extents (width and height).
HELP HELP
&mitch_misc; &mitch_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&brush_arg &brush_arg
@ -305,7 +285,7 @@ This procedure retrieves information about the specified brush. This
includes the brush extents (width and height) and its pixels data. includes the brush extents (width and height) and its pixels data.
HELP HELP
&mitch_misc; &mitch_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&brush_arg &brush_arg
@ -369,18 +349,18 @@ The return value is an integer between 0 and 1000 which represents
percentage of the maximum of the width and height of the mask. percentage of the maximum of the width and height of the mask.
HELP HELP
&mitch_misc; &mitch_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&brush_arg &brush_arg
); );
@outargs = ( @outargs = (
&spacing_arg { name => 'spacing', type => '0 <= int32 <= 1000',
desc => 'The brush spacing: %%desc%%',
alias => 'gimp_brush_get_spacing (brush)',
no_declare => 1, void_ret => 1 }
); );
$outargs[0]->{alias} = 'gimp_brush_get_spacing (brush)';
$outargs[0]->{no_declare} = 1;
$outargs[0]->{void_ret} = 1;
%invoke = ( %invoke = (
vars => [ 'GimpBrush *brush = NULL' ], vars => [ 'GimpBrush *brush = NULL' ],
@ -407,7 +387,7 @@ Square (GIMP_BRUSH_GENERATED_SQUARE), and Diamond
added in the future. added in the future.
HELP HELP
&bill_misc; &bill_pdb_misc('2004', '2.4');
@inargs = ( @inargs = (
&brush_arg &brush_arg
@ -441,7 +421,7 @@ This procedure gets the radius value for a generated brush. If
called for any other type of brush, it does not succeed. called for any other type of brush, it does not succeed.
HELP HELP
&bill_misc; &bill_pdb_misc('2004', '2.4');
@inargs = ( @inargs = (
&brush_arg &brush_arg
@ -475,7 +455,7 @@ This procedure gets the number of spikes for a generated brush.
If called for any other type of brush, it does not succeed. If called for any other type of brush, it does not succeed.
HELP HELP
&bill_misc; &bill_pdb_misc('2004', '2.4');
@inargs = ( @inargs = (
&brush_arg &brush_arg
@ -511,7 +491,7 @@ outside edge. If called for any other type of brush, the function
does not succeed. does not succeed.
HELP HELP
&bill_misc; &bill_pdb_misc('2004', '2.4');
@inargs = ( @inargs = (
&brush_arg &brush_arg
@ -545,7 +525,7 @@ This procedure gets the aspect ratio of a generated brush.
If called for any other type of brush, it does not succeed. If called for any other type of brush, it does not succeed.
HELP HELP
&bill_misc; &bill_pdb_misc('2004', '2.4');
@inargs = ( @inargs = (
&brush_arg &brush_arg
@ -579,7 +559,7 @@ This procedure gets the angle of rotation for a generated brush.
If called for any other type of brush, it does not succeed. If called for any other type of brush, it does not succeed.
HELP HELP
&bill_misc; &bill_pdb_misc('2004', '2.4');
@inargs = ( @inargs = (
&brush_arg &brush_arg
@ -613,11 +593,12 @@ This procedure modifies the spacing setting for the specified brush.
The value should be a integer between 0 and 1000. The value should be a integer between 0 and 1000.
HELP HELP
&bill_misc; &bill_pdb_misc('2004', '2.4');
@inargs = ( @inargs = (
&brush_arg, &brush_arg,
&spacing_arg { name => 'spacing', type => '0 <= int32 <= 1000',
desc => 'The brush spacing: %%desc%%' }
); );
%invoke = ( %invoke = (
@ -649,7 +630,7 @@ Square (GIMP_BRUSH_GENERATED_SQUARE), and Diamond
added in the future. added in the future.
HELP HELP
&bill_misc; &bill_pdb_misc('2004', '2.4');
@inargs = ( @inargs = (
&brush_arg, &brush_arg,
@ -688,7 +669,7 @@ This procedure sets the radius for a generated brush. If
called for any other type of brush, it does not succeed. called for any other type of brush, it does not succeed.
HELP HELP
&bill_misc; &bill_pdb_misc('2004', '2.4');
@inargs = ( @inargs = (
&brush_arg, &brush_arg,
@ -727,7 +708,7 @@ This procedure sets the number of spikes for a generated brush. If
called for any other type of brush, it does not succeed. called for any other type of brush, it does not succeed.
HELP HELP
&bill_misc; &bill_pdb_misc('2004', '2.4');
@inargs = ( @inargs = (
&brush_arg, &brush_arg,
@ -766,7 +747,7 @@ This procedure sets the hardness for a generated brush. If
called for any other type of brush, it does not succeed. called for any other type of brush, it does not succeed.
HELP HELP
&bill_misc; &bill_pdb_misc('2004', '2.4');
@inargs = ( @inargs = (
&brush_arg, &brush_arg,
@ -805,7 +786,7 @@ This procedure sets the aspect ratio for a generated brush. If
called for any other type of brush, it does not succeed. called for any other type of brush, it does not succeed.
HELP HELP
&bill_misc; &bill_pdb_misc('2004', '2.4');
@inargs = ( @inargs = (
&brush_arg, &brush_arg,
@ -844,7 +825,7 @@ This procedure sets the rotation angle for a generated brush. If
called for any other type of brush, it does not succeed. called for any other type of brush, it does not succeed.
HELP HELP
&bill_misc; &bill_pdb_misc('2004', '2.4');
@inargs = ( @inargs = (
&brush_arg, &brush_arg,

View File

@ -17,11 +17,6 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub pdb_misc {
$author = $copyright = 'Andy Thomas';
$date = '1998';
}
sub brush_args {( sub brush_args {(
{ name => 'opacity', { name => 'opacity',
type => '0 <= float <= 100', type => '0 <= float <= 100',
@ -36,10 +31,9 @@ sub brush_args {(
sub brushes_popup { sub brushes_popup {
$blurb = 'Invokes the Gimp brush selection.'; $blurb = 'Invokes the Gimp brush selection.';
$help = 'This procedure popups the brush selection dialog.';
$help = 'This procedure popups the brush selection dialog.'; &andy_pdb_misc('1998');
&pdb_misc;
@inargs = ( @inargs = (
{ name => 'brush_callback', type => 'string', { name => 'brush_callback', type => 'string',
@ -72,10 +66,9 @@ CODE
sub brushes_close_popup { sub brushes_close_popup {
$blurb = 'Popdown the Gimp brush selection.'; $blurb = 'Popdown the Gimp brush selection.';
$help = 'This procedure closes an opened brush selection dialog.';
$help = 'This procedure closes an opened brush selection dialog.'; &andy_pdb_misc('1998');
&pdb_misc;
@inargs = ( @inargs = (
{ name => 'brush_callback', type => 'string', { name => 'brush_callback', type => 'string',
@ -97,10 +90,9 @@ CODE
sub brushes_set_popup { sub brushes_set_popup {
$blurb = 'Sets the current brush selection in a popup.'; $blurb = 'Sets the current brush selection in a popup.';
$help = $blurb;
$help = $blurb; &andy_pdb_misc('1998');
&pdb_misc;
@inargs = ( @inargs = (
{ name => 'brush_callback', type => 'string', { name => 'brush_callback', type => 'string',

View File

@ -17,65 +17,6 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub brush_arg () {{
name => 'name',
type => 'string',
desc => 'The brush name',
null_ok => '1'
}}
sub dim_args () {
my @args;
foreach (qw(width height)) {
push @args, { name => $_, type => 'int32', desc => "The brush $_" };
}
@args;
}
sub opacity_arg () {{
name => 'opacity',
type => '0 <= float <= 100',
desc => 'The brush opacity: %%desc%%'
}}
sub spacing_arg () {{
name => 'spacing',
type => '0 <= int32 <= 1000',
desc => 'The brush spacing: %%desc%%'
}}
sub paint_mode_arg () {{
name => 'paint_mode', type => 'enum GimpLayerModeEffects',
desc => 'The paint mode: { %%desc%% }'
}}
sub brush_outargs {
foreach (@outargs) {
my $alias = ($_->{type} eq 'string') ?
"GIMP_OBJECT (brush)->$_->{name}" : "brush->$_->{name}";
$alias = "g_strdup ($alias)" if $_->{type} eq 'string';
$alias =~ s/brush/brush->mask/ if $_->{name} =~ /width|height/;
$_->{alias} = $alias;
$_->{no_declare} = 1;
}
}
my $get_brush_from_name = <<'CODE';
if (name && strlen (name))
{
brush = (GimpBrush *)
gimp_container_get_child_by_name (gimp->brush_factory->container,
name);
}
else
{
brush = gimp_context_get_brush (context);
}
CODE
# The defs
sub brushes_refresh { sub brushes_refresh {
$blurb = 'Refresh current brushes. This function always succeeds.'; $blurb = 'Refresh current brushes. This function always succeeds.';
@ -84,8 +25,7 @@ This procedure retrieves all brushes currently in the user's brush path
and updates the brush dialogs accordingly. and updates the brush dialogs accordingly.
HELP HELP
$author = $copyright = 'Seth Burgess'; &seth_pdb_misc('1997');
$date = '1997';
%invoke = ( %invoke = (
code => 'gimp_data_factory_data_refresh (gimp->brush_factory);' code => 'gimp_data_factory_data_refresh (gimp->brush_factory);'
@ -126,13 +66,20 @@ sub brushes_get_brush {
&std_pdb_deprecated ('gimp-context-get-brush'); &std_pdb_deprecated ('gimp-context-get-brush');
@outargs = ( @outargs = (
&brush_arg, { name => 'name', type => 'string', no_declare => 1,
&dim_args, desc => 'The brush name',
&spacing_arg alias => 'g_strdup (GIMP_OBJECT (brush)->name)' },
{ name => 'width', type => 'int32', no_declare => 1,
desc => 'The brush width',
alias => 'brush->mask->width' },
{ name => 'height', type => 'int32', no_declare => 1,
desc => 'The brush height',
alias => 'brush->mask->height' },
{ name => 'spacing', type => '0 <= int32 <= 1000', no_declare => 1,
desc => 'The brush spacing: %%desc%%',
alias => 'gimp_brush_get_spacing (brush)' }
); );
&brush_outargs;
%invoke = ( %invoke = (
vars => [ 'GimpBrush *brush' ], vars => [ 'GimpBrush *brush' ],
code => 'success = (brush = gimp_context_get_brush (context)) != NULL;' code => 'success = (brush = gimp_context_get_brush (context)) != NULL;'
@ -142,15 +89,21 @@ sub brushes_get_brush {
sub brushes_get_spacing { sub brushes_get_spacing {
&std_pdb_deprecated ('gimp-brush-get-spacing'); &std_pdb_deprecated ('gimp-brush-get-spacing');
@outargs = ( &spacing_arg ); @outargs = (
$outargs[0]->{alias} = 'gimp_brush_get_spacing (gimp_context_get_brush (context))'; { name => 'spacing', type => '0 <= int32 <= 1000',
$outargs[0]->{no_declare} = 1; desc => 'The brush spacing: %%desc%%',
alias => 'gimp_brush_get_spacing (gimp_context_get_brush (context))',
no_declare => 1 }
);
} }
sub brushes_set_spacing { sub brushes_set_spacing {
&std_pdb_deprecated ('gimp-brush-set-spacing'); &std_pdb_deprecated ('gimp-brush-set-spacing');
@inargs = ( &spacing_arg ); @inargs = (
{ name => 'spacing', type => '0 <= int32 <= 1000',
desc => 'The brush spacing: %%desc%%' }
);
%invoke = ( %invoke = (
code => 'gimp_brush_set_spacing (gimp_context_get_brush (context), spacing);' code => 'gimp_brush_set_spacing (gimp_context_get_brush (context), spacing);'
@ -161,28 +114,37 @@ sub brushes_get_brush_data {
&std_pdb_deprecated ('gimp-brush-get-pixels'); &std_pdb_deprecated ('gimp-brush-get-pixels');
@inargs = ( @inargs = (
&brush_arg { name => 'name', type => 'string',
desc => 'The brush name ("" means current active brush)',
null_ok => '1' }
); );
$inargs[0]->{desc} = 'The brush name ("" means current active brush)';
@outargs = ( @outargs = (
&brush_arg, { name => 'name', type => 'string', no_declare => 1,
&opacity_arg, desc => 'The brush name',
&spacing_arg, alias => 'g_strdup (GIMP_OBJECT (brush)->name)' },
&paint_mode_arg, { name => 'opacity', type => '0 <= float <= 100', no_declare => 1,
&dim_args, desc => 'The brush opacity: %%desc%%',
alias => '1.0' },
{ name => 'spacing', type => '0 <= int32 <= 1000', no_declare => 1,
desc => 'The brush spacing: %%desc%%',
alias => 'gimp_brush_get_spacing (brush)' },
{ name => 'paint_mode', type => 'enum GimpLayerModeEffects',
no_declare => 1,
desc => 'The paint mode: { %%desc%% }',
alias => '0' },
{ name => 'width', type => 'int32', no_declare => 1,
desc => 'The brush width',
alias => 'brush->mask->width' },
{ name => 'height', type => 'int32', no_declare => 1,
desc => 'The brush height',
alias => 'brush->mask->height' },
{ name => 'mask_data', type => 'int8array', init => 1,
desc => 'The brush mask data',
array => { name => 'length', init => 1,
desc => 'Length of brush mask data' } }
); );
&brush_outargs;
$outargs[1]->{alias} = '1.0';
$outargs[3]->{alias} = '0';
push @outargs, { name => 'mask_data', type => 'int8array', init => 1,
desc => 'The brush mask data',
array => { name => 'length', init => 1,
desc => 'Length of brush mask data' } };
%invoke = ( %invoke = (
vars => [ 'GimpBrush *brush = NULL' ], vars => [ 'GimpBrush *brush = NULL' ],
code => <<'CODE' code => <<'CODE'

View File

@ -17,8 +17,6 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
# The defs
sub buffers_get_list { sub buffers_get_list {
$blurb = 'Retrieve a complete listing of the available buffers.'; $blurb = 'Retrieve a complete listing of the available buffers.';
@ -26,9 +24,7 @@ sub buffers_get_list {
This procedure returns a complete listing of available named buffers. This procedure returns a complete listing of available named buffers.
HELP HELP
$author = $copyright = 'Michael Natterer <mitch@gimp.org>'; &mitch_pdb_misc('2005', '2.4');
$date = '2005';
$since = '2.4';
@inargs = ( @inargs = (
{ name => 'filter', type => 'string', null_ok => 1, { name => 'filter', type => 'string', null_ok => 1,
@ -50,14 +46,9 @@ HELP
sub buffer_rename { sub buffer_rename {
$blurb = 'Renames a named buffer.'; $blurb = 'Renames a named buffer.';
$help = 'This procedure renames a named buffer.';
$help = <<'HELP'; &mitch_pdb_misc('2005', '2.4');
This procedure renames a named buffer.
HELP
$author = $copyright = 'Michael Natterer <mitch@gimp.org>';
$date = '2005';
$since = '2.4';
@inargs = ( @inargs = (
{ name => 'buffer_name', type => 'string', { name => 'buffer_name', type => 'string',
@ -74,9 +65,7 @@ HELP
%invoke = ( %invoke = (
code => <<CODE code => <<CODE
{ {
GimpBuffer *buffer; GimpBuffer *buffer = (GimpBuffer *)
buffer = (GimpBuffer *)
gimp_container_get_child_by_name (gimp->named_buffers, buffer_name); gimp_container_get_child_by_name (gimp->named_buffers, buffer_name);
success = (buffer != NULL && strlen (new_name) > 0); success = (buffer != NULL && strlen (new_name) > 0);
@ -93,10 +82,7 @@ CODE
sub buffer_delete { sub buffer_delete {
$blurb = 'Deletes a named buffer.'; $blurb = 'Deletes a named buffer.';
$help = 'This procedure deletes a named buffer.';
$help = <<'HELP';
This procedure deletes a named buffer.
HELP
$author = $copyright = 'David Gowers <neota@softhome.net>'; $author = $copyright = 'David Gowers <neota@softhome.net>';
$date = '2005'; $date = '2005';
@ -110,9 +96,7 @@ HELP
%invoke = ( %invoke = (
code => <<CODE code => <<CODE
{ {
GimpBuffer *buffer; GimpBuffer *buffer = (GimpBuffer *)
buffer = (GimpBuffer *)
gimp_container_get_child_by_name (gimp->named_buffers, buffer_name); gimp_container_get_child_by_name (gimp->named_buffers, buffer_name);
success = (buffer != NULL); success = (buffer != NULL);
@ -126,13 +110,9 @@ CODE
sub buffer_get_width { sub buffer_get_width {
$blurb = "Retrieves the specified buffer's width."; $blurb = "Retrieves the specified buffer's width.";
$help = <<'HELP'; $help = "This procedure retrieves the specified named buffer's width.";
This procedure retrieves the specified named buffer's width.
HELP
$author = $copyright = 'Michael Natterer <mitch@gimp.org>'; &mitch_pdb_misc('2005', '2.4');
$date = '2005';
$since = '2.4';
@inargs = ( @inargs = (
{ name => 'buffer_name', type => 'string', { name => 'buffer_name', type => 'string',
@ -140,19 +120,20 @@ HELP
); );
@outargs = ( @outargs = (
{ name => 'width', type => 'int32', no_declare => '1', { name => 'width', type => 'int32', init => 1,
alias => 'gimp_buffer_get_width (buffer)',
desc => "The buffer width" } desc => "The buffer width" }
); );
%invoke = ( %invoke = (
vars => [ 'GimpBuffer *buffer = NULL' ],
code => <<'CODE' code => <<'CODE'
{ {
buffer = (GimpBuffer *) GimpBuffer *buffer = (GimpBuffer *)
gimp_container_get_child_by_name (gimp->named_buffers, buffer_name); gimp_container_get_child_by_name (gimp->named_buffers, buffer_name);
success = (buffer != NULL); if (buffer)
width = gimp_buffer_get_width (buffer);
else
success = FALSE;
} }
CODE CODE
); );
@ -160,13 +141,9 @@ CODE
sub buffer_get_height { sub buffer_get_height {
$blurb = "Retrieves the specified buffer's height."; $blurb = "Retrieves the specified buffer's height.";
$help = <<'HELP'; $help = "This procedure retrieves the specified named buffer's height.";
This procedure retrieves the specified named buffer's height.
HELP
$author = $copyright = 'Michael Natterer <mitch@gimp.org>'; &mitch_pdb_misc('2005', '2.4');
$date = '2005';
$since = '2.4';
@inargs = ( @inargs = (
{ name => 'buffer_name', type => 'string', { name => 'buffer_name', type => 'string',
@ -174,19 +151,20 @@ HELP
); );
@outargs = ( @outargs = (
{ name => 'height', type => 'int32', no_declare => '1', { name => 'height', type => 'int32', init => 1,
alias => 'gimp_buffer_get_height (buffer)',
desc => "The buffer height" } desc => "The buffer height" }
); );
%invoke = ( %invoke = (
vars => [ 'GimpBuffer *buffer = NULL' ],
code => <<'CODE' code => <<'CODE'
{ {
buffer = (GimpBuffer *) GimpBuffer *buffer = (GimpBuffer *)
gimp_container_get_child_by_name (gimp->named_buffers, buffer_name); gimp_container_get_child_by_name (gimp->named_buffers, buffer_name);
success = (buffer != NULL); if (buffer)
height = gimp_buffer_get_height (buffer);
else
success = FALSE;
} }
CODE CODE
); );
@ -194,13 +172,9 @@ CODE
sub buffer_get_bytes { sub buffer_get_bytes {
$blurb = "Retrieves the specified buffer's bytes."; $blurb = "Retrieves the specified buffer's bytes.";
$help = <<'HELP'; $help = "This procedure retrieves the specified named buffer's bytes.";
This procedure retrieves the specified named buffer's bytes.
HELP
$author = $copyright = 'Michael Natterer <mitch@gimp.org>'; &mitch_pdb_misc('2005', '2.4');
$date = '2005';
$since = '2.4';
@inargs = ( @inargs = (
{ name => 'buffer_name', type => 'string', { name => 'buffer_name', type => 'string',
@ -208,19 +182,20 @@ HELP
); );
@outargs = ( @outargs = (
{ name => 'bytes', type => 'int32', no_declare => '1', { name => 'bytes', type => 'int32', init => 1,
alias => 'gimp_buffer_get_bytes (buffer)',
desc => "The buffer bpp" } desc => "The buffer bpp" }
); );
%invoke = ( %invoke = (
vars => [ 'GimpBuffer *buffer = NULL' ],
code => <<'CODE' code => <<'CODE'
{ {
buffer = (GimpBuffer *) GimpBuffer *buffer = (GimpBuffer *)
gimp_container_get_child_by_name (gimp->named_buffers, buffer_name); gimp_container_get_child_by_name (gimp->named_buffers, buffer_name);
success = (buffer != NULL); if (buffer)
bytes = gimp_buffer_get_bytes (buffer);
else
success = FALSE;
} }
CODE CODE
); );
@ -228,13 +203,9 @@ CODE
sub buffer_get_image_type { sub buffer_get_image_type {
$blurb = "Retrieves the specified buffer's image type."; $blurb = "Retrieves the specified buffer's image type.";
$help = <<'HELP'; $help = "This procedure retrieves the specified named buffer's image type.";
This procedure retrieves the specified named buffer's image type.
HELP
$author = $copyright = 'Michael Natterer <mitch@gimp.org>'; &mitch_pdb_misc('2005', '2.4');
$date = '2005';
$since = '2.4';
@inargs = ( @inargs = (
{ name => 'buffer_name', type => 'string', { name => 'buffer_name', type => 'string',
@ -242,20 +213,20 @@ HELP
); );
@outargs = ( @outargs = (
{ name => 'image_type', type => 'enum GimpImageBaseType', { name => 'image_type', type => 'enum GimpImageBaseType', init => 1,
no_declare => '1',
alias => 'gimp_buffer_get_image_type (buffer)',
desc => "The buffer image type" } desc => "The buffer image type" }
); );
%invoke = ( %invoke = (
vars => [ 'GimpBuffer *buffer = NULL' ],
code => <<'CODE' code => <<'CODE'
{ {
buffer = (GimpBuffer *) GimpBuffer *buffer = (GimpBuffer *)
gimp_container_get_child_by_name (gimp->named_buffers, buffer_name); gimp_container_get_child_by_name (gimp->named_buffers, buffer_name);
success = (buffer != NULL); if (buffer)
image_type = gimp_buffer_get_image_type (buffer);
else
success = FALSE;
} }
CODE CODE
); );

View File

@ -17,18 +17,6 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub channel_arg () {{
name => 'channel',
type => 'channel',
desc => 'The channel'
}}
sub operation_arg () {{
name => 'operation',
type => 'enum GimpChannelOps',
desc => 'The selection operation: { %%desc%% }'
}}
sub channel_get_prop_proc { sub channel_get_prop_proc {
my ($prop, $type, $desc, $undo, $core_type, $core_var) = @_; my ($prop, $type, $desc, $undo, $core_type, $core_var) = @_;
@ -41,7 +29,10 @@ sub channel_get_prop_proc {
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &channel_arg ); @inargs = (
{ name => 'channel', type => 'channel',
desc => 'The channel' }
);
@outargs = ( @outargs = (
{ name => $prop, type => $type, { name => $prop, type => $type,
@ -71,7 +62,8 @@ sub channel_set_prop_proc {
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&channel_arg, { name => 'channel', type => 'channel',
desc => 'The channel' },
{ name => $prop, type => $type, { name => $prop, type => $type,
desc => "The new channel $desc" } desc => "The new channel $desc" }
); );
@ -178,8 +170,10 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &channel_arg ); @inargs = (
$inargs[0]->{desc} .= ' to copy'; { name => 'channel', type => 'channel',
desc => 'The channel to copy' }
);
@outargs = ( @outargs = (
{ name => 'channel_copy', type => 'channel', init => 1, { name => 'channel_copy', type => 'channel', init => 1,
@ -207,19 +201,20 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &channel_arg, &channel_arg, &operation_arg ); @inargs = (
{ name => 'channel1', type => 'channel',
foreach my $i (0,1) { desc => 'The channel1' },
foreach my $unused (qw(name desc)) { { name => 'channel2', type => 'channel',
$inargs[$i]{$unused} .= $i + 1; desc => 'The channel2' },
} { name => 'operation', type => 'enum GimpChannelOps',
} desc => 'The selection operation: { %%desc%% }' },
{ name => 'offx', type => 'int32',
foreach (qw(x y)) { desc => "x offset between upper left corner of
push @inargs, { name => "off$_", type => 'int32', channels: (second - first)" },
desc => "$_ offset between upper left corner of { name => 'offy', type => 'int32',
channels: (second - first)" } desc => "y offset between upper left corner of
} channels: (second - first)" }
);
%invoke = ( %invoke = (
headers => [ qw("core/gimpchannel-combine.h") ], headers => [ qw("core/gimpchannel-combine.h") ],
@ -238,17 +233,14 @@ sub channel_new_from_component {
This procedure creates a new channel from a color component. This procedure creates a new channel from a color component.
HELP HELP
$author = 'Shlomi Fish <shlomif@iglu.org.il>'; &shlomi_pdb_misc('2005', '2.4');
$copyright = 'Shlomi Fish';
$date = '2005';
$since = '2.4';
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
{ name => 'component', type => 'enum GimpChannelType', { name => 'component', type => 'enum GimpChannelType',
desc => 'The image component: { %%desc%% }' }, desc => 'The image component: { %%desc%% }' },
{ name => 'name', type => 'string', { name => 'name', type => 'string',
desc => 'The channel name' }, desc => 'The channel name' },
); );
$inargs[0]->{desc} .= ' to which to add the channel'; $inargs[0]->{desc} .= ' to which to add the channel';

View File

@ -17,18 +17,6 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub drawable_arg () {{
name => 'drawable',
type => 'drawable',
desc => 'The drawable',
}}
sub channel_arg () {{
name => 'channel',
type => 'enum GimpHistogramChannel',
desc => 'The channel to modify: { %%desc%% }'
}}
sub brightness_contrast { sub brightness_contrast {
$blurb = 'Modify brightness/contrast in the specified drawable.'; $blurb = 'Modify brightness/contrast in the specified drawable.';
@ -41,11 +29,14 @@ HELP
&std_pdb_misc; &std_pdb_misc;
$date = '1997'; $date = '1997';
@inargs = ( &drawable_arg ); @inargs = (
foreach (qw( brightness contrast)) { { name => 'drawable', type => 'drawable',
push @inargs, { name => $_, type => '-127 <= int32 <= 127', desc => 'The drawable' },
desc => "\u$_ adjustment: (%%desc%%)" } { name => 'brightness', type => '-127 <= int32 <= 127',
} desc => 'Brightness adjustment: (%%desc%%)' },
{ name => 'contrast', type => '-127 <= int32 <= 127',
desc => 'Contrast adjustment: (%%desc%%)' }
);
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
@ -108,20 +99,22 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
&channel_arg desc => 'The drawable' },
{ name => 'channel', type => 'enum GimpHistogramChannel',
desc => 'The channel to modify: { %%desc%% }' },
{ name => 'low_input', type => '0 <= int32 <= 255',
desc => "Intensity of lowest input: (%%desc%%)" },
{ name => 'high_input', type => '0 <= int32 <= 255',
desc => "Intensity of highest input: (%%desc%%)" },
{ name => 'gamma', type => '0.1 <= float <= 10',
desc => 'Gamma correction factor: (%%desc%%)' },
{ name => 'low_output', type => '0 <= int32 <= 255',
desc => "Intensity of lowest output: (%%desc%%)" },
{ name => 'high_output', type => '0 <= int32 <= 255',
desc => "Intensity of highest output: (%%desc%%)" }
); );
foreach $arg (qw(input output)) {
foreach (qw(low high)) {
push @inargs, { name => "${_}_$arg", type => '0 <= int32 <= 255',
desc => "Intensity of ${_}est $arg: (%%desc%%)" }
}
push @inargs, { name => 'gamma', type => '0.1 <= float <= 10',
desc => 'Gamma correction factor: (%%desc%%)' }
}
$#inargs--;
%invoke = ( %invoke = (
headers => [ qw("base/levels.h" headers => [ qw("base/levels.h"
"core/gimpdrawable-levels.h") ], "core/gimpdrawable-levels.h") ],
@ -162,7 +155,10 @@ HELP
$author = $copyright = 'Joao S.O. Bueno, Shawn Willden'; $author = $copyright = 'Joao S.O. Bueno, Shawn Willden';
$date = '2003'; $date = '2003';
@inargs = ( &drawable_arg ); @inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable' }
);
%invoke = ( %invoke = (
headers => [ qw("base/levels.h" headers => [ qw("base/levels.h"
@ -187,7 +183,10 @@ CODE
sub levels_auto { sub levels_auto {
&std_pdb_deprecated ('gimp_levels_stretch'); &std_pdb_deprecated ('gimp_levels_stretch');
@inargs = ( &drawable_arg ); @inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable' }
);
%invoke = ( %invoke = (
headers => [ qw("base/levels.h" headers => [ qw("base/levels.h"
@ -219,7 +218,8 @@ HELP
$date = '1997'; $date = '1997';
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The drawable' },
{ name => 'levels', type => '2 <= int32 <= 255', { name => 'levels', type => '2 <= int32 <= 255',
desc => 'Levels of posterization: (%%desc%%)' } desc => 'Levels of posterization: (%%desc%%)' }
); );
@ -273,7 +273,10 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &drawable_arg ); @inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable' }
);
%invoke = ( %invoke = (
headers => [ qw("core/gimpdrawable-desaturate.h") ], headers => [ qw("core/gimpdrawable-desaturate.h") ],
@ -303,7 +306,8 @@ HELP
$since = '2.4'; $since = '2.4';
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The drawable' },
{ name => 'desaturate_mode', type => 'enum GimpDesaturateMode', { name => 'desaturate_mode', type => 'enum GimpDesaturateMode',
desc => 'The formula to use to desaturate' } desc => 'The formula to use to desaturate' }
); );
@ -339,7 +343,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The drawable' },
{ name => 'mask_only', type => 'boolean', { name => 'mask_only', type => 'boolean',
desc => 'Equalization option' } desc => 'Equalization option' }
); );
@ -370,7 +375,10 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &drawable_arg ); @inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable' }
);
%invoke = ( %invoke = (
headers => [ qw("core/gimpdrawable-invert.h") ], headers => [ qw("core/gimpdrawable-invert.h") ],
@ -402,8 +410,10 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
&channel_arg, desc => 'The drawable' },
{ name => 'channel', type => 'enum GimpHistogramChannel',
desc => 'The channel to modify: { %%desc%% }' },
{ name => 'control_pts', type => 'int8array', { name => 'control_pts', type => 'int8array',
desc => 'The spline control points: { cp1.x, cp1.y, cp2.x, cp2.y, desc => 'The spline control points: { cp1.x, cp1.y, cp2.x, cp2.y,
... }', ... }',
@ -497,8 +507,10 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
&channel_arg, desc => 'The drawable' },
{ name => 'channel', type => 'enum GimpHistogramChannel',
desc => 'The channel to modify: { %%desc%% }' },
{ name => 'curve', type => 'int8array', { name => 'curve', type => 'int8array',
desc => 'The explicit curve', desc => 'The explicit curve',
array => { name => 'num_bytes', array => { name => 'num_bytes',
@ -584,20 +596,20 @@ HELP
$date = '1997'; $date = '1997';
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The drawable' },
{ name => 'transfer_mode', type => 'enum GimpTransferMode', { name => 'transfer_mode', type => 'enum GimpTransferMode',
desc => 'Transfer mode: { %%desc%% }' }, desc => 'Transfer mode: { %%desc%% }' },
{ name => 'preserve_lum', type => 'boolean', { name => 'preserve_lum', type => 'boolean',
desc => 'Preserve luminosity values at each pixel' } desc => 'Preserve luminosity values at each pixel' },
{ name => 'cyan_red', type => '-100 <= float <= 100',
desc => 'Cyan-Red color balance: (%%desc%%)' },
{ name => 'magenta_green', type => '-100 <= float <= 100',
desc => 'Magenta-Green color balance: (%%desc%%)' },
{ name => 'yellow_blue', type => '-100 <= float <= 100',
desc => 'Yellow-Blue color balance: (%%desc%%)' }
); );
foreach (qw(cyan_red magenta_green yellow_blue)) {
my $arg = { name => $_, type => '-100 <= float <= 100' };
($arg->{desc} = ucfirst $_) =~ s/_(.)/-\U$1\E/;
$arg->{desc} .= ' color balance: (%%desc%%)';
push @inargs, $arg;
}
%invoke = ( %invoke = (
headers => [ qw("base/color-balance.h") ], headers => [ qw("base/color-balance.h") ],
code => <<'CODE' code => <<'CODE'
@ -652,12 +664,11 @@ only valid on RGB color images. It will not operate on grayscale or indexed
drawables. drawables.
HELP HELP
&std_pdb_misc; &neo_pdb_misc('2004', '2.2');
$date = '2004';
$since = '2.2';
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The drawable' },
{ name => 'hue', type => '0 <= float <= 360', { name => 'hue', type => '0 <= float <= 360',
desc => 'Hue in degrees: (%%desc%%)' }, desc => 'Hue in degrees: (%%desc%%)' },
{ name => 'saturation', type => '0 <= float <= 100', { name => 'saturation', type => '0 <= float <= 100',
@ -731,34 +742,31 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
&channel_arg, desc => 'The drawable' },
{ name => 'channel', type => 'enum GimpHistogramChannel',
desc => 'The channel to modify: { %%desc%% }' },
{ name => 'start_range', type => '0 <= int32 < 256',
desc => 'Start of the intensity measurement range' },
{ name => 'end_range', type => '0 <= int32 < 256',
desc => 'End of the intensity measurement range' }
); );
foreach (qw(start end)) {
push @inargs, { name => "${_}_range", type => '0 <= int32 < 256',
desc => "\u$_ of the intensity measurement range" }
}
@outargs = ( @outargs = (
{ name => 'mean', void_ret => 1, init => 1, { name => 'mean', type => 'float', void_ret => 1, init => 1,
desc => 'Mean intensity value' }, desc => 'Mean intensity value' },
{ name => 'std_dev', init => 1, { name => 'std_dev', type => 'float', init => 1,
desc => 'Standard deviation of intensity values' }, desc => 'Standard deviation of intensity values' },
{ name => 'median', init => 1, { name => 'median', type => 'float', init => 1,
desc => 'Median intensity value' }, desc => 'Median intensity value' },
{ name => 'pixels', init => 1, { name => 'pixels', type => 'float', init => 1,
desc => 'Alpha-weighted pixel count for entire image' }, desc => 'Alpha-weighted pixel count for entire image' },
{ name => 'count', init => 1, { name => 'count', type => 'float', init => 1,
desc => 'Alpha-weighted pixel count for range' }, desc => 'Alpha-weighted pixel count for range' },
{ name => 'percentile', init => 1, { name => 'percentile', type => 'float', init => 1,
desc => 'Percentile that range falls under' } desc => 'Percentile that range falls under' }
); );
foreach (@outargs) {
@$_{qw(type alias)} = ('float', "$_->{name}", 1)
}
%invoke = ( %invoke = (
headers => [ qw("core/gimp.h" "core/gimpdrawable-histogram.h") ], headers => [ qw("core/gimp.h" "core/gimpdrawable-histogram.h") ],
code => <<'CODE' code => <<'CODE'
@ -810,18 +818,18 @@ HELP
$date = '1997'; $date = '1997';
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The drawable' },
{ name => 'hue_range', type => 'enum GimpHueRange', { name => 'hue_range', type => 'enum GimpHueRange',
desc => 'Range of affected hues: { %%desc%% }' }, desc => 'Range of affected hues: { %%desc%% }' },
{ name => 'hue_offset', type => '-180 <= float <= 180', { name => 'hue_offset', type => '-180 <= float <= 180',
desc => 'Hue offset in degrees: (%%desc%%)' } desc => 'Hue offset in degrees: (%%desc%%)' },
{ name => 'lightness', type => '-100 <= float <= 100',
desc => 'Lightness modification: (%%desc%%)' },
{ name => 'saturation', type => '-100 <= float <= 100',
desc => 'Saturation modification: (%%desc%%)' }
); );
foreach (qw(lightness saturation)) {
push @inargs, { name => $_, type => '-100 <= float <= 100',
desc => "$_ modification: (%%desc%%)" }
}
%invoke = ( %invoke = (
headers => [ qw("base/hue-saturation.h") ], headers => [ qw("base/hue-saturation.h") ],
code => <<'CODE' code => <<'CODE'
@ -878,11 +886,14 @@ HELP
&std_pdb_misc; &std_pdb_misc;
$date = '1997'; $date = '1997';
@inargs = ( &drawable_arg ); @inargs = (
foreach (qw(low high)) { { name => 'drawable', type => 'drawable',
push @inargs, { name => "${_}_threshold", type => '0 <= int32 <= 255', desc => 'The drawable' },
desc => "The $_ threshold value: %%desc%%" } { name => 'low_threshold', type => '0 <= int32 <= 255',
} desc => 'The low threshold value: %%desc%%' },
{ name => 'high_threshold', type => '0 <= int32 <= 255',
desc => 'The high threshold value: %%desc%%' }
);
%invoke = ( %invoke = (
headers => [ qw("base/threshold.h") ], headers => [ qw("base/threshold.h") ],

View File

@ -24,13 +24,6 @@ sub pdb_misc {
$since = '2.2'; $since = '2.2';
} }
sub mitch_misc {
$author = 'Michael Natterer <mitch@gimp.org>';
$copyright = 'Michael Natterer';
$date = '2005';
$since = '2.4';
}
sub context_push { sub context_push {
$blurb = 'Pushes a context to the top of the plug-in\'s context stack.'; $blurb = 'Pushes a context to the top of the plug-in\'s context stack.';
@ -92,7 +85,7 @@ sub context_get_paint_method {
This procedure returns the name of the currently active paint method. This procedure returns the name of the currently active paint method.
HELP HELP
&mitch_misc; &mitch_pdb_misc('2005', '2.4');
@outargs = ( @outargs = (
{ name => 'name', type => 'string', { name => 'name', type => 'string',
@ -119,7 +112,7 @@ method becomes active and will be used in all subsequent paint
operations. operations.
HELP HELP
&mitch_misc; &mitch_pdb_misc('2005', '2.4');
@inargs = ( @inargs = (
{ name => 'name', type => 'string', { name => 'name', type => 'string',

View File

@ -17,19 +17,26 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub simple_inargs { sub image_convert_rgb {
$blurb = 'Convert specified image to RGB color';
$help = <<'HELP';
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.
HELP
&std_pdb_misc;
@inargs = ( @inargs = (
&std_image_arg &std_image_arg
); );
}
sub simple_invoke {
my $type = shift;
%invoke = ( %invoke = (
code => <<CODE code => <<CODE
{ {
if (gimp_image_base_type (gimage) != $type) if (gimp_image_base_type (gimage) != GIMP_RGB)
gimp_image_convert (gimage, $type, 0, 0, FALSE, FALSE, 0, NULL, NULL); gimp_image_convert (gimage, GIMP_RGB, 0, 0, FALSE, FALSE, 0, NULL, NULL);
else else
success = FALSE; success = FALSE;
} }
@ -37,32 +44,31 @@ CODE
); );
} }
sub image_convert_rgb {
$blurb = 'Convert specified image to RGB color';
$help = <<'HELP';
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.
HELP
&std_pdb_misc;
&simple_inargs;
&simple_invoke('GIMP_RGB');
}
sub image_convert_grayscale { sub image_convert_grayscale {
$blurb = 'Convert specified image to grayscale (256 intensity levels)'; $blurb = 'Convert specified image to grayscale (256 intensity levels)';
$help = <<'HELP'; $help = <<'HELP';
This procedure converts the specified image to grayscale with 8 bits per pixel This procedure converts the specified image to grayscale with 8 bits
(256 intensity levels). This process requires an image of type GIMP_RGB or per pixel (256 intensity levels). This process requires an image of
GIMP_INDEXED. type GIMP_RGB or GIMP_INDEXED.
HELP HELP
&std_pdb_misc; &std_pdb_misc;
&simple_inargs;
&simple_invoke('GIMP_GRAY'); @inargs = (
&std_image_arg
);
%invoke = (
code => <<CODE
{
if (gimp_image_base_type (gimage) != GIMP_GRAY)
gimp_image_convert (gimage, GIMP_GRAY, 0, 0, FALSE, FALSE, 0, NULL, NULL);
else
success = FALSE;
}
CODE
);
} }
sub image_convert_indexed { sub image_convert_indexed {

View File

@ -82,9 +82,7 @@ an Xlib XID. A value of 0 is returned for an invalid display or if this
function is unimplemented for the windowing system that is being used. function is unimplemented for the windowing system that is being used.
HELP HELP
$author = $copyright = 'Sven Neumann'; &neo_pdb_misc('2005', '2.4');
$date = '2005';
$since = '2.4';
@inargs = ( @inargs = (
{ name => 'display', type => 'display', { name => 'display', type => 'display',

View File

@ -17,30 +17,6 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub drawable_arg () {{
name => 'drawable',
type => 'drawable',
desc => 'The drawable',
}}
sub drawable_coord_args () {
@inargs = ( &drawable_arg );
foreach (qw(x y)) {
push @inargs, { name => "${_}_coord", type => '0 <= int32',
desc => "The $_ coordinate", alias => $_ }
}
}
sub pixel_arg () {{
name => 'pixel',
type => 'int8array',
desc => 'The pixel value',
array => { name => 'num_channels', type => 'int32',
desc => 'The number of channels for the pixel',
no_success => 1 }
}}
sub drawable_prop_proc { sub drawable_prop_proc {
my ($return, $name, $type, $func, $desc, $core_type, $core_var) = @_; my ($return, $name, $type, $func, $desc, $core_type, $core_var) = @_;
@ -51,7 +27,10 @@ sub drawable_prop_proc {
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &drawable_arg ); @inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable' }
);
@outargs = ( @outargs = (
{ name => $name, type => $type, desc => $desc, { name => $name, type => $type, desc => $desc,
@ -100,7 +79,10 @@ sub drawable_get_prop_proc {
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &drawable_arg ); @inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable' }
);
@outargs = ( @outargs = (
{ name => $prop, type => $type, { name => $prop, type => $type,
@ -125,7 +107,8 @@ sub drawable_set_prop_proc {
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The drawable' },
{ name => $prop, type => $type, { name => $prop, type => $type,
desc => "The new drawable $desc" } desc => "The new drawable $desc" }
); );
@ -175,7 +158,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The drawable' },
{ name => 'undo', type => 'boolean', { name => 'undo', type => 'boolean',
desc => 'Push merge to undo stack?' } desc => 'Push merge to undo stack?' }
); );
@ -221,7 +205,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The drawable' },
{ name => 'fill_type', type => 'enum GimpFillType', { name => 'fill_type', type => 'enum GimpFillType',
desc => 'The type of fill: %%desc%%' } desc => 'The type of fill: %%desc%%' }
); );
@ -241,7 +226,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The drawable' },
{ name => 'x', type => 'int32', { name => 'x', type => 'int32',
desc => 'x coordinate of upper left corner of update region' }, desc => 'x coordinate of upper left corner of update region' },
{ name => 'y', type => 'int32', { name => 'y', type => 'int32',
@ -278,23 +264,24 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &drawable_arg ); @inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable' }
);
@outargs = ( @outargs = (
{ name => 'non_empty', type => 'boolean', init => 1, { name => 'non_empty', type => 'boolean', init => 1,
desc => 'TRUE if there is a selection' }, desc => 'TRUE if there is a selection' },
{ name => 'x1', type => 'int32',
desc => "x coordinate of the upper left corner of selection bounds" },
{ name => 'y1', type => 'int32',
desc => "y coordinate of the upper left corner of selection bounds" },
{ name => 'x2', type => 'int32',
desc => "x coordinate of the lower right corner of selection bounds" },
{ name => 'y2', type => 'int32',
desc => "y coordinate of the lower right corner of selection bounds" }
); );
my $pos = 1;
foreach $where ('upper left', 'lower right') {
foreach (qw(x y)) {
push @outargs, { name => "$_$pos", type => 'int32',
desc => "$_ coordinate of the $where corner of
selection bounds" }
}
$pos++;
}
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
non_empty = gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2); non_empty = gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
@ -317,12 +304,12 @@ If there is no selection this function returns TRUE and the returned
bounds are the extents of the whole drawable. bounds are the extents of the whole drawable.
HELP HELP
$author = 'Michael Natterer <mitch@gimp.org>'; &mitch_pdb_misc('2004', '2.2');
$copyright = 'Michael Natterer';
$date = '2004';
$since = '2.2';
@inargs = ( &drawable_arg ); @inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable' }
);
@outargs = ( @outargs = (
{ name => 'non_empty', type => 'boolean', init => 1, { name => 'non_empty', type => 'boolean', init => 1,
@ -351,9 +338,14 @@ sub drawable_get_image {
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &drawable_arg ); @inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable' }
);
@outargs = ( &std_image_arg ); @outargs = (
&std_image_arg
);
$outargs[0]->{desc} = "The drawable's image"; $outargs[0]->{desc} = "The drawable's image";
$outargs[0]->{init} = 1; $outargs[0]->{init} = 1;
@ -444,12 +436,17 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &drawable_arg ); @inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable' }
);
foreach (qw(x y)) { @outargs = (
push @outargs, { name => "offset_$_", type => 'int32', { name => 'offset_x', type => 'int32',
desc => "$_ offset of drawable", void_ret => 1 } desc => "x offset of drawable", void_ret => 1 },
} { name => 'offset_y', type => 'int32',
desc => "y offset of drawable" }
);
%invoke = ( code => 'gimp_item_offsets (GIMP_ITEM (drawable), &offset_x, &offset_y);' ); %invoke = ( code => 'gimp_item_offsets (GIMP_ITEM (drawable), &offset_x, &offset_y);' );
} }
@ -477,8 +474,7 @@ CODE
&drawable_accessors('linked', 'boolean', 'linked state', 1, &drawable_accessors('linked', 'boolean', 'linked state', 1,
<<'CODE', 'item', 'GIMP_ITEM (drawable)'); <<'CODE', 'item', 'GIMP_ITEM (drawable)');
$author = $copyright = 'Wolfgang Hofer'; &wolfgang_pdb_misc('1998');
$date = '1998';
if (scalar @outargs) { if (scalar @outargs) {
$outargs[0]->{desc} .= ' (for moves)' $outargs[0]->{desc} .= ' (for moves)'
@ -492,8 +488,7 @@ A tattoo is a unique and permanent identifier attached to a drawable that can be
used to uniquely identify a drawable within an image even between sessions used to uniquely identify a drawable within an image even between sessions
HELP HELP
$author = $copyright = 'Jay Cox'; &jay_pdb_misc('1998');
$date = '1998';
CODE CODE
sub drawable_get_pixel { sub drawable_get_pixel {
@ -508,10 +503,22 @@ HELP
&std_pdb_misc; &std_pdb_misc;
$date = '1997'; $date = '1997';
&drawable_coord_args(); @inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable' },
{ name => 'x_coord', type => '0 <= int32',
desc => "The x coordinate", alias => 'x' },
{ name => 'y_coord', type => '0 <= int32',
desc => "The y coordinate", alias => 'y' }
);
@outargs = ( &pixel_arg ); @outargs = (
$outargs[0]->{init} = $outargs[0]->{array}->{init} = 1; { name => 'pixel', type => 'int8array',
desc => 'The pixel value', init => 1,
array => { name => 'num_channels', type => 'int32',
desc => 'The number of channels for the pixel',
no_success => 1, init => 1 } }
);
%invoke = ( %invoke = (
vars => [ 'guint8 *p', 'gint b', 'Tile *tile' ], vars => [ 'guint8 *p', 'gint b', 'Tile *tile' ],
@ -555,8 +562,19 @@ HELP
&std_pdb_misc; &std_pdb_misc;
$date = '1997'; $date = '1997';
&drawable_coord_args; @inargs = (
push @inargs, &pixel_arg; { name => 'drawable', type => 'drawable',
desc => 'The drawable' },
{ name => 'x_coord', type => '0 <= int32',
desc => "The x coordinate", alias => 'x' },
{ name => 'y_coord', type => '0 <= int32',
desc => "The y coordinate", alias => 'y' },
{ name => 'pixel', type => 'int8array',
desc => 'The pixel value',
array => { name => 'num_channels', type => 'int32',
desc => 'The number of channels for the pixel',
no_success => 1 } }
);
%invoke = ( %invoke = (
vars => [ 'guint8 *p', 'gint b', 'Tile *tile' ], vars => [ 'guint8 *p', 'gint b', 'Tile *tile' ],
@ -589,7 +607,8 @@ sub drawable_set_image {
&std_pdb_deprecated(); &std_pdb_deprecated();
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The drawable' },
&std_image_arg &std_image_arg
); );
@ -601,15 +620,6 @@ CODE
); );
} }
sub dim_args () {
my @args;
foreach (qw(width height bpp)) {
push @args, { name => $_, type => 'int32', desc => "The previews $_", init => 1 };
}
@args;
}
sub drawable_thumbnail { sub drawable_thumbnail {
$blurb = 'Get a thumbnail of a drawable.'; $blurb = 'Get a thumbnail of a drawable.';
@ -620,11 +630,11 @@ returned in RGB[A] or GRAY[A] format. The bpp return value gives the
number of bytes in the image. number of bytes in the image.
HELP HELP
$author = $copyright = 'Andy Thomas'; &andy_pdb_misc('1999');
$date = '1999';
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The drawable' },
{ name => 'width', type => '0 < int32 <= 512', { name => 'width', type => '0 < int32 <= 512',
desc => 'The thumbnail width', alias => 'req_width' }, desc => 'The thumbnail width', alias => 'req_width' },
{ name => 'height', type => '0 < int32 <= 512', { name => 'height', type => '0 < int32 <= 512',
@ -632,14 +642,18 @@ HELP
); );
@outargs = ( @outargs = (
&dim_args, { name => 'width', type => 'int32', void_ret => 1,
desc => 'The previews width', init => 1 },
{ name => 'height', type => 'int32',
desc => 'The previews height', init => 1 },
{ name => 'bpp', type => 'int32',
desc => 'The previews bpp', init => 1 },
{ name => 'thumbnail_data', type => 'int8array', { name => 'thumbnail_data', type => 'int8array',
desc => 'The thumbnail data', init => 1, wrap => 1, desc => 'The thumbnail data', init => 1, wrap => 1,
array => { name => 'thumbnail_data_count', array => { name => 'thumbnail_data_count',
desc => 'The number of bytes in thumbnail data', desc => 'The number of bytes in thumbnail data',
alias => 'num_bytes', init => 1 } } alias => 'num_bytes', init => 1 } }
); );
$outargs[0]->{void_ret} = 1;
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
@ -695,12 +709,11 @@ returned in RGB[A] or GRAY[A] format. The bpp return value gives the
number of bytes in the image. number of bytes in the image.
HELP HELP
$author = $copyright = 'Michael Natterer <mitch@gimp.org>'; &mitch_pdb_misc('2004', '2.2');
$date = '2004';
$since = '2.2';
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The drawable' },
{ name => 'src_x', type => '0 <= int32', { name => 'src_x', type => '0 <= int32',
desc => 'The x coordinate of the area' }, desc => 'The x coordinate of the area' },
{ name => 'src_y', type => '0 <= int32', { name => 'src_y', type => '0 <= int32',
@ -716,14 +729,18 @@ HELP
); );
@outargs = ( @outargs = (
&dim_args, { name => 'width', type => 'int32', void_ret => 1,
desc => 'The previews width', init => 1 },
{ name => 'height', type => 'int32',
desc => 'The previews height', init => 1 },
{ name => 'bpp', type => 'int32',
desc => 'The previews bpp', init => 1 },
{ name => 'thumbnail_data', type => 'int8array', { name => 'thumbnail_data', type => 'int8array',
desc => 'The thumbnail data', init => 1, wrap => 1, desc => 'The thumbnail data', init => 1, wrap => 1,
array => { name => 'thumbnail_data_count', array => { name => 'thumbnail_data_count',
desc => 'The number of bytes in thumbnail data', desc => 'The number of bytes in thumbnail data',
alias => 'num_bytes', init => 1 } } alias => 'num_bytes', init => 1 } }
); );
$outargs[0]->{void_ret} = 1;
%invoke = ( %invoke = (
headers => [ qw("core/gimpdrawable-preview.h") ], headers => [ qw("core/gimpdrawable-preview.h") ],
@ -824,8 +841,10 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &drawable_arg ); @inargs = (
$inargs[0]->{desc} .= ' to delete'; { name => 'drawable', type => 'drawable',
desc => 'The drawable to delete' }
);
%invoke = ( code => <<'CODE' ); %invoke = ( code => <<'CODE' );
{ {
@ -851,13 +870,15 @@ HELP
$since = '2.4'; $since = '2.4';
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The drawable' },
{ name => 'mode', type => 'enum GimpForegroundExtractMode', { name => 'mode', type => 'enum GimpForegroundExtractMode',
desc => 'The algorithm to use: %%desc%%' }, desc => 'The algorithm to use: %%desc%%' },
{ name => 'mask', type => 'drawable', desc => 'Tri-Map' } { name => 'mask', type => 'drawable', desc => 'Tri-Map' }
); );
%invoke = ( headers => [ qw("core/gimpdrawable-foreground-extract.h") ], %invoke = (
headers => [ qw("core/gimpdrawable-foreground-extract.h") ],
code => <<'CODE' code => <<'CODE'
{ {
success = gimp_item_is_attached (GIMP_ITEM (drawable)); success = gimp_item_is_attached (GIMP_ITEM (drawable));

View File

@ -23,18 +23,6 @@
# shortcuts # shortcuts
sub joao_pdb_misc {
$author = $copyright = 'Jo\xc3\xa3o S. O. Bueno Calligaris';
$date = '2004';
$since = '2.2';
}
sub drawable_arg () {{
name => 'drawable',
type => 'drawable',
desc => 'The affected drawable'
}}
sub transform_options_args () { sub transform_options_args () {
{ name => 'transform_direction', type => 'enum GimpTransformDirection', { name => 'transform_direction', type => 'enum GimpTransformDirection',
desc => 'Direction of Transformation: { %%desc%% }' }, desc => 'Direction of Transformation: { %%desc%% }' },
@ -55,14 +43,6 @@ sub transform_options_default_args () {
desc => 'Whether to clip results' } desc => 'Whether to clip results' }
} }
sub drawable_out_arg {
my $type = shift;
my $arg = &drawable_arg;
$arg->{desc} = "The $type drawable";
$arg->{no_declare} = 1;
$arg;
}
sub transform_invoke { sub transform_invoke {
my ($progress_text, $assemble_matrix, $variables, $check) = @_; my ($progress_text, $assemble_matrix, $variables, $check) = @_;
my $success_check = 'gimp_item_is_attached (GIMP_ITEM (drawable));'; my $success_check = 'gimp_item_is_attached (GIMP_ITEM (drawable));';
@ -172,10 +152,11 @@ selection, this will be equal to the drawable ID supplied as input.
Otherwise, this will be the newly created and flipped drawable. Otherwise, this will be the newly created and flipped drawable.
HELP HELP
&joao_pdb_misc; &joao_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'flip_type', type => &std_orientation_enum, { name => 'flip_type', type => &std_orientation_enum,
desc => 'Type of flip: %%desc%%' }, desc => 'Type of flip: %%desc%%' },
{ name => 'auto_center', type => 'boolean', { name => 'auto_center', type => 'boolean',
@ -186,7 +167,10 @@ HELP
desc => 'Whether to clip results' } desc => 'Whether to clip results' }
); );
@outargs = ( &drawable_out_arg('flipped') ); @outargs = (
{ name => 'drawable', type => 'drawable', no_declare => 1,
desc => 'The flipped drawable' }
);
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
@ -227,10 +211,11 @@ Otherwise, this will be the newly created and flipped drawable. The clip
results parameter specifies wheter current selection will affect the transform. results parameter specifies wheter current selection will affect the transform.
HELP HELP
&joao_pdb_misc; &joao_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'x0', type => 'float', { name => 'x0', type => 'float',
desc => 'horz. coord. of one end of axis' }, desc => 'horz. coord. of one end of axis' },
{ name => 'y0', type => 'float', { name => 'y0', type => 'float',
@ -242,7 +227,10 @@ HELP
&transform_options_args &transform_options_args
); );
@outargs = ( &drawable_out_arg('flipped') ); @outargs = (
{ name => 'drawable', type => 'drawable', no_declare => 1,
desc => 'The flipped drawable' }
);
transform_invoke ("Flipping", <<CODE); transform_invoke ("Flipping", <<CODE);
gimp_matrix3_identity (&matrix); gimp_matrix3_identity (&matrix);
@ -263,10 +251,11 @@ uses no interpolation/supersampling at all, or default values
(depending on the 'interpolate' parameter). (depending on the 'interpolate' parameter).
HELP HELP
&joao_pdb_misc; &joao_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'x0', type => 'float', { name => 'x0', type => 'float',
desc => 'horz. coord. of one end of axis' }, desc => 'horz. coord. of one end of axis' },
{ name => 'y0', type => 'float', { name => 'y0', type => 'float',
@ -278,7 +267,10 @@ HELP
&transform_options_default_args &transform_options_default_args
); );
@outargs = ( &drawable_out_arg('flipped') ); @outargs = (
{ name => 'drawable', type => 'drawable', no_declare => 1,
desc => 'The flipped drawable' }
);
transform_default_invoke ("Flipping", <<CODE); transform_default_invoke ("Flipping", <<CODE);
gimp_matrix3_identity (&matrix); gimp_matrix3_identity (&matrix);
@ -311,10 +303,11 @@ resulting transformed drawable will appear to have been projected via
a perspective transform. a perspective transform.
HELP HELP
&joao_pdb_misc; &joao_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&drawable_arg { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' }
); );
my $pos = 0; my $pos = 0;
@ -332,7 +325,10 @@ HELP
&transform_options_args &transform_options_args
); );
@outargs = ( &drawable_out_arg('newly mapped') ); @outargs = (
{ name => 'drawable', type => 'drawable', no_declare => 1,
desc => 'The newly mapped drawable' }
);
transform_invoke ("Perspective", <<CODE, [ 'gdouble trans_info[8]' ]); transform_invoke ("Perspective", <<CODE, [ 'gdouble trans_info[8]' ]);
gimp_matrix3_identity (&matrix); gimp_matrix3_identity (&matrix);
@ -357,10 +353,11 @@ uses no interpolation/supersampling at all, or default values
(depending on the 'interpolate' parameter). (depending on the 'interpolate' parameter).
HELP HELP
&joao_pdb_misc; &joao_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&drawable_arg { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' }
); );
my $pos = 0; my $pos = 0;
@ -378,7 +375,10 @@ HELP
&transform_options_default_args &transform_options_default_args
); );
@outargs = ( &drawable_out_arg('newly mapped') ); @outargs = (
{ name => 'drawable', type => 'drawable', no_declare => 1,
desc => 'The newly mapped drawable' }
);
transform_default_invoke ("Perspective", <<CODE, [ 'gdouble trans_info[8]' ]); transform_default_invoke ("Perspective", <<CODE, [ 'gdouble trans_info[8]' ]);
gimp_matrix3_identity (&matrix); gimp_matrix3_identity (&matrix);
@ -407,10 +407,11 @@ this will be equal to the drawable ID supplied as input. Otherwise,
this will be the newly created and rotated drawable. this will be the newly created and rotated drawable.
HELP HELP
&joao_pdb_misc; &joao_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'rotate_type', type => 'enum GimpRotationType', { name => 'rotate_type', type => 'enum GimpRotationType',
desc => 'Type of rotation: %%desc%%' }, desc => 'Type of rotation: %%desc%%' },
{ name => 'auto_center', type => 'boolean', { name => 'auto_center', type => 'boolean',
@ -423,7 +424,10 @@ HELP
desc => 'Whether to clip results' } desc => 'Whether to clip results' }
); );
@outargs = ( &drawable_out_arg('rotated') ); @outargs = (
{ name => 'drawable', type => 'drawable', no_declare => 1,
desc => 'The rotated drawable' }
);
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
@ -460,10 +464,11 @@ this will be equal to the drawable ID supplied as input. Otherwise,
this will be the newly created and rotated drawable. this will be the newly created and rotated drawable.
HELP HELP
&joao_pdb_misc; &joao_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'angle', type => 'float', { name => 'angle', type => 'float',
desc => 'The angle of rotation (radians)' }, desc => 'The angle of rotation (radians)' },
{ name => 'auto_center', type => 'boolean', { name => 'auto_center', type => 'boolean',
@ -475,7 +480,10 @@ HELP
&transform_options_args &transform_options_args
); );
@outargs = ( &drawable_out_arg('rotated') ); @outargs = (
{ name => 'drawable', type => 'drawable', no_declare => 1,
desc => 'The rotated drawable' }
);
transform_invoke ("Rotating", <<CODE); transform_invoke ("Rotating", <<CODE);
gimp_matrix3_identity (&matrix); gimp_matrix3_identity (&matrix);
@ -499,10 +507,11 @@ uses no interpolation/supersampling at all, or default values
(depending on the 'interpolate' parameter). (depending on the 'interpolate' parameter).
HELP HELP
&joao_pdb_misc; &joao_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'angle', type => 'float', { name => 'angle', type => 'float',
desc => 'The angle of rotation (radians)' }, desc => 'The angle of rotation (radians)' },
{ name => 'auto_center', type => 'boolean', { name => 'auto_center', type => 'boolean',
@ -514,7 +523,10 @@ HELP
&transform_options_default_args &transform_options_default_args
); );
@outargs = ( &drawable_out_arg('rotated') ); @outargs = (
{ name => 'drawable', type => 'drawable', no_declare => 1,
desc => 'The rotated drawable' }
);
transform_default_invoke ("Rotating", <<CODE); transform_default_invoke ("Rotating", <<CODE);
gimp_matrix3_identity (&matrix); gimp_matrix3_identity (&matrix);
@ -540,30 +552,35 @@ this will be equal to the drawable ID supplied as input. Otherwise,
this will be the newly created and scaled drawable. this will be the newly created and scaled drawable.
HELP HELP
&joao_pdb_misc; &joao_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&drawable_arg { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'x0', type => 'float',
desc => 'The new x coordinate of the upper-left corner of the
scaled region',
alias => 'trans_info[X0]', no_declare => 1 },
{ name => 'y0', type => 'float',
desc => 'The new y coordinate of the upper-left corner of the
scaled region',
alias => 'trans_info[Y0]', no_declare => 1 },
{ name => 'x1', type => 'float',
desc => 'The new x coordinate of the lower-right corner of the
scaled region',
alias => 'trans_info[X1]', no_declare => 1 },
{ name => 'y1', type => 'float',
desc => 'The new y coordinate of the lower-right corner of the
scaled region',
alias => 'trans_info[Y1]', no_declare => 1 },
&transform_options_args
); );
my $pos = 0; @outargs = (
foreach $where (qw(upper-left lower-right)) { { name => 'drawable', type => 'drawable', no_declare => 1,
foreach (qw(x y)) { desc => 'The scaled drawable' }
push @inargs,
{ name => "$_$pos", type => 'float',
desc => "The new $_ coordinate of $where corner of newly
scaled region",
alias => "trans_info[\U$_\E$pos]", no_declare => 1 }
}
$pos++;
}
@inargs = (@inargs,
&transform_options_args
); );
@outargs = ( &drawable_out_arg('scaled') );
transform_invoke ("Scaling", <<CODE, [ 'gdouble trans_info[4]' ], <<CODE2); transform_invoke ("Scaling", <<CODE, [ 'gdouble trans_info[4]' ], <<CODE2);
gimp_matrix3_identity (&matrix); gimp_matrix3_identity (&matrix);
gimp_transform_matrix_scale (&matrix, gimp_transform_matrix_scale (&matrix,
@ -588,29 +605,34 @@ uses no interpolation/supersampling at all, or default values
(depending on the 'interpolate' parameter). (depending on the 'interpolate' parameter).
HELP HELP
&joao_pdb_misc; &joao_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&drawable_arg { name => 'drawable', type => 'drawable',
); desc => 'The affected drawable' },
{ name => 'x0', type => 'float',
my $pos = 0; desc => 'The new x coordinate of the upper-left corner of the
foreach $where (qw(upper-left lower-right)) { scaled region',
foreach (qw(x y)) { alias => 'trans_info[X0]', no_declare => 1 },
push @inargs, { name => 'y0', type => 'float',
{ name => "$_$pos", type => 'float', desc => 'The new y coordinate of the upper-left corner of the
desc => "The new $_ coordinate of $where corner of newly scaled region',
scaled region", alias => 'trans_info[Y0]', no_declare => 1 },
alias => "trans_info[\U$_\E$pos]", no_declare => 1 } { name => 'x1', type => 'float',
} desc => 'The new x coordinate of the lower-right corner of the
$pos++; scaled region',
} alias => 'trans_info[X1]', no_declare => 1 },
{ name => 'y1', type => 'float',
@inargs = (@inargs, desc => 'The new y coordinate of the lower-right corner of the
scaled region',
alias => 'trans_info[Y1]', no_declare => 1 },
&transform_options_default_args &transform_options_default_args
); );
@outargs = ( &drawable_out_arg('scaled') ); @outargs = (
{ name => 'drawable', type => 'drawable', no_declare => 1,
desc => 'The scaled drawable' }
);
transform_default_invoke ("Scaling", <<CODE, [ 'gdouble trans_info[4]' ], <<CODE2); transform_default_invoke ("Scaling", <<CODE, [ 'gdouble trans_info[4]' ], <<CODE2);
gimp_matrix3_identity (&matrix); gimp_matrix3_identity (&matrix);
@ -645,10 +667,11 @@ vertically. The magnitude can be either positive or negative and
indicates the extent (in pixels) to shear by. indicates the extent (in pixels) to shear by.
HELP HELP
&joao_pdb_misc; &joao_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'shear_type', type => &std_orientation_enum, { name => 'shear_type', type => &std_orientation_enum,
desc => 'Type of shear: %%desc%%' }, desc => 'Type of shear: %%desc%%' },
{ name => 'magnitude', type => 'float', { name => 'magnitude', type => 'float',
@ -656,7 +679,10 @@ HELP
&transform_options_args &transform_options_args
); );
@outargs = ( &drawable_out_arg('sheared') ); @outargs = (
{ name => 'drawable', type => 'drawable', no_declare => 1,
desc => 'The sheared drawable' }
);
transform_invoke ("Shearing", <<CODE); transform_invoke ("Shearing", <<CODE);
gimp_matrix3_identity (&matrix); gimp_matrix3_identity (&matrix);
@ -678,10 +704,11 @@ uses no interpolation/supersampling at all, or default values
(depending on the 'interpolate' parameter). (depending on the 'interpolate' parameter).
HELP HELP
&joao_pdb_misc; &joao_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'shear_type', type => &std_orientation_enum, { name => 'shear_type', type => &std_orientation_enum,
desc => 'Type of shear: %%desc%%' }, desc => 'Type of shear: %%desc%%' },
{ name => 'magnitude', type => 'float', { name => 'magnitude', type => 'float',
@ -689,7 +716,10 @@ HELP
&transform_options_default_args &transform_options_default_args
); );
@outargs = ( &drawable_out_arg('sheared') ); @outargs = (
{ name => 'drawable', type => 'drawable', no_declare => 1,
desc => 'The sheared drawable' }
);
transform_default_invoke ("Shearing", <<CODE); transform_default_invoke ("Shearing", <<CODE);
gimp_matrix3_identity (&matrix); gimp_matrix3_identity (&matrix);
@ -719,10 +749,11 @@ input. Otherwise, this will be the newly created and transformed
drawable. drawable.
HELP HELP
&joao_pdb_misc; &joao_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'source_x', type => 'float', { name => 'source_x', type => 'float',
desc => 'X coordinate of the transformation center' }, desc => 'X coordinate of the transformation center' },
{ name => 'source_y', type => 'float', { name => 'source_y', type => 'float',
@ -740,7 +771,10 @@ HELP
&transform_options_args &transform_options_args
); );
@outargs = ( &drawable_out_arg('transformed') ); @outargs = (
{ name => 'drawable', type => 'drawable', no_declare => 1,
desc => 'The transformed drawable' }
);
transform_invoke ("2D Transform", <<CODE); transform_invoke ("2D Transform", <<CODE);
gimp_matrix3_identity (&matrix); gimp_matrix3_identity (&matrix);
@ -763,10 +797,11 @@ uses no interpolation/supersampling at all, or default values
(depending on the 'interpolate' parameter). (depending on the 'interpolate' parameter).
HELP HELP
&joao_pdb_misc; &joao_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'source_x', type => 'float', { name => 'source_x', type => 'float',
desc => 'X coordinate of the transformation center' }, desc => 'X coordinate of the transformation center' },
{ name => 'source_y', type => 'float', { name => 'source_y', type => 'float',
@ -784,7 +819,10 @@ HELP
&transform_options_default_args &transform_options_default_args
); );
@outargs = ( &drawable_out_arg('transformed') ); @outargs = (
{ name => 'drawable', type => 'drawable', no_declare => 1,
desc => 'The transformed drawable' }
);
transform_default_invoke ("2D Transforming", <<CODE); transform_default_invoke ("2D Transforming", <<CODE);
gimp_matrix3_identity (&matrix); gimp_matrix3_identity (&matrix);
@ -812,10 +850,11 @@ this will be equal to the drawable ID supplied as input. Otherwise,
this will be the newly created and transformed drawable. this will be the newly created and transformed drawable.
HELP HELP
&joao_pdb_misc; &joao_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'coeff_0_0', type => 'float', { name => 'coeff_0_0', type => 'float',
desc => 'coefficient (0,0) of the transformation matrix' }, desc => 'coefficient (0,0) of the transformation matrix' },
{ name => 'coeff_0_1', type => 'float', { name => 'coeff_0_1', type => 'float',
@ -837,7 +876,10 @@ HELP
&transform_options_args &transform_options_args
); );
@outargs = ( &drawable_out_arg('transformed') ); @outargs = (
{ name => 'drawable', type => 'drawable', no_declare => 1,
desc => 'The transformed drawable' }
);
transform_invoke ("2D Transforming", <<CODE); transform_invoke ("2D Transforming", <<CODE);
matrix.coeff[0][0] = coeff_0_0; matrix.coeff[0][0] = coeff_0_0;
@ -864,10 +906,11 @@ uses no interpolation/supersampling at all, or default values
(depending on the 'interpolate' parameter). (depending on the 'interpolate' parameter).
HELP HELP
&joao_pdb_misc; &joao_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'coeff_0_0', type => 'float', { name => 'coeff_0_0', type => 'float',
desc => 'coefficient (0,0) of the transformation matrix' }, desc => 'coefficient (0,0) of the transformation matrix' },
{ name => 'coeff_0_1', type => 'float', { name => 'coeff_0_1', type => 'float',
@ -889,7 +932,10 @@ HELP
&transform_options_default_args &transform_options_default_args
); );
@outargs = ( &drawable_out_arg('transformed') ); @outargs = (
{ name => 'drawable', type => 'drawable', no_declare => 1,
desc => 'The transformed drawable' }
);
transform_default_invoke ("2D Transforming", <<CODE); transform_default_invoke ("2D Transforming", <<CODE);
matrix.coeff[0][0] = coeff_0_0; matrix.coeff[0][0] = coeff_0_0;

View File

@ -17,35 +17,16 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
# Common invoker for checking for image/drawable consistency
sub invoke {
%invoke = (
code => <<CODE
{
success = gimp_item_is_attached (GIMP_ITEM (drawable));
if (success)
{
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
@{[shift]};
}
}
CODE
);
}
# The defs
sub edit_cut { sub edit_cut {
$blurb = 'Cut from the specified drawable.'; $blurb = 'Cut from the specified drawable.';
$help = <<'HELP'; $help = <<'HELP';
If there is a selection in the image, then the area specified by the selection If there is a selection in the image, then the area specified by the
is cut from the specified drawable and placed in an internal GIMP edit buffer. selection is cut from the specified drawable and placed in an internal
It can subsequently be retrieved using the 'gimp-edit-paste' command. If there GIMP edit buffer. It can subsequently be retrieved using the
is no selection, then the specified drawable will be removed and its contents 'gimp-edit-paste' command. If there is no selection, then the
stored in the internal GIMP edit buffer. specified drawable will be removed and its contents stored in the
internal GIMP edit buffer.
HELP HELP
&std_pdb_misc; &std_pdb_misc;
@ -57,21 +38,36 @@ HELP
@outargs = ( @outargs = (
{ name => 'non_empty', type => 'boolean', init => 1, { name => 'non_empty', type => 'boolean', init => 1,
desc => 'TRUE if the cut was successful, FALSE if the selection contained only transparent pixels' } desc => 'TRUE if the cut was successful, FALSE if the
selection contained only transparent pixels' }
); );
&invoke('non_empty = gimp_edit_cut (image, drawable, context) != NULL'); %invoke = (
code => <<CODE
{
success = gimp_item_is_attached (GIMP_ITEM (drawable));
if (success)
{
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
non_empty = gimp_edit_cut (image, drawable, context) != NULL;
}
}
CODE
);
} }
sub edit_copy { sub edit_copy {
$blurb = 'Copy from the specified drawable.'; $blurb = 'Copy from the specified drawable.';
$help = <<'HELP'; $help = <<'HELP';
If there is a selection in the image, then the area specified by the selection If there is a selection in the image, then the area specified by the
is copied from the specified drawable and placed in an internal GIMP edit selection is copied from the specified drawable and placed in an
buffer. It can subsequently be retrieved using the 'gimp-edit-paste' command. internal GIMP edit buffer. It can subsequently be retrieved using the
If there is no selection, then the specified drawable's contents will be stored 'gimp-edit-paste' command. If there is no selection, then the
in the internal GIMP edit buffer. specified drawable's contents will be stored in the internal GIMP edit
buffer.
HELP HELP
&std_pdb_misc; &std_pdb_misc;
@ -83,10 +79,24 @@ HELP
@outargs = ( @outargs = (
{ name => 'non_empty', type => 'boolean', init => 1, { name => 'non_empty', type => 'boolean', init => 1,
desc => 'TRUE if the copy was successful, FALSE if the selection contained only transparent pixels' } desc => 'TRUE if the copy was successful, FALSE if the
selection contained only transparent pixels' }
); );
&invoke('non_empty = gimp_edit_copy (image, drawable, context) != NULL'); %invoke = (
code => <<CODE
{
success = gimp_item_is_attached (GIMP_ITEM (drawable));
if (success)
{
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
non_empty = gimp_edit_copy (image, drawable, context) != NULL;
}
}
CODE
);
} }
sub edit_copy_visible { sub edit_copy_visible {
@ -100,9 +110,7 @@ edit buffer. It can subsequently be retrieved using the
projection's contents will be stored in the internal GIMP edit buffer. projection's contents will be stored in the internal GIMP edit buffer.
HELP HELP
$author = $copyright = 'Michael Natterer <mitch@gimp.org>'; &mitch_pdb_misc('2004', '2.2');
$date = '2004';
$since = '2.2';
@inargs = ( @inargs = (
{ name => 'image', type => 'image', { name => 'image', type => 'image',
@ -111,7 +119,8 @@ HELP
@outargs = ( @outargs = (
{ name => 'non_empty', type => 'boolean', init => 1, { name => 'non_empty', type => 'boolean', init => 1,
desc => 'TRUE if the copy was successful, FALSE if the selection contained only transparent pixels' } desc => 'TRUE if the copy was successful, FALSE if the
selection contained only transparent pixels' }
); );
%invoke = ( %invoke = (
@ -127,19 +136,20 @@ sub edit_paste {
$blurb = 'Paste buffer to the specified drawable.'; $blurb = 'Paste buffer to the specified drawable.';
$help = <<'HELP'; $help = <<'HELP';
This procedure pastes a copy of the internal GIMP edit buffer to the specified This procedure pastes a copy of the internal GIMP edit buffer to the
drawable. The GIMP edit buffer will be empty unless a call was previously made specified drawable. The GIMP edit buffer will be empty unless a call
to either 'gimp-edit-cut' or 'gimp-edit-copy'. The "paste_into" option was previously made to either 'gimp-edit-cut' or 'gimp-edit-copy'. The
specifies whether to clear the current image selection, or to paste the buffer "paste_into" option specifies whether to clear the current image
"behind" the selection. This allows the selection to act as a mask for the selection, or to paste the buffer "behind" the selection. This allows
pasted buffer. Anywhere that the selection mask is non-zero, the pasted buffer the selection to act as a mask for the pasted buffer. Anywhere that
will show through. The pasted buffer will be a new layer in the image which is the selection mask is non-zero, the pasted buffer will show
designated as the image floating selection. If the image has a floating through. The pasted buffer will be a new layer in the image which is
selection at the time of pasting, the old floating selection will be anchored designated as the image floating selection. If the image has a
to it's drawable before the new floating selection is added. This procedure floating selection at the time of pasting, the old floating selection
returns the new floating layer. The resulting floating selection will already will be anchored to it's drawable before the new floating selection is
be attached to the specified drawable, and a subsequent call to added. This procedure returns the new floating layer. The resulting
floating_sel_attach is not needed. floating selection will already be attached to the specified drawable,
and a subsequent call to floating_sel_attach is not needed.
HELP HELP
&std_pdb_misc; &std_pdb_misc;
@ -185,9 +195,7 @@ previously made to either 'gimp-edit-cut' or 'gimp-edit-copy'. This
procedure returns the new image. procedure returns the new image.
HELP HELP
$author = $copyright = 'Michael Natterer <mitch@gimp.org>'; &mitch_pdb_misc('2005', '2.4');
$date = '2005';
$since = '2.4';
@outargs = ( @outargs = (
{ name => 'image', type => 'image', init => 1, { name => 'image', type => 'image', init => 1,
@ -213,12 +221,12 @@ sub edit_named_cut {
$blurb = 'Cut into a named buffer.'; $blurb = 'Cut into a named buffer.';
$help = <<'HELP'; $help = <<'HELP';
This procedure works like gimp-edit-cut, but additionally stores the cut buffer into a named buffer that will stay available for later pasting, regardless of any intermediate copy or cut operations. This procedure works like gimp-edit-cut, but additionally stores the
cut buffer into a named buffer that will stay available for later
pasting, regardless of any intermediate copy or cut operations.
HELP HELP
$author = $copyright = 'Michael Natterer <mitch@gimp.org>'; &mitch_pdb_misc('2005', '2.4');
$date = '2005';
$since = '2.4';
@inargs = ( @inargs = (
{ name => 'drawable', type => 'drawable', { name => 'drawable', type => 'drawable',
@ -228,7 +236,8 @@ HELP
); );
@outargs = ( @outargs = (
{ name => 'real_name', type => 'string', init => 1, { name => 'real_name', type => 'string', init => 1,
desc => 'The real name given to the buffer, or NULL if the selection contained only transparent pixels' } desc => 'The real name given to the buffer, or NULL if the
selection contained only transparent pixels' }
); );
%invoke = ( %invoke = (
@ -258,12 +267,12 @@ sub edit_named_copy {
$blurb = 'Copy into a named buffer.'; $blurb = 'Copy into a named buffer.';
$help = <<'HELP'; $help = <<'HELP';
This procedure works like gimp-edit-copy, but additionally stores the copied buffer into a named buffer that will stay available for later pasting, regardless of any intermediate copy or cut operations. This procedure works like gimp-edit-copy, but additionally stores the
copied buffer into a named buffer that will stay available for later
pasting, regardless of any intermediate copy or cut operations.
HELP HELP
$author = $copyright = 'Michael Natterer <mitch@gimp.org>'; &mitch_pdb_misc('2005', '2.4');
$date = '2005';
$since = '2.4';
@inargs = ( @inargs = (
{ name => 'drawable', type => 'drawable', { name => 'drawable', type => 'drawable',
@ -273,7 +282,8 @@ HELP
); );
@outargs = ( @outargs = (
{ name => 'real_name', type => 'string', init => 1, { name => 'real_name', type => 'string', init => 1,
desc => 'The real name given to the buffer, or NULL if the selection contained only transparent pixels' } desc => 'The real name given to the buffer, or NULL if the
selection contained only transparent pixels' }
); );
%invoke = ( %invoke = (
@ -303,12 +313,13 @@ sub edit_named_copy_visible {
$blurb = 'Copy from the projection into a named buffer.'; $blurb = 'Copy from the projection into a named buffer.';
$help = <<'HELP'; $help = <<'HELP';
This procedure works like gimp-edit-copy-visible, but additionally stores the copied buffer into a named buffer that will stay available for later pasting, regardless of any intermediate copy or cut operations. This procedure works like gimp-edit-copy-visible, but additionally
stores the copied buffer into a named buffer that will stay available
for later pasting, regardless of any intermediate copy or cut
operations.
HELP HELP
$author = $copyright = 'Michael Natterer <mitch@gimp.org>'; &mitch_pdb_misc('2005', '2.4');
$date = '2005';
$since = '2.4';
@inargs = ( @inargs = (
{ name => 'image', type => 'image', { name => 'image', type => 'image',
@ -346,13 +357,11 @@ sub edit_named_paste {
$blurb = 'Paste named buffer to the specified drawable.'; $blurb = 'Paste named buffer to the specified drawable.';
$help = <<'HELP'; $help = <<'HELP';
This procedure works like gimp-edit-paste but pastes a named buffer instead This procedure works like gimp-edit-paste but pastes a named buffer
of the global buffer. instead of the global buffer.
HELP HELP
$author = $copyright = 'Michael Natterer <mitch@gimp.org>'; &mitch_pdb_misc('2005', '2.4');
$date = '2005';
$since = '2.4';
@inargs = ( @inargs = (
{ name => 'drawable', type => 'drawable', { name => 'drawable', type => 'drawable',
@ -399,9 +408,7 @@ This procedure works like gimp-edit-paste-as-new but pastes a named buffer
instead of the global buffer. instead of the global buffer.
HELP HELP
$author = $copyright = 'Michael Natterer <mitch@gimp.org>'; &mitch_pdb_misc('2005', '2.4');
$date = '2005';
$since = '2.4';
@inargs = ( @inargs = (
{ name => 'buffer_name', type => 'string', { name => 'buffer_name', type => 'string',
@ -438,43 +445,75 @@ sub edit_clear {
$blurb = 'Clear selected area of drawable.'; $blurb = 'Clear selected area of drawable.';
$help = <<'HELP'; $help = <<'HELP';
This procedure clears the specified drawable. If the drawable has an alpha This procedure clears the specified drawable. If the drawable has an
channel, the cleared pixels will become transparent. If the drawable does not alpha channel, the cleared pixels will become transparent. If the
have an alpha channel, cleared pixels will be set to the background color. This drawable does not have an alpha channel, cleared pixels will be set to
procedure only affects regions within a selection if there is a selection the background color. This procedure only affects regions within a
active. selection if there is a selection active.
HELP HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
{ name => 'drawable', type => 'drawable', { name => 'drawable', type => 'drawable',
desc => 'The drawable to clear from' } desc => 'The drawable to clear from' }
); );
&invoke('success = gimp_edit_clear (image, drawable, context)');
%invoke = (
code => <<CODE
{
success = gimp_item_is_attached (GIMP_ITEM (drawable));
if (success)
{
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
success = gimp_edit_clear (image, drawable, context);
}
}
CODE
);
} }
sub edit_fill { sub edit_fill {
$blurb = 'Fill selected area of drawable.'; $blurb = 'Fill selected area of drawable.';
$help = <<'HELP'; $help = <<'HELP';
This procedure fills the specified drawable with the fill mode. If the fill This procedure fills the specified drawable with the fill mode. If the
mode is foreground, the current foreground color is used. If the fill mode is fill mode is foreground, the current foreground color is used. If the
background, the current background color is used. Other fill modes should not fill mode is background, the current background color is used. Other
be used. This procedure only affects regions within a selection if there is a fill modes should not be used. This procedure only affects regions
selection active. If you want to fill the whole drawable, regardless of the within a selection if there is a selection active. If you want to fill
selection, use gimp_drawable_fill(). the whole drawable, regardless of the selection, use
gimp_drawable_fill().
HELP HELP
&std_pdb_misc; &std_pdb_misc;
$author .= ' & Raphael Quinet'; $author .= ' & Raphael Quinet';
$date = '1995-2000'; $date = '1995-2000';
@inargs = ( @inargs = (
{ name => 'drawable', type => 'drawable', { name => 'drawable', type => 'drawable',
desc => "The drawable to fill to" }, desc => "The drawable to fill to" },
{ name => 'fill_type', type => 'enum GimpFillType', { name => 'fill_type', type => 'enum GimpFillType',
desc => 'The type of fill: %%desc%%' } desc => 'The type of fill: %%desc%%' }
); );
&invoke('success = gimp_edit_fill (image, drawable, context, (GimpFillType) fill_type)');
%invoke = (
code => <<CODE
{
success = gimp_item_is_attached (GIMP_ITEM (drawable));
if (success)
{
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
success = gimp_edit_fill (image, drawable, context,
(GimpFillType) fill_type);
}
}
CODE
);
} }
sub edit_bucket_fill { sub edit_bucket_fill {
@ -553,14 +592,15 @@ CODE
sub edit_blend { sub edit_blend {
$blurb = <<'BLURB'; $blurb = <<'BLURB';
Blend between the starting and ending coordinates with the specified blend mode Blend between the starting and ending coordinates with the specified
and gradient type. blend mode and gradient type.
BLURB BLURB
$help = <<'HELP'; $help = <<'HELP';
This tool requires information on the paint application mode, the blend mode, This tool requires information on the paint application mode, the
and the gradient type. It creates the specified variety of blend using the blend mode, and the gradient type. It creates the specified variety of
starting and ending coordinates as defined for each gradient type. blend using the starting and ending coordinates as defined for each
gradient type.
HELP HELP
&std_pdb_misc; &std_pdb_misc;
@ -645,6 +685,7 @@ the specified drawable regardless of the active selection.
HELP HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
{ name => 'drawable', type => 'drawable', { name => 'drawable', type => 'drawable',
desc => 'The drawable to stroke to' } desc => 'The drawable to stroke to' }

View File

@ -18,36 +18,6 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub pdb_misc {
$author = $copyright = 'Josh MacDonald';
$date = '1997';
}
sub list_arg {
my ($type, $name, $desc, $example) = @_;
push @inargs, { name => $name, type => 'string', no_success => 1,
desc => qq/comma separated list of $desc this handler
can $type (i.e. "$example")/ }
}
sub handler_args {
my $type = shift;
my $action = $type;
$action =~ s/e$//;
$action .= 'ing';
push @inargs, { name => 'procedure_name', type => 'string',
desc => "The name of the procedure to be used for $action",
alias => 'name' };
foreach ([ 'extensions', 'jpg,jpeg' ], [ 'prefixes', 'http:,ftp:' ]) {
&list_arg($type, $_->[0], @$_);
}
}
# The defs
sub file_load { sub file_load {
$blurb = 'Loads an image file by invoking the right load handler.'; $blurb = 'Loads an image file by invoking the right load handler.';
@ -60,7 +30,7 @@ this is that if the user types http://www.xcf/~gimp/ he wants to fetch a URL,
and the full pathname will not look like a URL." and the full pathname will not look like a URL."
HELP HELP
&pdb_misc; &josh_pdb_misc('1997');
@inargs = ( @inargs = (
{ name => 'run_mode', { name => 'run_mode',
@ -78,10 +48,13 @@ HELP
%invoke = ( %invoke = (
proc => [ 'proc->name', 'new_args' ], proc => [ 'proc->name', 'new_args' ],
args => [ 'new_args', 'return_vals' ], args => [ 'new_args', 'return_vals' ],
vars => [ 'PlugInProcDef *file_proc', 'const ProcRecord *proc',
'gchar *uri', 'gint i' ],
code => <<'CODE' code => <<'CODE'
{ {
PlugInProcDef *file_proc;
const ProcRecord *proc;
gchar *uri;
gint i;
uri = file_utils_filename_to_uri (gimp->load_procs, %%filename%%, NULL); uri = file_utils_filename_to_uri (gimp->load_procs, %%filename%%, NULL);
if (! uri) if (! uri)
@ -123,9 +96,7 @@ This procedure behaves like the file-load procedure but opens the specified
image as a layer into an already opened image. image as a layer into an already opened image.
HELP HELP
$author = $copyright = 'Sven Neumann'; &neo_pdb_misc('2005', '2.4');
$date = '2005';
$since = '2.4';
@inargs = ( @inargs = (
{ name => 'run_mode', { name => 'run_mode',
@ -144,9 +115,11 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("file/file-open.h") ], headers => [ qw("file/file-open.h") ],
vars => [ 'GimpPDBStatusType status', 'gchar *uri' ],
code => <<'CODE' code => <<'CODE'
{ {
GimpPDBStatusType status;
gchar *uri;
uri = file_utils_filename_to_uri (gimp->load_procs, filename, NULL); uri = file_utils_filename_to_uri (gimp->load_procs, filename, NULL);
if (! uri) if (! uri)
success = FALSE; success = FALSE;
@ -173,7 +146,7 @@ http://www.xcf/~gimp/ she wants to fetch a URL, and the full pathname will not
look like a URL. look like a URL.
HELP HELP
&pdb_misc; &josh_pdb_misc('1997');
@inargs = ( @inargs = (
{ name => 'run_mode', { name => 'run_mode',
@ -194,10 +167,13 @@ HELP
headers => [ qw(<string.h>) ], headers => [ qw(<string.h>) ],
proc => [ 'proc->name', 'new_args' ], proc => [ 'proc->name', 'new_args' ],
args => [ 'new_args', 'return_vals' ], args => [ 'new_args', 'return_vals' ],
vars => [ 'PlugInProcDef *file_proc', 'const ProcRecord *proc',
'gchar *uri', 'gint i' ],
code => <<'CODE' code => <<'CODE'
{ {
PlugInProcDef *file_proc;
const ProcRecord *proc;
gchar *uri;
gint i;
uri = file_utils_filename_to_uri (gimp->load_procs, %%filename%%, NULL); uri = file_utils_filename_to_uri (gimp->load_procs, %%filename%%, NULL);
if (! uri) if (! uri)
@ -264,11 +240,12 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'gchar *uri', code => <<'CODE'
'GimpThumbnail *thumbnail = NULL',
'GdkPixbuf *pixbuf = NULL' ],
code => <<'CODE'
{ {
GimpThumbnail *thumbnail = NULL;
GdkPixbuf *pixbuf = NULL;
gchar *uri;
uri = g_filename_to_uri (filename, NULL, NULL); uri = g_filename_to_uri (filename, NULL, NULL);
if (uri) if (uri)
@ -331,7 +308,7 @@ will fail. This procedure may become useful if you want to
explicitely save a thumbnail with a file. explicitely save a thumbnail with a file.
HELP HELP
&pdb_misc; &josh_pdb_misc('1997');
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
@ -340,17 +317,17 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'GimpImagefile *imagefile', 'gchar *uri',
'const gchar *image_uri' ],
code => <<'CODE' code => <<'CODE'
{ {
image_uri = gimp_object_get_name (GIMP_OBJECT (gimage)); const gchar *image_uri = gimp_object_get_name (GIMP_OBJECT (gimage));
if (! image_uri) if (! image_uri)
success = FALSE; success = FALSE;
if (success) if (success)
{ {
uri = g_filename_to_uri (filename, NULL, NULL); gchar *uri = g_filename_to_uri (filename, NULL, NULL);
if (! uri) if (! uri)
success = FALSE; success = FALSE;
@ -361,6 +338,8 @@ HELP
if (success) if (success)
{ {
GimpImagefile *imagefile;
imagefile = gimp_imagefile_new (gimp, uri); imagefile = gimp_imagefile_new (gimp, uri);
success = gimp_imagefile_save_thumbnail (imagefile, NULL, gimage); success = gimp_imagefile_save_thumbnail (imagefile, NULL, gimage);
g_object_unref (imagefile); g_object_unref (imagefile);
@ -381,7 +360,7 @@ sub temp_name {
Generates a unique filename using the temp path supplied in the user's gimprc. Generates a unique filename using the temp path supplied in the user's gimprc.
HELP HELP
&pdb_misc; &josh_pdb_misc('1997');
@inargs = ( @inargs = (
{ name => 'extension', type => 'string', no_validate => 1, { name => 'extension', type => 'string', no_validate => 1,
@ -394,12 +373,14 @@ HELP
); );
%invoke = ( %invoke = (
headers => [ qw(<process.h> headers => [ qw(<process.h> "config/gimpbaseconfig.h") ],
"config/gimpbaseconfig.h") ],
vars => [ 'static gint id = 0', 'static gint pid',
'gchar *filename', 'gchar *path' ],
code => <<'CODE' code => <<'CODE'
{ {
static gint id = 0;
static gint pid;
gchar *filename;
gchar *path;
if (id == 0) if (id == 0)
pid = getpid (); pid = getpid ();
@ -428,14 +409,27 @@ HELP
&std_pdb_misc; &std_pdb_misc;
&handler_args('load'); @inargs = (
&list_arg('load', 'magics', 'magic file information', '0,string,GIF'); { name => 'procedure_name', type => 'string',
desc => 'The name of the procedure to be used for loading',
alias => 'name' },
{ name => 'extensions', type => 'string', no_success => 1,
desc => 'comma separated list of extensions this handler
can load (i.e. "jpg,jpeg")' },
{ name => 'prefixes', type => 'string', no_success => 1,
desc => 'comma separated list of prefixes this handler
can load (i.e. "http:,ftp:")' },
{ name => 'magics', type => 'string', no_success => 1,
desc => 'comma separated list of magic file information
this handler can load (i.e. "0,string,GIF")' }
);
%invoke = ( %invoke = (
vars => [ 'ProcRecord *proc', 'PlugInProcDef *file_proc' ],
code => <<'CODE' code => <<'CODE'
{ {
gchar *canonical; ProcRecord *proc;
PlugInProcDef *file_proc;
gchar *canonical;
success = FALSE; success = FALSE;
@ -487,7 +481,17 @@ HELP
&std_pdb_misc; &std_pdb_misc;
&handler_args('load'); @inargs = (
{ name => 'procedure_name', type => 'string',
desc => 'The name of the procedure to be used for loading',
alias => 'name' },
{ name => 'extensions', type => 'string', no_success => 1,
desc => 'comma separated list of extensions this handler
can load (i.e. "jpg,jpeg")' },
{ name => 'prefixes', type => 'string', no_success => 1,
desc => 'comma separated list of prefixes this handler
can load (i.e. "http:,ftp:")' }
);
%invoke = ( %invoke = (
pass_through => 'register_magic_load_handler', pass_through => 'register_magic_load_handler',
@ -506,13 +510,24 @@ HELP
&std_pdb_misc; &std_pdb_misc;
&handler_args('save'); @inargs = (
{ name => 'procedure_name', type => 'string',
desc => 'The name of the procedure to be used for saving',
alias => 'name' },
{ name => 'extensions', type => 'string', no_success => 1,
desc => 'comma separated list of extensions this handler
can save (i.e. "jpg,jpeg")' },
{ name => 'prefixes', type => 'string', no_success => 1,
desc => 'comma separated list of prefixes this handler
can save (i.e. "http:,ftp:")' }
);
%invoke = ( %invoke = (
vars => [ 'ProcRecord *proc', 'PlugInProcDef *file_proc' ],
code => <<'CODE' code => <<'CODE'
{ {
gchar *canonical; ProcRecord *proc;
PlugInProcDef *file_proc;
gchar *canonical;
success = FALSE; success = FALSE;
@ -563,9 +578,7 @@ to determine the MIME type of the file opened or saved using this
procedure. procedure.
HELP HELP
$author = $copyright = 'Sven Neumann'; &neo_pdb_misc('2004', '2.2');
$date = '2004';
$since = '2.2';
@inargs = ( @inargs = (
{ name => 'procedure_name', type => 'string', alias => 'name', { name => 'procedure_name', type => 'string', alias => 'name',
@ -596,9 +609,7 @@ sub register_thumbnail_loader {
Some file formats allow for embedded thumbnails, other file formats contain a scalable image or provide the image data in different resolutions. A file plug-in for such a format may register a special procedure that allows GIMP to load a thumbnail preview of the image. This procedure is then associated with the standard load procedure using this function. Some file formats allow for embedded thumbnails, other file formats contain a scalable image or provide the image data in different resolutions. A file plug-in for such a format may register a special procedure that allows GIMP to load a thumbnail preview of the image. This procedure is then associated with the standard load procedure using this function.
HELP HELP
$author = $copyright = 'Sven Neumann'; &neo_pdb_misc('2004', '2.2');
$date = '2004';
$since = '2.2';
@inargs = ( @inargs = (
{ name => 'load_proc', type => 'string', { name => 'load_proc', type => 'string',

View File

@ -17,29 +17,6 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub inargs {
@inargs = (
{ name => 'floating_sel', type => 'layer',
desc => 'The floating selection' }
);
}
sub invoke {
my @subname = split /::/, (caller 1)[3];
my $cmd = pop @subname;
%invoke = (
headers => [ qw("core/gimplayer-floating-sel.h") ],
code => <<CODE
{
if (gimp_layer_is_floating_sel (floating_sel))
$cmd (floating_sel);
else
success = FALSE;
}
CODE
);
}
sub floating_sel_remove { sub floating_sel_remove {
$blurb = <<'BLURB'; $blurb = <<'BLURB';
Remove the specified floating selection from its associated drawable. Remove the specified floating selection from its associated drawable.
@ -51,8 +28,22 @@ effects. The associated drawable is then set to active.
HELP HELP
&std_pdb_misc; &std_pdb_misc;
&inargs;
&invoke; @inargs = (
{ name => 'floating_sel', type => 'layer',
desc => 'The floating selection' }
);
%invoke = (
code => <<CODE
{
if (gimp_layer_is_floating_sel (floating_sel))
floating_sel_remove (floating_sel);
else
success = FALSE;
}
CODE
);
} }
sub floating_sel_anchor { sub floating_sel_anchor {
@ -67,8 +58,22 @@ selection layer is no longer valid after this operation.
HELP HELP
&std_pdb_misc; &std_pdb_misc;
&inargs;
&invoke; @inargs = (
{ name => 'floating_sel', type => 'layer',
desc => 'The floating selection' }
);
%invoke = (
code => <<CODE
{
if (gimp_layer_is_floating_sel (floating_sel))
floating_sel_anchor (floating_sel);
else
success = FALSE;
}
CODE
);
} }
sub floating_sel_to_layer { sub floating_sel_to_layer {
@ -85,8 +90,22 @@ floating selection is above an auxillary channel or a layer mask.
HELP HELP
&std_pdb_misc; &std_pdb_misc;
&inargs;
&invoke; @inargs = (
{ name => 'floating_sel', type => 'layer',
desc => 'The floating selection' }
);
%invoke = (
code => <<CODE
{
if (gimp_layer_is_floating_sel (floating_sel))
floating_sel_to_layer (floating_sel);
else
success = FALSE;
}
CODE
);
} }
sub floating_sel_attach { sub floating_sel_attach {
@ -108,13 +127,12 @@ HELP
); );
%invoke = ( %invoke = (
headers => [ qw("core/gimplayer-floating-sel.h") ],
code => <<CODE code => <<CODE
{ {
success = gimp_item_is_attached (GIMP_ITEM (drawable)); if (gimp_item_is_attached (GIMP_ITEM (drawable)))
if (success)
floating_sel_attach (layer, drawable); floating_sel_attach (layer, drawable);
else
success = FALSE;
} }
CODE CODE
); );
@ -122,35 +140,55 @@ CODE
sub floating_sel_rigor { sub floating_sel_rigor {
$blurb = 'Rigor the floating selection.'; $blurb = 'Rigor the floating selection.';
$help = 'This procedure rigors the floating selection.';
$help = <<'HELP';
This procedure rigors the floating selection.
HELP
&std_pdb_misc; &std_pdb_misc;
&inargs; @inargs = (
push @inargs, { name => 'undo', type => 'boolean', desc => '%%desc%%' }; { name => 'floating_sel', type => 'layer',
desc => 'The floating selection' },
{ name => 'undo', type => 'boolean',
desc => '%%desc%%' }
);
&invoke; %invoke = (
$invoke{code} =~ s/\(floating_sel\);/(floating_sel, undo);/; code => <<CODE
{
if (gimp_layer_is_floating_sel (floating_sel))
floating_sel_rigor (floating_sel, undo);
else
success = FALSE;
}
CODE
);
} }
sub floating_sel_relax { sub floating_sel_relax {
$blurb = 'Relax the floating selection.'; $blurb = 'Relax the floating selection.';
$help = 'This procedure relaxes the floating selection.';
$help = <<'HELP';
This procedure relaxes the floating selection.
HELP
&std_pdb_misc; &std_pdb_misc;
&inargs; @inargs = (
push @inargs, { name => 'undo', type => 'boolean', desc => '%%desc%%' }; { name => 'floating_sel', type => 'layer',
desc => 'The floating selection' },
{ name => 'undo', type => 'boolean',
desc => '%%desc%%' }
);
&invoke; %invoke = (
$invoke{code} =~ s/\(floating_sel\);/(floating_sel, undo);/; code => <<CODE
{
if (gimp_layer_is_floating_sel (floating_sel))
floating_sel_relax (floating_sel, undo);
else
success = FALSE;
} }
CODE
);
}
@headers = qw("core/gimplayer-floating-sel.h");
@procs = qw(floating_sel_remove floating_sel_anchor floating_sel_to_layer @procs = qw(floating_sel_remove floating_sel_anchor floating_sel_to_layer
floating_sel_attach floating_sel_rigor floating_sel_relax); floating_sel_attach floating_sel_rigor floating_sel_relax);

View File

@ -17,18 +17,11 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub pdb_misc {
$author = 'Sven Neumann <sven@gimp.org>';
$copyright = 'Sven Neumann';
$date = '2003';
}
sub fonts_popup { sub fonts_popup {
$blurb = 'Invokes the Gimp font selection.'; $blurb = 'Invokes the Gimp font selection.';
$help = 'This procedure popups the font selection dialog.';
$help = 'This procedure popups the font selection dialog.'; &neo_pdb_misc('2003');
&pdb_misc;
@inargs = ( @inargs = (
{ name => 'font_callback', type => 'string', { name => 'font_callback', type => 'string',
@ -57,10 +50,9 @@ CODE
sub fonts_close_popup { sub fonts_close_popup {
$blurb = 'Popdown the Gimp font selection.'; $blurb = 'Popdown the Gimp font selection.';
$help = 'This procedure closes an opened font selection dialog.';
$help = 'This procedure closes an opened font selection dialog.'; &neo_pdb_misc('2003');
&pdb_misc;
@inargs = ( @inargs = (
{ name => 'font_callback', type => 'string', { name => 'font_callback', type => 'string',
@ -81,10 +73,9 @@ CODE
sub fonts_set_popup { sub fonts_set_popup {
$blurb = 'Sets the current font selection in a popup.'; $blurb = 'Sets the current font selection in a popup.';
$help = $blurb;
$help = $blurb; &neo_pdb_misc('2003');
&pdb_misc;
@inargs = ( @inargs = (
{ name => 'font_callback', type => 'string', { name => 'font_callback', type => 'string',

View File

@ -17,13 +17,6 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub pdb_misc {
$author = $copyright = 'Sven Neumann';
$date = '2003';
}
# The defs
sub fonts_refresh { sub fonts_refresh {
$blurb = 'Refresh current fonts. This function always succeeds.'; $blurb = 'Refresh current fonts. This function always succeeds.';
@ -32,7 +25,7 @@ This procedure retrieves all fonts currently in the user's font path
and updates the font dialogs accordingly. and updates the font dialogs accordingly.
HELP HELP
&pdb_misc; &neo_pdb_misc('2003');
%invoke = ( %invoke = (
code => 'gimp_fonts_load (gimp);' code => 'gimp_fonts_load (gimp);'
@ -46,7 +39,7 @@ sub fonts_get_list {
This procedure returns a list of the fonts that are currently available. This procedure returns a list of the fonts that are currently available.
HELP HELP
&pdb_misc; &neo_pdb_misc('2003');
@inargs = ( @inargs = (
{ name => 'filter', type => 'string', null_ok => 1, { name => 'filter', type => 'string', null_ok => 1,

View File

@ -16,10 +16,6 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
# Added a PDB entry for writing a gimprc entry, by
# Seth Burgess <sjburges@gimp.org> 15/04/99
# The defs
sub gimprc_query { sub gimprc_query {
$blurb = <<'BLURB'; $blurb = <<'BLURB';
@ -46,14 +42,11 @@ HELP
); );
@outargs = ( @outargs = (
{ name => 'value', type => 'string', { name => 'value', type => 'string', init => 1,
desc => 'The value associated with the queried token', desc => 'The value associated with the queried token' }
no_declare => 1 }
); );
%invoke = ( %invoke = (
headers => [ qw("config/gimprc.h") ],
vars => [ 'gchar *value = NULL' ],
code => <<'CODE' code => <<'CODE'
{ {
if (strlen (token)) if (strlen (token))
@ -79,8 +72,7 @@ gimp_gimprc_query to retrieve it. This will accept _only_ string values in
UTF-8 encoding. UTF-8 encoding.
HELP HELP
$author = $copyright = 'Seth Burgess'; &seth_pdb_misc('1999');
$date = '1999';
@inargs = ( @inargs = (
{ name => 'token', type => 'string', { name => 'token', type => 'string',
@ -115,8 +107,6 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( );
@outargs = ( @outargs = (
{ name => 'xres', type => 'float', void_ret => 1, { name => 'xres', type => 'float', void_ret => 1,
desc => 'X resolution', alias => 'xres' }, desc => 'X resolution', alias => 'xres' },
@ -125,7 +115,6 @@ HELP
); );
%invoke = ( %invoke = (
headers => [ qw("config/gimpdisplayconfig.h") ],
code => <<'CODE' code => <<'CODE'
{ {
xres = GIMP_DISPLAY_CONFIG (gimp->config)->monitor_xres; xres = GIMP_DISPLAY_CONFIG (gimp->config)->monitor_xres;
@ -137,20 +126,17 @@ CODE
sub get_default_comment { sub get_default_comment {
$blurb = 'Get the default image comment as specified in the Preferences.'; $blurb = 'Get the default image comment as specified in the Preferences.';
$help = 'Returns a copy of the default image comment.';
$help = 'Returns a copy of the default image comment.';
&std_pdb_misc; &std_pdb_misc;
@inargs = ( );
@outargs = ( @outargs = (
{ name => 'comment', type => 'string', { name => 'comment', type => 'string',
desc => 'Default Image Comment' } desc => 'Default Image Comment' }
); );
%invoke = ( %invoke = (
headers => [ qw("config/gimpcoreconfig.h" "core/gimptemplate.h") ], headers => [ qw("core/gimptemplate.h") ],
code => <<'CODE' code => <<'CODE'
{ {
comment = g_strdup (gimp->config->default_image->comment); comment = g_strdup (gimp->config->default_image->comment);
@ -161,13 +147,10 @@ CODE
sub get_theme_dir { sub get_theme_dir {
$blurb = 'Get the directory of the current GUI theme.'; $blurb = 'Get the directory of the current GUI theme.';
$help = 'Returns a copy of the current GUI theme dir.';
$help = 'Returns a copy of the current GUI theme dir.';
&std_pdb_misc; &std_pdb_misc;
@inargs = ( );
@outargs = ( @outargs = (
{ name => 'theme_dir', type => 'string', { name => 'theme_dir', type => 'string',
desc => 'The GUI theme dir' } desc => 'The GUI theme dir' }
@ -186,11 +169,7 @@ sub get_color_configuration {
$blurb = 'Get a serialized version of the color management configuration.'; $blurb = 'Get a serialized version of the color management configuration.';
$help = 'Returns a string that can be deserialized into a GimpColorConfig object representing the current color management configuration.'; $help = 'Returns a string that can be deserialized into a GimpColorConfig object representing the current color management configuration.';
$author = $copyright = 'Sven Neumann'; &neo_pdb_misc('2005', '2.4');
$date = '2005';
$since = '2.4';
@inargs = ( );
@outargs = ( @outargs = (
{ name => 'config', type => 'string', { name => 'config', type => 'string',
@ -199,7 +178,7 @@ sub get_color_configuration {
); );
%invoke = ( %invoke = (
headers => [ qw("libgimpconfig/gimpconfig.h" "config/gimpcoreconfig.h") ], headers => [ qw("libgimpconfig/gimpconfig.h") ],
code => <<'CODE' code => <<'CODE'
{ {
config = gimp_config_serialize_to_string (GIMP_CONFIG (gimp->config->color_management), NULL); config = gimp_config_serialize_to_string (GIMP_CONFIG (gimp->config->color_management), NULL);
@ -210,13 +189,10 @@ CODE
sub get_module_load_inhibit { sub get_module_load_inhibit {
$blurb = 'Get the list of modules which should not be loaded.'; $blurb = 'Get the list of modules which should not be loaded.';
$help = 'Returns a copy of the list of modules which should not be loaded.';
$help = 'Returns a copy of the list of modules which should not be loaded.';
&std_pdb_misc; &std_pdb_misc;
@inargs = ( );
@outargs = ( @outargs = (
{ name => 'load_inhibit', type => 'string', { name => 'load_inhibit', type => 'string',
desc => 'The list of modules' } desc => 'The list of modules' }
@ -232,7 +208,7 @@ CODE
); );
} }
@headers = qw(<string.h> "core/gimp.h"); @headers = qw(<string.h> "core/gimp.h" "config/gimprc.h");
@procs = qw(gimprc_query gimprc_set @procs = qw(gimprc_query gimprc_set
get_default_comment get_monitor_resolution get_theme_dir get_default_comment get_monitor_resolution get_theme_dir

View File

@ -15,31 +15,6 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
sub bill_misc {
$author = 'Bill Skaggs <weskaggs@primate.ucdavis.edu';
$copyright = 'Bill Skaggs';
$date = '2004';
$since = '2.4';
}
sub shlomi_misc {
$author = $copyright = 'Shlomi Fish';
$date = '2003';
$since = '2.2';
}
sub federico_misc {
$author = $copyright = 'Federico Mena Quintero';
$date = '1997';
$since = '2.2';
}
sub gradient_arg () {{
name => 'name',
type => 'string',
desc => 'The gradient name'
}}
sub _gen_gradient_search_for_segment_code sub _gen_gradient_search_for_segment_code
{ {
my $action_on_success = shift; my $action_on_success = shift;
@ -76,27 +51,10 @@ $action_on_success
CODE CODE
} }
sub other_side
{
my $side = shift;
return ($side eq "left") ? "right" : "left";
}
sub _grad_and_seg_params
{
return
( &gradient_arg,
{ name => 'segment', type => '0 <= int32',
desc => 'The index of the segment within the gradient' }
);
}
sub _gen_gradient_set_side_color sub _gen_gradient_set_side_color
{ {
my $side = shift; my $side = shift;
my $other_side = ($side eq "left") ? "right" : "left";
my $other_side = other_side($side);
$blurb = "Retrieves the $side endpoint color of the specified gradient and segment"; $blurb = "Retrieves the $side endpoint color of the specified gradient and segment";
@ -105,19 +63,19 @@ This procedure retrieves the $side endpoint color of the specified segment of
the specified gradient. the specified gradient.
HELP HELP
&shlomi_misc; &shlomi_pdb_misc('2003', '2.2');
@inargs = ( @inargs = (
&_grad_and_seg_params, { name => 'name', type => 'string',
desc => 'The gradient name' },
{ name => 'segment', type => '0 <= int32',
desc => 'The index of the segment within the gradient' },
{ name => 'color', type => 'color', { name => 'color', type => 'color',
desc => "The color to set" }, desc => "The color to set" },
{ name => "opacity", type => '0 <= float <= 100.0', { name => "opacity", type => '0 <= float <= 100.0',
desc => "The opacity to set for the endpoint" } desc => "The opacity to set for the endpoint" }
); );
@outargs = (
);
my @blend_params = ("&color","&(seg->${other_side}_color)"); my @blend_params = ("&color","&(seg->${other_side}_color)");
if ($side eq "right") { if ($side eq "right") {
@ -144,10 +102,13 @@ This procedure retrieves the $side endpoint color of the specified segment of
the specified gradient. the specified gradient.
HELP HELP
&shlomi_misc; &shlomi_pdb_misc('2003', '2.2');
@inargs = ( @inargs = (
&_grad_and_seg_params, { name => 'name', type => 'string',
desc => 'The gradient name' },
{ name => 'segment', type => '0 <= int32',
desc => 'The index of the segment within the gradient' }
); );
@outargs = ( @outargs = (
@ -183,9 +144,14 @@ This procedure retrieves the $side_endpoint position of the specified segment of
the specified gradient. the specified gradient.
HELP HELP
&shlomi_misc; &shlomi_pdb_misc('2003', '2.2');
@inargs = &_grad_and_seg_params; @inargs = (
{ name => 'name', type => 'string',
desc => 'The gradient name' },
{ name => 'segment', type => '0 <= int32',
desc => 'The index of the segment within the gradient' }
);
@outargs = ( @outargs = (
{ name => 'pos', type => 'float', { name => 'pos', type => 'float',
@ -229,10 +195,13 @@ the specified gradient. The final position will be between $betweens{$side}.
This procedure returns the final position. This procedure returns the final position.
HELP HELP
&shlomi_misc; &shlomi_pdb_misc('2003', '2.2');
@inargs = ( @inargs = (
&_grad_and_seg_params, { name => 'name', type => 'string',
desc => 'The gradient name' },
{ name => 'segment', type => '0 <= int32',
desc => 'The index of the segment within the gradient' },
{ name => 'pos', type => "0.0 <= float <= 1.0", { name => 'pos', type => "0.0 <= float <= 1.0",
desc => "The position to set the guidepoint in." } desc => "The position to set the guidepoint in." }
); );
@ -258,7 +227,7 @@ sub gradient_new {
$blurb = "Creates a new gradient"; $blurb = "Creates a new gradient";
$help = "This procedure creates a new, uninitialized gradient"; $help = "This procedure creates a new, uninitialized gradient";
&shlomi_misc; &shlomi_pdb_misc('2003', '2.2');
@inargs = ( @inargs = (
{ name => 'name', type => 'string', { name => 'name', type => 'string',
@ -288,10 +257,11 @@ sub gradient_duplicate {
$blurb = "Duplicates a gradient"; $blurb = "Duplicates a gradient";
$help = "This procedure creates an identical gradient by a different name"; $help = "This procedure creates an identical gradient by a different name";
&shlomi_misc; &shlomi_pdb_misc('2003', '2.2');
@inargs = ( @inargs = (
&gradient_arg { name => 'name', type => 'string',
desc => 'The gradient name' }
); );
@outargs = ( @outargs = (
@ -328,10 +298,11 @@ sub gradient_is_editable {
$blurb = "Tests if gradient can be edited"; $blurb = "Tests if gradient can be edited";
$help = "Returns True if you have permission to change the gradient"; $help = "Returns True if you have permission to change the gradient";
&bill_misc; &bill_pdb_misc('2004', '2.4');
@inargs = ( @inargs = (
&gradient_arg { name => 'name', type => 'string',
desc => 'The gradient name' }
); );
@outargs = ( @outargs = (
@ -361,10 +332,11 @@ sub gradient_rename {
$blurb = "Rename a gradient"; $blurb = "Rename a gradient";
$help = "This procedure renames a gradient"; $help = "This procedure renames a gradient";
&shlomi_misc; &shlomi_pdb_misc('2003', '2.2');
@inargs = ( @inargs = (
&gradient_arg, { name => 'name', type => 'string',
desc => 'The gradient name' },
{ name => 'new_name', type => 'string', { name => 'new_name', type => 'string',
desc => "The new name of the gradient" } desc => "The new name of the gradient" }
); );
@ -395,10 +367,11 @@ sub gradient_delete {
$blurb = "Deletes a gradient"; $blurb = "Deletes a gradient";
$help = "This procedure deletes a gradient"; $help = "This procedure deletes a gradient";
&shlomi_misc; &shlomi_pdb_misc('2003', '2.2');
@inargs = ( @inargs = (
&gradient_arg { name => 'name', type => 'string',
desc => 'The gradient name' }
); );
%invoke = ( %invoke = (
@ -434,11 +407,6 @@ sub sample_num_arg {
desc => 'The number of samples to take' } desc => 'The number of samples to take' }
} }
sub reverse_arg {
{ name => 'reverse', type => 'boolean',
desc => 'Use the reverse gradient (%%desc%%)' }
}
sub sample_outargs { sub sample_outargs {
@outargs = ( @outargs = (
{ name => 'color_samples', type => 'floatarray', init => 1, { name => 'color_samples', type => 'floatarray', init => 1,
@ -462,12 +430,14 @@ samples to take is 2, in which case the returned colors will correspond to the
is 3, the procedure will return the colors at positions { 0.0, 0.5, 1.0 }. is 3, the procedure will return the colors at positions { 0.0, 0.5, 1.0 }.
HELP HELP
&federico_misc; &federico_pdb_misc('1997', '2.2');
@inargs = ( @inargs = (
&gradient_arg, { name => 'name', type => 'string',
&sample_num_arg('2 <= '), desc => 'The gradient name' },
&reverse_arg &sample_num_arg('2 <= '),
{ name => 'reverse', type => 'boolean',
desc => 'Use the reverse gradient (%%desc%%)' }
); );
&sample_outargs; &sample_outargs;
@ -523,16 +493,18 @@ procedure returns a list of floating-point values which correspond to
the RGBA values for each sample. the RGBA values for each sample.
HELP HELP
&federico_misc; &federico_pdb_misc('1997', '2.2');
@inargs = ( @inargs = (
&gradient_arg, { name => 'name', type => 'string',
desc => 'The gradient name' },
{ name => 'positions', { name => 'positions',
type => 'floatarray', type => 'floatarray',
desc => 'The list of positions to sample along the gradient', desc => 'The list of positions to sample along the gradient',
alias => 'pos', alias => 'pos',
array => &sample_num_arg("") }, array => &sample_num_arg("") },
&reverse_arg { name => 'reverse', type => 'boolean',
desc => 'Use the reverse gradient (%%desc%%)' }
); );
&sample_outargs; &sample_outargs;
@ -633,9 +605,14 @@ This procedure retrieves the blending function of the segment at the
specified gradient name and segment index. specified gradient name and segment index.
HELP HELP
&shlomi_misc; &shlomi_pdb_misc('2003', '2.2');
@inargs = &_grad_and_seg_params; @inargs = (
{ name => 'name', type => 'string',
desc => 'The gradient name' },
{ name => 'segment', type => '0 <= int32',
desc => 'The index of the segment within the gradient' }
);
@outargs = ( @outargs = (
{ name => 'blend_func', type => 'enum GimpGradientSegmentType', { name => 'blend_func', type => 'enum GimpGradientSegmentType',
@ -661,9 +638,14 @@ This procedure retrieves the coloring type of the segment at the
specified gradient name and segment index. specified gradient name and segment index.
HELP HELP
&shlomi_misc; &shlomi_pdb_misc('2003', '2.2');
@inargs = &_grad_and_seg_params; @inargs = (
{ name => 'name', type => 'string',
desc => 'The gradient name' },
{ name => 'segment', type => '0 <= int32',
desc => 'The index of the segment within the gradient' }
);
@outargs = ( @outargs = (
{ name => 'coloring_type', type => 'enum GimpGradientSegmentColor', { name => 'coloring_type', type => 'enum GimpGradientSegmentColor',
@ -688,10 +670,11 @@ sub _gen_gradient_operate_on_segments_range
$help = $args{help}; $help = $args{help};
&shlomi_misc; &shlomi_pdb_misc('2003', '2.2');
@inargs = ( @inargs = (
&gradient_arg, { name => 'name', type => 'string',
desc => 'The gradient name' },
{ name => 'start_segment', type => '0 <= int32', { name => 'start_segment', type => '0 <= int32',
desc => 'The index of the first segment to operate on' }, desc => 'The index of the first segment to operate on' },
{ name => 'end_segment', type => 'int32', { name => 'end_segment', type => 'int32',
@ -719,6 +702,7 @@ sub _gen_gradient_operate_on_segments_range
if (gradient) if (gradient)
{ {
GimpGradientSegment *start_seg, *end_seg; GimpGradientSegment *start_seg, *end_seg;
start_seg = gimp_gradient_segment_get_nth (gradient->segments, start_seg = gimp_gradient_segment_get_nth (gradient->segments,
start_segment); start_segment);
if (start_seg) if (start_seg)

View File

@ -17,26 +17,11 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub pdb_misc {
$author = $copyright = 'Andy Thomas';
$date = '1998';
}
sub sample_size_arg {{
name => 'sample_size',
type => '0 < int32 <= 10000',
desc => 'Size of the sample to return when the gradient is changed
(%%desc%%)',
on_fail => 'sample_size = GIMP_GRADIENT_DEFAULT_SAMPLE_SIZE;',
no_success => 1
}}
sub gradients_popup { sub gradients_popup {
$blurb = 'Invokes the Gimp gradients selection.'; $blurb = 'Invokes the Gimp gradients selection.';
$help = 'This procedure popups the gradients selection dialog.';
$help = 'This procedure popups the gradients selection dialog.'; &andy_pdb_misc('1998');
&pdb_misc;
@inargs = ( @inargs = (
{ name => 'gradient_callback', type => 'string', { name => 'gradient_callback', type => 'string',
@ -47,7 +32,11 @@ sub gradients_popup {
{ name => 'initial_gradient', type => 'string', { name => 'initial_gradient', type => 'string',
desc => 'The name of the pattern to set as the first selected', desc => 'The name of the pattern to set as the first selected',
null_ok => 1 }, null_ok => 1 },
&sample_size_arg { name => 'sample_size', type => '0 < int32 <= 10000',
desc => 'Size of the sample to return when the gradient is changed
(%%desc%%)',
on_fail => 'sample_size = GIMP_GRADIENT_DEFAULT_SAMPLE_SIZE;',
no_success => 1 }
); );
%invoke = ( %invoke = (
@ -67,10 +56,9 @@ CODE
sub gradients_close_popup { sub gradients_close_popup {
$blurb = 'Popdown the Gimp gradient selection.'; $blurb = 'Popdown the Gimp gradient selection.';
$help = 'This procedure closes an opened gradient selection dialog.';
$help = 'This procedure closes an opened gradient selection dialog.'; &andy_pdb_misc('1998');
&pdb_misc;
@inargs = ( @inargs = (
{ name => 'gradient_callback', type => 'string', { name => 'gradient_callback', type => 'string',
@ -92,10 +80,9 @@ CODE
sub gradients_set_popup { sub gradients_set_popup {
$blurb = 'Sets the current gradient selection in a popup.'; $blurb = 'Sets the current gradient selection in a popup.';
$help = $blurb;
$help = $blurb; &andy_pdb_misc('1998');
&pdb_misc;
@inargs = ( @inargs = (
{ name => 'gradient_callback', type => 'string', { name => 'gradient_callback', type => 'string',

View File

@ -17,14 +17,6 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub federico_misc {
$author = $copyright = 'Federico Mena Quintero';
$date = '1997';
}
# The defs
sub gradients_refresh { sub gradients_refresh {
$blurb = 'Refresh current gradients. This function always succeeds.'; $blurb = 'Refresh current gradients. This function always succeeds.';
@ -33,8 +25,7 @@ This procedure retrieves all gradients currently in the user's gradient path
and updates the gradient dialogs accordingly. and updates the gradient dialogs accordingly.
HELP HELP
$author = $copyright = 'Michael Natterer'; &mitch_pdb_misc('2002');
$date = '2002';
%invoke = ( %invoke = (
code => 'gimp_data_factory_data_refresh (gimp->gradient_factory);' code => 'gimp_data_factory_data_refresh (gimp->gradient_factory);'
@ -50,7 +41,7 @@ You can later use the 'gimp-context-set-gradient' function to
set the active gradient. set the active gradient.
HELP HELP
&federico_misc; &federico_pdb_misc('1997');
@inargs = ( @inargs = (
{ name => 'filter', type => 'string', null_ok => 1, { name => 'filter', type => 'string', null_ok => 1,
@ -71,17 +62,16 @@ HELP
); );
} }
sub sample_num_arg { sub gradients_sample_uniform {
{ name => 'num_samples', type => $_[0] . 'int32', &std_pdb_deprecated ('gimp-gradient-get-uniform-samples');
desc => 'The number of samples to take', alias => 'i' }
}
sub reverse_arg { @inargs = (
{ name => 'reverse', type => 'boolean', { name => 'num_samples', type => '2 <= int32',
desc => 'Use the reverse gradient (%%desc%%)' } desc => 'The number of samples to take', alias => 'i' },
} { name => 'reverse', type => 'boolean',
desc => 'Use the reverse gradient (%%desc%%)' }
);
sub sample_outargs {
@outargs = ( @outargs = (
{ name => 'color_samples', type => 'floatarray', init => 1, { name => 'color_samples', type => 'floatarray', init => 1,
desc => 'Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }', desc => 'Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }',
@ -89,23 +79,15 @@ sub sample_outargs {
desc => 'Length of the color_samples array (4 * desc => 'Length of the color_samples array (4 *
num_samples)' } } num_samples)' } }
); );
}
sub gradients_sample_uniform {
&std_pdb_deprecated ('gimp-gradient-get-uniform-samples');
@inargs = (
&sample_num_arg('2 <= '),
&reverse_arg
);
&sample_outargs;
%invoke = ( %invoke = (
vars => [ 'GimpGradient *gradient', 'gdouble pos, delta',
'GimpRGB color', 'gdouble *pv' ],
code => <<'CODE' code => <<'CODE'
{ {
GimpGradient *gradient;
GimpGradientSegment *seg = NULL; GimpGradientSegment *seg = NULL;
gdouble pos, delta;
GimpRGB color;
gdouble *pv;
pos = 0.0; pos = 0.0;
delta = 1.0 / (i - 1); delta = 1.0 / (i - 1);
@ -140,17 +122,27 @@ sub gradients_sample_custom {
type => 'floatarray', type => 'floatarray',
desc => 'The list of positions to sample along the gradient', desc => 'The list of positions to sample along the gradient',
alias => 'pos', alias => 'pos',
array => &sample_num_arg("") }, array => { name => 'num_samples', type => 'int32',
&reverse_arg desc => 'The number of samples to take', alias => 'i' } },
{ name => 'reverse', type => 'boolean',
desc => 'Use the reverse gradient (%%desc%%)' }
); );
&sample_outargs; @outargs = (
{ name => 'color_samples', type => 'floatarray', init => 1,
desc => 'Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }',
array => { name => 'array_length', no_lib => 1, init => 1,
desc => 'Length of the color_samples array (4 *
num_samples)' } }
);
%invoke = ( %invoke = (
vars => [ 'GimpGradient *gradient', 'GimpRGB color', 'gdouble *pv' ],
code => <<'CODE' code => <<'CODE'
{ {
GimpGradient *gradient;
GimpGradientSegment *seg = NULL; GimpGradientSegment *seg = NULL;
GimpRGB color;
gdouble *pv;
array_length = i * 4; array_length = i * 4;
@ -174,15 +166,6 @@ CODE
); );
} }
sub sample_size_arg {
{ name => 'sample_size',
type => '0 < int32 <= 10000',
desc => 'Size of the sample to return when the gradient is changed
(%%desc%%)',
on_fail => 'sample_size = GIMP_GRADIENT_DEFAULT_SAMPLE_SIZE;',
no_success => 1 }
}
sub gradients_get_gradient_data { sub gradients_get_gradient_data {
&std_pdb_deprecated ('gimp-gradient-get-uniform-samples'); &std_pdb_deprecated ('gimp-gradient-get-uniform-samples');
@ -190,8 +173,13 @@ sub gradients_get_gradient_data {
{ name => 'name', type => 'string', { name => 'name', type => 'string',
desc => 'The gradient name ("" means current active gradient)', desc => 'The gradient name ("" means current active gradient)',
null_ok => '1' }, null_ok => '1' },
&sample_size_arg, { name => 'sample_size', type => '0 < int32 <= 10000',
&reverse_arg desc => 'Size of the sample to return when the gradient is changed
(%%desc%%)',
on_fail => 'sample_size = GIMP_GRADIENT_DEFAULT_SAMPLE_SIZE;',
no_success => 1 },
{ name => 'reverse', type => 'boolean',
desc => 'Use the reverse gradient (%%desc%%)' }
); );
@outargs = ( @outargs = (

View File

@ -17,10 +17,6 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub pdb_misc {
$author = $copyright = 'Adam D. Moss';
$date = '1998';
}
sub image_add_guide { sub image_add_guide {
my ($desc, $type, $max, $pos) = @_; my ($desc, $type, $max, $pos) = @_;
@ -33,7 +29,7 @@ $type-position of the new guide as parameters. It returns the guide ID of the
new guide. new guide.
HELP HELP
&pdb_misc; &adam_pdb_misc('1998');
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
@ -83,7 +79,7 @@ This procedure takes an image and a guide ID as input and removes the specified
guide from the specified image. guide from the specified image.
HELP HELP
&pdb_misc; &adam_pdb_misc('1998');
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
@ -115,7 +111,7 @@ guide ID is 0, the procedure will return the first Guide. The procedure will
return 0 if given the final guide ID as an argument or the image has no guides. return 0 if given the final guide ID as an argument or the image has no guides.
HELP HELP
&pdb_misc; &adam_pdb_misc('1998');
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
@ -148,7 +144,7 @@ This procedure takes an image and a guide ID as input and returns the
orientations of the guide. orientations of the guide.
HELP HELP
&pdb_misc; &adam_pdb_misc('1998');
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
@ -184,7 +180,7 @@ This procedure takes an image and a guide ID as input and returns the position
of the guide relative to the top or left of the image. of the guide relative to the top or left of the image.
HELP HELP
&pdb_misc; &adam_pdb_misc('1998');
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,

View File

@ -29,8 +29,7 @@ help_domain is NULL and no help domain was registered, the help domain
of the main GIMP installation is used. of the main GIMP installation is used.
HELP HELP
$author = $copyright = 'Michael Natterer <mitch@gimp.org>'; &mitch_pdb_misc('2000');
$date = '2000';
@inargs = ( @inargs = (
{ name => 'help_domain', type => 'string', null_ok => 1, { name => 'help_domain', type => 'string', null_ok => 1,

View File

@ -35,14 +35,6 @@ sub vectors_arg () {{
desc => 'The vectors object' desc => 'The vectors object'
}} }}
sub new_dim_args {
foreach (qw(width height)) {
push @inargs, { name => "new_$_",
type => '0 < int32',
desc => "New image $_: %%desc%%" }
}
}
sub image_list_proc { sub image_list_proc {
my $type = shift; my $type = shift;
@ -64,15 +56,19 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'GList *list = NULL', 'gint i' ],
code => <<CODE code => <<CODE
{ {
GList *list = NULL;
list = GIMP_LIST (gimage->${type}s)->list; list = GIMP_LIST (gimage->${type}s)->list;
num_${type}s = g_list_length (list); num_${type}s = g_list_length (list);
if (num_${type}s) if (num_${type}s)
{ {
gint i;
${type}_ids = g_new (gint32, num_${type}s); ${type}_ids = g_new (gint32, num_${type}s);
for (i = 0; i < num_${type}s; i++, list = g_list_next (list)) for (i = 0; i < num_${type}s; i++, list = g_list_next (list))
${type}_ids[i] = gimp_item_get_ID (GIMP_ITEM (list->data)); ${type}_ids[i] = gimp_item_get_ID (GIMP_ITEM (list->data));
} }
@ -229,15 +225,14 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
{ name => 'width', type => '0 < int32',
desc => 'The width of the image' },
{ name => 'height', type => '0 < int32',
desc => 'The height of the image' },
{ name => 'type', type => 'enum GimpImageBaseType', { name => 'type', type => 'enum GimpImageBaseType',
desc => 'The type of image: { %%desc%% }' } desc => 'The type of image: { %%desc%% }' }
); );
foreach (qw(height width)) {
unshift @inargs, { name => $_, type => '0 < int32',
desc => "The $_ of the image" }
}
@outargs = ( @outargs = (
{ name => 'image', type => 'image', init => 1, { name => 'image', type => 'image', init => 1,
desc => 'The ID of the newly created image' } desc => 'The ID of the newly created image' }
@ -319,14 +314,19 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &std_image_arg ); @inargs = (
&new_dim_args; &std_image_arg,
{ name => 'new_width', type => '0 < int32',
foreach (qw(x y)) { desc => "New image width: %%desc%%" },
push @inargs, { name => "off$_", type => 'int32', { name => 'new_height', type => '0 < int32',
desc => "$_ offset between upper left corner of old and desc => "New image height: %%desc%%" },
new images: (new - old)" } { name => 'offx', type => 'int32',
} desc => "x offset between upper left corner of old and
new images: (new - old)" },
{ name => 'offy', type => 'int32',
desc => "y offset between upper left corner of old and
new images: (new - old)" }
);
%invoke = ( %invoke = (
headers => [ qw("core/gimpimage-resize.h") ], headers => [ qw("core/gimpimage-resize.h") ],
@ -349,10 +349,7 @@ the image selection mask. All layers within the image are repositioned to the
new image area. new image area.
HELP HELP
$author = $copyright = 'Simon Budig'; &simon_pdb_misc('2004', '2.2');
$date = '2004';
$since = '2.2';
@inargs = ( &std_image_arg ); @inargs = ( &std_image_arg );
@ -381,8 +378,13 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &std_image_arg ); @inargs = (
&new_dim_args; &std_image_arg,
{ name => 'new_width', type => '0 < int32',
desc => "New image width: %%desc%%" },
{ name => 'new_height', type => '0 < int32',
desc => "New image height: %%desc%%" }
);
%invoke = ( %invoke = (
headers => [ qw("config/gimpcoreconfig.h" "core/gimpimage-scale.h") ], headers => [ qw("config/gimpcoreconfig.h" "core/gimpimage-scale.h") ],
@ -467,8 +469,8 @@ CODE
sub image_rotate { sub image_rotate {
$blurb = 'Rotates the image by the specified degrees.'; $blurb = 'Rotates the image by the specified degrees.';
$help = 'This procedure rotates the image.'; $help = 'This procedure rotates the image.';
$author = $copyright = 'Michael Natterer';
$date = '2003'; &mitch_pdb_misc('2003');
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
@ -654,16 +656,14 @@ sub image_lower_layer {
sub image_raise_layer_to_top { sub image_raise_layer_to_top {
&type_move('layer', 'raise_to_top', 'above'); &type_move('layer', 'raise_to_top', 'above');
$copyright = "Wolfgang Hofer"; &wolfgang_pdb_misc('1998');
$author = $copyright . ", Sven Neumann"; $author .= ", Sven Neumann";
$date = 1998;
} }
sub image_lower_layer_to_bottom { sub image_lower_layer_to_bottom {
&type_move('layer', 'lower_to_bottom', 'below'); &type_move('layer', 'lower_to_bottom', 'below');
$copyright = "Wolfgang Hofer"; &wolfgang_pdb_misc('1998');
$author = $copyright . ", Sven Neumann"; $author .= ", Sven Neumann";
$date = 1998;
} }
sub image_merge_visible_layers { sub image_merge_visible_layers {
@ -715,8 +715,7 @@ of CLIP_TO_BOTTOM_LAYER clips the final layer to the size of the bottommost
layer. layer.
HELP HELP
$author = $copyright = 'Larry Ewing'; &larry_pdb_misc('1998');
$date = '1998';
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
@ -783,7 +782,8 @@ HELP
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
&layer_arg, { name => 'layer', type => 'layer',
desc => 'The layer' },
{ name => 'position', type => 'int32', { name => 'position', type => 'int32',
desc => 'The layer position' } desc => 'The layer position' }
); );
@ -818,7 +818,8 @@ HELP
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
&layer_arg { name => 'layer', type => 'layer',
desc => 'The layer' }
); );
%invoke = ( code => 'gimp_image_remove_layer (gimage, layer);' ); %invoke = ( code => 'gimp_image_remove_layer (gimage, layer);' );
@ -829,7 +830,8 @@ sub image_add_layer_mask {
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
&layer_arg, { name => 'layer', type => 'layer',
desc => 'The layer' },
{ name => 'mask', type => 'layer_mask', { name => 'mask', type => 'layer_mask',
desc => 'The mask to add to the layer' } desc => 'The mask to add to the layer' }
); );
@ -849,7 +851,8 @@ sub image_remove_layer_mask {
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
&layer_arg, { name => 'layer', type => 'layer',
desc => 'The layer' },
{ name => 'mode', type => 'enum GimpMaskApplyMode', { name => 'mode', type => 'enum GimpMaskApplyMode',
desc => 'Removal mode: { %%desc%% }' } desc => 'Removal mode: { %%desc%% }' }
); );
@ -881,7 +884,8 @@ HELP
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
&channel_arg, { name => 'channel', type => 'channel',
desc => 'The channel' },
{ name => 'position', type => 'int32', { name => 'position', type => 'int32',
desc => 'The channel position' } desc => 'The channel position' }
); );
@ -910,7 +914,8 @@ HELP
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
&channel_arg { name => 'channel', type => 'channel',
desc => 'The channel' }
); );
%invoke = ( code => 'gimp_image_remove_channel (gimage, channel);' ); %invoke = ( code => 'gimp_image_remove_channel (gimage, channel);' );
@ -929,7 +934,8 @@ HELP
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
&vectors_arg, { name => 'vectors', type => 'vectors',
desc => 'The vectors object' },
{ name => 'position', type => 'int32', { name => 'position', type => 'int32',
desc => 'The vectors objects position' } desc => 'The vectors objects position' }
); );
@ -949,15 +955,12 @@ This procedure removes the specified path from the image. If the path
doesn't exist, an error is returned. doesn't exist, an error is returned.
HELP HELP
&std_pdb_misc; &simon_pdb_misc('2005', '2.4');
$author = "Simon Budig";
$date = 2005;
$since = 2.4;
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
&vectors_arg { name => 'vectors', type => 'vectors',
desc => 'The vectors object' }
); );
%invoke = ( code => 'gimp_image_remove_vectors (gimage, vectors);' ); %invoke = ( code => 'gimp_image_remove_vectors (gimage, vectors);' );
@ -965,34 +968,22 @@ HELP
sub image_raise_vectors { sub image_raise_vectors {
&type_move('vectors', 'raise', 'above'); &type_move('vectors', 'raise', 'above');
&std_pdb_misc; &simon_pdb_misc('2005', '2.4');
$author = "Simon Budig";
$date = 2005;
$since = 2.4;
} }
sub image_lower_vectors { sub image_lower_vectors {
&type_move('vectors', 'lower', 'below'); &type_move('vectors', 'lower', 'below');
&std_pdb_misc; &simon_pdb_misc('2005', '2.4');
$author = "Simon Budig";
$date = 2005;
$since = 2.4;
} }
sub image_raise_vectors_to_top { sub image_raise_vectors_to_top {
&type_move('vectors', 'raise_to_top', 'above'); &type_move('vectors', 'raise_to_top', 'above');
&std_pdb_misc; &simon_pdb_misc('2005', '2.4');
$author = "Simon Budig";
$date = 2005;
$since = 2.4;
} }
sub image_lower_vectors_to_bottom { sub image_lower_vectors_to_bottom {
&type_move('vectors', 'lower_to_bottom', 'below'); &type_move('vectors', 'lower_to_bottom', 'below');
&std_pdb_misc; &simon_pdb_misc('2005', '2.4');
$author = "Simon Budig";
$date = 2005;
$since = 2.4;
} }
sub image_get_active_drawable { sub image_get_active_drawable {
@ -1171,8 +1162,7 @@ This procedure returns the drawable the image's floating selection is attached
to, if it exists. If it doesn't exist, -1 is returned as the drawable ID. to, if it exists. If it doesn't exist, -1 is returned as the drawable ID.
HELP HELP
$author = $copyright = 'Wolfgang Hofer'; &wolfgang_pdb_misc('1998');
$date = '1998';
@inargs = ( &std_image_arg ); @inargs = ( &std_image_arg );
@ -1183,10 +1173,9 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'GimpLayer *floating_sel' ],
code => <<'CODE' code => <<'CODE'
{ {
floating_sel = gimp_image_floating_sel (gimage); GimpLayer *floating_sel = gimp_image_floating_sel (gimage);
if (floating_sel) if (floating_sel)
drawable = GIMP_DRAWABLE (GIMP_LAYER (floating_sel)->fs.drawable); drawable = GIMP_DRAWABLE (GIMP_LAYER (floating_sel)->fs.drawable);
@ -1428,8 +1417,7 @@ $#procs--;
in dots per inch. This value is independent of any of the layers in this image. in dots per inch. This value is independent of any of the layers in this image.
HELP HELP
$author = $copyright = 'Austin Donnelly'; &austin_pdb_misc('1998');
$date = '1998';
push @outargs, { %{$outargs[0]} }; push @outargs, { %{$outargs[0]} };
$outargs[0]->{void_ret} = 1; $outargs[0]->{void_ret} = 1;
@ -1448,8 +1436,7 @@ in dots per inch. This value is independent of any of the layers in this image.
No scaling or resizing is performed. No scaling or resizing is performed.
HELP HELP
$author = $copyright = 'Austin Donnelly'; &austin_pdb_misc('1998');
$date = '1998';
push @inargs, { %{$inargs[1]} }; push @inargs, { %{$inargs[1]} };
@ -1487,25 +1474,15 @@ gimp_unit_* procedure definitions for the valid range of unit IDs and a
description of the unit system. description of the unit system.
HELP HELP
my $unit_misc = <<'CODE';
$author = $copyright = 'Michael Natterer';
$date = '1998';
CODE
&image_accessors('unit', 'unit (min GIMP_UNIT_INCH)', 'unit', 1, &image_accessors('unit', 'unit (min GIMP_UNIT_INCH)', 'unit', 1,
[ <<CODE1, <<CODE2 ]); [ <<CODE1, <<CODE2 ]);
\$help .= '$unit_help'; \$help .= '$unit_help';
$unit_misc &mitch_pdb_misc('1998');
CODE1 CODE1
\$help .= 'No scaling or resizing is performed. $unit_help'; \$help .= 'No scaling or resizing is performed. $unit_help';
$unit_misc &mitch_pdb_misc('1998');
CODE2 CODE2
my $tattoo_state_misc = <<'CODE';
$author = $copyright = 'Andy Thomas';
$date = '2000';
CODE
&image_accessors('tattoo_state', 'int32', 'tattoo_state', 1, &image_accessors('tattoo_state', 'int32', 'tattoo_state', 1,
[ <<CODE1, <<CODE2 ]); [ <<CODE1, <<CODE2 ]);
\$blurb = 'Returns the tattoo state associated with the image.'; \$blurb = 'Returns the tattoo state associated with the image.';
@ -1514,7 +1491,7 @@ This procedure returns the tattoo state of the image. Use only by
save/load plugins that wish to preserve an images tattoo state. Using this save/load plugins that wish to preserve an images tattoo state. Using this
function at other times will produce unexpected results. function at other times will produce unexpected results.
HELP HELP
$tattoo_state_misc &andy_pdb_misc('2000');
CODE1 CODE1
\$blurb = 'Set the tattoo state associated with the image.'; \$blurb = 'Set the tattoo state associated with the image.';
\$help = <<'HELP'; \$help = <<'HELP';
@ -1530,7 +1507,7 @@ loaded and all the tattoos have been set then this is the last
procedure that should be called. If effectively does a status check on procedure that should be called. If effectively does a status check on
the tattoo values that have been set to make sure that all is OK. the tattoo values that have been set to make sure that all is OK.
HELP HELP
$tattoo_state_misc &andy_pdb_misc('2000');
CODE2 CODE2
@ -1544,8 +1521,7 @@ sub image_get_${_}_by_tattoo {
This procedure returns the $_ with the given tattoo in the specified image. This procedure returns the $_ with the given tattoo in the specified image.
HELP HELP
\$author = \$copyright = 'Jay Cox'; \&jay_pdb_misc('1998');
\$date = '1998';
\@inargs = ( \@inargs = (
\&std_image_arg, \&std_image_arg,
@ -1570,17 +1546,6 @@ CODE
SUB SUB
} }
sub preview_dim_args () {
my @args;
foreach (qw(width height bpp)) {
push @args, { name => $_,
type => 'int32',
desc => "The previews $_",
init => 1 };
}
@args;
}
sub image_thumbnail { sub image_thumbnail {
$blurb = 'Get a thumbnail of an image.'; $blurb = 'Get a thumbnail of an image.';
@ -1591,8 +1556,7 @@ returned in RGB[A] or GRAY[A] format. The bpp return value gives the
number of bits per pixel in the image. number of bits per pixel in the image.
HELP HELP
$author = $copyright = 'Andy Thomas'; &andy_pdb_misc('1999');
$date = '1999';
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
@ -1603,7 +1567,12 @@ HELP
); );
@outargs = ( @outargs = (
&preview_dim_args, { name => 'width', type => 'int32',
desc => 'The previews width', init => 1 },
{ name => 'height', type => 'int32',
desc => 'The previews height', init => 1 },
{ name => 'bpp', type => 'int32',
desc => 'The previews bpp', init => 1 },
{ name => 'thumbnail_data', type => 'int8array', wrap => 1, { name => 'thumbnail_data', type => 'int8array', wrap => 1,
desc => 'The thumbnail data', init => 1, desc => 'The thumbnail data', init => 1,
array => { name => 'thumbnail_data_count', array => { name => 'thumbnail_data_count',

View File

@ -17,12 +17,6 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub layer_arg () {{
name => 'layer',
type => 'layer',
desc => 'The layer'
}}
sub layer_dim_proc { sub layer_dim_proc {
my ($op, $morehelp, @args) = @_; my ($op, $morehelp, @args) = @_;
@ -38,7 +32,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&layer_arg, { name => 'layer', type => 'layer',
desc => 'The layer' },
{ name => 'new_width', type => '0 < int32', { name => 'new_width', type => '0 < int32',
desc => 'New layer width: (%%desc%%)' }, desc => 'New layer width: (%%desc%%)' },
{ name => 'new_height', type => '0 < int32', { name => 'new_height', type => '0 < int32',
@ -81,7 +76,10 @@ sub layer_get_prop_proc {
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &layer_arg ); @inargs = (
{ name => 'layer', type => 'layer',
desc => 'The layer' }
);
@outargs = ( @outargs = (
{ name => $prop, type => $type, { name => $prop, type => $type,
@ -106,7 +104,8 @@ sub layer_set_prop_proc {
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&layer_arg, { name => 'layer', type => 'layer',
desc => 'The layer' },
{ name => $prop, type => $type, { name => $prop, type => $type,
desc => "The new layer $desc" } desc => "The new layer $desc" }
); );
@ -192,10 +191,7 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
layer = gimp_layer_new (gimage, layer = gimp_layer_new (gimage, width, height, type, name,
width, height,
type,
name,
opacity / 100.0, mode); opacity / 100.0, mode);
success = (layer != NULL); success = (layer != NULL);
} }
@ -217,11 +213,11 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&layer_arg, { name => 'layer', type => 'layer',
desc => 'The layer to copy' },
{ name => 'add_alpha', type => 'boolean', { name => 'add_alpha', type => 'boolean',
desc => 'Add an alpha channel to the copied layer' } desc => 'Add an alpha channel to the copied layer' }
); );
$inargs[0]->{desc} .= ' to copy';
@outargs = ( @outargs = (
{ name => 'layer_copy', type => 'layer', init => 1, wrap => 1, { name => 'layer_copy', type => 'layer', init => 1, wrap => 1,
@ -251,11 +247,11 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&layer_arg, { name => 'layer', type => 'layer',
desc => 'The layer to which to add the mask' },
{ name => 'mask_type', type => 'enum GimpAddMaskType', { name => 'mask_type', type => 'enum GimpAddMaskType',
desc => 'The type of mask: { %%desc%% }' } desc => 'The type of mask: { %%desc%% }' }
); );
$inargs[0]->{desc} .= ' to which to add the mask';
@outargs = ( @outargs = (
{ name => 'mask', type => 'layer_mask', { name => 'mask', type => 'layer_mask',
@ -283,11 +279,11 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&layer_arg, { name => 'layer', type => 'layer',
desc => 'The layer to receive the mask' },
{ name => 'mask', type => 'layer_mask', { name => 'mask', type => 'layer_mask',
desc => 'The mask to add to the layer' } desc => 'The mask to add to the layer' }
); );
$inargs[0]->{desc} .= ' to receive the mask';
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
@ -312,13 +308,14 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&layer_arg, { name => 'layer', type => 'layer',
desc => 'The layer from which to remove mask' },
{ name => 'mode', type => 'enum GimpMaskApplyMode', { name => 'mode', type => 'enum GimpMaskApplyMode',
desc => 'Removal mode: { %%desc%% }' } desc => 'Removal mode: { %%desc%% }' }
); );
$inargs[0]->{desc} .= ' from which to remove mask';
%invoke = ( code => <<'CODE' %invoke = (
code => <<'CODE'
{ {
success = gimp_item_is_attached (GIMP_ITEM (layer)); success = gimp_item_is_attached (GIMP_ITEM (layer));
@ -361,11 +358,12 @@ This procedure resizes the layer so that it's new width and height are equal to
the width and height of its image container. the width and height of its image container.
HELP HELP
$author = $copyright = 'Manish Singh'; &yosh_pdb_misc('2003');
$date = '2003';
@inargs = ( &layer_arg ); @inargs = (
$inargs[0]->{desc} .= ' to resize'; { name => 'layer', type => 'layer',
desc => 'The layer to resize' }
);
%invoke = ( code => <<'CODE' ); %invoke = ( code => <<'CODE' );
{ {
@ -390,11 +388,14 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &layer_arg ); @inargs = (
foreach (qw(x y)) { { name => 'layer', type => 'layer',
push @inargs, { name => "off$_", type => 'int32', desc => 'The layer' },
desc => "Offset in $_ direction" } { name => 'offx', type => 'int32',
} desc => "Offset in x direction" },
{ name => 'offy', type => 'int32',
desc => "Offset in y direction" }
);
%invoke = ( code => <<'CODE'); %invoke = ( code => <<'CODE');
{ {
@ -428,7 +429,10 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &layer_arg ); @inargs = (
{ name => 'layer', type => 'layer',
desc => 'The layer' }
);
%invoke = ( code => 'gimp_layer_add_alpha (layer);' ); %invoke = ( code => 'gimp_layer_add_alpha (layer);' );
} }
@ -459,7 +463,10 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &layer_arg ); @inargs = (
{ name => 'layer', type => 'layer',
desc => 'The layer' }
);
@outargs = ( @outargs = (
{ name => 'mask', type => 'channel', { name => 'mask', type => 'channel',
@ -512,7 +519,10 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &layer_arg ); @inargs = (
{ name => 'layer', type => 'layer',
desc => 'The layer' }
);
@outargs = ( @outargs = (
{ name => 'is_floating_sel', type => 'boolean', { name => 'is_floating_sel', type => 'boolean',

View File

@ -17,11 +17,6 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub pdb_misc {
$author = $copyright = 'Manish Singh';
$date = '1998';
}
sub message { sub message {
$blurb = 'Displays a dialog box with a message.'; $blurb = 'Displays a dialog box with a message.';
@ -30,7 +25,7 @@ Displays a dialog box with a message. Useful for status or error reporting.
The message must be in UTF-8 encoding. The message must be in UTF-8 encoding.
HELP HELP
&pdb_misc; &yosh_pdb_misc('1998');
@inargs = ( @inargs = (
{ name => 'message', type => 'string', const => 1, { name => 'message', type => 'string', const => 1,
@ -59,7 +54,7 @@ This procedure returns the way g_message warnings are displayed. They can be
shown in a dialog box or printed on the console where gimp was started. shown in a dialog box or printed on the console where gimp was started.
HELP HELP
&pdb_misc; &yosh_pdb_misc('1998');
@outargs = ( @outargs = (
{ name => 'handler', type => 'enum GimpMessageHandlerType', { name => 'handler', type => 'enum GimpMessageHandlerType',
@ -76,7 +71,7 @@ This procedure controls how g_message warnings are displayed. They can be shown
in a dialog box or printed on the console where gimp was started. in a dialog box or printed on the console where gimp was started.
HELP HELP
&pdb_misc; &yosh_pdb_misc('1998');
@inargs = ( @inargs = (
{ name => 'handler', type => 'enum GimpMessageHandlerType', { name => 'handler', type => 'enum GimpMessageHandlerType',
@ -86,9 +81,8 @@ HELP
%invoke = ( code => 'gimp->message_handler = handler;' ); %invoke = ( code => 'gimp->message_handler = handler;' );
} }
@headers = qw(<string.h> @headers = qw(<string.h> "core/gimp.h" "plug-in/plug-in.h"
"core/gimp.h" "plug-in/plug-in.h" "plug-in/plug-in-progress.h" "plug-in/plug-in-progress.h" "gimp-intl.h");
"gimp-intl.h");
@procs = qw(message message_get_handler message_set_handler); @procs = qw(message message_get_handler message_set_handler);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);

View File

@ -26,8 +26,7 @@ BLURB
This procedure returns the version number of the currently running gimp. This procedure returns the version number of the currently running gimp.
HELP HELP
$author = $copyright = 'Manish Singh'; &yosh_pdb_misc('1999');
$date = '1999';
@outargs = ( @outargs = (
{ name => 'version', type => 'string', { name => 'version', type => 'string',
@ -47,9 +46,7 @@ BLURB
This procedure returns the process ID of the currently running gimp. This procedure returns the process ID of the currently running gimp.
HELP HELP
$author = $copyright = 'Michael Natterer'; &mitch_pdb_misc('2005', '2.4');
$date = '2005';
$since = '2.4';
@outargs = ( @outargs = (
{ name => 'pid', type => 'int32', { name => 'pid', type => 'int32',

View File

@ -21,20 +21,6 @@
# shortcuts # shortcuts
sub drawable_arg () {{
name => 'drawable',
type => 'drawable',
desc => 'The affected drawable',
}}
sub drawable_out_arg {
my $type = shift;
my $arg = &drawable_arg;
$arg->{desc} = "The $type drawable";
$arg->{no_declare} = 1;
$arg;
}
sub stroke_arg () { sub stroke_arg () {
{ name => 'strokes', type => 'floatarray', { name => 'strokes', type => 'floatarray',
desc => 'Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., desc => 'Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ...,
@ -47,7 +33,7 @@ sub stroke_arg () {
# The defs # The defs
sub airbrush { sub airbrush {
$blurb = <<'BLURB'; $blurb = <<'BLURB';
Paint in the current brush with varying pressure. Paint application is Paint in the current brush with varying pressure. Paint application is
time-dependent. time-dependent.
BLURB BLURB
@ -61,9 +47,10 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
{ name => 'pressure', type => '0 <= float <= 100', desc => 'The affected drawable' },
desc => 'The pressure of the airbrush strokes (%%desc%%)' }, { name => 'pressure', type => '0 <= float <= 100',
desc => 'The pressure of the airbrush strokes (%%desc%%)' },
&stroke_arg &stroke_arg
); );
@ -92,7 +79,7 @@ CODE
} }
sub airbrush_default { sub airbrush_default {
$blurb = <<'BLURB'; $blurb = <<'BLURB';
Paint in the current brush with varying pressure. Paint application is Paint in the current brush with varying pressure. Paint application is
time-dependent. time-dependent.
BLURB BLURB
@ -103,11 +90,11 @@ except that the pressure is derived from the airbrush tools options box.
It the option has not been set the default for the option will be used. It the option has not been set the default for the option will be used.
HELP HELP
$author = $copyright = 'Andy Thomas'; &andy_pdb_misc('1999');
$date = '1999';
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
&stroke_arg &stroke_arg
); );
@ -153,7 +140,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'src_drawable', type => 'drawable', { name => 'src_drawable', type => 'drawable',
desc => 'The source drawable' }, desc => 'The source drawable' },
{ name => 'clone_type', type => 'enum GimpCloneType', { name => 'clone_type', type => 'enum GimpCloneType',
@ -213,11 +201,11 @@ obtained from the clones option dialog. It this dialog has not been activated
then the dialogs default values will be used. then the dialogs default values will be used.
HELP HELP
$author = $copyright = 'Andy Thomas'; &andy_pdb_misc('1999');
$date = '1999';
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
&stroke_arg &stroke_arg
); );
@ -253,11 +241,11 @@ option dialog. It this dialog has not been activated then the dialogs
default values will be used. default values will be used.
HELP HELP
$author = $copyright = 'Andy Thomas'; &andy_pdb_misc('1999');
$date = '1999';
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
&stroke_arg &stroke_arg
); );
@ -294,7 +282,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'pressure', type => '0 <= float <= 100', { name => 'pressure', type => '0 <= float <= 100',
desc => 'The pressure: %%desc%%' }, desc => 'The pressure: %%desc%%' },
{ name => 'convolve_type', type => 'enum GimpConvolveType', { name => 'convolve_type', type => 'enum GimpConvolveType',
@ -337,11 +326,11 @@ obtained from the eraser option dialog. It this dialog has not been activated
then the dialogs default values will be used. then the dialogs default values will be used.
HELP HELP
$author = $copyright = 'Andy Thomas'; &andy_pdb_misc('1999');
$date = '1999';
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
&stroke_arg &stroke_arg
); );
@ -379,7 +368,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
&stroke_arg, &stroke_arg,
{ name => 'hardness', type => 'enum GimpBrushApplicationMode', { name => 'hardness', type => 'enum GimpBrushApplicationMode',
desc => '%%desc%%' }, desc => '%%desc%%' },
@ -426,7 +416,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
&stroke_arg, &stroke_arg,
{ name => 'hardness', type => 'enum GimpBrushApplicationMode', { name => 'hardness', type => 'enum GimpBrushApplicationMode',
desc => '%%desc%%' }, desc => '%%desc%%' },
@ -480,7 +471,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'fade_out', type => '0 <= float', { name => 'fade_out', type => '0 <= float',
desc => 'Fade out parameter: %%desc%%' }, desc => 'Fade out parameter: %%desc%%' },
&stroke_arg, &stroke_arg,
@ -538,11 +530,11 @@ distance to spread the gradient over. It is measured in pixels. If
the gradient_length is 0, no gradient is used. the gradient_length is 0, no gradient is used.
HELP HELP
$author = $copyright = 'Andy Thomas'; &andy_pdb_misc('1999');
$date = '1999';
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
&stroke_arg &stroke_arg
); );
@ -580,7 +572,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
&stroke_arg &stroke_arg
); );
@ -605,9 +598,7 @@ CODE
} }
sub smudge { sub smudge {
$blurb = <<'BLURB'; $blurb = 'Smudge image with varying pressure.';
Smudge image with varying pressure.
BLURB
$help = <<'HELP'; $help = <<'HELP';
This tool simulates a smudge using the current brush. High pressure results This tool simulates a smudge using the current brush. High pressure results
@ -617,7 +608,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'pressure', type => '0 <= float <= 100', { name => 'pressure', type => '0 <= float <= 100',
desc => 'The pressure of the smudge strokes (%%desc%%)' }, desc => 'The pressure of the smudge strokes (%%desc%%)' },
&stroke_arg &stroke_arg
@ -659,11 +651,11 @@ smudge tool options or the options default if the tools option dialog has
not been activated. not been activated.
HELP HELP
$author = $copyright = 'Andy Thomas'; &andy_pdb_misc('1999');
$date = '1999';
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
&stroke_arg &stroke_arg
); );
@ -696,12 +688,11 @@ BLURB
Dodgeburn. More details here later. Dodgeburn. More details here later.
HELP HELP
&andy_pdb_misc('1999');
$author = $copyright = 'Andy Thomas';
$date = '1999';
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'exposure', type => '0 <= float <= 100', { name => 'exposure', type => '0 <= float <= 100',
desc => 'The exposer of the strokes (%%desc%%)' }, desc => 'The exposer of the strokes (%%desc%%)' },
{ name => 'dodgeburn_type', type => 'enum GimpDodgeBurnType', { name => 'dodgeburn_type', type => 'enum GimpDodgeBurnType',
@ -752,7 +743,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
&stroke_arg &stroke_arg
); );
@ -787,7 +779,8 @@ sub ink {
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
&stroke_arg &stroke_arg
); );
} }

View File

@ -17,54 +17,11 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub bill_misc {
$author = 'Bill Skaggs <weskaggs@primate.ucdavis.edu';
$copyright = 'Bill Skaggs';
$date = '2004';
$since = '2.4';
}
sub mitch_misc {
$author = 'Michael Natterer <mitch@gimp.org>';
$copyright = 'Michael Natterer';
$date = '2004';
$since = '2.2';
}
sub neo_misc {
$author = 'Sven Neumann <sven@gimp.org>';
$copyright = 'Sven Neumann';
$date = '2005';
$since = '2.4';
}
sub palette_arg () {{
name => 'name',
type => 'string',
desc => 'The palette name.'
}}
my $get_palette_from_name = <<'CODE';
if (name && strlen (name))
{
palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container,
name);
}
else
{
palette = gimp_context_get_palette (context);
}
CODE
# The defs
sub palette_new { sub palette_new {
$blurb = "Creates a new palette"; $blurb = "Creates a new palette";
$help = "This procedure creates a new, uninitialized palette"; $help = "This procedure creates a new, uninitialized palette";
&mitch_misc; &mitch_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
{ name => 'name', type => 'string', { name => 'name', type => 'string',
@ -94,10 +51,11 @@ sub palette_is_editable {
$blurb = "Tests if palette can be edited"; $blurb = "Tests if palette can be edited";
$help = "Returns True if you have permission to change the palette"; $help = "Returns True if you have permission to change the palette";
&bill_misc; &bill_pdb_misc('2004', '2.4');
@inargs = ( @inargs = (
&palette_arg { name => 'name', type => 'string',
desc => 'The palette name' }
); );
@outargs = ( @outargs = (
@ -127,10 +85,11 @@ sub palette_duplicate {
$blurb = "Duplicates a palette"; $blurb = "Duplicates a palette";
$help = "This procedure creates an identical palette by a different name"; $help = "This procedure creates an identical palette by a different name";
&mitch_misc; &mitch_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&palette_arg { name => 'name', type => 'string',
desc => 'The palette name' }
); );
@outargs = ( @outargs = (
@ -141,11 +100,10 @@ sub palette_duplicate {
); );
%invoke = ( %invoke = (
vars => [ 'GimpPalette *palette = NULL', vars => [ 'GimpPalette *palette_copy = NULL' ],
'GimpPalette *palette_copy = NULL' ],
code => <<'CODE' code => <<'CODE'
{ {
palette = (GimpPalette *) GimpPalette *palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container, name); gimp_container_get_child_by_name (gimp->palette_factory->container, name);
if (palette) if (palette)
@ -167,10 +125,11 @@ sub palette_rename {
$blurb = "Rename a palette"; $blurb = "Rename a palette";
$help = "This procedure renames a palette"; $help = "This procedure renames a palette";
&mitch_misc; &mitch_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&palette_arg, { name => 'name', type => 'string',
desc => 'The palette name' },
{ name => 'new_name', type => 'string', { name => 'new_name', type => 'string',
desc => "The new name of the palette" } desc => "The new name of the palette" }
); );
@ -201,17 +160,17 @@ sub palette_delete {
$blurb = "Deletes a palette"; $blurb = "Deletes a palette";
$help = "This procedure deletes a palette"; $help = "This procedure deletes a palette";
&mitch_misc; &mitch_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&palette_arg { name => 'name', type => 'string',
desc => 'The palette name' }
); );
%invoke = ( %invoke = (
vars => [ 'GimpPalette *palette = NULL' ],
code => <<'CODE' code => <<'CODE'
{ {
palette = (GimpPalette *) GimpPalette *palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container, name); gimp_container_get_child_by_name (gimp->palette_factory->container, name);
if (palette && GIMP_DATA (palette)->deletable) if (palette && GIMP_DATA (palette)->deletable)
@ -243,10 +202,11 @@ This procedure retrieves information about the specified palette. This
includes the name, and the number of colors. includes the name, and the number of colors.
HELP HELP
&mitch_misc; &mitch_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&palette_arg { name => 'name', type => 'string',
desc => 'The palette name' }
); );
@outargs = ( @outargs = (
@ -275,10 +235,11 @@ This procedures retrieves the prefered number of columns to use when the
palette is being displayed. palette is being displayed.
HELP HELP
&neo_misc; &neo_pdb_misc('2005', '2.4');
@inargs = ( @inargs = (
&palette_arg { name => 'name', type => 'string',
desc => 'The palette name' }
); );
@outargs = ( @outargs = (
@ -308,19 +269,19 @@ palette is being displayed. This value can only be changed if the palette
is writable. The maximum allowed value is 64. is writable. The maximum allowed value is 64.
HELP HELP
&neo_misc; &neo_pdb_misc('2005', '2.4');
@inargs = ( @inargs = (
&palette_arg, { name => 'name', type => 'string',
desc => 'The palette name' },
{ name => 'columns', type => '0 <= int32 <= 64', { name => 'columns', type => '0 <= int32 <= 64',
desc => "The new number of columns" } desc => "The new number of columns" }
); );
%invoke = ( %invoke = (
vars => [ 'GimpPalette *palette = NULL' ],
code => <<'CODE' code => <<'CODE'
{ {
palette = (GimpPalette *) GimpPalette *palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container, name); gimp_container_get_child_by_name (gimp->palette_factory->container, name);
if (palette && GIMP_DATA (palette)->writable) if (palette && GIMP_DATA (palette)->writable)
@ -340,10 +301,11 @@ This procedure adds an entry to the specifed palette.
It returns an error if the entry palette does not exist. It returns an error if the entry palette does not exist.
HELP HELP
&mitch_misc; &mitch_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&palette_arg, { name => 'name', type => 'string',
desc => 'The palette name' },
{ name => 'entry_name', type => 'string', null_ok => '1', { name => 'entry_name', type => 'string', null_ok => '1',
desc => 'The name of the entry' }, desc => 'The name of the entry' },
{ name => 'color', type => 'color', { name => 'color', type => 'color',
@ -357,11 +319,10 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'GimpPalette *palette = NULL', vars => [ 'GimpPaletteEntry *entry = NULL' ],
'GimpPaletteEntry *entry = NULL' ],
code => <<'CODE' code => <<'CODE'
{ {
palette = (GimpPalette *) GimpPalette *palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container, name); gimp_container_get_child_by_name (gimp->palette_factory->container, name);
if (palette && GIMP_DATA (palette)->writable) if (palette && GIMP_DATA (palette)->writable)
@ -381,27 +342,26 @@ This procedure deletes an entry from the specifed palette.
It returns an error if the entry palette does not exist. It returns an error if the entry palette does not exist.
HELP HELP
&mitch_misc; &mitch_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&palette_arg, { name => 'name', type => 'string',
desc => 'The palette name' },
{ name => 'entry_num', type => 'int32', { name => 'entry_num', type => 'int32',
desc => 'The index of the added entry' } desc => 'The index of the added entry' }
); );
%invoke = ( %invoke = (
vars => [ 'GimpPalette *palette = NULL',
'GimpPaletteEntry *entry = NULL' ],
code => <<'CODE' code => <<'CODE'
{ {
palette = (GimpPalette *) GimpPalette *palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container, name); gimp_container_get_child_by_name (gimp->palette_factory->container, name);
if (palette && GIMP_DATA (palette)->writable) if (palette && GIMP_DATA (palette)->writable)
{ {
if (entry_num >= 0 && entry_num < palette->n_colors) if (entry_num >= 0 && entry_num < palette->n_colors)
{ {
entry = g_list_nth_data (palette->colors, entry_num); GimpPaletteEntry *entry = g_list_nth_data (palette->colors, entry_num);
gimp_palette_delete_entry (palette, entry); gimp_palette_delete_entry (palette, entry);
} }
@ -423,10 +383,11 @@ This procedure retrieves the color of the zero-based entry specifed for the
specified palette. It returns an error if the entry does not exist. specified palette. It returns an error if the entry does not exist.
HELP HELP
&mitch_misc; &mitch_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&palette_arg, { name => 'name', type => 'string',
desc => 'The palette name' },
{ name => 'entry_num', type => 'int32', { name => 'entry_num', type => 'int32',
desc => 'The entry to retrieve' } desc => 'The entry to retrieve' }
); );
@ -437,18 +398,16 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'GimpPalette *palette = NULL',
'GimpPaletteEntry *entry = NULL' ],
code => <<'CODE' code => <<'CODE'
{ {
palette = (GimpPalette *) GimpPalette *palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container, name); gimp_container_get_child_by_name (gimp->palette_factory->container, name);
if (palette) if (palette)
{ {
if (entry_num >= 0 && entry_num < palette->n_colors) if (entry_num >= 0 && entry_num < palette->n_colors)
{ {
entry = g_list_nth_data (palette->colors, entry_num); GimpPaletteEntry *entry = g_list_nth_data (palette->colors, entry_num);
color = entry->color; color = entry->color;
} }
@ -470,10 +429,11 @@ This procedure sets the color of the zero-based entry specifed for the
specified palette. It returns an error if the entry does not exist. specified palette. It returns an error if the entry does not exist.
HELP HELP
&mitch_misc; &mitch_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&palette_arg, { name => 'name', type => 'string',
desc => 'The palette name' },
{ name => 'entry_num', type => 'int32', { name => 'entry_num', type => 'int32',
desc => 'The entry to retrieve' }, desc => 'The entry to retrieve' },
{ name => 'color', type => 'color', { name => 'color', type => 'color',
@ -481,18 +441,16 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'GimpPalette *palette = NULL',
'GimpPaletteEntry *entry = NULL' ],
code => <<'CODE' code => <<'CODE'
{ {
palette = (GimpPalette *) GimpPalette *palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container, name); gimp_container_get_child_by_name (gimp->palette_factory->container, name);
if (palette && GIMP_DATA (palette)->writable) if (palette && GIMP_DATA (palette)->writable)
{ {
if (entry_num >= 0 && entry_num < palette->n_colors) if (entry_num >= 0 && entry_num < palette->n_colors)
{ {
entry = g_list_nth_data (palette->colors, entry_num); GimpPaletteEntry *entry = g_list_nth_data (palette->colors, entry_num);
entry->color = color; entry->color = color;
@ -516,10 +474,11 @@ This procedure retrieves the name of the zero-based entry specifed for the
specified palette. It returns an error if the entry does not exist. specified palette. It returns an error if the entry does not exist.
HELP HELP
&mitch_misc; &mitch_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&palette_arg, { name => 'name', type => 'string',
desc => 'The palette name' },
{ name => 'entry_num', type => 'int32', { name => 'entry_num', type => 'int32',
desc => 'The entry to retrieve' } desc => 'The entry to retrieve' }
); );
@ -531,11 +490,10 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'GimpPalette *palette = NULL', vars => [ 'GimpPaletteEntry *entry = NULL' ],
'GimpPaletteEntry *entry = NULL' ],
code => <<'CODE' code => <<'CODE'
{ {
palette = (GimpPalette *) GimpPalette *palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container, name); gimp_container_get_child_by_name (gimp->palette_factory->container, name);
if (palette) if (palette)
@ -560,10 +518,11 @@ This procedure sets the name of the zero-based entry specifed for the
specified palette. It returns an error if the entry does not exist. specified palette. It returns an error if the entry does not exist.
HELP HELP
&mitch_misc; &mitch_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&palette_arg, { name => 'name', type => 'string',
desc => 'The palette name' },
{ name => 'entry_num', type => 'int32', { name => 'entry_num', type => 'int32',
desc => 'The entry to retrieve' }, desc => 'The entry to retrieve' },
{ name => 'entry_name', type => 'string', null_ok => '1', { name => 'entry_name', type => 'string', null_ok => '1',
@ -571,18 +530,16 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'GimpPalette *palette = NULL',
'GimpPaletteEntry *entry = NULL' ],
code => <<'CODE' code => <<'CODE'
{ {
palette = (GimpPalette *) GimpPalette *palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container, name); gimp_container_get_child_by_name (gimp->palette_factory->container, name);
if (palette && GIMP_DATA (palette)->writable) if (palette && GIMP_DATA (palette)->writable)
{ {
if (entry_num >= 0 && entry_num < palette->n_colors) if (entry_num >= 0 && entry_num < palette->n_colors)
{ {
entry = g_list_nth_data (palette->colors, entry_num); GimpPaletteEntry *entry = g_list_nth_data (palette->colors, entry_num);
g_free (entry->name); g_free (entry->name);
entry->name = g_strdup (entry_name); entry->name = g_strdup (entry_name);

View File

@ -17,18 +17,11 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub pdb_misc {
$author = 'Michael Natterer <mitch@gimp.org>';
$copyright = 'Michael Natterer';
$date = '2002';
}
sub palettes_popup { sub palettes_popup {
$blurb = 'Invokes the Gimp palette selection.'; $blurb = 'Invokes the Gimp palette selection.';
$help = 'This procedure popups the palette selection dialog.';
$help = 'This procedure popups the palette selection dialog.'; &mitch_pdb_misc('2002');
&pdb_misc;
@inargs = ( @inargs = (
{ name => 'palette_callback', type => 'string', { name => 'palette_callback', type => 'string',
@ -57,10 +50,9 @@ CODE
sub palettes_close_popup { sub palettes_close_popup {
$blurb = 'Popdown the Gimp palette selection.'; $blurb = 'Popdown the Gimp palette selection.';
$help = 'This procedure closes an opened palette selection dialog.';
$help = 'This procedure closes an opened palette selection dialog.'; &mitch_pdb_misc('2002');
&pdb_misc;
@inargs = ( @inargs = (
{ name => 'palette_callback', type => 'string', { name => 'palette_callback', type => 'string',
@ -82,10 +74,9 @@ CODE
sub palettes_set_popup { sub palettes_set_popup {
$blurb = 'Sets the current palette selection in a popup.'; $blurb = 'Sets the current palette selection in a popup.';
$help = $blurb;
$help = $blurb; &mitch_pdb_misc('2002');
&pdb_misc;
@inargs = ( @inargs = (
{ name => 'palette_callback', type => 'string', { name => 'palette_callback', type => 'string',

View File

@ -17,71 +17,6 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub rock_misc {
$author = 'Nathan Summers <rock@gimp.org>';
$copyright = 'Nathan Summers';
$date = '2001';
}
sub adrian_misc {
$author = 'Adrian Likins <adrian@gimp.org>';
$copyright = 'Adrian Likins';
$date = '1998';
}
sub mitch_misc {
$author = 'Michael Natterer <mitch@gimp.org>';
$copyright = 'Michael Natterer';
$date = '2004';
$since = '2.2';
}
sub palette_arg () {{
name => 'name',
type => 'string',
desc => 'The palette name',
null_ok => '1'
}}
sub dim_args () {
my @args;
foreach (qw(num_colors)) {
push @args, { name => $_, type => 'int32', desc => "The palette $_" };
}
@args;
}
sub palette_outargs {
foreach (@outargs) {
my $alias;
if ($_->{type} eq 'string') {
$alias = "GIMP_OBJECT (palette)->$_->{name}";
} else {
$alias = "palette->$_->{name}";
}
$alias = "g_strdup ($alias)" if $_->{type} eq 'string';
$alias =~ s/num_colors/n_colors/ if $_->{name} =~ /num_colors/;
$_->{alias} = $alias;
$_->{no_declare} = 1;
}
}
my $get_palette_from_name = <<'CODE';
if (name && strlen (name))
{
palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container,
name);
}
else
{
palette = gimp_context_get_palette (context);
}
CODE
# The defs
sub palettes_refresh { sub palettes_refresh {
$blurb = 'Refreshes current palettes. This function always succeeds.'; $blurb = 'Refreshes current palettes. This function always succeeds.';
@ -90,7 +25,7 @@ This procedure retrieves all palettes currently in the user's palette path
and updates the palette dialogs accordingly. and updates the palette dialogs accordingly.
HELP HELP
&adrian_misc; &adrian_pdb_misc('1998');
%invoke = ( %invoke = (
code => 'gimp_data_factory_data_refresh (gimp->palette_factory);' code => 'gimp_data_factory_data_refresh (gimp->palette_factory);'
@ -105,7 +40,7 @@ This procedure returns a complete listing of available palettes. Each name
returned can be used as input to the command 'gimp-context-set-palette'. returned can be used as input to the command 'gimp-context-set-palette'.
HELP HELP
&rock_misc; &rock_pdb_misc('2001');
@inargs = ( @inargs = (
{ name => 'filter', type => 'string', null_ok => 1, { name => 'filter', type => 'string', null_ok => 1,
@ -130,12 +65,14 @@ sub palettes_get_palette {
&std_pdb_deprecated ('gimp-context-get-palette'); &std_pdb_deprecated ('gimp-context-get-palette');
@outargs = ( @outargs = (
&palette_arg, { name => 'name', type => 'string', no_declare => 1,
&dim_args, desc => 'The palette name', null_ok => '1',
alias => 'g_strdup (GIMP_OBJECT (palette)->name)' },
{ name => 'num_colors', type => 'int32', no_declare => 1,
desc => 'The palette num_colors',
alias => 'palette->n_colors' }
); );
&palette_outargs;
%invoke = ( %invoke = (
vars => [ 'GimpPalette *palette' ], vars => [ 'GimpPalette *palette' ],
code => 'success = (palette = gimp_context_get_palette (context)) != NULL;' code => 'success = (palette = gimp_context_get_palette (context)) != NULL;'
@ -146,27 +83,38 @@ sub palettes_get_palette_entry {
&std_pdb_deprecated ('gimp-palette-entry-get-color'); &std_pdb_deprecated ('gimp-palette-entry-get-color');
@inargs = ( @inargs = (
&palette_arg, { name => 'name', type => 'string',
desc => 'The palette name ("" means currently active palette)',
null_ok => '1' },
{ name => 'entry_num', type => 'int32', { name => 'entry_num', type => 'int32',
desc => 'The entry to retrieve' } desc => 'The entry to retrieve' }
); );
$inargs[0]->{desc} = 'The palette name ("" means currently active palette)';
@outargs = ( @outargs = (
&palette_arg, { name => 'name', type => 'string', no_declare => 1,
&dim_args, desc => 'The palette name', null_ok => '1',
alias => 'g_strdup (GIMP_OBJECT (palette)->name)' },
{ name => 'num_colors', type => 'int32', no_declare => 1,
desc => 'The palette num_colors',
alias => 'palette->n_colors' },
{ name => 'color', type => 'color', void_ret => 1,
desc => 'The color requested' }
); );
&palette_outargs;
push @outargs, { name => 'color', type => 'color', void_ret => 1,
desc => 'The color requested' };
%invoke = ( %invoke = (
vars => [ 'GimpPalette *palette = NULL' ], vars => [ 'GimpPalette *palette = NULL' ],
code => <<"CODE" code => <<"CODE"
{ {
$get_palette_from_name if (name && strlen (name))
{
palette = (GimpPalette *)
gimp_container_get_child_by_name (gimp->palette_factory->container,
name);
}
else
{
palette = gimp_context_get_palette (context);
}
if (palette) if (palette)
{ {

View File

@ -17,24 +17,6 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub pdb_misc {
$author = $copyright = 'Jay Cox';
$date = '1998';
}
sub name_arg {{
name => 'name',
type => 'string',
desc => "The name of the parasite to $_[0]"
}}
sub parasite_outarg {{
name => 'parasite',
type => 'parasite',
desc => "The $_[0] parasite",
init => 1
}}
sub drawable_arg () {{ sub drawable_arg () {{
name => 'drawable', name => 'drawable',
type => 'drawable', type => 'drawable',
@ -70,11 +52,18 @@ sub parasite_find {
Finds and returns the named parasite that was previously attached to the gimp. Finds and returns the named parasite that was previously attached to the gimp.
HELP HELP
&pdb_misc; &jay_pdb_misc('1998');
@inargs = ( &name_arg('find') ); @inargs = (
{ name => 'name', type => 'string',
desc => 'The name of the parasite to find' }
);
@outargs = ( &parasite_outarg('found') ); @outargs = (
{ name => 'parasite', type => 'parasite',
desc => 'The found parasite',
init => 1 }
);
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
@ -93,7 +82,7 @@ sub parasite_attach {
This procedure attaches a parasite to the gimp. It has no return values. This procedure attaches a parasite to the gimp. It has no return values.
HELP HELP
&pdb_misc; &jay_pdb_misc('1998');
@inargs = ( @inargs = (
{ name => 'parasite', type => 'parasite', { name => 'parasite', type => 'parasite',
@ -110,20 +99,21 @@ sub parasite_detach {
This procedure detaches a parasite from the gimp. It has no return values. This procedure detaches a parasite from the gimp. It has no return values.
HELP HELP
&pdb_misc; &jay_pdb_misc('1998');
@inargs = ( &name_arg('detach from the gimp.') ); @inargs = (
{ name => 'name', type => 'string',
desc => 'The name of the parasite to detach from the gimp.' }
);
%invoke = ( code => 'gimp_parasite_detach (gimp, name);' ); %invoke = ( code => 'gimp_parasite_detach (gimp, name);' );
} }
sub parasite_list { sub parasite_list {
$blurb = 'List all parasites.'; $blurb = 'List all parasites.';
$help = 'Returns a list of all currently attached parasites.';
$help = 'Returns a list of all currently attached parasites.'; &marc_pdb_misc('1999');
$author = $copyright = 'Marc Lehmann';
$date = '1999';
@outargs = ( @outargs = (
{ name => 'parasites', type => 'stringarray', void_ret => 1, { name => 'parasites', type => 'stringarray', void_ret => 1,

View File

@ -17,13 +17,6 @@
# "Perlized" from C source by Andy Thomas <alt@gimp.org> # "Perlized" from C source by Andy Thomas <alt@gimp.org>
sub pdb_misc {
$author = $copyright = 'Andy Thomas';
$date = '1999';
}
# The defs
sub path_list { sub path_list {
$blurb = 'List the paths associated with the passed image.'; $blurb = 'List the paths associated with the passed image.';
@ -31,7 +24,7 @@ sub path_list {
List the paths associated with the passed image. List the paths associated with the passed image.
HELP HELP
&pdb_misc; &andy_pdb_misc('1999');
@inargs = ( &std_image_arg ); @inargs = ( &std_image_arg );
$inargs[0]->{desc} = 'The ID of the image to list the paths from'; $inargs[0]->{desc} = 'The ID of the image to list the paths from';
@ -56,7 +49,7 @@ sub path_get_points {
List the points associated with the named path. List the points associated with the named path.
HELP HELP
&pdb_misc; &andy_pdb_misc('1999');
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
@ -139,7 +132,7 @@ sub path_get_current {
The name of the current path. Error if no paths. The name of the current path. Error if no paths.
HELP HELP
&pdb_misc; &andy_pdb_misc('1999');
@inargs = ( &std_image_arg ); @inargs = ( &std_image_arg );
$inargs[0]->{desc} = 'The ID of the image to get the current path from.'; $inargs[0]->{desc} = 'The ID of the image to get the current path from.';
@ -151,10 +144,9 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'GimpVectors *vectors' ],
code => <<'CODE' code => <<'CODE'
{ {
vectors = gimp_image_get_active_vectors (gimage); GimpVectors *vectors = gimp_image_get_active_vectors (gimage);
if (vectors) if (vectors)
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors))); name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors)));
@ -172,7 +164,7 @@ sub path_set_current {
Sets a named path as the current path. Sets a named path as the current path.
HELP HELP
&pdb_misc; &andy_pdb_misc('1999');
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
@ -182,10 +174,9 @@ HELP
$inargs[0]->{desc} = 'The ID of the image in which a path will become current.'; $inargs[0]->{desc} = 'The ID of the image in which a path will become current.';
%invoke = ( %invoke = (
vars => [ 'GimpVectors *vectors' ],
code => <<'CODE' code => <<'CODE'
{ {
vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors) if (vectors)
gimp_image_set_active_vectors (gimage, vectors); gimp_image_set_active_vectors (gimage, vectors);
@ -203,7 +194,7 @@ sub path_set_points {
Set the points associated with the named path. Set the points associated with the named path.
HELP HELP
&pdb_misc; &andy_pdb_misc('1999');
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
@ -244,9 +235,10 @@ HELP
$inargs[0]->{desc} = 'The ID of the image to set the paths in.'; $inargs[0]->{desc} = 'The ID of the image to set the paths in.';
%invoke = ( %invoke = (
vars => [ 'gboolean closed = FALSE' ],
code => <<'CODE' code => <<'CODE'
{ {
gboolean closed = FALSE;
if ((num_path_points / 3) % 3 == 0) if ((num_path_points / 3) % 3 == 0)
closed = TRUE; closed = TRUE;
else if ((num_path_points / 3) % 3 != 2) else if ((num_path_points / 3) % 3 != 2)
@ -295,7 +287,7 @@ sub path_stroke_current {
Stroke the current path in the passed image. Stroke the current path in the passed image.
HELP HELP
&pdb_misc; &andy_pdb_misc('1999');
@inargs = ( &std_image_arg ); @inargs = ( &std_image_arg );
$inargs[0]->{desc} = 'The ID of the image which contains the path to $inargs[0]->{desc} = 'The ID of the image which contains the path to
@ -337,7 +329,7 @@ start of the path is the first point on the path that was created. This might
not be obvious. Note the current path is used. not be obvious. Note the current path is used.
HELP HELP
&pdb_misc; &andy_pdb_misc('1999');
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
@ -356,11 +348,15 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'GimpVectors *vectors', 'GimpStroke *stroke',
'gdouble distance_along', 'gdouble stroke_length',
'gdouble stroke_distance', 'GimpCoords position' ],
code => <<'CODE' code => <<'CODE'
{ {
GimpVectors *vectors;
GimpStroke *stroke;
gdouble distance_along;
gdouble stroke_length;
gdouble stroke_distance;
GimpCoords position;
vectors = gimp_image_get_active_vectors (gimage); vectors = gimp_image_get_active_vectors (gimage);
if (vectors) if (vectors)
@ -417,7 +413,7 @@ tattoo is a unique and permanent identifier attached to a path that can
be used to uniquely identify a path within an image even between sessions. be used to uniquely identify a path within an image even between sessions.
HELP HELP
&pdb_misc; &andy_pdb_misc('1999');
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
@ -431,10 +427,9 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'GimpVectors *vectors' ],
code => <<'CODE' code => <<'CODE'
{ {
vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors) if (vectors)
tattoo = gimp_item_get_tattoo (GIMP_ITEM (vectors)); tattoo = gimp_item_get_tattoo (GIMP_ITEM (vectors));
@ -456,7 +451,7 @@ sessions. Note that the value passed to this function must have been
obtained from a previous call to path_get_tattoo. obtained from a previous call to path_get_tattoo.
HELP HELP
&pdb_misc; &andy_pdb_misc('1999');
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
@ -469,10 +464,9 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'GimpVectors *vectors' ],
code => <<'CODE' code => <<'CODE'
{ {
vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors) if (vectors)
gimp_item_set_tattoo (GIMP_ITEM (vectors), tattovalue); gimp_item_set_tattoo (GIMP_ITEM (vectors), tattovalue);
@ -494,7 +488,7 @@ and will be preserved across sessions and through renaming of the path.
An error is returned if no path with the specified tattoo can be found. An error is returned if no path with the specified tattoo can be found.
HELP HELP
&pdb_misc; &andy_pdb_misc('1999');
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
@ -508,10 +502,9 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'GimpVectors *vectors' ],
code => <<'CODE' code => <<'CODE'
{ {
vectors = gimp_image_get_vectors_by_tattoo (gimage, tattoo); GimpVectors *vectors = gimp_image_get_vectors_by_tattoo (gimage, tattoo);
if (vectors) if (vectors)
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors))); name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors)));
@ -529,7 +522,7 @@ sub path_delete {
Delete the named path. Delete the named path.
HELP HELP
&pdb_misc; &andy_pdb_misc('1999');
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
@ -539,10 +532,9 @@ HELP
$inargs[0]->{desc} = 'The ID of the image to delete the path from.'; $inargs[0]->{desc} = 'The ID of the image to delete the path from.';
%invoke = ( %invoke = (
vars => [ 'GimpVectors *vectors' ],
code => <<'CODE' code => <<'CODE'
{ {
vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors) if (vectors)
gimp_image_remove_vectors (gimage, vectors); gimp_image_remove_vectors (gimage, vectors);
@ -562,7 +554,7 @@ path. A path can be "locked" which means that the transformation
tool operations will also apply to the path. tool operations will also apply to the path.
HELP HELP
&pdb_misc; &andy_pdb_misc('1999');
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
@ -577,10 +569,9 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'GimpVectors *vectors' ],
code => <<'CODE' code => <<'CODE'
{ {
vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors) if (vectors)
locked = gimp_item_get_linked (GIMP_ITEM (vectors)); locked = gimp_item_get_linked (GIMP_ITEM (vectors));
@ -600,7 +591,7 @@ path can be "locked" which means that the transformation tool operations
will also apply to the path. will also apply to the path.
HELP HELP
&pdb_misc; &andy_pdb_misc('1999');
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
@ -611,10 +602,9 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'GimpVectors *vectors' ],
code => <<'CODE' code => <<'CODE'
{ {
vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors) if (vectors)
gimp_item_set_linked (GIMP_ITEM (vectors), locked, TRUE); gimp_item_set_linked (GIMP_ITEM (vectors), locked, TRUE);
@ -632,7 +622,7 @@ sub path_get_visible {
This procedure returns the visibility of the specified path. This procedure returns the visibility of the specified path.
HELP HELP
&pdb_misc; &andy_pdb_misc('1999');
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
@ -646,10 +636,9 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'GimpVectors *vectors' ],
code => <<'CODE' code => <<'CODE'
{ {
vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors) if (vectors)
visible = gimp_item_get_visible (GIMP_ITEM (vectors)); visible = gimp_item_get_visible (GIMP_ITEM (vectors));
@ -667,9 +656,7 @@ sub path_set_visible {
This procedure sets the specified path's visibility. This procedure sets the specified path's visibility.
HELP HELP
$author = $copyright = 'Sven Neumann'; &neo_pdb_misc('2005', '2.4');
$date = '2005';
$since = '2.4';
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
@ -680,10 +667,9 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'GimpVectors *vectors' ],
code => <<'CODE' code => <<'CODE'
{ {
vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors) if (vectors)
gimp_item_set_visible (GIMP_ITEM (vectors), visible, TRUE); gimp_item_set_visible (GIMP_ITEM (vectors), visible, TRUE);
@ -701,9 +687,7 @@ sub path_to_selection {
This procedure renders the desired path into the current selection. This procedure renders the desired path into the current selection.
HELP HELP
&joao_pdb_misc('2003');
$author = $copyright = 'Joao S. O. Bueno';
$date = '2003';
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
@ -722,10 +706,9 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'GimpVectors *vectors' ],
code => <<'CODE' code => <<'CODE'
{ {
vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors) if (vectors)
gimp_channel_select_vectors (gimp_image_get_mask (gimage), gimp_channel_select_vectors (gimp_image_get_mask (gimage),
@ -751,8 +734,7 @@ This procedure imports paths from an SVG file. SVG elements other than
paths and basic shapes are ignored. paths and basic shapes are ignored.
HELP HELP
$author = $copyright = 'Sven Neumann'; &neo_pdb_misc('2003');
$date = '2003';
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,
@ -779,9 +761,7 @@ than reading the SVG from a file. This allows you to write scripts that
generate SVG and feed it to GIMP. generate SVG and feed it to GIMP.
HELP HELP
$author = $copyright = 'Sven Neumann'; &neo_pdb_misc('2005', '2.4');
$date = '2005';
$since = '2.4';
@inargs = ( @inargs = (
&std_image_arg, &std_image_arg,

View File

@ -17,33 +17,19 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub mitch_misc {
$author = 'Michael Natterer <mitch@gimp.org>';
$copyright = 'Michael Natterer';
$date = '2004';
$since = '2.2';
}
sub pattern_arg () {{
name => 'name',
type => 'string',
desc => 'The pattern name.'
}}
# The defs
sub pattern_get_info { sub pattern_get_info {
$blurb = 'Retrieve information about the specified pattern.'; $blurb = 'Retrieve information about the specified pattern.';
$help = <<'HELP'; $help = <<'HELP';
This procedure retrieves information about the specified pattern. This procedure retrieves information about the specified pattern.
This includes the pattern extents (width and height). This includes the pattern extents (width and height).
HELP HELP
&mitch_misc; &mitch_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&pattern_arg { name => 'name', type => 'string',
desc => 'The pattern name.' }
); );
@outargs = ( @outargs = (
@ -82,10 +68,11 @@ includes the pattern extents (width and height), its bpp and its pixel
data. data.
HELP HELP
&mitch_misc; &mitch_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
&pattern_arg { name => 'name', type => 'string',
desc => 'The pattern name.' }
); );
@outargs = ( @outargs = (

View File

@ -17,17 +17,11 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub pdb_misc {
$author = $copyright = 'Andy Thomas';
$date = '1998';
}
sub patterns_popup { sub patterns_popup {
$blurb = 'Invokes the Gimp pattern selection.'; $blurb = 'Invokes the Gimp pattern selection.';
$help = 'This procedure popups the pattern selection dialog.';
$help = 'This procedure popups the pattern selection dialog.'; &andy_pdb_misc('1998');
&pdb_misc;
@inargs = ( @inargs = (
{ name => 'pattern_callback', type => 'string', { name => 'pattern_callback', type => 'string',
@ -56,10 +50,9 @@ CODE
sub patterns_close_popup { sub patterns_close_popup {
$blurb = 'Popdown the Gimp pattern selection.'; $blurb = 'Popdown the Gimp pattern selection.';
$help = 'This procedure closes an opened pattern selection dialog.';
$help = 'This procedure closes an opened pattern selection dialog.'; &andy_pdb_misc('1998');
&pdb_misc;
@inargs = ( @inargs = (
{ name => 'pattern_callback', type => 'string', { name => 'pattern_callback', type => 'string',
@ -81,10 +74,9 @@ CODE
sub patterns_set_popup { sub patterns_set_popup {
$blurb = 'Sets the current pattern selection in a popup.'; $blurb = 'Sets the current pattern selection in a popup.';
$help = $blurb;
$help = $blurb; &andy_pdb_misc('1998');
&pdb_misc;
@inargs = ( @inargs = (
{ name => 'pattern_callback', type => 'string', { name => 'pattern_callback', type => 'string',

View File

@ -17,38 +17,6 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub pattern_arg () {{
name => 'name',
type => 'string',
desc => 'The pattern name',
null_ok => '1'
}}
sub dim_args () {
my @args;
foreach (qw(width height)) {
push @args, { name => $_, type => 'int32', desc => "The pattern $_" };
}
@args;
}
sub pattern_outargs {
foreach (@outargs) {
my $alias;
if ($_->{type} eq 'string') {
$alias = "GIMP_OBJECT (pattern)->$_->{name}";
} else {
$alias = "pattern->$_->{name}";
}
$alias = "g_strdup ($alias)" if $_->{type} eq 'string';
$alias =~ s/pattern/pattern->mask/ if $_->{name} =~ /width|height/;
$_->{alias} = $alias;
$_->{no_declare} = 1;
}
}
# The defs
sub patterns_refresh { sub patterns_refresh {
$blurb = 'Refresh current patterns. This function always succeeds.'; $blurb = 'Refresh current patterns. This function always succeeds.';
@ -57,8 +25,7 @@ This procedure retrieves all patterns currently in the user's pattern path
and updates all pattern dialogs accordingly. and updates all pattern dialogs accordingly.
HELP HELP
$author = $copyright = 'Michael Natterer'; &mitch_pdb_misc('2002');
$date = '2002';
%invoke = ( %invoke = (
code => 'gimp_data_factory_data_refresh (gimp->pattern_factory);' code => 'gimp_data_factory_data_refresh (gimp->pattern_factory);'
@ -76,8 +43,7 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
{ name => 'filter', { name => 'filter', type => 'string', null_ok => 1,
type => 'string', null_ok => 1,
desc => 'An optional regular expression used to filter the list' } desc => 'An optional regular expression used to filter the list' }
); );
@ -99,12 +65,17 @@ sub patterns_get_pattern {
&std_pdb_deprecated ('gimp-context-get-pattern'); &std_pdb_deprecated ('gimp-context-get-pattern');
@outargs = ( @outargs = (
&pattern_arg, { name => 'name', type => 'string', no_declare => 1,
&dim_args, desc => 'The pattern name',
alias =>'g_strdup (GIMP_OBJECT (pattern)->name)' },
{ name => 'width', type => 'int32', no_declare => 1,
desc => 'The pattern width',
alias => 'pattern->mask->width' },
{ name => 'height', type => 'int32', no_declare => 1,
desc => 'The pattern height',
alias => 'pattern->mask->height' }
); );
&pattern_outargs;
%invoke = ( %invoke = (
vars => [ 'GimpPattern *pattern' ], vars => [ 'GimpPattern *pattern' ],
code => 'success = (pattern = gimp_context_get_pattern (context)) != NULL;' code => 'success = (pattern = gimp_context_get_pattern (context)) != NULL;'
@ -115,24 +86,29 @@ sub patterns_get_pattern_data {
&std_pdb_deprecated ('gimp-pattern-get-pixels'); &std_pdb_deprecated ('gimp-pattern-get-pixels');
@inargs = ( @inargs = (
&pattern_arg { name => 'name', type => 'string',
desc => 'The pattern name ("" means currently active pattern)',
null_ok => '1' }
); );
$inargs[0]->{desc} = 'The pattern name ("" means currently active pattern)';
@outargs = ( @outargs = (
&pattern_arg, { name => 'name', type => 'string', no_declare => 1,
&dim_args, desc => 'The pattern name',
alias =>'g_strdup (GIMP_OBJECT (pattern)->name)' },
{ name => 'width', type => 'int32', no_declare => 1,
desc => 'The pattern width',
alias => 'pattern->mask->width' },
{ name => 'height', type => 'int32', no_declare => 1,
desc => 'The pattern height',
alias => 'pattern->mask->height' },
{ name => 'mask_bpp', type => 'int32', init => 1,
desc => 'Pattern bytes per pixel',
alias => 'pattern->mask->bytes', no_declare => 1 },
{ name => 'mask_data', type => 'int8array', init => 1,
desc => 'The pattern mask data',
array => { name => 'length', init => 1,
desc => 'Length of pattern mask data' } }
); );
&pattern_outargs;
push @outargs, { name => 'mask_bpp', type => 'int32', init => 1,
desc => 'Pattern bytes per pixel',
alias => 'pattern->mask->bytes', no_declare => 1 },
{ name => 'mask_data', type => 'int8array', init => 1,
desc => 'The pattern mask data',
array => { name => 'length', init => 1,
desc => 'Length of pattern mask data' } };
%invoke = ( %invoke = (
vars => [ 'GimpPattern *pattern = NULL' ], vars => [ 'GimpPattern *pattern = NULL' ],

View File

@ -17,15 +17,12 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
# The defs
sub plugins_query { sub plugins_query {
$blurb = 'Queries the plugin database for its contents.'; $blurb = 'Queries the plugin database for its contents.';
$help = 'This procedure queries the contents of the plugin database.'; $help = 'This procedure queries the contents of the plugin database.';
$author = $copyright = 'Andy Thomas'; &andy_pdb_misc('1998');
$date = '1998';
@inargs = ( @inargs = (
{ name => 'search_string', type => 'string', { name => 'search_string', type => 'string',
@ -92,8 +89,7 @@ in the query function of a plug-in and it has to be called before any
procedure is installed. procedure is installed.
HELP HELP
$author = $copyright = 'Sven Neumann'; &neo_pdb_misc('2000');
$date = '2000';
@inargs = ( @inargs = (
{ name => 'domain_name', type => 'string', { name => 'domain_name', type => 'string',
@ -130,8 +126,7 @@ subsequent calls of gimp_help from this plug-in will be interpreted relative
to this rootdir. to this rootdir.
HELP HELP
$author = $copyright = 'Michael Natterer <mitch@gimp.org>'; &mitch_pdb_misc('2000');
$date = '2000';
@inargs = ( @inargs = (
{ name => 'domain_name', type => 'string', { name => 'domain_name', type => 'string',
@ -164,9 +159,7 @@ sub plugin_menu_register {
This procedure installs an additional menu entry for the given procedure. This procedure installs an additional menu entry for the given procedure.
HELP HELP
$author = $copyright = 'Michael Natterer <mitch@gimp.org>'; &mitch_pdb_misc('2004', '2.2');
$date = '2004';
$since = '2.2';
@inargs = ( @inargs = (
{ name => 'procedure_name', type => 'string', { name => 'procedure_name', type => 'string',
@ -202,9 +195,7 @@ sub plugin_menu_branch_register {
This procedure installs an sub-menu which does not belong to any procedure. This procedure installs an sub-menu which does not belong to any procedure.
HELP HELP
$author = $copyright = 'Michael Natterer <mitch@gimp.org>'; &mitch_pdb_misc('2005', '2.4');
$date = '2005';
$since = '2.4';
@inargs = ( @inargs = (
{ name => 'menu_path', type => 'string', { name => 'menu_path', type => 'string',
@ -243,9 +234,7 @@ sub plugin_icon_register {
This procedure installs an icon for the given procedure. This procedure installs an icon for the given procedure.
HELP HELP
$author = $copyright = 'Michael Natterer <mitch@gimp.org>'; &mitch_pdb_misc('2004', '2.2');
$date = '2004';
$since = '2.2';
@inargs = ( @inargs = (
{ name => 'procedure_name', type => 'string', wrap => 1, { name => 'procedure_name', type => 'string', wrap => 1,

View File

@ -17,32 +17,6 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub proc_name_arg () {{
name => 'procedure',
type => 'string',
desc => 'The procedure name',
alias => 'proc_name'
}}
sub data_ident_arg () {{
name => 'identifier',
type => 'string',
desc => 'The identifier associated with data'
}}
sub data_bytes_arg () {{
name => 'bytes',
type => '0 < int32',
desc => 'The number of bytes in the data',
}}
sub data_arg () {{
name => 'data',
type => 'int8array',
desc => 'A byte array containing data',
array => &data_bytes_arg
}}
sub arg_info_proc { sub arg_info_proc {
my ($type, $long_type, $real_type) = @_; my ($type, $long_type, $real_type) = @_;
@ -60,7 +34,8 @@ HELP
$date = '1997'; $date = '1997';
@inargs = ( @inargs = (
&proc_name_arg, { name => 'procedure', type => 'string',
desc => 'The procedure name', alias => 'proc_name' },
{ name => "${type}_num", type => 'int32', { name => "${type}_num", type => 'int32',
desc => "The $long_type number" } desc => "The $long_type number" }
); );
@ -119,8 +94,7 @@ unique. It is mainly used by the interactive popup dialogs to generate a PDB
entry name. entry name.
HELP HELP
$author = $copyright = 'Andy Thomas'; &andy_pdb_misc('1998');
$date = '1998';
@outargs = ( @outargs = (
{ name => 'temp_name', type => 'string', { name => 'temp_name', type => 'string',
@ -128,9 +102,12 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'static gint proc_number = 0' ],
code => <<'CODE' code => <<'CODE'
temp_name = g_strdup_printf ("temp-procedure-number-%d", proc_number++); {
static gint proc_number = 0;
temp_name = g_strdup_printf ("temp-procedure-number-%d", proc_number++);
}
CODE CODE
); );
} }
@ -233,7 +210,10 @@ HELP
&std_pdb_misc; &std_pdb_misc;
$date = '1997'; $date = '1997';
@inargs = ( &proc_name_arg ); @inargs = (
{ name => 'procedure', type => 'string',
desc => 'The procedure name', alias => 'proc_name' }
);
@outargs = ( @outargs = (
{ name => 'blurb', type => 'string', void_ret => 1, wrap => 1, { name => 'blurb', type => 'string', void_ret => 1, wrap => 1,
@ -295,19 +275,24 @@ HELP
&std_pdb_misc; &std_pdb_misc;
$date = '1997'; $date = '1997';
@inargs = ( &data_ident_arg ); @inargs = (
{ name => 'identifier', type => 'string',
desc => 'The identifier associated with data' }
);
@outargs = ( &data_arg ); @outargs = (
$outargs[0]->{alias} = 'data_copy'; { name => 'data', type => 'int8array',
$outargs[0]->{init} = 1; desc => 'A byte array containing data', wrap => 1, init => 1,
$outargs[0]->{wrap} = 1; alias => 'data_copy', void_ret => 1,
$outargs[0]->{void_ret} = 1; array => { name => 'bytes', type => '0 < int32',
desc => 'The number of bytes in the data' } }
);
%invoke = ( %invoke = (
vars => [ 'const guint8 *data' ],
code => <<'CODE' code => <<'CODE'
{ {
gchar *canonical; const guint8 *data;
gchar *canonical;
canonical = gimp_canonicalize_identifier (identifier); canonical = gimp_canonicalize_identifier (identifier);
@ -332,18 +317,23 @@ the specified identifier. If no data has been associated with the identifier,
an error is returned. an error is returned.
HELP HELP
$author = $copyright = 'Nick Lamb'; &nick_pdb_misc('1998');
$date = '1998';
@inargs = ( &data_ident_arg ); @inargs = (
{ name => 'identifier', type => 'string',
desc => 'The identifier associated with data' }
);
@outargs = ( &data_bytes_arg ); @outargs = (
{ name => 'bytes', type => '0 < int32',
desc => 'The number of bytes in the data' }
);
%invoke = ( %invoke = (
vars => [ 'const guint8 *data' ],
code => <<'CODE' code => <<'CODE'
{ {
gchar *canonical; const guint8 *data;
gchar *canonical;
canonical = gimp_canonicalize_identifier (identifier); canonical = gimp_canonicalize_identifier (identifier);
@ -369,9 +359,14 @@ HELP
&std_pdb_misc; &std_pdb_misc;
$date = '1997'; $date = '1997';
@inargs = ( &data_ident_arg, &data_arg ); @inargs = (
$inargs[1]->{wrap} = 1; { name => 'identifier', type => 'string',
delete @{$inargs[1]->{array}}{qw(alias no_declare)}; desc => 'The identifier associated with data' },
{ name => 'data', type => 'int8array',
desc => 'A byte array containing data', wrap => 1,
array => { name => 'bytes', type => '0 < int32',
desc => 'The number of bytes in the data' } }
);
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'

View File

@ -17,20 +17,6 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub mitch_pdb_misc {
$author = 'Michael Natterer <mitch@gimp.org>';
$copyright = 'Michael Natterer';
$date = '2004';
$since = '2.2';
}
sub neo_pdb_misc {
$author = 'Sven Neumann <sven@gimp.org>';
$copyright = 'Sven Neumann';
$date = '2005';
$since = '2.4';
}
sub progress_init { sub progress_init {
$blurb = 'Initializes the progress bar for the current plug-in.'; $blurb = 'Initializes the progress bar for the current plug-in.';
@ -77,7 +63,8 @@ HELP
@inargs = ( @inargs = (
{ name => 'percentage', type => 'float', wrap => 1, { name => 'percentage', type => 'float', wrap => 1,
desc => 'Percentage of progress completed which must be between 0.0 and 1.0' } desc => 'Percentage of progress completed which must
be between 0.0 and 1.0' }
); );
%invoke = ( %invoke = (
@ -106,7 +93,7 @@ made. This usually causes the the progress bar to enter "activity
mode", where a block bounces back and forth. mode", where a block bounces back and forth.
HELP HELP
&neo_pdb_misc; &neo_pdb_misc('2005', '2.4');
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
@ -132,12 +119,13 @@ current plug-in. Unlike gimp_progress_init() it does not change the
displayed value. displayed value.
HELP HELP
&neo_pdb_misc; &neo_pdb_misc('2005', '2.4');
@inargs = ( @inargs = (
{ name => 'message', type => 'string', null_ok => 1, { name => 'message', type => 'string', null_ok => 1,
desc => 'Message to use in the progress dialog' } desc => 'Message to use in the progress dialog' }
); );
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
@ -160,12 +148,13 @@ sub progress_get_window_handle {
This function returns the native window ID of the toplevel window this plug-in\'s progress is displayed in. This function returns the native window ID of the toplevel window this plug-in\'s progress is displayed in.
HELP HELP
&mitch_pdb_misc; &mitch_pdb_misc('2004', '2.2');
@outargs = ( @outargs = (
{ name => 'window', type => 'int32', init => 1, { name => 'window', type => 'int32', init => 1,
desc => 'The progress bar\'s toplevel window' } desc => 'The progress bar\'s toplevel window' }
); );
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
@ -190,7 +179,7 @@ progress calls made by this plug-in and any procedure it calls. Calling
this function multiple times simply replaces the old progress callbacks. this function multiple times simply replaces the old progress callbacks.
HELP HELP
&mitch_pdb_misc; &mitch_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
{ name => 'progress_callback', type => 'string', { name => 'progress_callback', type => 'string',
@ -219,7 +208,7 @@ This function uninstalls any progress callback installed with
gimp_progress_install() before. gimp_progress_install() before.
HELP HELP
&mitch_pdb_misc; &mitch_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
{ name => 'progress_callback', type => 'string', { name => 'progress_callback', type => 'string',
@ -247,7 +236,7 @@ sub progress_cancel {
This function cancels the currently running progress. This function cancels the currently running progress.
HELP HELP
&mitch_pdb_misc; &mitch_pdb_misc('2004', '2.2');
@inargs = ( @inargs = (
{ name => 'progress_callback', type => 'string', { name => 'progress_callback', type => 'string',

View File

@ -17,32 +17,14 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub channel_arg () {{
name => 'channel',
type => 'channel',
desc => 'The channel'
}}
sub operation_arg () {{
name => 'operation',
type => 'enum GimpChannelOps',
desc => 'The selection operation: { %%desc%% }'
}}
sub coord_args {
my ($name, $desc, $args) = @_;
foreach (qw(x y)) {
push @$args, { name => eval qq/"$name"/, type => 'int32',
desc => eval qq/"$desc"/ }
}
}
sub selection_simple_proc { sub selection_simple_proc {
my $op = shift; my $op = shift;
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &std_image_arg ); @inargs = (
&std_image_arg
);
%invoke = ( code => "gimp_channel_$op (gimp_image_get_mask (gimage), TRUE);" ); %invoke = ( code => "gimp_channel_$op (gimp_image_get_mask (gimage), TRUE);" );
} }
@ -51,8 +33,7 @@ sub selection_change_proc {
my ($op, $arg, $type, $edge_lock) = @_; my ($op, $arg, $type, $edge_lock) = @_;
$blurb = "\u$op the image's selection"; $blurb = "\u$op the image's selection";
$help = "This procedure ${op}s the selection. ";
$help = "This procedure ${op}s the selection. ";
&std_pdb_misc; &std_pdb_misc;
@ -82,21 +63,23 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &std_image_arg ); @inargs = (
&std_image_arg
);
@outargs = ( @outargs = (
{ name => 'non_empty', type => 'boolean', void_ret => 1, { name => 'non_empty', type => 'boolean', void_ret => 1,
desc => 'True if there is a selection', init => 1 } desc => 'True if there is a selection', init => 1 },
{ name => 'x1', type => 'int32',
desc => 'x coordinate of upper left corner of selection bounds' },
{ name => 'y1', type => 'int32',
desc => 'y coordinate of upper left corner of selection bounds' },
{ name => 'x2', type => 'int32',
desc => 'x coordinate of lower right corner of selection bounds' },
{ name => 'y2', type => 'int32',
desc => 'y coordinate of lower right corner of selection bounds' }
); );
my $count = 1;
foreach ('upper left', 'lower right') {
&coord_args("\${_}$count",
"\$_ coordinate of $_ corner of selection bounds",
\@outargs);
$count++;
}
%invoke = ( %invoke = (
code => 'non_empty = gimp_channel_bounds (gimp_image_get_mask (gimage), &x1, &y1, &x2, &y2);' code => 'non_empty = gimp_channel_bounds (gimp_image_get_mask (gimage), &x1, &y1, &x2, &y2);'
); );
@ -112,8 +95,13 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &std_image_arg ); @inargs = (
&coord_args('$_', '$_ coordinate of value', \@inargs); &std_image_arg,
{ name => 'x', type => 'int32',
desc => 'x coordinate of value' },
{ name => 'y', type => 'int32',
desc => 'y coordinate of value' }
);
@outargs = ( @outargs = (
{ name => 'value', type => '0 <= int32 <= 255', { name => 'value', type => '0 <= int32 <= 255',
@ -133,7 +121,9 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &std_image_arg); @inargs = (
&std_image_arg
);
@outargs = ( @outargs = (
{ name => 'is_empty', type => 'boolean', { name => 'is_empty', type => 'boolean',
@ -155,8 +145,13 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &std_image_arg ); @inargs = (
&coord_args('off$_', '$_ offset for translation', \@inargs); &std_image_arg,
{ name => 'offx', type => 'int32',
desc => 'x offset for translation' },
{ name => 'offy', type => 'int32',
desc => 'y offset for translation' }
);
%invoke = ( code => 'gimp_item_translate (GIMP_ITEM (gimp_image_get_mask (gimage)), offx, offy, TRUE);' ); %invoke = ( code => 'gimp_item_translate (GIMP_ITEM (gimp_image_get_mask (gimage)), offx, offy, TRUE);' );
} }
@ -178,9 +173,12 @@ HELP
@inargs = ( @inargs = (
{ name => 'drawable', type => 'drawable', { name => 'drawable', type => 'drawable',
desc => 'The drawable from which to float selection' } desc => 'The drawable from which to float selection' },
{ name => 'offx', type => 'int32',
desc => 'x offset for translation' },
{ name => 'offy', type => 'int32',
desc => 'y offset for translation' }
); );
&coord_args('off$_', '$_ offset for translation', \@inargs);
@outargs = ( @outargs = (
{ name => 'layer', type => 'layer', wrap => 1, { name => 'layer', type => 'layer', wrap => 1,
@ -250,7 +248,9 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &std_image_arg ); @inargs = (
&std_image_arg
);
%invoke = ( code => "gimp_channel_clear (gimp_image_get_mask (gimage), NULL, TRUE);" ); %invoke = ( code => "gimp_channel_clear (gimp_image_get_mask (gimage), NULL, TRUE);" );
} }
@ -309,10 +309,10 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'GimpImage *gimage' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = gimp_item_get_image (GIMP_ITEM (layer)); GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (layer));
gimp_channel_select_alpha (gimp_image_get_mask (gimage), gimp_channel_select_alpha (gimp_image_get_mask (gimage),
GIMP_DRAWABLE (layer), GIMP_DRAWABLE (layer),
GIMP_CHANNEL_OP_REPLACE, FALSE, 0.0, 0.0); GIMP_CHANNEL_OP_REPLACE, FALSE, 0.0, 0.0);
@ -330,7 +330,10 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &channel_arg ); @inargs = (
{ name => 'channel', type => 'channel',
desc => 'The channel' }
);
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
@ -361,7 +364,12 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &channel_arg, &operation_arg ); @inargs = (
{ name => 'channel', type => 'channel',
desc => 'The channel' },
{ name => 'operation', type => 'enum GimpChannelOps',
desc => 'The selection operation: { %%desc%% }' }
);
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
@ -394,7 +402,9 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &std_image_arg ); @inargs = (
&std_image_arg
);
@outargs = ( @outargs = (
{ name => 'channel', type => 'channel', { name => 'channel', type => 'channel',

View File

@ -17,52 +17,6 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
# Selection Tools
# shortcuts
sub drawable_arg () {{
name => 'drawable',
type => 'drawable',
desc => 'The affected drawable',
}}
sub drawable_out_arg {
my $type = shift;
my $arg = &drawable_arg;
$arg->{desc} = "The $type drawable";
$arg->{no_declare} = 1;
$arg;
}
sub sample_merged_arg () {{
name => 'sample_merged',
type => 'boolean',
desc => 'Use the composite image, not the drawable'
}}
sub operation_arg () {{
name => 'operation',
type => 'enum GimpChannelOps',
desc => 'The selection operation: { %%desc%% }'
}}
sub threshold_arg () {{
name => 'threshold',
type => '0 <= int32 <= 255',
desc => 'Threshold in intensity levels %%desc%%'
}}
sub feather_select_args () {(
{ name => 'feather', type => 'boolean',
desc => 'Feather option for selections' },
{ name => 'feather_radius', type => 'float',
desc => 'Radius for feather operation' }
)}
# The defs
sub by_color_select { sub by_color_select {
$blurb = <<'BLURB'; $blurb = <<'BLURB';
Create a selection by selecting all pixels (in the specified drawable) with the Create a selection by selecting all pixels (in the specified drawable) with the
@ -86,21 +40,27 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'color', type => 'color', { name => 'color', type => 'color',
desc => 'The color to select' }, desc => 'The color to select' },
&threshold_arg, { name => 'threshold', type => '0 <= int32 <= 255',
&operation_arg, desc => 'Threshold in intensity levels %%desc%%' },
{ name => 'operation', type => 'enum GimpChannelOps',
desc => 'The selection operation: { %%desc%% }' },
&std_antialias_arg, &std_antialias_arg,
&feather_select_args, { name => 'feather', type => 'boolean',
&sample_merged_arg desc => 'Feather option for selections' },
{ name => 'feather_radius', type => 'float',
desc => 'Radius for feather operation' },
{ name => 'sample_merged', type => 'boolean',
desc => 'Use the composite image, not the drawable' }
); );
%invoke = ( %invoke = (
vars => [ 'GimpImage *gimage' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = gimp_item_get_image (GIMP_ITEM (drawable)); GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable));
gimp_channel_select_by_color (gimp_image_get_mask (gimage), drawable, gimp_channel_select_by_color (gimp_image_get_mask (gimage), drawable,
sample_merged, sample_merged,
@ -143,21 +103,27 @@ HELP
desc => 'The width of the ellipse: %%desc%%' }, desc => 'The width of the ellipse: %%desc%%' },
{ name => 'height', type => '0 < float', { name => 'height', type => '0 < float',
desc => 'The height of the ellipse: %%desc%%' }, desc => 'The height of the ellipse: %%desc%%' },
&operation_arg, { name => 'operation', type => 'enum GimpChannelOps',
desc => 'The selection operation: { %%desc%% }' },
&std_antialias_arg, &std_antialias_arg,
&feather_select_args { name => 'feather', type => 'boolean',
desc => 'Feather option for selections' },
{ name => 'feather_radius', type => 'float',
desc => 'Radius for feather operation' }
); );
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
gimp_channel_select_ellipse (gimp_image_get_mask (gimage), {
(gint) x, (gint) y, gimp_channel_select_ellipse (gimp_image_get_mask (gimage),
(gint) width, (gint) height, (gint) x, (gint) y,
operation, (gint) width, (gint) height,
antialias, operation,
feather, antialias,
feather_radius, feather,
feather_radius); feather_radius,
feather_radius);
}
CODE CODE
); );
} }
@ -187,22 +153,28 @@ HELP
array => { type => '2 <= int32', on_success => 'num_segs /= 2;', array => { type => '2 <= int32', on_success => 'num_segs /= 2;',
desc => 'Number of points (count 1 coordinate as two desc => 'Number of points (count 1 coordinate as two
points)' } }, points)' } },
&operation_arg, { name => 'operation', type => 'enum GimpChannelOps',
desc => 'The selection operation: { %%desc%% }' },
&std_antialias_arg, &std_antialias_arg,
&feather_select_args { name => 'feather', type => 'boolean',
desc => 'Feather option for selections' },
{ name => 'feather_radius', type => 'float',
desc => 'Radius for feather operation' }
); );
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
gimp_channel_select_polygon (gimp_image_get_mask (gimage), {
_("Free Select"), gimp_channel_select_polygon (gimp_image_get_mask (gimage),
num_segs, _("Free Select"),
(GimpVector2 *) segs, num_segs,
operation, (GimpVector2 *) segs,
antialias, operation,
feather, antialias,
feather_radius, feather,
feather_radius); feather_radius,
feather_radius);
}
CODE CODE
); );
} }
@ -234,25 +206,31 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'x', type => 'float', { name => 'x', type => 'float',
desc => 'x coordinate of initial seed fill point: (image desc => 'x coordinate of initial seed fill point: (image
coordinates)' }, coordinates)' },
{ name => 'y', type => 'float', { name => 'y', type => 'float',
desc => 'y coordinate of initial seed fill point: (image desc => 'y coordinate of initial seed fill point: (image
coordinates)' }, coordinates)' },
&threshold_arg, { name => 'threshold', type => '0 <= int32 <= 255',
&operation_arg, desc => 'Threshold in intensity levels %%desc%%' },
{ name => 'operation', type => 'enum GimpChannelOps',
desc => 'The selection operation: { %%desc%% }' },
&std_antialias_arg, &std_antialias_arg,
&feather_select_args, { name => 'feather', type => 'boolean',
&sample_merged_arg desc => 'Feather option for selections' },
{ name => 'feather_radius', type => 'float',
desc => 'Radius for feather operation' },
{ name => 'sample_merged', type => 'boolean',
desc => 'Use the composite image, not the drawable' }
); );
%invoke = ( %invoke = (
vars => [ 'GimpImage *gimage' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = gimp_item_get_image (GIMP_ITEM (drawable)); GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable));
gimp_channel_select_fuzzy (gimp_image_get_mask (gimage), gimp_channel_select_fuzzy (gimp_image_get_mask (gimage),
drawable, drawable,
@ -293,19 +271,25 @@ HELP
desc => 'The width of the rectangle: %%desc%%' }, desc => 'The width of the rectangle: %%desc%%' },
{ name => 'height', type => '0 < float', { name => 'height', type => '0 < float',
desc => 'The height of the rectangle: %%desc%%' }, desc => 'The height of the rectangle: %%desc%%' },
&operation_arg, { name => 'operation', type => 'enum GimpChannelOps',
&feather_select_args, desc => 'The selection operation: { %%desc%% }' },
{ name => 'feather', type => 'boolean',
desc => 'Feather option for selections' },
{ name => 'feather_radius', type => 'float',
desc => 'Radius for feather operation' }
); );
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
gimp_channel_select_rectangle (gimp_image_get_mask (gimage), {
(gint) x, (gint) y, gimp_channel_select_rectangle (gimp_image_get_mask (gimage),
(gint) width, (gint) height, (gint) x, (gint) y,
operation, (gint) width, (gint) height,
feather, operation,
feather_radius, feather,
feather_radius); feather_radius,
feather_radius);
}
CODE CODE
); );
} }

View File

@ -17,47 +17,24 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
# Text
sub pdb_misc {
&std_pdb_misc;
$author = 'Martin Edlman';
$date = '1998';
}
sub text_arg () {{
name => 'text',
type => 'string',
desc => 'The text to generate (in UTF-8 encoding)'
}}
sub fontname_arg () {{
name => 'fontname',
type => 'string',
desc => 'The name of the font'
}}
sub size_args () {(
{ name => 'size', type => '0 < float',
desc => 'The size of text in either pixels or points' },
{ name => 'size_type', type => 'enum GimpSizeType',
desc => 'The units of specified size: %%desc%%' }
)}
sub render_args () {( sub render_args () {(
&std_image_arg, &std_image_arg,
{ name => 'drawable', type => 'drawable', { name => 'drawable', type => 'drawable',
desc => 'The affected drawable: (-1 for a new text layer)', desc => 'The affected drawable: (-1 for a new text layer)',
no_success => 1 }, no_success => 1 },
{ name => 'x', type => 'float', { name => 'x', type => 'float',
desc => 'The x coordinate for the left of the text bounding box' }, desc => 'The x coordinate for the left of the text bounding box' },
{ name => 'y', type => 'float', { name => 'y', type => 'float',
desc => 'The y coordinate for the top of the text bounding box' }, desc => 'The y coordinate for the top of the text bounding box' },
&text_arg, { name => 'text', type => 'string',
{ name => 'border', type => '-1 <= int32', desc => 'The text to generate (in UTF-8 encoding)' },
desc => 'The size of the border: %%desc%%' }, { name => 'border', type => '-1 <= int32',
&std_antialias_arg, desc => 'The size of the border: %%desc%%' },
&size_args &std_antialias_arg,
{ name => 'size', type => '0 < float',
desc => 'The size of text in either pixels or points' },
{ name => 'size_type', type => 'enum GimpSizeType',
desc => 'The units of specified size: %%desc%%' }
)} )}
@props = qw(foundry family weight slant set_width spacing registry encoding); @props = qw(foundry family weight slant set_width spacing registry encoding);
@ -72,14 +49,6 @@ sub font_prop_args {
@result; @result;
} }
sub render_outargs {
@outargs = (
{ name => 'text_layer', type => 'layer',
desc => 'The new text layer or -1 if no layer was created.',
init => 1, return_fail => -1 }
);
}
sub extents_outargs { sub extents_outargs {
foreach (qw(width height ascent descent)) { foreach (qw(width height ascent descent)) {
push @outargs, { name => $_, type => 'int32', push @outargs, { name => $_, type => 'int32',
@ -105,16 +74,21 @@ around the final rendered text. The border is measured in pixels.
HELP HELP
&pdb_misc; &std_pdb_misc;
$author .= ' & Sven Neumann'; $author = 'Martin Edlman & Sven Neumann';
$date .= '- 2001'; $date = '1998- 2001';
@inargs = ( @inargs = (
&render_args, &render_args,
&fontname_arg { name => 'fontname', type => 'string',
desc => 'The name of the font' }
); );
&render_outargs; @outargs = (
{ name => 'text_layer', type => 'layer',
desc => 'The new text layer or -1 if no layer was created.',
init => 1, return_fail => -1 }
);
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
@ -146,24 +120,28 @@ string with the specified font information. Ascent and descent for the
specified font are returned as well. specified font are returned as well.
HELP HELP
&pdb_misc; &std_pdb_misc;
$author .= ' & Sven Neumann'; $author = 'Martin Edlman & Sven Neumann';
$date .= '- 2001'; $date = '1998- 2001';
@inargs = ( @inargs = (
&text_arg, { name => 'text', type => 'string',
&size_args, desc => 'The text to generate (in UTF-8 encoding)' },
&fontname_arg { name => 'size', type => '0 < float',
desc => 'The size of text in either pixels or points' },
{ name => 'size_type', type => 'enum GimpSizeType',
desc => 'The units of specified size: %%desc%%' },
{ name => 'fontname', type => 'string',
desc => 'The name of the font' }
); );
&extents_outargs; &extents_outargs;
$outargs[0]->{void_ret} = 1; $outargs[0]->{void_ret} = 1;
%invoke = ( %invoke = (
vars => [ 'gchar *real_fontname' ],
code => <<'CODE' code => <<'CODE'
{ {
real_fontname = g_strdup_printf ("%s %d", fontname, (gint) size); gchar *real_fontname = g_strdup_printf ("%s %d", fontname, (gint) size);
success = text_get_extents (real_fontname, text, success = text_get_extents (real_fontname, text,
&width, &height, &width, &height,
@ -183,7 +161,11 @@ sub text {
&font_prop_args &font_prop_args
); );
&render_outargs; @outargs = (
{ name => 'text_layer', type => 'layer',
desc => 'The new text layer or -1 if no layer was created.',
init => 1, return_fail => -1 }
);
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
@ -210,8 +192,12 @@ sub text_get_extents {
&std_pdb_deprecated ('gimp-text-get-extents-fontname'); &std_pdb_deprecated ('gimp-text-get-extents-fontname');
@inargs = ( @inargs = (
&text_arg, { name => 'text', type => 'string',
&size_args, desc => 'The text to generate (in UTF-8 encoding)' },
{ name => 'size', type => '0 < float',
desc => 'The size of text in either pixels or points' },
{ name => 'size_type', type => 'enum GimpSizeType',
desc => 'The units of specified size: %%desc%%' },
&font_prop_args &font_prop_args
); );
@ -219,10 +205,9 @@ sub text_get_extents {
$outargs[0]->{void_ret} = 1; $outargs[0]->{void_ret} = 1;
%invoke = ( %invoke = (
vars => [ 'gchar *real_fontname' ],
code => <<'CODE' code => <<'CODE'
{ {
real_fontname = g_strdup_printf ("%s %d", family, (gint) size); gchar *real_fontname = g_strdup_printf ("%s %d", family, (gint) size);
success = text_get_extents (real_fontname, text, success = text_get_extents (real_fontname, text,
&width, &height, &width, &height,

View File

@ -17,37 +17,20 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
# Transform Tools
# shortcuts
sub drawable_arg () {{
name => 'drawable',
type => 'drawable',
desc => 'The affected drawable',
}}
sub drawable_out_arg {
my $type = shift;
my $arg = &drawable_arg;
$arg->{desc} = "The $type drawable";
$arg->{no_declare} = 1;
$arg;
}
# The defs
sub flip { sub flip {
&std_pdb_deprecated ('gimp-drawable-transform-flip-simple'); &std_pdb_deprecated ('gimp-drawable-transform-flip-simple');
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'flip_type', type => &std_orientation_enum, { name => 'flip_type', type => &std_orientation_enum,
desc => 'Type of flip: %%desc%%' } desc => 'Type of flip: %%desc%%' }
); );
@outargs = ( &drawable_out_arg('flipped') ); @outargs = (
{ name => 'drawable', type => 'drawable', no_declare => 1,
desc => 'The flipped drawable' }
);
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
@ -71,7 +54,8 @@ sub perspective {
&std_pdb_deprecated ('gimp-drawable-transform-perspective-default'); &std_pdb_deprecated ('gimp-drawable-transform-perspective-default');
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'interpolation', type => 'boolean', { name => 'interpolation', type => 'boolean',
desc => 'Whether to use interpolation' } desc => 'Whether to use interpolation' }
); );
@ -88,7 +72,10 @@ sub perspective {
$pos++; $pos++;
} }
@outargs = ( &drawable_out_arg('newly mapped') ); @outargs = (
{ name => 'drawable', type => 'drawable', no_declare => 1,
desc => 'The newly mapped drawable' }
);
%invoke = ( %invoke = (
vars => [ 'gdouble trans_info[8]' ], vars => [ 'gdouble trans_info[8]' ],
@ -138,14 +125,18 @@ sub rotate {
&std_pdb_deprecated ('gimp-drawable-transform-rotate-default'); &std_pdb_deprecated ('gimp-drawable-transform-rotate-default');
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'interpolation', type => 'boolean', { name => 'interpolation', type => 'boolean',
desc => 'Whether to use interpolation' }, desc => 'Whether to use interpolation' },
{ name => 'angle', type => 'float', { name => 'angle', type => 'float',
desc => 'The angle of rotation (radians)' } desc => 'The angle of rotation (radians)' }
); );
@outargs = ( &drawable_out_arg('rotated') ); @outargs = (
{ name => 'drawable', type => 'drawable', no_declare => 1,
desc => 'The rotated drawable' }
);
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
@ -190,24 +181,32 @@ sub scale {
&std_pdb_deprecated ('gimp-drawable-transform-scale-default'); &std_pdb_deprecated ('gimp-drawable-transform-scale-default');
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'interpolation', type => 'boolean', { name => 'interpolation', type => 'boolean',
desc => 'Whether to use interpolation' } desc => 'Whether to use interpolation' },
{ name => 'x0', type => 'float',
desc => 'The new x coordinate of the upper-left corner of the
scaled region',
alias => 'trans_info[X0]', no_declare => 1 },
{ name => 'y0', type => 'float',
desc => 'The new y coordinate of the upper-left corner of the
scaled region',
alias => 'trans_info[Y0]', no_declare => 1 },
{ name => 'x1', type => 'float',
desc => 'The new x coordinate of the lower-right corner of the
scaled region',
alias => 'trans_info[X1]', no_declare => 1 },
{ name => 'y1', type => 'float',
desc => 'The new y coordinate of the lower-right corner of the
scaled region',
alias => 'trans_info[Y1]', no_declare => 1 }
); );
my $pos = 0; @outargs = (
foreach $where (qw(upper-left lower-right)) { { name => 'drawable', type => 'drawable', no_declare => 1,
foreach (qw(x y)) { desc => 'The scaled drawable' }
push @inargs, );
{ name => "$_$pos", type => 'float',
desc => "The new $_ coordinate of $where corner of newly
scaled region",
alias => "trans_info[\U$_\E$pos]", no_declare => 1 }
}
$pos++;
}
@outargs = ( &drawable_out_arg('scaled') );
%invoke = ( %invoke = (
vars => [ 'gdouble trans_info[4]' ], vars => [ 'gdouble trans_info[4]' ],
@ -259,7 +258,8 @@ sub shear {
&std_pdb_deprecated ('gimp-drawable-transform-shear-default'); &std_pdb_deprecated ('gimp-drawable-transform-shear-default');
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'interpolation', type => 'boolean', { name => 'interpolation', type => 'boolean',
desc => 'Whether to use interpolation' }, desc => 'Whether to use interpolation' },
{ name => 'shear_type', type => &std_orientation_enum, { name => 'shear_type', type => &std_orientation_enum,
@ -268,7 +268,10 @@ sub shear {
desc => 'The magnitude of the shear' } desc => 'The magnitude of the shear' }
); );
@outargs = ( &drawable_out_arg('sheared') ); @outargs = (
{ name => 'drawable', type => 'drawable', no_declare => 1,
desc => 'The sheared drawable' }
);
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
@ -314,7 +317,8 @@ sub transform_2d {
&std_pdb_deprecated ('gimp-drawable-transform-2d-default'); &std_pdb_deprecated ('gimp-drawable-transform-2d-default');
@inargs = ( @inargs = (
&drawable_arg, { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
{ name => 'interpolation', type => 'boolean', { name => 'interpolation', type => 'boolean',
desc => 'Whether to use interpolation' }, desc => 'Whether to use interpolation' },
{ name => 'source_x', type => 'float', { name => 'source_x', type => 'float',
@ -333,7 +337,10 @@ sub transform_2d {
desc => 'Y coordinate of where the centre goes' } desc => 'Y coordinate of where the centre goes' }
); );
@outargs = ( &drawable_out_arg('transformed') ); @outargs = (
{ name => 'drawable', type => 'drawable', no_declare => 1,
desc => 'The transformed drawable' }
);
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'

View File

@ -17,8 +17,6 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
# The defs
sub image_undo_group_start { sub image_undo_group_start {
$blurb = 'Starts a group undo.'; $blurb = 'Starts a group undo.';
@ -35,9 +33,10 @@ HELP
$inargs[0]->{desc} = 'The ID of the image in which to open an undo group'; $inargs[0]->{desc} = 'The ID of the image in which to open an undo group';
%invoke = ( headers => [ qw("core/gimp.h" "plug-in/plug-in.h") ], %invoke = ( headers => [ qw("core/gimp.h" "plug-in/plug-in.h") ],
vars => [ 'gchar *undo_desc = NULL' ],
code => <<CODE code => <<CODE
{ {
gchar *undo_desc = NULL;
if (gimp->current_plug_in) if (gimp->current_plug_in)
undo_desc = plug_in_get_undo_desc (gimp->current_plug_in); undo_desc = plug_in_get_undo_desc (gimp->current_plug_in);
@ -77,8 +76,7 @@ and want to check if their caller has already used 'gimp_image_undo_disable'
or 'gimp_image_undo_freeze'. or 'gimp_image_undo_freeze'.
HELP HELP
$author = $copyright = 'Raphael Quinet'; &raphael_pdb_misc('1999');
$date = '1999';
@inargs = ( &std_image_arg ); @inargs = ( &std_image_arg );
@ -138,8 +136,7 @@ HELP
sub image_undo_freeze { sub image_undo_freeze {
$blurb = "Freeze the image's undo stack."; $blurb = "Freeze the image's undo stack.";
$author = $copyright = 'Adam D. Moss'; &adam_pdb_misc('1999');
$date = '1999';
$help = <<'HELP'; $help = <<'HELP';
This procedure freezes the image's undo stack, allowing subsequent operations This procedure freezes the image's undo stack, allowing subsequent operations
@ -167,8 +164,7 @@ HELP
sub image_undo_thaw { sub image_undo_thaw {
$blurb = "Thaw the image's undo stack."; $blurb = "Thaw the image's undo stack.";
$author = $copyright = 'Adam D. Moss'; &adam_pdb_misc('1999');
$date = '1999';
$help = <<'HELP'; $help = <<'HELP';
This procedure thaws the image's undo stack, allowing subsequent operations to This procedure thaws the image's undo stack, allowing subsequent operations to

View File

@ -17,28 +17,19 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub pdb_misc {
$author = $copyright = 'Michael Natterer';
$date = '1999';
}
sub unit_arg () {{
name => 'unit_id',
type => 'unit',
desc => "The unit's integer ID",
alias => 'unit',
wrap => 1
}}
sub unit_prop_proc { sub unit_prop_proc {
my ($prop, $type, $desc) = @_; my ($prop, $type, $desc) = @_;
$desc = $prop unless $desc; $desc = $prop unless $desc;
$blurb = "Returns the $desc of the unit."; $blurb = "Returns the $desc of the unit.";
&pdb_misc; &mitch_pdb_misc('1999');
@inargs = ( &unit_arg ); @inargs = (
{ name => 'unit_id', type => 'unit',
desc => "The unit's integer ID",
alias => 'unit', wrap => 1 }
);
@outargs = ( @outargs = (
{ name => $prop, type => $type, { name => $prop, type => $type,
@ -57,7 +48,7 @@ sub unit_get_number_of_units {
$help = 'This procedure returns the number of defined units.'; $help = 'This procedure returns the number of defined units.';
&pdb_misc; &mitch_pdb_misc('1999');
@outargs = ( @outargs = (
{ name => 'num_units', type => 'int32', libdef => 'GIMP_UNIT_END', { name => 'num_units', type => 'int32', libdef => 'GIMP_UNIT_END',
@ -73,7 +64,7 @@ sub unit_get_number_of_built_in_units {
This procedure returns the number of defined units built-in to the GIMP. This procedure returns the number of defined units built-in to the GIMP.
HELP HELP
&pdb_misc; &mitch_pdb_misc('1999');
@outargs = ( @outargs = (
{ name => 'num_units', type => 'int32', libdef => 'GIMP_UNIT_END', { name => 'num_units', type => 'int32', libdef => 'GIMP_UNIT_END',
@ -92,7 +83,7 @@ new unit will have it's deletion flag set to TRUE, so you will have to set it
to FALSE with gimp_unit_set_deletion_flag to make it persistent. to FALSE with gimp_unit_set_deletion_flag to make it persistent.
HELP HELP
&pdb_misc; &mitch_pdb_misc('1999');
@inargs = ( @inargs = (
{ name => 'identifier', type => 'string', wrap => 1, { name => 'identifier', type => 'string', wrap => 1,
@ -111,15 +102,18 @@ HELP
desc => "The new unit's plural form" } desc => "The new unit's plural form" }
); );
@outargs = ( &unit_arg ); @outargs = (
$outargs[0]->{desc} = "The new unit's ID"; { name => 'unit_id', type => 'unit', init => 1,
$outargs[0]->{init} = 1; desc => "The new unit's ID",
$outargs[0]->{libdef} = 'GIMP_UNIT_INCH'; alias => 'unit', wrap => 1, libdef => 'GIMP_UNIT_INCH' }
);
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
unit = _gimp_unit_new (gimp, identifier, factor, digits, symbol, abbreviation, {
singular, plural); unit = _gimp_unit_new (gimp, identifier, factor, digits, symbol, abbreviation,
singular, plural);
}
CODE CODE
); );
} }
@ -142,10 +136,12 @@ TRUE on gimp exit, this unit's definition will not be saved in the user's
unitrc. unitrc.
HELP HELP
&pdb_misc; &mitch_pdb_misc('1999');
@inargs = ( @inargs = (
&unit_arg, { name => 'unit_id', type => 'unit',
desc => "The unit's integer ID",
alias => 'unit', wrap => 1 },
{ name => 'deletion_flag', type => 'boolean', { name => 'deletion_flag', type => 'boolean',
desc => 'The new deletion flag of the unit' } desc => 'The new deletion flag of the unit' }
); );
@ -199,17 +195,13 @@ HELP
} }
sub unit_get_singular { sub unit_get_singular {
$help = <<'HELP'; $help = 'This procedure returns the singular form of the unit.';
This procedure returns the singular form of the unit.
HELP
&unit_prop_proc('singular', 'string', 'singular form'); &unit_prop_proc('singular', 'string', 'singular form');
} }
sub unit_get_plural { sub unit_get_plural {
$help = <<'HELP'; $help = 'This procedure returns the plural form of the unit.';
This procedure returns the plural form of the unit.
HELP
&unit_prop_proc('plural', 'string', 'plural form'); &unit_prop_proc('plural', 'string', 'plural form');
} }

View File

@ -15,29 +15,6 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
sub pdb_misc {
$author = $copyright = 'Simon Budig';
$date = '2005';
$since = '2.4';
}
# The defs
sub vectors_arg () {{
name => 'vectors',
type => 'vectors',
desc => 'The vectors object'
}}
sub stroke_arg () {
&vectors_arg,
{
name => 'stroke_id',
type => 'int32',
desc => 'The stroke ID'
}}
sub vectors_new { sub vectors_new {
$blurb = 'Creates a new empty vectors object. Needs to be added to an image using gimp_image_add_vectors.'; $blurb = 'Creates a new empty vectors object. Needs to be added to an image using gimp_image_add_vectors.';
@ -45,17 +22,18 @@ sub vectors_new {
Creates a new empty vectors object. Needs to be added to an image using gimp_image_add_vectors. Creates a new empty vectors object. Needs to be added to an image using gimp_image_add_vectors.
HELP HELP
&pdb_misc; &simon_pdb_misc('2005', '2.4');
@inargs = ( &std_image_arg, @inargs = (
&std_image_arg,
{ name => 'name', type => 'string', { name => 'name', type => 'string',
desc => 'the name of the new vector object.', desc => 'the name of the new vector object.' }
init => 1 }
); );
@outargs = ( @outargs = (
{ name => 'vectors', type => 'vectors', { name => 'vectors', type => 'vectors',
desc => 'the current vector object, 0 if no vector exists in the image.', desc => 'the current vector object, 0 if no vector exists
in the image.',
init => 1 } init => 1 }
); );
@ -71,19 +49,17 @@ CODE
sub vectors_get_current { sub vectors_get_current {
$blurb = 'Gets the current path in the given image.'; $blurb = 'Gets the current path in the given image.';
$help = 'Gets the current path in the given image.';
$help = <<'HELP'; &simon_pdb_misc('2005', '2.4');
Gets the current path in the given image.
HELP
&pdb_misc;
@inargs = ( &std_image_arg ); @inargs = ( &std_image_arg );
$inargs[0]->{desc} = 'The ID of the image to get the current path from.'; $inargs[0]->{desc} = 'The ID of the image to get the current path from.';
@outargs = ( @outargs = (
{ name => 'vectors', type => 'vectors', { name => 'vectors', type => 'vectors',
desc => 'the current vector object, 0 if no vector exists in the image.', desc => 'the current vector object, 0 if no vector exists
in the image.',
init => 1 } init => 1 }
); );
@ -99,19 +75,18 @@ CODE
sub vectors_get_image { sub vectors_get_image {
$blurb = 'Returns the vectors objects image.'; $blurb = 'Returns the vectors objects image.';
$help = 'Returns the vectors objects image.';
$help = <<'HELP'; &simon_pdb_misc('2005', '2.4');
Returns the vectors objects image.
HELP
&pdb_misc; @inargs = (
{ name => 'vectors', type => 'vectors',
@inargs = ( &vectors_arg ); desc => 'The vectors object' }
);
@outargs = ( @outargs = (
{ name => 'image', type => 'image', { name => 'image', type => 'image',
desc => 'The vectors image', desc => 'The vectors image', init => 1 }
init => 1 }
); );
%invoke = ( %invoke = (
@ -126,14 +101,14 @@ CODE
sub vectors_get_linked { sub vectors_get_linked {
$blurb = 'Gets the linked state of the vectors object.'; $blurb = 'Gets the linked state of the vectors object.';
$help = 'Gets the linked state of the vectors object.';
$help = <<'HELP'; &simon_pdb_misc('2005', '2.4');
Gets the linked state of the vectors object.
HELP
&pdb_misc; @inargs = (
{ name => 'vectors', type => 'vectors',
@inargs = ( &vectors_arg ); desc => 'The vectors object' }
);
@outargs = ( @outargs = (
{ name => 'linked', type => 'boolean', { name => 'linked', type => 'boolean',
@ -152,16 +127,15 @@ CODE
sub vectors_set_linked { sub vectors_set_linked {
$blurb = 'Sets the linked state of the vectors object.'; $blurb = 'Sets the linked state of the vectors object.';
$help = 'Sets the linked state of the vectors object.';
$help = <<'HELP'; &simon_pdb_misc('2005', '2.4');
Sets the linked state of the vectors object.
HELP
&pdb_misc; @inargs = (
{ name => 'vectors', type => 'vectors',
@inargs = ( &vectors_arg, desc => 'The vectors object' },
{ name => 'linked', type => 'boolean', { name => 'linked', type => 'boolean',
desc => 'Whether the path is linked', init => 1 } desc => 'Whether the path is linked' }
); );
%invoke = ( %invoke = (
@ -176,19 +150,18 @@ CODE
sub vectors_get_tattoo { sub vectors_get_tattoo {
$blurb = 'Get the tattoo of the vectors object.'; $blurb = 'Get the tattoo of the vectors object.';
$help = 'Get the tattoo state of the vectors object.';
$help = <<'HELP'; &simon_pdb_misc('2005', '2.4');
Get the tattoo state of the vectors object.
HELP
&pdb_misc; @inargs = (
{ name => 'vectors', type => 'vectors',
@inargs = ( &vectors_arg ); desc => 'The vectors object' }
);
@outargs = ( @outargs = (
{ name => 'tattoo', type => 'int32', { name => 'tattoo', type => 'int32',
desc => 'The vectors tattoo', desc => 'The vectors tattoo', init => 1 }
init => 1 }
); );
%invoke = ( %invoke = (
@ -203,17 +176,15 @@ CODE
sub vectors_set_tattoo { sub vectors_set_tattoo {
$blurb = 'Set the tattoo of the vectors object.'; $blurb = 'Set the tattoo of the vectors object.';
$help = 'Set the tattoo of the vectors object.';
$help = <<'HELP'; &simon_pdb_misc('2005', '2.4');
Set the tattoo of the vectors object.
HELP
&pdb_misc; @inargs = (
{ name => 'vectors', type => 'vectors',
@inargs = ( &vectors_arg, desc => 'The vectors object' },
{ name => 'tattoo', type => 'int32', { name => 'tattoo', type => 'int32',
desc => 'the new tattoo', desc => 'the new tattoo' }
init => 1 }
); );
%invoke = ( %invoke = (
@ -228,14 +199,14 @@ CODE
sub vectors_get_visible { sub vectors_get_visible {
$blurb = 'Gets the visibility of the vectors object.'; $blurb = 'Gets the visibility of the vectors object.';
$help = 'Gets the visibility of the vectors object.';
$help = <<'HELP'; &simon_pdb_misc('2005', '2.4');
Gets the visibility of the vectors object.
HELP
&pdb_misc; @inargs = (
{ name => 'vectors', type => 'vectors',
@inargs = ( &vectors_arg ); desc => 'The vectors object' }
);
@outargs = ( @outargs = (
{ name => 'visible', type => 'boolean', { name => 'visible', type => 'boolean',
@ -254,17 +225,15 @@ CODE
sub vectors_set_visible { sub vectors_set_visible {
$blurb = 'Sets the visibility of the vectors object.'; $blurb = 'Sets the visibility of the vectors object.';
$help = 'Sets the visibility of the vectors object.';
$help = <<'HELP'; &simon_pdb_misc('2005', '2.4');
Sets the visibility of the vectors object.
HELP
&pdb_misc; @inargs = (
{ name => 'vectors', type => 'vectors',
@inargs = ( &vectors_arg, desc => 'The vectors object' },
{ name => 'visible', type => 'boolean', { name => 'visible', type => 'boolean',
desc => 'Whether the path is visible', desc => 'Whether the path is visible' }
init => 1 }
); );
%invoke = ( %invoke = (
@ -279,19 +248,18 @@ CODE
sub vectors_get_name { sub vectors_get_name {
$blurb = 'Gets the name of the vectors object.'; $blurb = 'Gets the name of the vectors object.';
$help = 'Gets the name of the vectors object.';
$help = <<'HELP'; &simon_pdb_misc('2005', '2.4');
Gets the name of the vectors object.
HELP
&pdb_misc; @inargs = (
{ name => 'vectors', type => 'vectors',
@inargs = ( &vectors_arg ); desc => 'The vectors object' }
);
@outargs = ( @outargs = (
{ name => 'name', type => 'string', { name => 'name', type => 'string',
desc => 'The name of the vectors object', desc => 'The name of the vectors object', init => 1 }
init => 1 }
); );
%invoke = ( %invoke = (
@ -306,17 +274,15 @@ CODE
sub vectors_set_name { sub vectors_set_name {
$blurb = 'Sets the name of the vectors object.'; $blurb = 'Sets the name of the vectors object.';
$help = 'Sets the name of the vectors object.';
$help = <<'HELP'; &simon_pdb_misc('2005', '2.4');
Sets the name of the vectors object.
HELP
&pdb_misc; @inargs = (
{ name => 'vectors', type => 'vectors',
@inargs = ( &vectors_arg, desc => 'The vectors object' },
{ name => 'name', type => 'string', { name => 'name', type => 'string',
desc => 'the new name of the path', desc => 'the new name of the path' }
init => 1 }
); );
%invoke = ( %invoke = (
@ -337,9 +303,12 @@ sub vectors_get_strokes {
Returns an Array with the stroke-IDs associated with the passed path. Returns an Array with the stroke-IDs associated with the passed path.
HELP HELP
&pdb_misc; &simon_pdb_misc('2005', '2.4');
@inargs = ( &vectors_arg ); @inargs = (
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' }
);
@outargs = ( @outargs = (
{ name => 'stroke_ids', type => 'int32array', { name => 'stroke_ids', type => 'int32array',
@ -351,13 +320,15 @@ HELP
); );
%invoke = ( %invoke = (
vars => ['gint i = 0', 'GimpStroke *cur_stroke = NULL'],
code => <<"CODE" code => <<"CODE"
{ {
num_strokes = gimp_vectors_get_n_strokes (vectors); num_strokes = gimp_vectors_get_n_strokes (vectors);
if (num_strokes) if (num_strokes)
{ {
GimpStroke *cur_stroke;
gint i = 0;
stroke_ids = g_new (gint32, num_strokes); stroke_ids = g_new (gint32, num_strokes);
for (cur_stroke = gimp_vectors_stroke_get_next (vectors, NULL); for (cur_stroke = gimp_vectors_stroke_get_next (vectors, NULL);
@ -375,37 +346,34 @@ CODE
sub vectors_stroke_get_length { sub vectors_stroke_get_length {
$blurb = 'measures the length of the given stroke.'; $blurb = 'Measure the length of the given stroke.';
$help = 'Measure the length of the given stroke.';
$help = <<'HELP'; &simon_pdb_misc('2005', '2.4');
Measure the length of the given stroke.
HELP
&pdb_misc; @inargs = (
{ name => 'vectors', type => 'vectors',
@inargs = ( &stroke_arg, desc => 'The vectors object' },
{ name => 'prescision', type => 'float', { name => 'stroke_id', type => 'int32',
desc => 'The prescision used for the approximation' } ); desc => 'The stroke ID' },
{ name => 'prescision', type => 'float',
desc => 'The prescision used for the approximation' }
);
@outargs = ( @outargs = (
{ name => 'length', type => 'float', { name => 'length', type => 'float', init => 1,
desc => 'The length (in pixels) of the given stroke.' } desc => 'The length (in pixels) of the given stroke.' }
); );
%invoke = ( %invoke = (
vars => [ 'GimpStroke *stroke' ],
code => <<"CODE" code => <<"CODE"
{ {
stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id); GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
if (!stroke) if (stroke)
{ length = gimp_stroke_get_length (stroke, prescision);
success = FALSE;
}
else else
{ success = FALSE;
length = gimp_stroke_get_length (stroke, prescision);
}
} }
CODE CODE
); );
@ -423,13 +391,18 @@ start of the path is the first point on the path that was created. This might
not be obvious. If the stroke is not long enough, a "valid" flag will be FALSE. not be obvious. If the stroke is not long enough, a "valid" flag will be FALSE.
HELP HELP
&pdb_misc; &simon_pdb_misc('2005', '2.4');
@inargs = ( &stroke_arg, @inargs = (
{ name => 'dist', type => 'float', { name => 'vectors', type => 'vectors',
desc => 'The given distance.' }, desc => 'The vectors object' },
{ name => 'prescision', type => 'float', { name => 'stroke_id', type => 'int32',
desc => 'The prescision used for the approximation' } ); desc => 'The stroke ID' },
{ name => 'dist', type => 'float',
desc => 'The given distance.' },
{ name => 'prescision', type => 'float',
desc => 'The prescision used for the approximation' }
);
@outargs = ( @outargs = (
{ name => 'x_point', type => 'float', { name => 'x_point', type => 'float',
@ -444,14 +417,14 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'GimpStroke *stroke',
'GimpCoords coord'],
code => <<"CODE" code => <<"CODE"
{ {
stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id); GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
if (stroke) if (stroke)
{ {
GimpCoords coord;
valid = gimp_stroke_get_point_at_dist (stroke, dist, prescision, valid = gimp_stroke_get_point_at_dist (stroke, dist, prescision,
&coord, &slope); &coord, &slope);
x_point = valid ? coord.x : 0; x_point = valid ? coord.x : 0;
@ -474,15 +447,19 @@ sub vectors_stroke_remove {
Remove the stroke from a vectors object. Remove the stroke from a vectors object.
HELP HELP
&pdb_misc; &simon_pdb_misc('2005', '2.4');
@inargs = ( &stroke_arg ); @inargs = (
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' },
{ name => 'stroke_id', type => 'int32',
desc => 'The stroke ID' }
);
%invoke = ( %invoke = (
vars => [ 'GimpStroke *stroke' ],
code => <<"CODE" code => <<"CODE"
{ {
stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id); GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
if (stroke) if (stroke)
gimp_vectors_stroke_remove (vectors, stroke); gimp_vectors_stroke_remove (vectors, stroke);
@ -501,15 +478,19 @@ sub vectors_stroke_close {
Closes the specified stroke. Closes the specified stroke.
HELP HELP
&pdb_misc; &simon_pdb_misc('2005', '2.4');
@inargs = ( &stroke_arg ); @inargs = (
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' },
{ name => 'stroke_id', type => 'int32',
desc => 'The stroke ID' }
);
%invoke = ( %invoke = (
vars => [ 'GimpStroke *stroke' ],
code => <<"CODE" code => <<"CODE"
{ {
stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id); GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
if (stroke) if (stroke)
gimp_stroke_close (stroke); gimp_stroke_close (stroke);
@ -528,19 +509,23 @@ sub vectors_stroke_translate {
Translate the given stroke. Translate the given stroke.
HELP HELP
&pdb_misc; &simon_pdb_misc('2005', '2.4');
@inargs = ( &stroke_arg ); @inargs = (
foreach (qw(x y)) { { name => 'vectors', type => 'vectors',
push @inargs, { name => "off_$_", type => 'int32', desc => 'The vectors object' },
desc => "Offset in $_ direction" } { name => 'stroke_id', type => 'int32',
} desc => 'The stroke ID' },
{ name => "off_x", type => 'int32',
desc => "Offset in x direction" },
{ name => "off_y", type => 'int32',
desc => "Offset in y direction" }
);
%invoke = ( %invoke = (
vars => [ 'GimpStroke *stroke' ],
code => <<"CODE" code => <<"CODE"
{ {
stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id); GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
if (stroke) if (stroke)
gimp_stroke_translate (stroke, off_x, off_y); gimp_stroke_translate (stroke, off_x, off_y);
@ -558,19 +543,23 @@ sub vectors_stroke_scale {
Scale the given stroke. Scale the given stroke.
HELP HELP
&pdb_misc; &simon_pdb_misc('2005', '2.4');
@inargs = ( &stroke_arg ); @inargs = (
foreach (qw(x y)) { { name => 'vectors', type => 'vectors',
push @inargs, { name => "scale_$_", type => 'float', desc => 'The vectors object' },
desc => "Scale factor in $_ direction" } { name => 'stroke_id', type => 'int32',
} desc => 'The stroke ID' },
{ name => "scale_x", type => 'float',
desc => "Scale factor in x direction" },
{ name => "scale_y", type => 'float',
desc => "Scale factor in y direction" }
);
%invoke = ( %invoke = (
vars => [ 'GimpStroke *stroke' ],
code => <<"CODE" code => <<"CODE"
{ {
stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id); GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
if (stroke) if (stroke)
gimp_stroke_scale (stroke, scale_x, scale_y); gimp_stroke_scale (stroke, scale_x, scale_y);
@ -588,11 +577,16 @@ sub vectors_stroke_interpolate {
returns polygonal approximation of the stroke. returns polygonal approximation of the stroke.
HELP HELP
&pdb_misc; &simon_pdb_misc('2005', '2.4');
@inargs = ( &stroke_arg, @inargs = (
{ name => 'prescision', type => 'float', { name => 'vectors', type => 'vectors',
desc => 'The prescision used for the approximation' } ); desc => 'The vectors object' },
{ name => 'stroke_id', type => 'int32',
desc => 'The stroke ID' },
{ name => 'prescision', type => 'float',
desc => 'The prescision used for the approximation' }
);
@outargs = ( @outargs = (
{ name => 'closed', type => 'boolean', { name => 'closed', type => 'boolean',
@ -606,16 +600,17 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'GimpStroke *stroke',
'GArray *coords_array',
'gint i' ],
code => <<"CODE" code => <<"CODE"
{ {
stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id); GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
if (stroke) if (stroke)
{ {
GArray *coords_array;
gint i;
coords_array = gimp_stroke_interpolate (stroke, prescision, &closed); coords_array = gimp_stroke_interpolate (stroke, prescision, &closed);
if (coords_array) if (coords_array)
{ {
num_coords = coords_array->len; num_coords = coords_array->len;
@ -651,9 +646,11 @@ sub vectors_bezier_stroke_new_moveto {
Adds a bezier stroke with a single moveto to the vectors object. Adds a bezier stroke with a single moveto to the vectors object.
HELP HELP
&pdb_misc; &simon_pdb_misc('2005', '2.4');
@inargs = ( &vectors_arg, @inargs = (
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' },
{ name => 'x0', type => 'float', { name => 'x0', type => 'float',
desc => 'The x-coordinate of the moveto', desc => 'The x-coordinate of the moveto',
init => 1 }, init => 1 },
@ -669,16 +666,17 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'GimpStroke *stroke',
'GimpCoords coord0' ],
code => <<"CODE" code => <<"CODE"
{ {
coord0.x = x0; GimpStroke *stroke;
coord0.y = y0; GimpCoords coord0;
coord0.x = x0;
coord0.y = y0;
coord0.pressure = GIMP_COORDS_DEFAULT_PRESSURE; coord0.pressure = GIMP_COORDS_DEFAULT_PRESSURE;
coord0.xtilt = GIMP_COORDS_DEFAULT_TILT; coord0.xtilt = GIMP_COORDS_DEFAULT_TILT;
coord0.ytilt = GIMP_COORDS_DEFAULT_TILT; coord0.ytilt = GIMP_COORDS_DEFAULT_TILT;
coord0.wheel = GIMP_COORDS_DEFAULT_WHEEL; coord0.wheel = GIMP_COORDS_DEFAULT_WHEEL;
stroke = gimp_bezier_stroke_new_moveto (&coord0); stroke = gimp_bezier_stroke_new_moveto (&coord0);
gimp_vectors_stroke_add (vectors, stroke); gimp_vectors_stroke_add (vectors, stroke);
@ -695,9 +693,13 @@ sub vectors_bezier_stroke_lineto {
Extends a bezier stroke with a lineto. Extends a bezier stroke with a lineto.
HELP HELP
&pdb_misc; &simon_pdb_misc('2005', '2.4');
@inargs = ( &stroke_arg, @inargs = (
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' },
{ name => 'stroke_id', type => 'int32',
desc => 'The stroke ID' },
{ name => 'x0', type => 'float', { name => 'x0', type => 'float',
desc => 'The x-coordinate of the lineto', desc => 'The x-coordinate of the lineto',
init => 1 }, init => 1 },
@ -707,22 +709,27 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'GimpStroke *stroke',
'GimpCoords coord0' ],
code => <<"CODE" code => <<"CODE"
{ {
coord0.x = x0; GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
coord0.y = y0;
coord0.pressure = GIMP_COORDS_DEFAULT_PRESSURE;
coord0.xtilt = GIMP_COORDS_DEFAULT_TILT;
coord0.ytilt = GIMP_COORDS_DEFAULT_TILT;
coord0.wheel = GIMP_COORDS_DEFAULT_WHEEL;
stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
if (stroke) if (stroke)
gimp_bezier_stroke_lineto (stroke, &coord0); {
GimpCoords coord0;
coord0.x = x0;
coord0.y = y0;
coord0.pressure = GIMP_COORDS_DEFAULT_PRESSURE;
coord0.xtilt = GIMP_COORDS_DEFAULT_TILT;
coord0.ytilt = GIMP_COORDS_DEFAULT_TILT;
coord0.wheel = GIMP_COORDS_DEFAULT_WHEEL;
gimp_bezier_stroke_lineto (stroke, &coord0);
}
else else
success = FALSE; {
success = FALSE;
}
} }
CODE CODE
); );
@ -737,44 +744,49 @@ cubic bezier spline gets added that realizes the shape of a conic
bezier spline. bezier spline.
HELP HELP
&pdb_misc; &simon_pdb_misc('2005', '2.4');
@inargs = ( &stroke_arg, @inargs = (
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' },
{ name => 'stroke_id', type => 'int32',
desc => 'The stroke ID' },
{ name => 'x0', type => 'float', { name => 'x0', type => 'float',
desc => 'The x-coordinate of the control point', desc => 'The x-coordinate of the control point' },
init => 1 },
{ name => 'y0', type => 'float', { name => 'y0', type => 'float',
desc => 'The y-coordinate of the control point', desc => 'The y-coordinate of the control point' },
init => 1 },
{ name => 'x1', type => 'float', { name => 'x1', type => 'float',
desc => 'The x-coordinate of the end point', desc => 'The x-coordinate of the end point' },
init => 1 },
{ name => 'y1', type => 'float', { name => 'y1', type => 'float',
desc => 'The y-coordinate of the end point', desc => 'The y-coordinate of the end point' }
init => 1 }
); );
%invoke = ( %invoke = (
vars => [ 'GimpStroke *stroke',
'GimpCoords coord0, coord1' ],
code => <<"CODE" code => <<"CODE"
{ {
coord0.x = x0; GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
coord0.y = y0;
coord0.pressure = GIMP_COORDS_DEFAULT_PRESSURE;
coord0.xtilt = GIMP_COORDS_DEFAULT_TILT;
coord0.ytilt = GIMP_COORDS_DEFAULT_TILT;
coord0.wheel = GIMP_COORDS_DEFAULT_WHEEL;
coord1 = coord0;
coord1.x = x1;
coord1.y = y1;
stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
if (stroke) if (stroke)
gimp_bezier_stroke_conicto (stroke, &coord0, &coord1); {
GimpCoords coord0, coord1;
coord0.x = x0;
coord0.y = y0;
coord0.pressure = GIMP_COORDS_DEFAULT_PRESSURE;
coord0.xtilt = GIMP_COORDS_DEFAULT_TILT;
coord0.ytilt = GIMP_COORDS_DEFAULT_TILT;
coord0.wheel = GIMP_COORDS_DEFAULT_WHEEL;
coord1 = coord0;
coord1.x = x1;
coord1.y = y1;
gimp_bezier_stroke_conicto (stroke, &coord0, &coord1);
}
else else
success = FALSE; {
success = FALSE;
}
} }
CODE CODE
); );
@ -787,54 +799,57 @@ sub vectors_bezier_stroke_cubicto {
Extends a bezier stroke with a cubic bezier spline. Extends a bezier stroke with a cubic bezier spline.
HELP HELP
&pdb_misc; &simon_pdb_misc('2005', '2.4');
@inargs = ( &stroke_arg, @inargs = (
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' },
{ name => 'stroke_id', type => 'int32',
desc => 'The stroke ID' },
{ name => 'x0', type => 'float', { name => 'x0', type => 'float',
desc => 'The x-coordinate of the first control point', desc => 'The x-coordinate of the first control point' },
init => 1 },
{ name => 'y0', type => 'float', { name => 'y0', type => 'float',
desc => 'The y-coordinate of the first control point', desc => 'The y-coordinate of the first control point' },
init => 1 },
{ name => 'x1', type => 'float', { name => 'x1', type => 'float',
desc => 'The x-coordinate of the second control point', desc => 'The x-coordinate of the second control point' },
init => 1 },
{ name => 'y1', type => 'float', { name => 'y1', type => 'float',
desc => 'The y-coordinate of the second control point', desc => 'The y-coordinate of the second control point' },
init => 1 },
{ name => 'x2', type => 'float', { name => 'x2', type => 'float',
desc => 'The x-coordinate of the end point', desc => 'The x-coordinate of the end point' },
init => 1 },
{ name => 'y2', type => 'float', { name => 'y2', type => 'float',
desc => 'The y-coordinate of the end point', desc => 'The y-coordinate of the end point' }
init => 1 }
); );
%invoke = ( %invoke = (
vars => [ 'GimpStroke *stroke',
'GimpCoords coord0, coord1, coord2' ],
code => <<"CODE" code => <<"CODE"
{ {
coord0.x = x0; GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
coord0.y = y0;
coord0.pressure = GIMP_COORDS_DEFAULT_PRESSURE;
coord0.xtilt = GIMP_COORDS_DEFAULT_TILT;
coord0.ytilt = GIMP_COORDS_DEFAULT_TILT;
coord0.wheel = GIMP_COORDS_DEFAULT_WHEEL;
coord1 = coord0;
coord1.x = x1;
coord1.y = y1;
coord2 = coord0;
coord2.x = x2;
coord2.y = y2;
stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id);
if (stroke) if (stroke)
gimp_bezier_stroke_cubicto (stroke, &coord0, &coord1, &coord2); {
GimpCoords coord0, coord1, coord2;
coord0.x = x0;
coord0.y = y0;
coord0.pressure = GIMP_COORDS_DEFAULT_PRESSURE;
coord0.xtilt = GIMP_COORDS_DEFAULT_TILT;
coord0.ytilt = GIMP_COORDS_DEFAULT_TILT;
coord0.wheel = GIMP_COORDS_DEFAULT_WHEEL;
coord1 = coord0;
coord1.x = x1;
coord1.y = y1;
coord2 = coord0;
coord2.x = x2;
coord2.y = y2;
gimp_bezier_stroke_cubicto (stroke, &coord0, &coord1, &coord2);
}
else else
success = FALSE; {
success = FALSE;
}
} }
CODE CODE
); );
@ -847,24 +862,22 @@ sub vectors_bezier_stroke_new_ellipse {
Adds a bezier stroke describing an ellipse the vectors object. Adds a bezier stroke describing an ellipse the vectors object.
HELP HELP
&pdb_misc; &simon_pdb_misc('2005', '2.4');
@inargs = ( &vectors_arg, @inargs = (
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' },
{ name => 'x0', type => 'float', { name => 'x0', type => 'float',
desc => 'The x-coordinate of the center', desc => 'The x-coordinate of the center' },
init => 1 },
{ name => 'y0', type => 'float', { name => 'y0', type => 'float',
desc => 'The y-coordinate of the center', desc => 'The y-coordinate of the center' },
init => 1 },
{ name => 'radius_x', type => 'float', { name => 'radius_x', type => 'float',
desc => 'The radius in x direction', desc => 'The radius in x direction' },
init => 1 },
{ name => 'radius_y', type => 'float', { name => 'radius_y', type => 'float',
desc => 'The radius in y direction', desc => 'The radius in y direction' },
init => 1 },
{ name => 'angle', type => 'float', { name => 'angle', type => 'float',
desc => 'The angle the x-axis of the ellipse (radians, counterclockwise)', desc => 'The angle the x-axis of the ellipse
init => 1 } (radians, counterclockwise)' }
); );
@outargs = ( @outargs = (
@ -874,16 +887,17 @@ HELP
); );
%invoke = ( %invoke = (
vars => [ 'GimpStroke *stroke',
'GimpCoords coord0' ],
code => <<"CODE" code => <<"CODE"
{ {
coord0.x = x0; GimpStroke *stroke;
coord0.y = y0; GimpCoords coord0;
coord0.x = x0;
coord0.y = y0;
coord0.pressure = GIMP_COORDS_DEFAULT_PRESSURE; coord0.pressure = GIMP_COORDS_DEFAULT_PRESSURE;
coord0.xtilt = GIMP_COORDS_DEFAULT_TILT; coord0.xtilt = GIMP_COORDS_DEFAULT_TILT;
coord0.ytilt = GIMP_COORDS_DEFAULT_TILT; coord0.ytilt = GIMP_COORDS_DEFAULT_TILT;
coord0.wheel = GIMP_COORDS_DEFAULT_WHEEL; coord0.wheel = GIMP_COORDS_DEFAULT_WHEEL;
stroke = gimp_bezier_stroke_new_ellipse (&coord0, radius_x, radius_y, angle); stroke = gimp_bezier_stroke_new_ellipse (&coord0, radius_x, radius_y, angle);
gimp_vectors_stroke_add (vectors, stroke); gimp_vectors_stroke_add (vectors, stroke);
@ -894,24 +908,17 @@ CODE
} }
@headers = qw(<string.h> "core/gimp.h" "core/gimplist.h" @headers = qw(<string.h> "core/gimp.h" "core/gimplist.h"
"core/gimpimage.h" "core/gimpimage.h"
"vectors/gimpanchor.h" "vectors/gimpbezierstroke.h" "vectors/gimpanchor.h" "vectors/gimpbezierstroke.h"
"vectors/gimpvectors.h" "vectors/gimpvectors-compat.h" "vectors/gimpvectors.h" "vectors/gimpvectors-compat.h"
"gimp-intl.h"); "gimp-intl.h");
@procs = qw(vectors_new @procs = qw(vectors_new vectors_get_strokes vectors_get_image
vectors_get_strokes vectors_get_linked vectors_set_linked
vectors_get_image vectors_get_visible vectors_set_visible
vectors_get_linked vectors_get_name vectors_set_name
vectors_set_linked vectors_get_tattoo vectors_set_tattoo
vectors_get_visible
vectors_set_visible
vectors_get_name
vectors_set_name
vectors_get_tattoo
vectors_set_tattoo
vectors_stroke_get_length vectors_stroke_get_length
vectors_stroke_get_point_at_dist vectors_stroke_get_point_at_dist
vectors_stroke_remove vectors_stroke_remove
@ -923,8 +930,7 @@ CODE
vectors_bezier_stroke_lineto vectors_bezier_stroke_lineto
vectors_bezier_stroke_conicto vectors_bezier_stroke_conicto
vectors_bezier_stroke_cubicto vectors_bezier_stroke_cubicto
vectors_bezier_stroke_new_ellipse vectors_bezier_stroke_new_ellipse);
);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Paths'; $desc = 'Paths';

View File

@ -22,6 +22,110 @@ sub std_pdb_misc {
$date = '1995-1996'; $date = '1995-1996';
} }
sub contrib_pdb_misc {
my $a = shift;
my $e = shift;
my $d = shift;
my $s = shift;
if ($e eq '') {
$author = "$a";
} else {
$author = "$a <$e>";
}
$copyright = "$a";
$date = "$d";
if ($s) {
$since = "$s";
}
}
sub adam_pdb_misc {
contrib_pdb_misc('Adam D. Moss', '', @_);
}
sub adrian_pdb_misc {
contrib_pdb_misc('Adrian Likins', 'adrian@gimp.org', @_);
}
sub andy_pdb_misc {
contrib_pdb_misc('Andy Thomas', '', @_);
}
sub austin_pdb_misc {
contrib_pdb_misc('Austin Donnelly', '', @_);
}
sub bill_pdb_misc {
contrib_pdb_misc('Bill Skaggs', 'weskaggs@primate.ucdavis.edu', @_);
}
sub federico_pdb_misc {
contrib_pdb_misc('Federico Mena Quintero', '', @_);
}
sub jay_pdb_misc {
contrib_pdb_misc('Jay Cox', '', @_);
}
sub joao_pdb_misc {
contrib_pdb_misc('Jo\xc3\xa3o S. O. Bueno Calligaris', '', @_);
}
sub josh_pdb_misc {
contrib_pdb_misc('Josh MacDonald', '', @_);
}
sub larry_pdb_misc {
contrib_pdb_misc('Larry Ewing', '', @_);
}
sub marc_pdb_misc {
contrib_pdb_misc('Marc Lehmann', '', @_);
}
sub mitch_pdb_misc {
contrib_pdb_misc('Michael Natterer', 'mitch@gimp.org', @_);
}
sub neo_pdb_misc {
contrib_pdb_misc('Sven Neumann', 'sven@gimp.org', @_);
}
sub nick_pdb_misc {
contrib_pdb_misc('Nick Lamb', '', @_);
}
sub raphael_pdb_misc {
contrib_pdb_misc('Raphael Quinet', '', @_);
}
sub rock_pdb_misc {
contrib_pdb_misc('Nathan Summers', 'rock@gimp.org', @_);
}
sub seth_pdb_misc {
contrib_pdb_misc('Seth Burgess', '', @_);
}
sub shlomi_pdb_misc {
contrib_pdb_misc('Shlomi Fish', 'shlomif@iglu.org.il', @_);
}
sub simon_pdb_misc {
contrib_pdb_misc('Simon Budig', '', @_);
}
sub wolfgang_pdb_misc {
contrib_pdb_misc('Wolfgang Hofer', '', @_);
}
sub yosh_pdb_misc {
contrib_pdb_misc('Manish Singh', '', @_);
}
sub std_pdb_deprecated { sub std_pdb_deprecated {
if (@_) { if (@_) {
$blurb = $help = "This procedure is deprecated! Use '@_' instead."; $blurb = $help = "This procedure is deprecated! Use '@_' instead.";