diff --git a/ChangeLog b/ChangeLog index 65f29e91a3..5dbc1f8e6d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2006-03-14 Michael Natterer + + * 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 * app/core/gimpimage-guides.[ch]: added gimp_image_get_guide() and diff --git a/app/pdb/brush_cmds.c b/app/pdb/brush_cmds.c index d175176dd6..a0ac812456 100644 --- a/app/pdb/brush_cmds.c +++ b/app/pdb/brush_cmds.c @@ -287,7 +287,7 @@ static ProcRecord brush_is_generated_proc = "gimp-brush-is-generated", "Tests if generated", "Returns True if this brush is parametric, False for other types", - "Bill Skaggs ", "Bill Skaggs", "2004", NULL, @@ -504,7 +504,7 @@ static ProcRecord brush_is_editable_proc = "gimp-brush-is-editable", "Tests if brush can be edited", "Returns True if you have permission to change the brush", - "Bill Skaggs ", "Bill Skaggs", "2004", NULL, @@ -855,7 +855,7 @@ static ProcRecord brush_set_spacing_proc = "gimp-brush-set-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.", - "Bill Skaggs ", "Bill Skaggs", "2004", NULL, @@ -922,7 +922,7 @@ static ProcRecord brush_get_shape_proc = "gimp-brush-get-shape", "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.", - "Bill Skaggs ", "Bill Skaggs", "2004", NULL, @@ -989,7 +989,7 @@ static ProcRecord brush_get_radius_proc = "gimp-brush-get-radius", "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.", - "Bill Skaggs ", "Bill Skaggs", "2004", NULL, @@ -1056,7 +1056,7 @@ static ProcRecord brush_get_spikes_proc = "gimp-brush-get-spikes", "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.", - "Bill Skaggs ", "Bill Skaggs", "2004", NULL, @@ -1123,7 +1123,7 @@ static ProcRecord brush_get_hardness_proc = "gimp-brush-get-hardness", "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.", - "Bill Skaggs ", "Bill Skaggs", "2004", NULL, @@ -1190,7 +1190,7 @@ static ProcRecord brush_get_aspect_ratio_proc = "gimp-brush-get-aspect-ratio", "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.", - "Bill Skaggs ", "Bill Skaggs", "2004", NULL, @@ -1257,7 +1257,7 @@ static ProcRecord brush_get_angle_proc = "gimp-brush-get-angle", "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.", - "Bill Skaggs ", "Bill Skaggs", "2004", NULL, @@ -1335,7 +1335,7 @@ static ProcRecord brush_set_shape_proc = "gimp-brush-set-shape", "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.", - "Bill Skaggs ", "Bill Skaggs", "2004", NULL, @@ -1413,7 +1413,7 @@ static ProcRecord brush_set_radius_proc = "gimp-brush-set-radius", "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.", - "Bill Skaggs ", "Bill Skaggs", "2004", NULL, @@ -1491,7 +1491,7 @@ static ProcRecord brush_set_spikes_proc = "gimp-brush-set-spikes", "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.", - "Bill Skaggs ", "Bill Skaggs", "2004", NULL, @@ -1569,7 +1569,7 @@ static ProcRecord brush_set_hardness_proc = "gimp-brush-set-hardness", "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.", - "Bill Skaggs ", "Bill Skaggs", "2004", NULL, @@ -1647,7 +1647,7 @@ static ProcRecord brush_set_aspect_ratio_proc = "gimp-brush-set-aspect-ratio", "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.", - "Bill Skaggs ", "Bill Skaggs", "2004", NULL, @@ -1725,7 +1725,7 @@ static ProcRecord brush_set_angle_proc = "gimp-brush-set-angle", "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.", - "Bill Skaggs ", "Bill Skaggs", "2004", NULL, diff --git a/app/pdb/brushes_cmds.c b/app/pdb/brushes_cmds.c index f28e6c61c6..6e9000ce16 100644 --- a/app/pdb/brushes_cmds.c +++ b/app/pdb/brushes_cmds.c @@ -171,7 +171,7 @@ brushes_get_brush_invoker (Gimp *gimp, return_args[1].value.pdb_pointer = g_strdup (GIMP_OBJECT (brush)->name); return_args[2].value.pdb_int = brush->mask->width; 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; @@ -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[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[5].value.pdb_int = brush->mask->width; return_args[6].value.pdb_int = brush->mask->height; diff --git a/app/pdb/buffer_cmds.c b/app/pdb/buffer_cmds.c index c2724631ce..93588aed8d 100644 --- a/app/pdb/buffer_cmds.c +++ b/app/pdb/buffer_cmds.c @@ -113,7 +113,7 @@ static ProcRecord buffers_get_list_proc = "Retrieve a complete listing of the available buffers.", "This procedure returns a complete listing of available named buffers.", "Michael Natterer ", - "Michael Natterer ", + "Michael Natterer", "2005", NULL, GIMP_INTERNAL, @@ -146,9 +146,7 @@ buffer_rename_invoker (Gimp *gimp, if (success) { - GimpBuffer *buffer; - - buffer = (GimpBuffer *) + GimpBuffer *buffer = (GimpBuffer *) gimp_container_get_child_by_name (gimp->named_buffers, buffer_name); success = (buffer != NULL && strlen (new_name) > 0); @@ -198,7 +196,7 @@ static ProcRecord buffer_rename_proc = "Renames a named buffer.", "This procedure renames a named buffer.", "Michael Natterer ", - "Michael Natterer ", + "Michael Natterer", "2005", NULL, GIMP_INTERNAL, @@ -224,9 +222,7 @@ buffer_delete_invoker (Gimp *gimp, if (success) { - GimpBuffer *buffer; - - buffer = (GimpBuffer *) + GimpBuffer *buffer = (GimpBuffer *) gimp_container_get_child_by_name (gimp->named_buffers, buffer_name); success = (buffer != NULL); @@ -274,7 +270,7 @@ buffer_get_width_invoker (Gimp *gimp, gboolean success = TRUE; Argument *return_args; gchar *buffer_name; - GimpBuffer *buffer = NULL; + gint32 width = 0; buffer_name = (gchar *) args[0].value.pdb_pointer; if (buffer_name == NULL || !g_utf8_validate (buffer_name, -1, NULL)) @@ -282,16 +278,19 @@ buffer_get_width_invoker (Gimp *gimp, if (success) { - buffer = (GimpBuffer *) + GimpBuffer *buffer = (GimpBuffer *) 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); if (success) - return_args[1].value.pdb_int = gimp_buffer_get_width (buffer); + return_args[1].value.pdb_int = width; return return_args; } @@ -321,7 +320,7 @@ static ProcRecord buffer_get_width_proc = "Retrieves the specified buffer's width.", "This procedure retrieves the specified named buffer's width.", "Michael Natterer ", - "Michael Natterer ", + "Michael Natterer", "2005", NULL, GIMP_INTERNAL, @@ -341,7 +340,7 @@ buffer_get_height_invoker (Gimp *gimp, gboolean success = TRUE; Argument *return_args; gchar *buffer_name; - GimpBuffer *buffer = NULL; + gint32 height = 0; buffer_name = (gchar *) args[0].value.pdb_pointer; if (buffer_name == NULL || !g_utf8_validate (buffer_name, -1, NULL)) @@ -349,16 +348,19 @@ buffer_get_height_invoker (Gimp *gimp, if (success) { - buffer = (GimpBuffer *) + GimpBuffer *buffer = (GimpBuffer *) 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); if (success) - return_args[1].value.pdb_int = gimp_buffer_get_height (buffer); + return_args[1].value.pdb_int = height; return return_args; } @@ -388,7 +390,7 @@ static ProcRecord buffer_get_height_proc = "Retrieves the specified buffer's height.", "This procedure retrieves the specified named buffer's height.", "Michael Natterer ", - "Michael Natterer ", + "Michael Natterer", "2005", NULL, GIMP_INTERNAL, @@ -408,7 +410,7 @@ buffer_get_bytes_invoker (Gimp *gimp, gboolean success = TRUE; Argument *return_args; gchar *buffer_name; - GimpBuffer *buffer = NULL; + gint32 bytes = 0; buffer_name = (gchar *) args[0].value.pdb_pointer; if (buffer_name == NULL || !g_utf8_validate (buffer_name, -1, NULL)) @@ -416,16 +418,19 @@ buffer_get_bytes_invoker (Gimp *gimp, if (success) { - buffer = (GimpBuffer *) + GimpBuffer *buffer = (GimpBuffer *) 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); if (success) - return_args[1].value.pdb_int = gimp_buffer_get_bytes (buffer); + return_args[1].value.pdb_int = bytes; return return_args; } @@ -455,7 +460,7 @@ static ProcRecord buffer_get_bytes_proc = "Retrieves the specified buffer's bytes.", "This procedure retrieves the specified named buffer's bytes.", "Michael Natterer ", - "Michael Natterer ", + "Michael Natterer", "2005", NULL, GIMP_INTERNAL, @@ -475,7 +480,7 @@ buffer_get_image_type_invoker (Gimp *gimp, gboolean success = TRUE; Argument *return_args; gchar *buffer_name; - GimpBuffer *buffer = NULL; + gint32 image_type = 0; buffer_name = (gchar *) args[0].value.pdb_pointer; if (buffer_name == NULL || !g_utf8_validate (buffer_name, -1, NULL)) @@ -483,16 +488,19 @@ buffer_get_image_type_invoker (Gimp *gimp, if (success) { - buffer = (GimpBuffer *) + GimpBuffer *buffer = (GimpBuffer *) 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); 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; } @@ -522,7 +530,7 @@ static ProcRecord buffer_get_image_type_proc = "Retrieves the specified buffer's image type.", "This procedure retrieves the specified named buffer's image type.", "Michael Natterer ", - "Michael Natterer ", + "Michael Natterer", "2005", NULL, GIMP_INTERNAL, diff --git a/app/pdb/color_cmds.c b/app/pdb/color_cmds.c index 6668d0e7f9..34e841c44c 100644 --- a/app/pdb/color_cmds.c +++ b/app/pdb/color_cmds.c @@ -1225,8 +1225,8 @@ static ProcRecord colorize_proc = "gimp-colorize", "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.", - "Spencer Kimball & Peter Mattis", - "Spencer Kimball & Peter Mattis", + "Sven Neumann ", + "Sven Neumann", "2004", NULL, GIMP_INTERNAL, @@ -1489,12 +1489,12 @@ static ProcArg hue_saturation_inargs[] = { GIMP_PDB_FLOAT, "lightness", - "lightness modification: (-100 <= lightness <= 100)" + "Lightness modification: (-100 <= lightness <= 100)" }, { GIMP_PDB_FLOAT, "saturation", - "saturation modification: (-100 <= saturation <= 100)" + "Saturation modification: (-100 <= saturation <= 100)" } }; diff --git a/app/pdb/display_cmds.c b/app/pdb/display_cmds.c index f3de3aa30d..a0177b5c5d 100644 --- a/app/pdb/display_cmds.c +++ b/app/pdb/display_cmds.c @@ -212,7 +212,7 @@ static ProcRecord display_get_window_handle_proc = "gimp-display-get-window-handle", "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.", - "Sven Neumann", + "Sven Neumann ", "Sven Neumann", "2005", NULL, diff --git a/app/pdb/drawable_cmds.c b/app/pdb/drawable_cmds.c index 433cca0503..67701c4008 100644 --- a/app/pdb/drawable_cmds.c +++ b/app/pdb/drawable_cmds.c @@ -2526,7 +2526,7 @@ static ProcRecord drawable_sub_thumbnail_proc = "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.", "Michael Natterer ", - "Michael Natterer ", + "Michael Natterer", "2004", NULL, GIMP_INTERNAL, diff --git a/app/pdb/drawable_transform_cmds.c b/app/pdb/drawable_transform_cmds.c index b2d0e94fe9..114b42e007 100644 --- a/app/pdb/drawable_transform_cmds.c +++ b/app/pdb/drawable_transform_cmds.c @@ -1386,22 +1386,22 @@ static ProcArg drawable_transform_scale_inargs[] = { GIMP_PDB_FLOAT, "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, "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, "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, "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, @@ -1545,22 +1545,22 @@ static ProcArg drawable_transform_scale_default_inargs[] = { GIMP_PDB_FLOAT, "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, "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, "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, "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, diff --git a/app/pdb/edit_cmds.c b/app/pdb/edit_cmds.c index 741e0e6b9e..9718384f5e 100644 --- a/app/pdb/edit_cmds.c +++ b/app/pdb/edit_cmds.c @@ -271,7 +271,7 @@ static ProcRecord edit_copy_visible_proc = "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.", "Michael Natterer ", - "Michael Natterer ", + "Michael Natterer", "2004", NULL, GIMP_INTERNAL, @@ -407,7 +407,7 @@ static ProcRecord edit_paste_as_new_proc = "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.", "Michael Natterer ", - "Michael Natterer ", + "Michael Natterer", "2005", NULL, GIMP_INTERNAL, @@ -495,7 +495,7 @@ static ProcRecord edit_named_cut_proc = "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.", "Michael Natterer ", - "Michael Natterer ", + "Michael Natterer", "2005", NULL, GIMP_INTERNAL, @@ -583,7 +583,7 @@ static ProcRecord edit_named_copy_proc = "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.", "Michael Natterer ", - "Michael Natterer ", + "Michael Natterer", "2005", NULL, GIMP_INTERNAL, @@ -668,7 +668,7 @@ static ProcRecord edit_named_copy_visible_proc = "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.", "Michael Natterer ", - "Michael Natterer ", + "Michael Natterer", "2005", NULL, GIMP_INTERNAL, @@ -764,7 +764,7 @@ static ProcRecord edit_named_paste_proc = "Paste named buffer to the specified drawable.", "This procedure works like gimp-edit-paste but pastes a named buffer instead of the global buffer.", "Michael Natterer ", - "Michael Natterer ", + "Michael Natterer", "2005", NULL, GIMP_INTERNAL, @@ -840,7 +840,7 @@ static ProcRecord edit_named_paste_as_new_proc = "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.", "Michael Natterer ", - "Michael Natterer ", + "Michael Natterer", "2005", NULL, GIMP_INTERNAL, @@ -932,7 +932,8 @@ edit_fill_invoker (Gimp *gimp, { 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); } } diff --git a/app/pdb/fileops_cmds.c b/app/pdb/fileops_cmds.c index 48fe68dbcf..80a5839abc 100644 --- a/app/pdb/fileops_cmds.c +++ b/app/pdb/fileops_cmds.c @@ -92,10 +92,11 @@ file_load_invoker (Gimp *gimp, { Argument *new_args; Argument *return_vals; - PlugInProcDef *file_proc; + + PlugInProcDef *file_proc; const ProcRecord *proc; - gchar *uri; - gint i; + gchar *uri; + gint i; 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; gchar *filename; GimpLayer *layer = NULL; - GimpPDBStatusType status; - gchar *uri; run_mode = args[0].value.pdb_int; if (run_mode < GIMP_RUN_INTERACTIVE || run_mode > GIMP_RUN_NONINTERACTIVE) @@ -202,6 +201,9 @@ file_load_layer_invoker (Gimp *gimp, if (success) { + GimpPDBStatusType status; + gchar *uri; + uri = file_utils_filename_to_uri (gimp->load_procs, filename, NULL); if (! uri) success = FALSE; @@ -255,7 +257,7 @@ static ProcRecord file_load_layer_proc = "gimp-file-load-layer", "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.", - "Sven Neumann", + "Sven Neumann ", "Sven Neumann", "2005", NULL, @@ -280,9 +282,6 @@ file_load_thumbnail_invoker (Gimp *gimp, gint32 height = 0; gint32 num_bytes = 0; guint8 *thumb_data = NULL; - gchar *uri; - GimpThumbnail *thumbnail = NULL; - GdkPixbuf *pixbuf = NULL; filename = (gchar *) args[0].value.pdb_pointer; if (filename == NULL) @@ -290,6 +289,10 @@ file_load_thumbnail_invoker (Gimp *gimp, if (success) { + GimpThumbnail *thumbnail = NULL; + GdkPixbuf *pixbuf = NULL; + gchar *uri; + uri = g_filename_to_uri (filename, NULL, NULL); if (uri) @@ -409,10 +412,11 @@ file_save_invoker (Gimp *gimp, { Argument *new_args; Argument *return_vals; - PlugInProcDef *file_proc; + + PlugInProcDef *file_proc; const ProcRecord *proc; - gchar *uri; - gint i; + gchar *uri; + gint i; 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; GimpImage *gimage; gchar *filename; - GimpImagefile *imagefile; - gchar *uri; - const gchar *image_uri; gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (! GIMP_IS_IMAGE (gimage)) @@ -514,13 +515,15 @@ file_save_thumbnail_invoker (Gimp *gimp, 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) success = FALSE; if (success) { - uri = g_filename_to_uri (filename, NULL, NULL); + gchar *uri = g_filename_to_uri (filename, NULL, NULL); + if (! uri) success = FALSE; @@ -531,6 +534,8 @@ file_save_thumbnail_invoker (Gimp *gimp, if (success) { + GimpImagefile *imagefile; + imagefile = gimp_imagefile_new (gimp, uri); success = gimp_imagefile_save_thumbnail (imagefile, NULL, gimage); g_object_unref (imagefile); @@ -586,10 +591,6 @@ temp_name_invoker (Gimp *gimp, Argument *return_args; gchar *extension; gchar *name = NULL; - static gint id = 0; - static gint pid; - gchar *filename; - gchar *path; extension = (gchar *) args[0].value.pdb_pointer; if (extension == NULL) @@ -597,6 +598,11 @@ temp_name_invoker (Gimp *gimp, if (success) { + static gint id = 0; + static gint pid; + gchar *filename; + gchar *path; + if (id == 0) pid = getpid (); @@ -667,8 +673,6 @@ register_magic_load_handler_invoker (Gimp *gimp, gchar *extensions; gchar *prefixes; gchar *magics; - ProcRecord *proc; - PlugInProcDef *file_proc; name = (gchar *) args[0].value.pdb_pointer; if (name == NULL || !g_utf8_validate (name, -1, NULL)) @@ -682,7 +686,9 @@ register_magic_load_handler_invoker (Gimp *gimp, if (success) { - gchar *canonical; + ProcRecord *proc; + PlugInProcDef *file_proc; + gchar *canonical; success = FALSE; @@ -831,8 +837,6 @@ register_save_handler_invoker (Gimp *gimp, gchar *name; gchar *extensions; gchar *prefixes; - ProcRecord *proc; - PlugInProcDef *file_proc; name = (gchar *) args[0].value.pdb_pointer; if (name == NULL || !g_utf8_validate (name, -1, NULL)) @@ -844,7 +848,9 @@ register_save_handler_invoker (Gimp *gimp, if (success) { - gchar *canonical; + ProcRecord *proc; + PlugInProcDef *file_proc; + gchar *canonical; success = FALSE; @@ -975,7 +981,7 @@ static ProcRecord register_file_handler_mime_proc = "gimp-register-file-handler-mime", "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.", - "Sven Neumann", + "Sven Neumann ", "Sven Neumann", "2004", NULL, @@ -1040,7 +1046,7 @@ static ProcRecord register_thumbnail_loader_proc = "gimp-register-thumbnail-loader", "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.", - "Sven Neumann", + "Sven Neumann ", "Sven Neumann", "2004", NULL, diff --git a/app/pdb/floating_sel_cmds.c b/app/pdb/floating_sel_cmds.c index 43aa4f5009..162d1b8468 100644 --- a/app/pdb/floating_sel_cmds.c +++ b/app/pdb/floating_sel_cmds.c @@ -221,10 +221,10 @@ floating_sel_attach_invoker (Gimp *gimp, if (success) { - success = gimp_item_is_attached (GIMP_ITEM (drawable)); - - if (success) + if (gimp_item_is_attached (GIMP_ITEM (drawable))) floating_sel_attach (layer, drawable); + else + success = FALSE; } return procedural_db_return_args (&floating_sel_attach_proc, success); diff --git a/app/pdb/fonts_cmds.c b/app/pdb/fonts_cmds.c index 4d8c620886..44cca1c45d 100644 --- a/app/pdb/fonts_cmds.c +++ b/app/pdb/fonts_cmds.c @@ -57,7 +57,7 @@ static ProcRecord fonts_refresh_proc = "gimp-fonts-refresh", "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.", - "Sven Neumann", + "Sven Neumann ", "Sven Neumann", "2003", NULL, @@ -128,7 +128,7 @@ static ProcRecord fonts_get_list_proc = "gimp-fonts-get-list", "Retrieve the list of loaded fonts.", "This procedure returns a list of the fonts that are currently available.", - "Sven Neumann", + "Sven Neumann ", "Sven Neumann", "2003", NULL, diff --git a/app/pdb/gimprc_cmds.c b/app/pdb/gimprc_cmds.c index 8ec12f726e..a17de278a3 100644 --- a/app/pdb/gimprc_cmds.c +++ b/app/pdb/gimprc_cmds.c @@ -30,8 +30,6 @@ #include "pdb-types.h" #include "procedural_db.h" -#include "config/gimpcoreconfig.h" -#include "config/gimpdisplayconfig.h" #include "config/gimprc.h" #include "core/gimp.h" #include "core/gimptemplate.h" @@ -363,7 +361,7 @@ static ProcRecord get_color_configuration_proc = "gimp-get-color-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.", - "Sven Neumann", + "Sven Neumann ", "Sven Neumann", "2005", NULL, diff --git a/app/pdb/gradient_cmds.c b/app/pdb/gradient_cmds.c index ee28e2ea9f..50a4c58dd2 100644 --- a/app/pdb/gradient_cmds.c +++ b/app/pdb/gradient_cmds.c @@ -157,7 +157,7 @@ static ProcRecord gradient_new_proc = "gimp-gradient-new", "Creates a new gradient", "This procedure creates a new, uninitialized gradient", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -234,7 +234,7 @@ static ProcRecord gradient_duplicate_proc = "gimp-gradient-duplicate", "Duplicates a gradient", "This procedure creates an identical gradient by a different name", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -304,7 +304,7 @@ static ProcRecord gradient_is_editable_proc = "gimp-gradient-is-editable", "Tests if gradient can be edited", "Returns True if you have permission to change the gradient", - "Bill Skaggs ", "Bill Skaggs", "2004", NULL, @@ -384,7 +384,7 @@ static ProcRecord gradient_rename_proc = "gimp-gradient-rename", "Rename a gradient", "This procedure renames a gradient", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -451,7 +451,7 @@ static ProcRecord gradient_delete_proc = "gimp-gradient-delete", "Deletes a gradient", "This procedure deletes a gradient", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -801,7 +801,7 @@ static ProcRecord gradient_segment_get_left_color_proc = "gimp-gradient-segment-get-left-color", "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.", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -896,7 +896,7 @@ static ProcRecord gradient_segment_set_left_color_proc = "gimp-gradient-segment-set-left-color", "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.", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -998,7 +998,7 @@ static ProcRecord gradient_segment_get_right_color_proc = "gimp-gradient-segment-get-right-color", "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.", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -1093,7 +1093,7 @@ static ProcRecord gradient_segment_set_right_color_proc = "gimp-gradient-segment-set-right-color", "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.", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -1185,7 +1185,7 @@ static ProcRecord gradient_segment_get_left_pos_proc = "gimp-gradient-segment-get-left-pos", "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.", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -1288,7 +1288,7 @@ static ProcRecord gradient_segment_set_left_pos_proc = "gimp-gradient-segment-set-left-pos", "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.", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -1380,7 +1380,7 @@ static ProcRecord gradient_segment_get_middle_pos_proc = "gimp-gradient-segment-get-middle-pos", "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.", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -1483,7 +1483,7 @@ static ProcRecord gradient_segment_set_middle_pos_proc = "gimp-gradient-segment-set-middle-pos", "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.", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -1575,7 +1575,7 @@ static ProcRecord gradient_segment_get_right_pos_proc = "gimp-gradient-segment-get-right-pos", "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.", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -1678,7 +1678,7 @@ static ProcRecord gradient_segment_set_right_pos_proc = "gimp-gradient-segment-set-right-pos", "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.", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -1771,7 +1771,7 @@ static ProcRecord gradient_segment_get_blending_function_proc = "gimp-gradient-segment-get-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.", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -1864,7 +1864,7 @@ static ProcRecord gradient_segment_get_coloring_type_proc = "gimp-gradient-segment-get-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.", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -1911,6 +1911,7 @@ gradient_segment_range_set_blending_function_invoker (Gimp *gimp, if (gradient) { GimpGradientSegment *start_seg, *end_seg; + start_seg = gimp_gradient_segment_get_nth (gradient->segments, start_segment); if (start_seg) @@ -1980,7 +1981,7 @@ static ProcRecord gradient_segment_range_set_blending_function_proc = "gimp-gradient-segment-range-set-blending-function", "Change the blending function of a segments range", "This function changes the blending function of a segment range to the specified blending function.", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -2027,6 +2028,7 @@ gradient_segment_range_set_coloring_type_invoker (Gimp *gimp, if (gradient) { GimpGradientSegment *start_seg, *end_seg; + start_seg = gimp_gradient_segment_get_nth (gradient->segments, start_segment); if (start_seg) @@ -2096,7 +2098,7 @@ static ProcRecord gradient_segment_range_set_coloring_type_proc = "gimp-gradient-segment-range-set-coloring-type", "Change the coloring type of a segments range", "This function changes the coloring type of a segment range to the specified coloring type.", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -2138,6 +2140,7 @@ gradient_segment_range_flip_invoker (Gimp *gimp, if (gradient) { GimpGradientSegment *start_seg, *end_seg; + start_seg = gimp_gradient_segment_get_nth (gradient->segments, start_segment); if (start_seg) @@ -2202,7 +2205,7 @@ static ProcRecord gradient_segment_range_flip_proc = "gimp-gradient-segment-range-flip", "Flip the segment range", "This function flips a segment range.", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -2249,6 +2252,7 @@ gradient_segment_range_replicate_invoker (Gimp *gimp, if (gradient) { GimpGradientSegment *start_seg, *end_seg; + start_seg = gimp_gradient_segment_get_nth (gradient->segments, start_segment); if (start_seg) @@ -2319,7 +2323,7 @@ static ProcRecord gradient_segment_range_replicate_proc = "gimp-gradient-segment-range-replicate", "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.", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -2361,6 +2365,7 @@ gradient_segment_range_split_midpoint_invoker (Gimp *gimp, if (gradient) { GimpGradientSegment *start_seg, *end_seg; + start_seg = gimp_gradient_segment_get_nth (gradient->segments, start_segment); if (start_seg) @@ -2425,7 +2430,7 @@ static ProcRecord gradient_segment_range_split_midpoint_proc = "gimp-gradient-segment-range-split-midpoint", "Splits each segment in the segment range at midpoint", "This function splits each segment in the segment range at its midpoint.", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -2472,6 +2477,7 @@ gradient_segment_range_split_uniform_invoker (Gimp *gimp, if (gradient) { GimpGradientSegment *start_seg, *end_seg; + start_seg = gimp_gradient_segment_get_nth (gradient->segments, start_segment); if (start_seg) @@ -2542,7 +2548,7 @@ static ProcRecord gradient_segment_range_split_uniform_proc = "gimp-gradient-segment-range-split-uniform", "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.", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -2584,6 +2590,7 @@ gradient_segment_range_delete_invoker (Gimp *gimp, if (gradient) { GimpGradientSegment *start_seg, *end_seg; + start_seg = gimp_gradient_segment_get_nth (gradient->segments, start_segment); if (start_seg) @@ -2648,7 +2655,7 @@ static ProcRecord gradient_segment_range_delete_proc = "gimp-gradient-segment-range-delete", "Delete the segment range", "This function deletes a segment range.", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -2690,6 +2697,7 @@ gradient_segment_range_redistribute_handles_invoker (Gimp *gimp, if (gradient) { GimpGradientSegment *start_seg, *end_seg; + start_seg = gimp_gradient_segment_get_nth (gradient->segments, start_segment); if (start_seg) @@ -2753,7 +2761,7 @@ static ProcRecord gradient_segment_range_redistribute_handles_proc = "gimp-gradient-segment-range-redistribute-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.", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -2795,6 +2803,7 @@ gradient_segment_range_blend_colors_invoker (Gimp *gimp, if (gradient) { GimpGradientSegment *start_seg, *end_seg; + start_seg = gimp_gradient_segment_get_nth (gradient->segments, start_segment); if (start_seg) @@ -2860,7 +2869,7 @@ static ProcRecord gradient_segment_range_blend_colors_proc = "gimp-gradient-segment-range-blend-colors", "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.", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -2902,6 +2911,7 @@ gradient_segment_range_blend_opacity_invoker (Gimp *gimp, if (gradient) { GimpGradientSegment *start_seg, *end_seg; + start_seg = gimp_gradient_segment_get_nth (gradient->segments, start_segment); if (start_seg) @@ -2967,7 +2977,7 @@ static ProcRecord gradient_segment_range_blend_opacity_proc = "gimp-gradient-segment-range-blend-opacity", "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.", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, @@ -3019,6 +3029,7 @@ gradient_segment_range_move_invoker (Gimp *gimp, if (gradient) { GimpGradientSegment *start_seg, *end_seg; + start_seg = gimp_gradient_segment_get_nth (gradient->segments, start_segment); if (start_seg) @@ -3109,7 +3120,7 @@ static ProcRecord gradient_segment_range_move_proc = "gimp-gradient-segment-range-move", "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.", - "Shlomi Fish", + "Shlomi Fish ", "Shlomi Fish", "2003", NULL, diff --git a/app/pdb/gradients_cmds.c b/app/pdb/gradients_cmds.c index e3b7c0f792..ee8f39f5eb 100644 --- a/app/pdb/gradients_cmds.c +++ b/app/pdb/gradients_cmds.c @@ -66,7 +66,7 @@ static ProcRecord gradients_refresh_proc = "gimp-gradients-refresh", "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.", - "Michael Natterer", + "Michael Natterer ", "Michael Natterer", "2002", NULL, @@ -161,10 +161,6 @@ gradients_sample_uniform_invoker (Gimp *gimp, gboolean reverse; gint32 array_length = 0; gdouble *color_samples = NULL; - GimpGradient *gradient; - gdouble pos, delta; - GimpRGB color; - gdouble *pv; i = args[0].value.pdb_int; if (i < 2) @@ -174,7 +170,11 @@ gradients_sample_uniform_invoker (Gimp *gimp, if (success) { + GimpGradient *gradient; GimpGradientSegment *seg = NULL; + gdouble pos, delta; + GimpRGB color; + gdouble *pv; pos = 0.0; delta = 1.0 / (i - 1); @@ -268,9 +268,6 @@ gradients_sample_custom_invoker (Gimp *gimp, gboolean reverse; gint32 array_length = 0; gdouble *color_samples = NULL; - GimpGradient *gradient; - GimpRGB color; - gdouble *pv; i = args[0].value.pdb_int; if (i <= 0) @@ -282,7 +279,10 @@ gradients_sample_custom_invoker (Gimp *gimp, if (success) { + GimpGradient *gradient; GimpGradientSegment *seg = NULL; + GimpRGB color; + gdouble *pv; array_length = i * 4; diff --git a/app/pdb/help_cmds.c b/app/pdb/help_cmds.c index 9ac9c40c0b..f736d5393d 100644 --- a/app/pdb/help_cmds.c +++ b/app/pdb/help_cmds.c @@ -89,7 +89,7 @@ static ProcRecord help_proc = "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.", "Michael Natterer ", - "Michael Natterer ", + "Michael Natterer", "2000", NULL, GIMP_INTERNAL, diff --git a/app/pdb/image_cmds.c b/app/pdb/image_cmds.c index 1bae8a9e83..b44ea036d1 100644 --- a/app/pdb/image_cmds.c +++ b/app/pdb/image_cmds.c @@ -222,15 +222,18 @@ image_list_invoker (Gimp *gimp, Argument *return_args; gint32 num_images = 0; gint32 *image_ids = NULL; + GList *list = NULL; - gint i; list = GIMP_LIST (gimp->images)->list; num_images = g_list_length (list); if (num_images) { + gint i; + image_ids = g_new (gint32, num_images); + for (i = 0; i < num_images; i++, list = g_list_next (list)) image_ids[i] = gimp_image_get_ID (GIMP_IMAGE (list->data)); } @@ -1100,7 +1103,7 @@ static ProcRecord image_rotate_proc = "gimp-image-rotate", "Rotates the image by the specified degrees.", "This procedure rotates the image.", - "Michael Natterer", + "Michael Natterer ", "Michael Natterer", "2003", NULL, @@ -1123,8 +1126,6 @@ image_get_layers_invoker (Gimp *gimp, GimpImage *gimage; gint32 num_layers = 0; gint32 *layer_ids = NULL; - GList *list = NULL; - gint i; gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (! GIMP_IS_IMAGE (gimage)) @@ -1132,12 +1133,17 @@ image_get_layers_invoker (Gimp *gimp, if (success) { + GList *list = NULL; + list = GIMP_LIST (gimage->layers)->list; num_layers = g_list_length (list); if (num_layers) { + gint i; + layer_ids = g_new (gint32, num_layers); + for (i = 0; i < num_layers; i++, list = g_list_next (list)) layer_ids[i] = gimp_item_get_ID (GIMP_ITEM (list->data)); } @@ -1206,8 +1212,6 @@ image_get_channels_invoker (Gimp *gimp, GimpImage *gimage; gint32 num_channels = 0; gint32 *channel_ids = NULL; - GList *list = NULL; - gint i; gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (! GIMP_IS_IMAGE (gimage)) @@ -1215,12 +1219,17 @@ image_get_channels_invoker (Gimp *gimp, if (success) { + GList *list = NULL; + list = GIMP_LIST (gimage->channels)->list; num_channels = g_list_length (list); if (num_channels) { + gint i; + channel_ids = g_new (gint32, num_channels); + for (i = 0; i < num_channels; i++, list = g_list_next (list)) channel_ids[i] = gimp_item_get_ID (GIMP_ITEM (list->data)); } @@ -1289,8 +1298,6 @@ image_get_vectors_invoker (Gimp *gimp, GimpImage *gimage; gint32 num_vectors = 0; gint32 *vector_ids = NULL; - GList *list = NULL; - gint i; gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (! GIMP_IS_IMAGE (gimage)) @@ -1298,12 +1305,17 @@ image_get_vectors_invoker (Gimp *gimp, if (success) { + GList *list = NULL; + list = GIMP_LIST (gimage->vectors)->list; num_vectors = g_list_length (list); if (num_vectors) { + gint i; + vector_ids = g_new (gint32, num_vectors); + for (i = 0; i < num_vectors; i++, list = g_list_next (list)) 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; GimpImage *gimage; GimpDrawable *drawable = NULL; - GimpLayer *floating_sel; gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (! GIMP_IS_IMAGE (gimage)) @@ -1549,7 +1560,7 @@ image_floating_sel_attached_to_invoker (Gimp *gimp, if (success) { - floating_sel = gimp_image_floating_sel (gimage); + GimpLayer *floating_sel = gimp_image_floating_sel (gimage); if (floating_sel) 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", "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", - "Spencer Kimball & Peter Mattis", + "Simon Budig", "2005", NULL, GIMP_INTERNAL, @@ -2269,7 +2280,7 @@ static ProcRecord image_lower_vectors_proc = "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.", "Simon Budig", - "Spencer Kimball & Peter Mattis", + "Simon Budig", "2005", NULL, 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", "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", - "Spencer Kimball & Peter Mattis", + "Simon Budig", "2005", NULL, 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", "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", - "Spencer Kimball & Peter Mattis", + "Simon Budig", "2005", NULL, GIMP_INTERNAL, @@ -2628,7 +2639,7 @@ static ProcRecord image_remove_vectors_proc = "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.", "Simon Budig", - "Spencer Kimball & Peter Mattis", + "Simon Budig", "2005", NULL, GIMP_INTERNAL, @@ -4615,7 +4626,7 @@ static ProcRecord image_get_unit_proc = "gimp-image-get-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.", - "Michael Natterer", + "Michael Natterer ", "Michael Natterer", "1998", NULL, @@ -4671,7 +4682,7 @@ static ProcRecord image_set_unit_proc = "gimp-image-set-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.", - "Michael Natterer", + "Michael Natterer ", "Michael Natterer", "1998", NULL, diff --git a/app/pdb/layer_cmds.c b/app/pdb/layer_cmds.c index 9b2786b560..957ee509b5 100644 --- a/app/pdb/layer_cmds.c +++ b/app/pdb/layer_cmds.c @@ -144,10 +144,7 @@ layer_new_invoker (Gimp *gimp, if (success) { - layer = gimp_layer_new (gimage, - width, height, - type, - name, + layer = gimp_layer_new (gimage, width, height, type, name, opacity / 100.0, mode); success = (layer != NULL); } diff --git a/app/pdb/misc_cmds.c b/app/pdb/misc_cmds.c index 9ba70f25a7..6eea2da3ae 100644 --- a/app/pdb/misc_cmds.c +++ b/app/pdb/misc_cmds.c @@ -124,7 +124,7 @@ static ProcRecord getpid_proc = "gimp-getpid", "Returns the PID of the host gimp process.", "This procedure returns the process ID of the currently running gimp.", - "Michael Natterer", + "Michael Natterer ", "Michael Natterer", "2005", NULL, diff --git a/app/pdb/palette_cmds.c b/app/pdb/palette_cmds.c index 20409fca3a..018d0d53b6 100644 --- a/app/pdb/palette_cmds.c +++ b/app/pdb/palette_cmds.c @@ -145,7 +145,6 @@ palette_duplicate_invoker (Gimp *gimp, gboolean success = TRUE; Argument *return_args; gchar *name; - GimpPalette *palette = NULL; GimpPalette *palette_copy = NULL; name = (gchar *) args[0].value.pdb_pointer; @@ -154,7 +153,7 @@ palette_duplicate_invoker (Gimp *gimp, if (success) { - palette = (GimpPalette *) + GimpPalette *palette = (GimpPalette *) gimp_container_get_child_by_name (gimp->palette_factory->container, name); if (palette) @@ -182,7 +181,7 @@ static ProcArg palette_duplicate_inargs[] = { GIMP_PDB_STRING, "name", - "The palette name." + "The palette name" } }; @@ -257,7 +256,7 @@ static ProcArg palette_rename_inargs[] = { GIMP_PDB_STRING, "name", - "The palette name." + "The palette name" }, { GIMP_PDB_STRING, @@ -301,7 +300,6 @@ palette_delete_invoker (Gimp *gimp, { gboolean success = TRUE; gchar *name; - GimpPalette *palette = NULL; name = (gchar *) args[0].value.pdb_pointer; if (name == NULL || !g_utf8_validate (name, -1, NULL)) @@ -309,7 +307,7 @@ palette_delete_invoker (Gimp *gimp, if (success) { - palette = (GimpPalette *) + GimpPalette *palette = (GimpPalette *) gimp_container_get_child_by_name (gimp->palette_factory->container, name); if (palette && GIMP_DATA (palette)->deletable) @@ -338,7 +336,7 @@ static ProcArg palette_delete_inargs[] = { GIMP_PDB_STRING, "name", - "The palette name." + "The palette name" } }; @@ -399,7 +397,7 @@ static ProcArg palette_is_editable_inargs[] = { GIMP_PDB_STRING, "name", - "The palette name." + "The palette name" } }; @@ -418,7 +416,7 @@ static ProcRecord palette_is_editable_proc = "gimp-palette-is-editable", "Tests if palette can be edited", "Returns True if you have permission to change the palette", - "Bill Skaggs ", "Bill Skaggs", "2004", NULL, @@ -466,7 +464,7 @@ static ProcArg palette_get_info_inargs[] = { GIMP_PDB_STRING, "name", - "The palette name." + "The palette name" } }; @@ -533,7 +531,7 @@ static ProcArg palette_get_columns_inargs[] = { GIMP_PDB_STRING, "name", - "The palette name." + "The palette name" } }; @@ -573,7 +571,6 @@ palette_set_columns_invoker (Gimp *gimp, gboolean success = TRUE; gchar *name; gint32 columns; - GimpPalette *palette = NULL; name = (gchar *) args[0].value.pdb_pointer; if (name == NULL || !g_utf8_validate (name, -1, NULL)) @@ -585,7 +582,7 @@ palette_set_columns_invoker (Gimp *gimp, if (success) { - palette = (GimpPalette *) + GimpPalette *palette = (GimpPalette *) gimp_container_get_child_by_name (gimp->palette_factory->container, name); if (palette && GIMP_DATA (palette)->writable) @@ -602,7 +599,7 @@ static ProcArg palette_set_columns_inargs[] = { GIMP_PDB_STRING, "name", - "The palette name." + "The palette name" }, { GIMP_PDB_INT32, @@ -640,7 +637,6 @@ palette_add_entry_invoker (Gimp *gimp, gchar *name; gchar *entry_name; GimpRGB color; - GimpPalette *palette = NULL; GimpPaletteEntry *entry = NULL; name = (gchar *) args[0].value.pdb_pointer; @@ -655,7 +651,7 @@ palette_add_entry_invoker (Gimp *gimp, if (success) { - palette = (GimpPalette *) + GimpPalette *palette = (GimpPalette *) gimp_container_get_child_by_name (gimp->palette_factory->container, name); if (palette && GIMP_DATA (palette)->writable) @@ -677,7 +673,7 @@ static ProcArg palette_add_entry_inargs[] = { GIMP_PDB_STRING, "name", - "The palette name." + "The palette name" }, { GIMP_PDB_STRING, @@ -727,8 +723,6 @@ palette_delete_entry_invoker (Gimp *gimp, gboolean success = TRUE; gchar *name; gint32 entry_num; - GimpPalette *palette = NULL; - GimpPaletteEntry *entry = NULL; name = (gchar *) args[0].value.pdb_pointer; if (name == NULL || !g_utf8_validate (name, -1, NULL)) @@ -738,14 +732,14 @@ palette_delete_entry_invoker (Gimp *gimp, if (success) { - palette = (GimpPalette *) + GimpPalette *palette = (GimpPalette *) gimp_container_get_child_by_name (gimp->palette_factory->container, name); if (palette && GIMP_DATA (palette)->writable) { 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); } @@ -764,7 +758,7 @@ static ProcArg palette_delete_entry_inargs[] = { GIMP_PDB_STRING, "name", - "The palette name." + "The palette name" }, { GIMP_PDB_INT32, @@ -802,8 +796,6 @@ palette_entry_get_color_invoker (Gimp *gimp, gchar *name; gint32 entry_num; GimpRGB color; - GimpPalette *palette = NULL; - GimpPaletteEntry *entry = NULL; name = (gchar *) args[0].value.pdb_pointer; if (name == NULL || !g_utf8_validate (name, -1, NULL)) @@ -813,14 +805,14 @@ palette_entry_get_color_invoker (Gimp *gimp, if (success) { - palette = (GimpPalette *) + GimpPalette *palette = (GimpPalette *) gimp_container_get_child_by_name (gimp->palette_factory->container, name); if (palette) { 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; } @@ -844,7 +836,7 @@ static ProcArg palette_entry_get_color_inargs[] = { GIMP_PDB_STRING, "name", - "The palette name." + "The palette name" }, { GIMP_PDB_INT32, @@ -890,8 +882,6 @@ palette_entry_set_color_invoker (Gimp *gimp, gchar *name; gint32 entry_num; GimpRGB color; - GimpPalette *palette = NULL; - GimpPaletteEntry *entry = NULL; name = (gchar *) args[0].value.pdb_pointer; if (name == NULL || !g_utf8_validate (name, -1, NULL)) @@ -903,14 +893,14 @@ palette_entry_set_color_invoker (Gimp *gimp, if (success) { - palette = (GimpPalette *) + GimpPalette *palette = (GimpPalette *) gimp_container_get_child_by_name (gimp->palette_factory->container, name); if (palette && GIMP_DATA (palette)->writable) { 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; @@ -931,7 +921,7 @@ static ProcArg palette_entry_set_color_inargs[] = { GIMP_PDB_STRING, "name", - "The palette name." + "The palette name" }, { GIMP_PDB_INT32, @@ -973,7 +963,6 @@ palette_entry_get_name_invoker (Gimp *gimp, Argument *return_args; gchar *name; gint32 entry_num; - GimpPalette *palette = NULL; GimpPaletteEntry *entry = NULL; name = (gchar *) args[0].value.pdb_pointer; @@ -984,7 +973,7 @@ palette_entry_get_name_invoker (Gimp *gimp, if (success) { - palette = (GimpPalette *) + GimpPalette *palette = (GimpPalette *) gimp_container_get_child_by_name (gimp->palette_factory->container, name); if (palette) @@ -1011,7 +1000,7 @@ static ProcArg palette_entry_get_name_inargs[] = { GIMP_PDB_STRING, "name", - "The palette name." + "The palette name" }, { GIMP_PDB_INT32, @@ -1057,8 +1046,6 @@ palette_entry_set_name_invoker (Gimp *gimp, gchar *name; gint32 entry_num; gchar *entry_name; - GimpPalette *palette = NULL; - GimpPaletteEntry *entry = NULL; name = (gchar *) args[0].value.pdb_pointer; if (name == NULL || !g_utf8_validate (name, -1, NULL)) @@ -1072,14 +1059,14 @@ palette_entry_set_name_invoker (Gimp *gimp, if (success) { - palette = (GimpPalette *) + GimpPalette *palette = (GimpPalette *) gimp_container_get_child_by_name (gimp->palette_factory->container, name); if (palette && GIMP_DATA (palette)->writable) { 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); entry->name = g_strdup (entry_name); @@ -1101,7 +1088,7 @@ static ProcArg palette_entry_set_name_inargs[] = { GIMP_PDB_STRING, "name", - "The palette name." + "The palette name" }, { GIMP_PDB_INT32, diff --git a/app/pdb/palettes_cmds.c b/app/pdb/palettes_cmds.c index 0d578fa983..9e968eba30 100644 --- a/app/pdb/palettes_cmds.c +++ b/app/pdb/palettes_cmds.c @@ -226,15 +226,15 @@ palettes_get_palette_entry_invoker (Gimp *gimp, if (success) { if (name && strlen (name)) - { - palette = (GimpPalette *) - gimp_container_get_child_by_name (gimp->palette_factory->container, - name); - } - else - { - palette = gimp_context_get_palette (context); - } + { + palette = (GimpPalette *) + gimp_container_get_child_by_name (gimp->palette_factory->container, + name); + } + else + { + palette = gimp_context_get_palette (context); + } if (palette) { diff --git a/app/pdb/paths_cmds.c b/app/pdb/paths_cmds.c index b077a4c841..8d3f1a9c00 100644 --- a/app/pdb/paths_cmds.c +++ b/app/pdb/paths_cmds.c @@ -162,7 +162,6 @@ path_get_current_invoker (Gimp *gimp, Argument *return_args; GimpImage *gimage; gchar *name = NULL; - GimpVectors *vectors; gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (! GIMP_IS_IMAGE (gimage)) @@ -170,7 +169,7 @@ path_get_current_invoker (Gimp *gimp, if (success) { - vectors = gimp_image_get_active_vectors (gimage); + GimpVectors *vectors = gimp_image_get_active_vectors (gimage); if (vectors) name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors))); @@ -231,7 +230,6 @@ path_set_current_invoker (Gimp *gimp, gboolean success = TRUE; GimpImage *gimage; gchar *name; - GimpVectors *vectors; gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (! GIMP_IS_IMAGE (gimage)) @@ -243,7 +241,7 @@ path_set_current_invoker (Gimp *gimp, if (success) { - vectors = gimp_image_get_vectors_by_name (gimage, name); + GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); if (vectors) gimp_image_set_active_vectors (gimage, vectors); @@ -295,7 +293,6 @@ path_delete_invoker (Gimp *gimp, gboolean success = TRUE; GimpImage *gimage; gchar *name; - GimpVectors *vectors; gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (! GIMP_IS_IMAGE (gimage)) @@ -307,7 +304,7 @@ path_delete_invoker (Gimp *gimp, if (success) { - vectors = gimp_image_get_vectors_by_name (gimage, name); + GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); if (vectors) gimp_image_remove_vectors (gimage, vectors); @@ -496,7 +493,6 @@ path_set_points_invoker (Gimp *gimp, gint32 ptype; gint32 num_path_points = 0; gdouble *points_pairs; - gboolean closed = FALSE; gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (! GIMP_IS_IMAGE (gimage)) @@ -516,6 +512,8 @@ path_set_points_invoker (Gimp *gimp, if (success) { + gboolean closed = FALSE; + if ((num_path_points / 3) % 3 == 0) closed = TRUE; 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 y_point = 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); if (! GIMP_IS_IMAGE (gimage)) @@ -695,6 +687,13 @@ path_get_point_at_dist_invoker (Gimp *gimp, if (success) { + GimpVectors *vectors; + GimpStroke *stroke; + gdouble distance_along; + gdouble stroke_length; + gdouble stroke_distance; + GimpCoords position; + vectors = gimp_image_get_active_vectors (gimage); if (vectors) @@ -813,7 +812,6 @@ path_get_tattoo_invoker (Gimp *gimp, GimpImage *gimage; gchar *name; gint32 tattoo = 0; - GimpVectors *vectors; gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (! GIMP_IS_IMAGE (gimage)) @@ -825,7 +823,7 @@ path_get_tattoo_invoker (Gimp *gimp, if (success) { - vectors = gimp_image_get_vectors_by_name (gimage, name); + GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); if (vectors) tattoo = gimp_item_get_tattoo (GIMP_ITEM (vectors)); @@ -892,7 +890,6 @@ path_set_tattoo_invoker (Gimp *gimp, GimpImage *gimage; gchar *name; gint32 tattovalue = 0; - GimpVectors *vectors; gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (! GIMP_IS_IMAGE (gimage)) @@ -906,7 +903,7 @@ path_set_tattoo_invoker (Gimp *gimp, if (success) { - vectors = gimp_image_get_vectors_by_name (gimage, name); + GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); if (vectors) gimp_item_set_tattoo (GIMP_ITEM (vectors), tattovalue); @@ -965,7 +962,6 @@ get_path_by_tattoo_invoker (Gimp *gimp, GimpImage *gimage; gint32 tattoo; gchar *name = NULL; - GimpVectors *vectors; gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (! GIMP_IS_IMAGE (gimage)) @@ -975,7 +971,7 @@ get_path_by_tattoo_invoker (Gimp *gimp, if (success) { - vectors = gimp_image_get_vectors_by_tattoo (gimage, tattoo); + GimpVectors *vectors = gimp_image_get_vectors_by_tattoo (gimage, tattoo); if (vectors) name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors))); @@ -1043,7 +1039,6 @@ path_get_locked_invoker (Gimp *gimp, GimpImage *gimage; gchar *name; gboolean locked = FALSE; - GimpVectors *vectors; gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (! GIMP_IS_IMAGE (gimage)) @@ -1055,7 +1050,7 @@ path_get_locked_invoker (Gimp *gimp, if (success) { - vectors = gimp_image_get_vectors_by_name (gimage, name); + GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); if (vectors) locked = gimp_item_get_linked (GIMP_ITEM (vectors)); @@ -1122,7 +1117,6 @@ path_set_locked_invoker (Gimp *gimp, GimpImage *gimage; gchar *name; gboolean locked = FALSE; - GimpVectors *vectors; gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (! GIMP_IS_IMAGE (gimage)) @@ -1136,7 +1130,7 @@ path_set_locked_invoker (Gimp *gimp, if (success) { - vectors = gimp_image_get_vectors_by_name (gimage, name); + GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); if (vectors) gimp_item_set_linked (GIMP_ITEM (vectors), locked, TRUE); @@ -1195,7 +1189,6 @@ path_get_visible_invoker (Gimp *gimp, GimpImage *gimage; gchar *name; gboolean visible = FALSE; - GimpVectors *vectors; gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (! GIMP_IS_IMAGE (gimage)) @@ -1207,7 +1200,7 @@ path_get_visible_invoker (Gimp *gimp, if (success) { - vectors = gimp_image_get_vectors_by_name (gimage, name); + GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); if (vectors) visible = gimp_item_get_visible (GIMP_ITEM (vectors)); @@ -1274,7 +1267,6 @@ path_set_visible_invoker (Gimp *gimp, GimpImage *gimage; gchar *name; gboolean visible = FALSE; - GimpVectors *vectors; gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (! GIMP_IS_IMAGE (gimage)) @@ -1288,7 +1280,7 @@ path_set_visible_invoker (Gimp *gimp, if (success) { - vectors = gimp_image_get_vectors_by_name (gimage, name); + GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); if (vectors) gimp_item_set_visible (GIMP_ITEM (vectors), visible, TRUE); @@ -1324,7 +1316,7 @@ static ProcRecord path_set_visible_proc = "gimp-path-set-visible", "Sets the visibility of the named path.", "This procedure sets the specified path's visibility.", - "Sven Neumann", + "Sven Neumann ", "Sven Neumann", "2005", NULL, @@ -1350,7 +1342,6 @@ path_to_selection_invoker (Gimp *gimp, gboolean feather; gdouble feather_radius_x; gdouble feather_radius_y; - GimpVectors *vectors; gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (! GIMP_IS_IMAGE (gimage)) @@ -1374,7 +1365,7 @@ path_to_selection_invoker (Gimp *gimp, if (success) { - vectors = gimp_image_get_vectors_by_name (gimage, name); + GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); if (vectors) gimp_channel_select_vectors (gimp_image_get_mask (gimage), @@ -1437,8 +1428,8 @@ static ProcRecord path_to_selection_proc = "gimp-path-to-selection", "Transforms the active path into a selection", "This procedure renders the desired path into the current selection.", - "Joao S. O. Bueno", - "Joao S. O. Bueno", + "Jo\xc3\xa3o S. O. Bueno Calligaris", + "Jo\xc3\xa3o S. O. Bueno Calligaris", "2003", NULL, GIMP_INTERNAL, @@ -1509,7 +1500,7 @@ static ProcRecord path_import_proc = "gimp-path-import", "Import paths from an SVG file.", "This procedure imports paths from an SVG file. SVG elements other than paths and basic shapes are ignored.", - "Sven Neumann", + "Sven Neumann ", "Sven Neumann", "2003", NULL, @@ -1589,7 +1580,7 @@ static ProcRecord path_import_string_proc = "gimp-path-import-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.", - "Sven Neumann", + "Sven Neumann ", "Sven Neumann", "2005", NULL, diff --git a/app/pdb/patterns_cmds.c b/app/pdb/patterns_cmds.c index 32296a4034..4bc194661d 100644 --- a/app/pdb/patterns_cmds.c +++ b/app/pdb/patterns_cmds.c @@ -65,7 +65,7 @@ static ProcRecord patterns_refresh_proc = "gimp-patterns-refresh", "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.", - "Michael Natterer", + "Michael Natterer ", "Michael Natterer", "2002", NULL, diff --git a/app/pdb/plug_in_cmds.c b/app/pdb/plug_in_cmds.c index 2acf337e6d..0395454810 100644 --- a/app/pdb/plug_in_cmds.c +++ b/app/pdb/plug_in_cmds.c @@ -244,7 +244,7 @@ static ProcRecord plugin_domain_register_proc = "gimp-plugin-domain-register", "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.", - "Sven Neumann", + "Sven Neumann ", "Sven Neumann", "2000", NULL, @@ -311,7 +311,7 @@ static ProcRecord plugin_help_register_proc = "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.", "Michael Natterer ", - "Michael Natterer ", + "Michael Natterer", "2000", NULL, GIMP_INTERNAL, @@ -380,7 +380,7 @@ static ProcRecord plugin_menu_register_proc = "Register an additional menu path for a plug-in procedure.", "This procedure installs an additional menu entry for the given procedure.", "Michael Natterer ", - "Michael Natterer ", + "Michael Natterer", "2004", NULL, GIMP_INTERNAL, @@ -452,7 +452,7 @@ static ProcRecord plugin_menu_branch_register_proc = "Register a sub-menu.", "This procedure installs an sub-menu which does not belong to any procedure.", "Michael Natterer ", - "Michael Natterer ", + "Michael Natterer", "2005", NULL, GIMP_INTERNAL, @@ -547,7 +547,7 @@ static ProcRecord plugin_icon_register_proc = "Register an icon for a plug-in procedure.", "This procedure installs an icon for the given procedure.", "Michael Natterer ", - "Michael Natterer ", + "Michael Natterer", "2004", NULL, GIMP_INTERNAL, diff --git a/app/pdb/procedural_db_cmds.c b/app/pdb/procedural_db_cmds.c index 82f8e6bdcf..22d3f74481 100644 --- a/app/pdb/procedural_db_cmds.c +++ b/app/pdb/procedural_db_cmds.c @@ -64,6 +64,7 @@ procedural_db_temp_name_invoker (Gimp *gimp, { Argument *return_args; gchar *temp_name; + static gint proc_number = 0; temp_name = g_strdup_printf ("temp-procedure-number-%d", proc_number++); @@ -636,7 +637,6 @@ procedural_db_get_data_invoker (Gimp *gimp, gchar *identifier; gint32 bytes; guint8 *data_copy = NULL; - const guint8 *data; identifier = (gchar *) args[0].value.pdb_pointer; if (identifier == NULL || !g_utf8_validate (identifier, -1, NULL)) @@ -644,7 +644,8 @@ procedural_db_get_data_invoker (Gimp *gimp, if (success) { - gchar *canonical; + const guint8 *data; + gchar *canonical; canonical = gimp_canonicalize_identifier (identifier); @@ -719,7 +720,6 @@ procedural_db_get_data_size_invoker (Gimp *gimp, Argument *return_args; gchar *identifier; gint32 bytes; - const guint8 *data; identifier = (gchar *) args[0].value.pdb_pointer; if (identifier == NULL || !g_utf8_validate (identifier, -1, NULL)) @@ -727,7 +727,8 @@ procedural_db_get_data_size_invoker (Gimp *gimp, if (success) { - gchar *canonical; + const guint8 *data; + gchar *canonical; canonical = gimp_canonicalize_identifier (identifier); diff --git a/app/pdb/selection_cmds.c b/app/pdb/selection_cmds.c index 16da47fff3..d2b057c4c1 100644 --- a/app/pdb/selection_cmds.c +++ b/app/pdb/selection_cmds.c @@ -867,7 +867,6 @@ selection_layer_alpha_invoker (Gimp *gimp, { gboolean success = TRUE; GimpLayer *layer; - GimpImage *gimage; 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)))) @@ -875,7 +874,8 @@ selection_layer_alpha_invoker (Gimp *gimp, 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_DRAWABLE (layer), GIMP_CHANNEL_OP_REPLACE, FALSE, 0.0, 0.0); diff --git a/app/pdb/selection_tools_cmds.c b/app/pdb/selection_tools_cmds.c index fce48b8e97..6034efb129 100644 --- a/app/pdb/selection_tools_cmds.c +++ b/app/pdb/selection_tools_cmds.c @@ -64,7 +64,6 @@ by_color_select_invoker (Gimp *gimp, gboolean feather; gdouble feather_radius; gboolean sample_merged; - GimpImage *gimage; 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)))) @@ -90,7 +89,7 @@ by_color_select_invoker (Gimp *gimp, 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, sample_merged, @@ -213,14 +212,16 @@ ellipse_select_invoker (Gimp *gimp, feather_radius = args[8].value.pdb_float; if (success) - gimp_channel_select_ellipse (gimp_image_get_mask (gimage), - (gint) x, (gint) y, - (gint) width, (gint) height, - operation, - antialias, - feather, - feather_radius, - feather_radius); + { + gimp_channel_select_ellipse (gimp_image_get_mask (gimage), + (gint) x, (gint) y, + (gint) width, (gint) height, + operation, + antialias, + feather, + feather_radius, + feather_radius); + } 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; if (success) - gimp_channel_select_polygon (gimp_image_get_mask (gimage), - _("Free Select"), - num_segs, - (GimpVector2 *) segs, - operation, - antialias, - feather, - feather_radius, - feather_radius); + { + gimp_channel_select_polygon (gimp_image_get_mask (gimage), + _("Free Select"), + num_segs, + (GimpVector2 *) segs, + operation, + antialias, + feather, + feather_radius, + feather_radius); + } return procedural_db_return_args (&free_select_proc, success); } @@ -416,7 +419,6 @@ fuzzy_select_invoker (Gimp *gimp, gboolean feather; gdouble feather_radius; gboolean sample_merged; - GimpImage *gimage; 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)))) @@ -444,7 +446,7 @@ fuzzy_select_invoker (Gimp *gimp, 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), drawable, @@ -571,13 +573,15 @@ rect_select_invoker (Gimp *gimp, feather_radius = args[7].value.pdb_float; if (success) - gimp_channel_select_rectangle (gimp_image_get_mask (gimage), - (gint) x, (gint) y, - (gint) width, (gint) height, - operation, - feather, - feather_radius, - feather_radius); + { + gimp_channel_select_rectangle (gimp_image_get_mask (gimage), + (gint) x, (gint) y, + (gint) width, (gint) height, + operation, + feather, + feather_radius, + feather_radius); + } return procedural_db_return_args (&rect_select_proc, success); } diff --git a/app/pdb/text_tool_cmds.c b/app/pdb/text_tool_cmds.c index a1f3ab6601..7cb0fd8844 100644 --- a/app/pdb/text_tool_cmds.c +++ b/app/pdb/text_tool_cmds.c @@ -221,7 +221,6 @@ text_get_extents_fontname_invoker (Gimp *gimp, gint32 height; gint32 ascent; gint32 descent; - gchar *real_fontname; text = (gchar *) args[0].value.pdb_pointer; if (text == NULL || !g_utf8_validate (text, -1, NULL)) @@ -241,7 +240,7 @@ text_get_extents_fontname_invoker (Gimp *gimp, 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, &width, &height, @@ -580,7 +579,6 @@ text_get_extents_invoker (Gimp *gimp, gint32 height; gint32 ascent; gint32 descent; - gchar *real_fontname; text = (gchar *) args[0].value.pdb_pointer; if (text == NULL || !g_utf8_validate (text, -1, NULL)) @@ -628,7 +626,7 @@ text_get_extents_invoker (Gimp *gimp, 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, &width, &height, diff --git a/app/pdb/transform_tools_cmds.c b/app/pdb/transform_tools_cmds.c index e53eb8108e..a19252e143 100644 --- a/app/pdb/transform_tools_cmds.c +++ b/app/pdb/transform_tools_cmds.c @@ -498,22 +498,22 @@ static ProcArg scale_inargs[] = { GIMP_PDB_FLOAT, "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, "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, "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, "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" } }; diff --git a/app/pdb/undo_cmds.c b/app/pdb/undo_cmds.c index bcfd61736c..6293f6efd8 100644 --- a/app/pdb/undo_cmds.c +++ b/app/pdb/undo_cmds.c @@ -59,7 +59,6 @@ image_undo_group_start_invoker (Gimp *gimp, { gboolean success = TRUE; GimpImage *gimage; - gchar *undo_desc = NULL; gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (! GIMP_IS_IMAGE (gimage)) @@ -67,6 +66,8 @@ image_undo_group_start_invoker (Gimp *gimp, if (success) { + gchar *undo_desc = NULL; + if (gimp->current_plug_in) undo_desc = plug_in_get_undo_desc (gimp->current_plug_in); diff --git a/app/pdb/unit_cmds.c b/app/pdb/unit_cmds.c index ae3054467d..99f1cc01d3 100644 --- a/app/pdb/unit_cmds.c +++ b/app/pdb/unit_cmds.c @@ -89,7 +89,7 @@ static ProcRecord unit_get_number_of_units_proc = "gimp-unit-get-number-of-units", "Returns the number of units.", "This procedure returns the number of defined units.", - "Michael Natterer", + "Michael Natterer ", "Michael Natterer", "1999", NULL, @@ -130,7 +130,7 @@ static ProcRecord unit_get_number_of_built_in_units_proc = "gimp-unit-get-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.", - "Michael Natterer", + "Michael Natterer ", "Michael Natterer", "1999", NULL, @@ -184,8 +184,10 @@ unit_new_invoker (Gimp *gimp, success = FALSE; 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); @@ -249,7 +251,7 @@ static ProcRecord unit_new_proc = "gimp-unit-new", "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.", - "Michael Natterer", + "Michael Natterer ", "Michael Natterer", "1999", NULL, @@ -307,7 +309,7 @@ static ProcRecord unit_get_deletion_flag_proc = "gimp-unit-get-deletion-flag", "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.", - "Michael Natterer", + "Michael Natterer ", "Michael Natterer", "1999", NULL, @@ -361,7 +363,7 @@ static ProcRecord unit_set_deletion_flag_proc = "gimp-unit-set-deletion-flag", "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.", - "Michael Natterer", + "Michael Natterer ", "Michael Natterer", "1999", NULL, @@ -419,7 +421,7 @@ static ProcRecord unit_get_identifier_proc = "gimp-unit-get-identifier", "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.", - "Michael Natterer", + "Michael Natterer ", "Michael Natterer", "1999", NULL, @@ -477,7 +479,7 @@ static ProcRecord unit_get_factor_proc = "gimp-unit-get-factor", "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.", - "Michael Natterer", + "Michael Natterer ", "Michael Natterer", "1999", NULL, @@ -535,7 +537,7 @@ static ProcRecord unit_get_digits_proc = "gimp-unit-get-digits", "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.", - "Michael Natterer", + "Michael Natterer ", "Michael Natterer", "1999", NULL, @@ -593,7 +595,7 @@ static ProcRecord unit_get_symbol_proc = "gimp-unit-get-symbol", "Returns the symbol of the unit.", "This procedure returns the symbol of the unit (\"''\" for inches).", - "Michael Natterer", + "Michael Natterer ", "Michael Natterer", "1999", NULL, @@ -651,7 +653,7 @@ static ProcRecord unit_get_abbreviation_proc = "gimp-unit-get-abbreviation", "Returns the abbreviation of the unit.", "This procedure returns the abbreviation of the unit (\"in\" for inches).", - "Michael Natterer", + "Michael Natterer ", "Michael Natterer", "1999", NULL, @@ -709,7 +711,7 @@ static ProcRecord unit_get_singular_proc = "gimp-unit-get-singular", "Returns the singular form of the unit.", "This procedure returns the singular form of the unit.", - "Michael Natterer", + "Michael Natterer ", "Michael Natterer", "1999", NULL, @@ -767,7 +769,7 @@ static ProcRecord unit_get_plural_proc = "gimp-unit-get-plural", "Returns the plural form of the unit.", "This procedure returns the plural form of the unit.", - "Michael Natterer", + "Michael Natterer ", "Michael Natterer", "1999", NULL, diff --git a/app/pdb/vectors_cmds.c b/app/pdb/vectors_cmds.c index 7d47aedfd5..e2628102ec 100644 --- a/app/pdb/vectors_cmds.c +++ b/app/pdb/vectors_cmds.c @@ -97,7 +97,7 @@ vectors_new_invoker (Gimp *gimp, gboolean success = TRUE; Argument *return_args; GimpImage *gimage; - gchar *name = NULL; + gchar *name; GimpVectors *vectors = NULL; gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); @@ -173,8 +173,6 @@ vectors_get_strokes_invoker (Gimp *gimp, GimpVectors *vectors; gint32 num_strokes = 0; gint32 *stroke_ids = NULL; - gint i = 0; - GimpStroke *cur_stroke = NULL; 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)))) @@ -186,6 +184,9 @@ vectors_get_strokes_invoker (Gimp *gimp, if (num_strokes) { + GimpStroke *cur_stroke; + gint i = 0; + stroke_ids = g_new (gint32, num_strokes); for (cur_stroke = gimp_vectors_stroke_get_next (vectors, NULL); @@ -386,7 +387,7 @@ vectors_set_linked_invoker (Gimp *gimp, { gboolean success = TRUE; GimpVectors *vectors; - gboolean linked = FALSE; + gboolean linked; 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)))) @@ -506,7 +507,7 @@ vectors_set_visible_invoker (Gimp *gimp, { gboolean success = TRUE; GimpVectors *vectors; - gboolean visible = FALSE; + gboolean visible; 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)))) @@ -626,7 +627,7 @@ vectors_set_name_invoker (Gimp *gimp, { gboolean success = TRUE; GimpVectors *vectors; - gchar *name = NULL; + gchar *name; 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)))) @@ -749,7 +750,7 @@ vectors_set_tattoo_invoker (Gimp *gimp, { gboolean success = TRUE; GimpVectors *vectors; - gint32 tattoo = 0; + gint32 tattoo; 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)))) @@ -808,8 +809,7 @@ vectors_stroke_get_length_invoker (Gimp *gimp, GimpVectors *vectors; gint32 stroke_id; gdouble prescision; - gdouble length; - GimpStroke *stroke; + gdouble length = 0; 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)))) @@ -821,16 +821,12 @@ vectors_stroke_get_length_invoker (Gimp *gimp, 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) - { - success = FALSE; - } + if (stroke) + length = gimp_stroke_get_length (stroke, prescision); else - { - length = gimp_stroke_get_length (stroke, prescision); - } + success = FALSE; } 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", - "measures the length of the given stroke.", + "Measure the length of the given stroke.", "Measure the length of the given stroke.", "Simon Budig", "Simon Budig", @@ -903,8 +899,6 @@ vectors_stroke_get_point_at_dist_invoker (Gimp *gimp, gdouble y_point = 0; gdouble slope = 0; gboolean valid = FALSE; - GimpStroke *stroke; - GimpCoords coord; 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)))) @@ -918,10 +912,12 @@ vectors_stroke_get_point_at_dist_invoker (Gimp *gimp, 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) { + GimpCoords coord; + valid = gimp_stroke_get_point_at_dist (stroke, dist, prescision, &coord, &slope); x_point = valid ? coord.x : 0; @@ -1021,7 +1017,6 @@ vectors_stroke_remove_invoker (Gimp *gimp, gboolean success = TRUE; GimpVectors *vectors; gint32 stroke_id; - GimpStroke *stroke; 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)))) @@ -1031,7 +1026,7 @@ vectors_stroke_remove_invoker (Gimp *gimp, 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) gimp_vectors_stroke_remove (vectors, stroke); @@ -1083,7 +1078,6 @@ vectors_stroke_close_invoker (Gimp *gimp, gboolean success = TRUE; GimpVectors *vectors; gint32 stroke_id; - GimpStroke *stroke; 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)))) @@ -1093,7 +1087,7 @@ vectors_stroke_close_invoker (Gimp *gimp, 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) gimp_stroke_close (stroke); @@ -1147,7 +1141,6 @@ vectors_stroke_translate_invoker (Gimp *gimp, gint32 stroke_id; gint32 off_x; gint32 off_y; - GimpStroke *stroke; 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)))) @@ -1161,7 +1154,7 @@ vectors_stroke_translate_invoker (Gimp *gimp, 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) gimp_stroke_translate (stroke, off_x, off_y); @@ -1225,7 +1218,6 @@ vectors_stroke_scale_invoker (Gimp *gimp, gint32 stroke_id; gdouble scale_x; gdouble scale_y; - GimpStroke *stroke; 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)))) @@ -1239,7 +1231,7 @@ vectors_stroke_scale_invoker (Gimp *gimp, 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) gimp_stroke_scale (stroke, scale_x, scale_y); @@ -1306,9 +1298,6 @@ vectors_stroke_interpolate_invoker (Gimp *gimp, gboolean closed; gint32 num_coords = 0; gdouble *coords = NULL; - GimpStroke *stroke; - GArray *coords_array; - gint i; 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)))) @@ -1320,11 +1309,15 @@ vectors_stroke_interpolate_invoker (Gimp *gimp, 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) { + GArray *coords_array; + gint i; + coords_array = gimp_stroke_interpolate (stroke, prescision, &closed); + if (coords_array) { num_coords = coords_array->len; @@ -1429,8 +1422,6 @@ vectors_bezier_stroke_new_moveto_invoker (Gimp *gimp, gdouble x0 = 0; gdouble y0 = 0; gint32 stroke_id = 0; - GimpStroke *stroke; - GimpCoords coord0; 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)))) @@ -1442,12 +1433,15 @@ vectors_bezier_stroke_new_moveto_invoker (Gimp *gimp, if (success) { - coord0.x = x0; - coord0.y = y0; + GimpStroke *stroke; + 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; + coord0.xtilt = GIMP_COORDS_DEFAULT_TILT; + coord0.ytilt = GIMP_COORDS_DEFAULT_TILT; + coord0.wheel = GIMP_COORDS_DEFAULT_WHEEL; stroke = gimp_bezier_stroke_new_moveto (&coord0); gimp_vectors_stroke_add (vectors, stroke); @@ -1519,8 +1513,6 @@ vectors_bezier_stroke_lineto_invoker (Gimp *gimp, gint32 stroke_id; gdouble x0 = 0; gdouble y0 = 0; - GimpStroke *stroke; - GimpCoords coord0; 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)))) @@ -1534,18 +1526,25 @@ vectors_bezier_stroke_lineto_invoker (Gimp *gimp, if (success) { - 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; + GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id); - stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id); 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 - success = FALSE; + { + success = FALSE; + } } 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; GimpVectors *vectors; gint32 stroke_id; - gdouble x0 = 0; - gdouble y0 = 0; - gdouble x1 = 0; - gdouble y1 = 0; - GimpStroke *stroke; - GimpCoords coord0, coord1; + gdouble x0; + gdouble y0; + gdouble x1; + gdouble y1; 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)))) @@ -1625,22 +1622,29 @@ vectors_bezier_stroke_conicto_invoker (Gimp *gimp, if (success) { - 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; + GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id); - coord1 = coord0; - coord1.x = x1; - coord1.y = y1; - - stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id); 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 - success = FALSE; + { + success = FALSE; + } } 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; GimpVectors *vectors; gint32 stroke_id; - gdouble x0 = 0; - gdouble y0 = 0; - gdouble x1 = 0; - gdouble y1 = 0; - gdouble x2 = 0; - gdouble y2 = 0; - GimpStroke *stroke; - GimpCoords coord0, coord1, coord2; + gdouble x0; + gdouble y0; + gdouble x1; + gdouble y1; + gdouble x2; + gdouble y2; 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)))) @@ -1736,26 +1738,33 @@ vectors_bezier_stroke_cubicto_invoker (Gimp *gimp, if (success) { - 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; + GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id); - 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) - 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 - success = FALSE; + { + success = FALSE; + } } 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; Argument *return_args; GimpVectors *vectors; - gdouble x0 = 0; - gdouble y0 = 0; - gdouble radius_x = 0; - gdouble radius_y = 0; - gdouble angle = 0; + gdouble x0; + gdouble y0; + gdouble radius_x; + gdouble radius_y; + gdouble angle; gint32 stroke_id = 0; - GimpStroke *stroke; - GimpCoords coord0; 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)))) @@ -1857,12 +1864,15 @@ vectors_bezier_stroke_new_ellipse_invoker (Gimp *gimp, if (success) { - coord0.x = x0; - coord0.y = y0; + GimpStroke *stroke; + 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; + coord0.xtilt = GIMP_COORDS_DEFAULT_TILT; + coord0.ytilt = GIMP_COORDS_DEFAULT_TILT; + coord0.wheel = GIMP_COORDS_DEFAULT_WHEEL; stroke = gimp_bezier_stroke_new_ellipse (&coord0, radius_x, radius_y, angle); gimp_vectors_stroke_add (vectors, stroke); diff --git a/libgimp/gimpcolor_pdb.c b/libgimp/gimpcolor_pdb.c index 251234def1..3e25fa5e30 100644 --- a/libgimp/gimpcolor_pdb.c +++ b/libgimp/gimpcolor_pdb.c @@ -618,8 +618,8 @@ gimp_histogram (gint32 drawable_ID, * @drawable_ID: The drawable. * @hue_range: Range of affected hues. * @hue_offset: Hue offset in degrees. - * @lightness: lightness modification. - * @saturation: saturation modification. + * @lightness: Lightness modification. + * @saturation: Saturation modification. * * Modify hue, lightness, and saturation in the specified drawable. * diff --git a/libgimp/gimpdrawabletransform_pdb.c b/libgimp/gimpdrawabletransform_pdb.c index 614100b258..b7d20cb29b 100644 --- a/libgimp/gimpdrawabletransform_pdb.c +++ b/libgimp/gimpdrawabletransform_pdb.c @@ -524,10 +524,10 @@ gimp_drawable_transform_rotate_default (gint32 drawable_ID, /** * gimp_drawable_transform_scale: * @drawable_ID: The affected drawable. - * @x0: The new x coordinate of upper-left corner of newly scaled region. - * @y0: The new y coordinate of upper-left corner of newly scaled region. - * @x1: The new x coordinate of lower-right corner of newly scaled region. - * @y1: The new y coordinate of lower-right 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 the upper-left corner of the scaled region. + * @x1: The new x coordinate of the lower-right corner of the scaled region. + * @y1: The new y coordinate of the lower-right corner of the scaled region. * @transform_direction: Direction of Transformation. * @interpolation: Type of interpolation. * @supersample: Whether to perform supersample. @@ -589,10 +589,10 @@ gimp_drawable_transform_scale (gint32 drawable_ID, /** * gimp_drawable_transform_scale_default: * @drawable_ID: The affected drawable. - * @x0: The new x coordinate of upper-left corner of newly scaled region. - * @y0: The new y coordinate of upper-left corner of newly scaled region. - * @x1: The new x coordinate of lower-right corner of newly scaled region. - * @y1: The new y coordinate of lower-right 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 the upper-left corner of the scaled region. + * @x1: The new x coordinate of the lower-right corner of the scaled region. + * @y1: The new y coordinate of the lower-right corner of the scaled region. * @interpolate: Whether to use interpolation and supersampling. * @clip_result: Whether to clip results. * diff --git a/libgimp/gimptransformtools_pdb.c b/libgimp/gimptransformtools_pdb.c index 13c3e9f4d3..b490600227 100644 --- a/libgimp/gimptransformtools_pdb.c +++ b/libgimp/gimptransformtools_pdb.c @@ -152,10 +152,10 @@ gimp_rotate (gint32 drawable_ID, * gimp_scale: * @drawable_ID: The affected drawable. * @interpolation: Whether to use interpolation. - * @x0: The new x coordinate of upper-left corner of newly scaled region. - * @y0: The new y coordinate of upper-left corner of newly scaled region. - * @x1: The new x coordinate of lower-right corner of newly scaled region. - * @y1: The new y coordinate of lower-right 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 the upper-left corner of the scaled region. + * @x1: The new x coordinate of the lower-right corner of the scaled region. + * @y1: The new y coordinate of the lower-right corner of the scaled region. * * This procedure is deprecated! Use * gimp_drawable_transform_scale_default() instead. diff --git a/libgimp/gimpvectors_pdb.c b/libgimp/gimpvectors_pdb.c index 6022cfaf9e..bc0802e9c6 100644 --- a/libgimp/gimpvectors_pdb.c +++ b/libgimp/gimpvectors_pdb.c @@ -408,7 +408,7 @@ gimp_vectors_set_tattoo (gint32 vectors_ID, * @stroke_id: The stroke ID. * @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. * diff --git a/tools/pdbgen/pdb/brush.pdb b/tools/pdbgen/pdb/brush.pdb index 57a893dd1e..aabb1fee23 100644 --- a/tools/pdbgen/pdb/brush.pdb +++ b/tools/pdbgen/pdb/brush.pdb @@ -17,32 +17,12 @@ # "Perlized" from C source by Manish Singh -sub mitch_misc { - $author = 'Michael Natterer '; - $copyright = 'Michael Natterer'; - $date = '2004'; - $since = '2.2'; -} - -sub bill_misc { - $author = 'Bill Skaggs 'name', type => 'string', desc => 'The brush name' }} -sub spacing_arg () {{ - name => 'spacing', - type => '0 <= int32 <= 1000', - desc => 'The brush spacing: %%desc%%' -}} - # The defs @@ -50,7 +30,7 @@ sub brush_new { $blurb = "Creates a new brush"; $help = "This procedure creates a new, uninitialized brush"; - &mitch_misc; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( { name => 'name', type => 'string', @@ -80,7 +60,7 @@ sub brush_duplicate { $blurb = "Duplicates a brush"; $help = "This procedure creates an identical brush by a different name"; - &mitch_misc; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( &brush_arg @@ -120,7 +100,7 @@ sub brush_is_generated { $blurb = "Tests if generated"; $help = "Returns True if this brush is parametric, False for other types"; - &bill_misc; + &bill_pdb_misc('2004', '2.4'); @inargs = ( &brush_arg @@ -153,7 +133,7 @@ sub brush_is_editable { $blurb = "Tests if brush can be edited"; $help = "Returns True if you have permission to change the brush"; - &bill_misc; + &bill_pdb_misc('2004', '2.4'); @inargs = ( &brush_arg @@ -186,7 +166,7 @@ sub brush_rename { $blurb = "Rename a brush"; $help = "This procedure renames a brush"; - &mitch_misc; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( &brush_arg, @@ -220,7 +200,7 @@ sub brush_delete { $blurb = "Deletes a brush"; $help = "This procedure deletes a brush"; - &mitch_misc; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( &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). HELP - &mitch_misc; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( &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. HELP - &mitch_misc; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( &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. HELP - &mitch_misc; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( &brush_arg ); @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 = ( vars => [ 'GimpBrush *brush = NULL' ], @@ -407,7 +387,7 @@ Square (GIMP_BRUSH_GENERATED_SQUARE), and Diamond added in the future. HELP - &bill_misc; + &bill_pdb_misc('2004', '2.4'); @inargs = ( &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. HELP - &bill_misc; + &bill_pdb_misc('2004', '2.4'); @inargs = ( &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. HELP - &bill_misc; + &bill_pdb_misc('2004', '2.4'); @inargs = ( &brush_arg @@ -511,7 +491,7 @@ outside edge. If called for any other type of brush, the function does not succeed. HELP - &bill_misc; + &bill_pdb_misc('2004', '2.4'); @inargs = ( &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. HELP - &bill_misc; + &bill_pdb_misc('2004', '2.4'); @inargs = ( &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. HELP - &bill_misc; + &bill_pdb_misc('2004', '2.4'); @inargs = ( &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. HELP - &bill_misc; + &bill_pdb_misc('2004', '2.4'); @inargs = ( &brush_arg, - &spacing_arg + { name => 'spacing', type => '0 <= int32 <= 1000', + desc => 'The brush spacing: %%desc%%' } ); %invoke = ( @@ -649,7 +630,7 @@ Square (GIMP_BRUSH_GENERATED_SQUARE), and Diamond added in the future. HELP - &bill_misc; + &bill_pdb_misc('2004', '2.4'); @inargs = ( &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. HELP - &bill_misc; + &bill_pdb_misc('2004', '2.4'); @inargs = ( &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. HELP - &bill_misc; + &bill_pdb_misc('2004', '2.4'); @inargs = ( &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. HELP - &bill_misc; + &bill_pdb_misc('2004', '2.4'); @inargs = ( &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. HELP - &bill_misc; + &bill_pdb_misc('2004', '2.4'); @inargs = ( &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. HELP - &bill_misc; + &bill_pdb_misc('2004', '2.4'); @inargs = ( &brush_arg, diff --git a/tools/pdbgen/pdb/brush_select.pdb b/tools/pdbgen/pdb/brush_select.pdb index ae29bd18ee..ceebd48c18 100644 --- a/tools/pdbgen/pdb/brush_select.pdb +++ b/tools/pdbgen/pdb/brush_select.pdb @@ -17,11 +17,6 @@ # "Perlized" from C source by Manish Singh -sub pdb_misc { - $author = $copyright = 'Andy Thomas'; - $date = '1998'; -} - sub brush_args {( { name => 'opacity', type => '0 <= float <= 100', @@ -36,10 +31,9 @@ sub brush_args {( sub brushes_popup { $blurb = 'Invokes the Gimp brush selection.'; + $help = 'This procedure popups the brush selection dialog.'; - $help = 'This procedure popups the brush selection dialog.'; - - &pdb_misc; + &andy_pdb_misc('1998'); @inargs = ( { name => 'brush_callback', type => 'string', @@ -72,10 +66,9 @@ CODE sub brushes_close_popup { $blurb = 'Popdown the Gimp brush selection.'; + $help = 'This procedure closes an opened brush selection dialog.'; - $help = 'This procedure closes an opened brush selection dialog.'; - - &pdb_misc; + &andy_pdb_misc('1998'); @inargs = ( { name => 'brush_callback', type => 'string', @@ -97,10 +90,9 @@ CODE sub brushes_set_popup { $blurb = 'Sets the current brush selection in a popup.'; + $help = $blurb; - $help = $blurb; - - &pdb_misc; + &andy_pdb_misc('1998'); @inargs = ( { name => 'brush_callback', type => 'string', diff --git a/tools/pdbgen/pdb/brushes.pdb b/tools/pdbgen/pdb/brushes.pdb index 1a8dfed100..41efdc8a93 100644 --- a/tools/pdbgen/pdb/brushes.pdb +++ b/tools/pdbgen/pdb/brushes.pdb @@ -17,65 +17,6 @@ # "Perlized" from C source by Manish Singh -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 { $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. HELP - $author = $copyright = 'Seth Burgess'; - $date = '1997'; + &seth_pdb_misc('1997'); %invoke = ( code => 'gimp_data_factory_data_refresh (gimp->brush_factory);' @@ -126,13 +66,20 @@ sub brushes_get_brush { &std_pdb_deprecated ('gimp-context-get-brush'); @outargs = ( - &brush_arg, - &dim_args, - &spacing_arg + { name => 'name', type => 'string', no_declare => 1, + desc => 'The brush name', + 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 = ( vars => [ 'GimpBrush *brush' ], code => 'success = (brush = gimp_context_get_brush (context)) != NULL;' @@ -142,15 +89,21 @@ sub brushes_get_brush { sub brushes_get_spacing { &std_pdb_deprecated ('gimp-brush-get-spacing'); - @outargs = ( &spacing_arg ); - $outargs[0]->{alias} = 'gimp_brush_get_spacing (gimp_context_get_brush (context))'; - $outargs[0]->{no_declare} = 1; + @outargs = ( + { name => 'spacing', type => '0 <= int32 <= 1000', + desc => 'The brush spacing: %%desc%%', + alias => 'gimp_brush_get_spacing (gimp_context_get_brush (context))', + no_declare => 1 } + ); } sub brushes_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 = ( 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'); @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 = ( - &brush_arg, - &opacity_arg, - &spacing_arg, - &paint_mode_arg, - &dim_args, + { name => 'name', type => 'string', no_declare => 1, + desc => 'The brush name', + alias => 'g_strdup (GIMP_OBJECT (brush)->name)' }, + { name => 'opacity', type => '0 <= float <= 100', no_declare => 1, + 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 = ( vars => [ 'GimpBrush *brush = NULL' ], code => <<'CODE' diff --git a/tools/pdbgen/pdb/buffer.pdb b/tools/pdbgen/pdb/buffer.pdb index f33261f88e..c59b43c710 100644 --- a/tools/pdbgen/pdb/buffer.pdb +++ b/tools/pdbgen/pdb/buffer.pdb @@ -17,8 +17,6 @@ # "Perlized" from C source by Manish Singh -# The defs - sub buffers_get_list { $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. HELP - $author = $copyright = 'Michael Natterer '; - $date = '2005'; - $since = '2.4'; + &mitch_pdb_misc('2005', '2.4'); @inargs = ( { name => 'filter', type => 'string', null_ok => 1, @@ -50,14 +46,9 @@ HELP sub buffer_rename { $blurb = 'Renames a named buffer.'; + $help = 'This procedure renames a named buffer.'; - $help = <<'HELP'; -This procedure renames a named buffer. -HELP - - $author = $copyright = 'Michael Natterer '; - $date = '2005'; - $since = '2.4'; + &mitch_pdb_misc('2005', '2.4'); @inargs = ( { name => 'buffer_name', type => 'string', @@ -74,9 +65,7 @@ HELP %invoke = ( code => <named_buffers, buffer_name); success = (buffer != NULL && strlen (new_name) > 0); @@ -93,10 +82,7 @@ CODE sub buffer_delete { $blurb = 'Deletes a named buffer.'; - - $help = <<'HELP'; -This procedure deletes a named buffer. -HELP + $help = 'This procedure deletes a named buffer.'; $author = $copyright = 'David Gowers '; $date = '2005'; @@ -110,9 +96,7 @@ HELP %invoke = ( code => <named_buffers, buffer_name); success = (buffer != NULL); @@ -126,13 +110,9 @@ CODE sub buffer_get_width { $blurb = "Retrieves the specified buffer's width."; - $help = <<'HELP'; -This procedure retrieves the specified named buffer's width. -HELP + $help = "This procedure retrieves the specified named buffer's width."; - $author = $copyright = 'Michael Natterer '; - $date = '2005'; - $since = '2.4'; + &mitch_pdb_misc('2005', '2.4'); @inargs = ( { name => 'buffer_name', type => 'string', @@ -140,19 +120,20 @@ HELP ); @outargs = ( - { name => 'width', type => 'int32', no_declare => '1', - alias => 'gimp_buffer_get_width (buffer)', + { name => 'width', type => 'int32', init => 1, desc => "The buffer width" } ); %invoke = ( - vars => [ 'GimpBuffer *buffer = NULL' ], code => <<'CODE' { - buffer = (GimpBuffer *) + GimpBuffer *buffer = (GimpBuffer *) 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 ); @@ -160,13 +141,9 @@ CODE sub buffer_get_height { $blurb = "Retrieves the specified buffer's height."; - $help = <<'HELP'; -This procedure retrieves the specified named buffer's height. -HELP + $help = "This procedure retrieves the specified named buffer's height."; - $author = $copyright = 'Michael Natterer '; - $date = '2005'; - $since = '2.4'; + &mitch_pdb_misc('2005', '2.4'); @inargs = ( { name => 'buffer_name', type => 'string', @@ -174,19 +151,20 @@ HELP ); @outargs = ( - { name => 'height', type => 'int32', no_declare => '1', - alias => 'gimp_buffer_get_height (buffer)', + { name => 'height', type => 'int32', init => 1, desc => "The buffer height" } ); %invoke = ( - vars => [ 'GimpBuffer *buffer = NULL' ], code => <<'CODE' { - buffer = (GimpBuffer *) + GimpBuffer *buffer = (GimpBuffer *) 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 ); @@ -194,13 +172,9 @@ CODE sub buffer_get_bytes { $blurb = "Retrieves the specified buffer's bytes."; - $help = <<'HELP'; -This procedure retrieves the specified named buffer's bytes. -HELP + $help = "This procedure retrieves the specified named buffer's bytes."; - $author = $copyright = 'Michael Natterer '; - $date = '2005'; - $since = '2.4'; + &mitch_pdb_misc('2005', '2.4'); @inargs = ( { name => 'buffer_name', type => 'string', @@ -208,19 +182,20 @@ HELP ); @outargs = ( - { name => 'bytes', type => 'int32', no_declare => '1', - alias => 'gimp_buffer_get_bytes (buffer)', + { name => 'bytes', type => 'int32', init => 1, desc => "The buffer bpp" } ); %invoke = ( - vars => [ 'GimpBuffer *buffer = NULL' ], code => <<'CODE' { - buffer = (GimpBuffer *) + GimpBuffer *buffer = (GimpBuffer *) 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 ); @@ -228,13 +203,9 @@ CODE sub buffer_get_image_type { $blurb = "Retrieves the specified buffer's image type."; - $help = <<'HELP'; -This procedure retrieves the specified named buffer's image type. -HELP + $help = "This procedure retrieves the specified named buffer's image type."; - $author = $copyright = 'Michael Natterer '; - $date = '2005'; - $since = '2.4'; + &mitch_pdb_misc('2005', '2.4'); @inargs = ( { name => 'buffer_name', type => 'string', @@ -242,20 +213,20 @@ HELP ); @outargs = ( - { name => 'image_type', type => 'enum GimpImageBaseType', - no_declare => '1', - alias => 'gimp_buffer_get_image_type (buffer)', + { name => 'image_type', type => 'enum GimpImageBaseType', init => 1, desc => "The buffer image type" } ); %invoke = ( - vars => [ 'GimpBuffer *buffer = NULL' ], code => <<'CODE' { - buffer = (GimpBuffer *) + GimpBuffer *buffer = (GimpBuffer *) 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 ); diff --git a/tools/pdbgen/pdb/channel.pdb b/tools/pdbgen/pdb/channel.pdb index c2db863746..c06ae18248 100644 --- a/tools/pdbgen/pdb/channel.pdb +++ b/tools/pdbgen/pdb/channel.pdb @@ -17,18 +17,6 @@ # "Perlized" from C source by Manish Singh -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 { my ($prop, $type, $desc, $undo, $core_type, $core_var) = @_; @@ -41,7 +29,10 @@ sub channel_get_prop_proc { &std_pdb_misc; - @inargs = ( &channel_arg ); + @inargs = ( + { name => 'channel', type => 'channel', + desc => 'The channel' } + ); @outargs = ( { name => $prop, type => $type, @@ -71,7 +62,8 @@ sub channel_set_prop_proc { &std_pdb_misc; @inargs = ( - &channel_arg, + { name => 'channel', type => 'channel', + desc => 'The channel' }, { name => $prop, type => $type, desc => "The new channel $desc" } ); @@ -178,8 +170,10 @@ HELP &std_pdb_misc; - @inargs = ( &channel_arg ); - $inargs[0]->{desc} .= ' to copy'; + @inargs = ( + { name => 'channel', type => 'channel', + desc => 'The channel to copy' } + ); @outargs = ( { name => 'channel_copy', type => 'channel', init => 1, @@ -207,19 +201,20 @@ HELP &std_pdb_misc; - @inargs = ( &channel_arg, &channel_arg, &operation_arg ); - - foreach my $i (0,1) { - foreach my $unused (qw(name desc)) { - $inargs[$i]{$unused} .= $i + 1; - } - } - - foreach (qw(x y)) { - push @inargs, { name => "off$_", type => 'int32', - desc => "$_ offset between upper left corner of - channels: (second - first)" } - } + @inargs = ( + { name => 'channel1', type => 'channel', + desc => 'The channel1' }, + { name => 'channel2', type => 'channel', + desc => 'The channel2' }, + { name => 'operation', type => 'enum GimpChannelOps', + desc => 'The selection operation: { %%desc%% }' }, + { name => 'offx', type => 'int32', + desc => "x offset between upper left corner of + channels: (second - first)" }, + { name => 'offy', type => 'int32', + desc => "y offset between upper left corner of + channels: (second - first)" } + ); %invoke = ( 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. HELP - $author = 'Shlomi Fish '; - $copyright = 'Shlomi Fish'; - $date = '2005'; - $since = '2.4'; + &shlomi_pdb_misc('2005', '2.4'); @inargs = ( &std_image_arg, - { name => 'component', type => 'enum GimpChannelType', - desc => 'The image component: { %%desc%% }' }, - { name => 'name', type => 'string', - desc => 'The channel name' }, + { name => 'component', type => 'enum GimpChannelType', + desc => 'The image component: { %%desc%% }' }, + { name => 'name', type => 'string', + desc => 'The channel name' }, ); $inargs[0]->{desc} .= ' to which to add the channel'; diff --git a/tools/pdbgen/pdb/color.pdb b/tools/pdbgen/pdb/color.pdb index d46e1bb131..19ef6ddc24 100644 --- a/tools/pdbgen/pdb/color.pdb +++ b/tools/pdbgen/pdb/color.pdb @@ -17,18 +17,6 @@ # "Perlized" from C source by Manish Singh -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 { $blurb = 'Modify brightness/contrast in the specified drawable.'; @@ -41,11 +29,14 @@ HELP &std_pdb_misc; $date = '1997'; - @inargs = ( &drawable_arg ); - foreach (qw( brightness contrast)) { - push @inargs, { name => $_, type => '-127 <= int32 <= 127', - desc => "\u$_ adjustment: (%%desc%%)" } - } + @inargs = ( + { name => 'drawable', type => 'drawable', + desc => 'The drawable' }, + { name => 'brightness', type => '-127 <= int32 <= 127', + desc => 'Brightness adjustment: (%%desc%%)' }, + { name => 'contrast', type => '-127 <= int32 <= 127', + desc => 'Contrast adjustment: (%%desc%%)' } + ); %invoke = ( code => <<'CODE' @@ -108,20 +99,22 @@ HELP &std_pdb_misc; @inargs = ( - &drawable_arg, - &channel_arg + { name => 'drawable', type => 'drawable', + 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 = ( headers => [ qw("base/levels.h" "core/gimpdrawable-levels.h") ], @@ -162,7 +155,10 @@ HELP $author = $copyright = 'Joao S.O. Bueno, Shawn Willden'; $date = '2003'; - @inargs = ( &drawable_arg ); + @inargs = ( + { name => 'drawable', type => 'drawable', + desc => 'The drawable' } + ); %invoke = ( headers => [ qw("base/levels.h" @@ -187,7 +183,10 @@ CODE sub levels_auto { &std_pdb_deprecated ('gimp_levels_stretch'); - @inargs = ( &drawable_arg ); + @inargs = ( + { name => 'drawable', type => 'drawable', + desc => 'The drawable' } + ); %invoke = ( headers => [ qw("base/levels.h" @@ -219,7 +218,8 @@ HELP $date = '1997'; @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The drawable' }, { name => 'levels', type => '2 <= int32 <= 255', desc => 'Levels of posterization: (%%desc%%)' } ); @@ -273,7 +273,10 @@ HELP &std_pdb_misc; - @inargs = ( &drawable_arg ); + @inargs = ( + { name => 'drawable', type => 'drawable', + desc => 'The drawable' } + ); %invoke = ( headers => [ qw("core/gimpdrawable-desaturate.h") ], @@ -303,7 +306,8 @@ HELP $since = '2.4'; @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The drawable' }, { name => 'desaturate_mode', type => 'enum GimpDesaturateMode', desc => 'The formula to use to desaturate' } ); @@ -339,7 +343,8 @@ HELP &std_pdb_misc; @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The drawable' }, { name => 'mask_only', type => 'boolean', desc => 'Equalization option' } ); @@ -370,7 +375,10 @@ HELP &std_pdb_misc; - @inargs = ( &drawable_arg ); + @inargs = ( + { name => 'drawable', type => 'drawable', + desc => 'The drawable' } + ); %invoke = ( headers => [ qw("core/gimpdrawable-invert.h") ], @@ -402,8 +410,10 @@ HELP &std_pdb_misc; @inargs = ( - &drawable_arg, - &channel_arg, + { name => 'drawable', type => 'drawable', + desc => 'The drawable' }, + { name => 'channel', type => 'enum GimpHistogramChannel', + desc => 'The channel to modify: { %%desc%% }' }, { name => 'control_pts', type => 'int8array', desc => 'The spline control points: { cp1.x, cp1.y, cp2.x, cp2.y, ... }', @@ -497,8 +507,10 @@ HELP &std_pdb_misc; @inargs = ( - &drawable_arg, - &channel_arg, + { name => 'drawable', type => 'drawable', + desc => 'The drawable' }, + { name => 'channel', type => 'enum GimpHistogramChannel', + desc => 'The channel to modify: { %%desc%% }' }, { name => 'curve', type => 'int8array', desc => 'The explicit curve', array => { name => 'num_bytes', @@ -584,20 +596,20 @@ HELP $date = '1997'; @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The drawable' }, { name => 'transfer_mode', type => 'enum GimpTransferMode', desc => 'Transfer mode: { %%desc%% }' }, { 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 = ( headers => [ qw("base/color-balance.h") ], code => <<'CODE' @@ -652,12 +664,11 @@ only valid on RGB color images. It will not operate on grayscale or indexed drawables. HELP - &std_pdb_misc; - $date = '2004'; - $since = '2.2'; + &neo_pdb_misc('2004', '2.2'); @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The drawable' }, { name => 'hue', type => '0 <= float <= 360', desc => 'Hue in degrees: (%%desc%%)' }, { name => 'saturation', type => '0 <= float <= 100', @@ -731,34 +742,31 @@ HELP &std_pdb_misc; @inargs = ( - &drawable_arg, - &channel_arg, + { name => 'drawable', type => 'drawable', + 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 = ( - { name => 'mean', void_ret => 1, init => 1, + { name => 'mean', type => 'float', void_ret => 1, init => 1, desc => 'Mean intensity value' }, - { name => 'std_dev', init => 1, + { name => 'std_dev', type => 'float', init => 1, desc => 'Standard deviation of intensity values' }, - { name => 'median', init => 1, + { name => 'median', type => 'float', init => 1, desc => 'Median intensity value' }, - { name => 'pixels', init => 1, + { name => 'pixels', type => 'float', init => 1, 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' }, - { name => 'percentile', init => 1, + { name => 'percentile', type => 'float', init => 1, desc => 'Percentile that range falls under' } ); - foreach (@outargs) { - @$_{qw(type alias)} = ('float', "$_->{name}", 1) - } - %invoke = ( headers => [ qw("core/gimp.h" "core/gimpdrawable-histogram.h") ], code => <<'CODE' @@ -810,18 +818,18 @@ HELP $date = '1997'; @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The drawable' }, { name => 'hue_range', type => 'enum GimpHueRange', desc => 'Range of affected hues: { %%desc%% }' }, { 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 = ( headers => [ qw("base/hue-saturation.h") ], code => <<'CODE' @@ -878,11 +886,14 @@ HELP &std_pdb_misc; $date = '1997'; - @inargs = ( &drawable_arg ); - foreach (qw(low high)) { - push @inargs, { name => "${_}_threshold", type => '0 <= int32 <= 255', - desc => "The $_ threshold value: %%desc%%" } - } + @inargs = ( + { name => 'drawable', type => 'drawable', + desc => 'The drawable' }, + { 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 = ( headers => [ qw("base/threshold.h") ], diff --git a/tools/pdbgen/pdb/context.pdb b/tools/pdbgen/pdb/context.pdb index 8dd5ba83b2..08d71fe975 100644 --- a/tools/pdbgen/pdb/context.pdb +++ b/tools/pdbgen/pdb/context.pdb @@ -24,13 +24,6 @@ sub pdb_misc { $since = '2.2'; } -sub mitch_misc { - $author = 'Michael Natterer '; - $copyright = 'Michael Natterer'; - $date = '2005'; - $since = '2.4'; -} - sub context_push { $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. HELP - &mitch_misc; + &mitch_pdb_misc('2005', '2.4'); @outargs = ( { name => 'name', type => 'string', @@ -119,7 +112,7 @@ method becomes active and will be used in all subsequent paint operations. HELP - &mitch_misc; + &mitch_pdb_misc('2005', '2.4'); @inargs = ( { name => 'name', type => 'string', diff --git a/tools/pdbgen/pdb/convert.pdb b/tools/pdbgen/pdb/convert.pdb index c2c6bbf0c7..cea9852719 100644 --- a/tools/pdbgen/pdb/convert.pdb +++ b/tools/pdbgen/pdb/convert.pdb @@ -17,19 +17,26 @@ # "Perlized" from C source by Manish Singh -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 = ( &std_image_arg ); -} -sub simple_invoke { - my $type = shift; %invoke = ( code => < < 'display', type => 'display', diff --git a/tools/pdbgen/pdb/drawable.pdb b/tools/pdbgen/pdb/drawable.pdb index b8439b9a81..00d034928f 100644 --- a/tools/pdbgen/pdb/drawable.pdb +++ b/tools/pdbgen/pdb/drawable.pdb @@ -17,30 +17,6 @@ # "Perlized" from C source by Manish Singh -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 { my ($return, $name, $type, $func, $desc, $core_type, $core_var) = @_; @@ -51,7 +27,10 @@ sub drawable_prop_proc { &std_pdb_misc; - @inargs = ( &drawable_arg ); + @inargs = ( + { name => 'drawable', type => 'drawable', + desc => 'The drawable' } + ); @outargs = ( { name => $name, type => $type, desc => $desc, @@ -100,7 +79,10 @@ sub drawable_get_prop_proc { &std_pdb_misc; - @inargs = ( &drawable_arg ); + @inargs = ( + { name => 'drawable', type => 'drawable', + desc => 'The drawable' } + ); @outargs = ( { name => $prop, type => $type, @@ -125,7 +107,8 @@ sub drawable_set_prop_proc { &std_pdb_misc; @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The drawable' }, { name => $prop, type => $type, desc => "The new drawable $desc" } ); @@ -175,7 +158,8 @@ HELP &std_pdb_misc; @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The drawable' }, { name => 'undo', type => 'boolean', desc => 'Push merge to undo stack?' } ); @@ -221,7 +205,8 @@ HELP &std_pdb_misc; @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The drawable' }, { name => 'fill_type', type => 'enum GimpFillType', desc => 'The type of fill: %%desc%%' } ); @@ -241,7 +226,8 @@ HELP &std_pdb_misc; @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The drawable' }, { name => 'x', type => 'int32', desc => 'x coordinate of upper left corner of update region' }, { name => 'y', type => 'int32', @@ -278,23 +264,24 @@ HELP &std_pdb_misc; - @inargs = ( &drawable_arg ); + @inargs = ( + { name => 'drawable', type => 'drawable', + desc => 'The drawable' } + ); @outargs = ( { name => 'non_empty', type => 'boolean', init => 1, 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 = ( code => <<'CODE' 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. HELP - $author = 'Michael Natterer '; - $copyright = 'Michael Natterer'; - $date = '2004'; - $since = '2.2'; + &mitch_pdb_misc('2004', '2.2'); - @inargs = ( &drawable_arg ); + @inargs = ( + { name => 'drawable', type => 'drawable', + desc => 'The drawable' } + ); @outargs = ( { name => 'non_empty', type => 'boolean', init => 1, @@ -351,9 +338,14 @@ sub drawable_get_image { &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]->{init} = 1; @@ -444,12 +436,17 @@ HELP &std_pdb_misc; - @inargs = ( &drawable_arg ); + @inargs = ( + { name => 'drawable', type => 'drawable', + desc => 'The drawable' } + ); - foreach (qw(x y)) { - push @outargs, { name => "offset_$_", type => 'int32', - desc => "$_ offset of drawable", void_ret => 1 } - } + @outargs = ( + { name => 'offset_x', type => 'int32', + 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);' ); } @@ -477,8 +474,7 @@ CODE &drawable_accessors('linked', 'boolean', 'linked state', 1, <<'CODE', 'item', 'GIMP_ITEM (drawable)'); - $author = $copyright = 'Wolfgang Hofer'; - $date = '1998'; + &wolfgang_pdb_misc('1998'); if (scalar @outargs) { $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 HELP - $author = $copyright = 'Jay Cox'; - $date = '1998'; + &jay_pdb_misc('1998'); CODE sub drawable_get_pixel { @@ -508,10 +503,22 @@ HELP &std_pdb_misc; $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[0]->{init} = $outargs[0]->{array}->{init} = 1; + @outargs = ( + { 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 = ( vars => [ 'guint8 *p', 'gint b', 'Tile *tile' ], @@ -555,8 +562,19 @@ HELP &std_pdb_misc; $date = '1997'; - &drawable_coord_args; - push @inargs, &pixel_arg; + @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' }, + { 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 = ( vars => [ 'guint8 *p', 'gint b', 'Tile *tile' ], @@ -589,7 +607,8 @@ sub drawable_set_image { &std_pdb_deprecated(); @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The drawable' }, &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 { $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. HELP - $author = $copyright = 'Andy Thomas'; - $date = '1999'; + &andy_pdb_misc('1999'); @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The drawable' }, { name => 'width', type => '0 < int32 <= 512', desc => 'The thumbnail width', alias => 'req_width' }, { name => 'height', type => '0 < int32 <= 512', @@ -632,14 +642,18 @@ HELP ); @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', desc => 'The thumbnail data', init => 1, wrap => 1, array => { name => 'thumbnail_data_count', desc => 'The number of bytes in thumbnail data', alias => 'num_bytes', init => 1 } } ); - $outargs[0]->{void_ret} = 1; %invoke = ( 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. HELP - $author = $copyright = 'Michael Natterer '; - $date = '2004'; - $since = '2.2'; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The drawable' }, { name => 'src_x', type => '0 <= int32', desc => 'The x coordinate of the area' }, { name => 'src_y', type => '0 <= int32', @@ -716,14 +729,18 @@ HELP ); @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', desc => 'The thumbnail data', init => 1, wrap => 1, array => { name => 'thumbnail_data_count', desc => 'The number of bytes in thumbnail data', alias => 'num_bytes', init => 1 } } ); - $outargs[0]->{void_ret} = 1; %invoke = ( headers => [ qw("core/gimpdrawable-preview.h") ], @@ -824,8 +841,10 @@ HELP &std_pdb_misc; - @inargs = ( &drawable_arg ); - $inargs[0]->{desc} .= ' to delete'; + @inargs = ( + { name => 'drawable', type => 'drawable', + desc => 'The drawable to delete' } + ); %invoke = ( code => <<'CODE' ); { @@ -851,13 +870,15 @@ HELP $since = '2.4'; @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The drawable' }, { name => 'mode', type => 'enum GimpForegroundExtractMode', desc => 'The algorithm to use: %%desc%%' }, { 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' { success = gimp_item_is_attached (GIMP_ITEM (drawable)); diff --git a/tools/pdbgen/pdb/drawable_transform.pdb b/tools/pdbgen/pdb/drawable_transform.pdb index 85f0a6aaf2..fcfebfcba3 100644 --- a/tools/pdbgen/pdb/drawable_transform.pdb +++ b/tools/pdbgen/pdb/drawable_transform.pdb @@ -23,18 +23,6 @@ # 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 () { { name => 'transform_direction', type => 'enum GimpTransformDirection', desc => 'Direction of Transformation: { %%desc%% }' }, @@ -55,14 +43,6 @@ sub transform_options_default_args () { 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 { my ($progress_text, $assemble_matrix, $variables, $check) = @_; 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. HELP - &joao_pdb_misc; + &joao_pdb_misc('2004', '2.2'); @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, { name => 'flip_type', type => &std_orientation_enum, desc => 'Type of flip: %%desc%%' }, { name => 'auto_center', type => 'boolean', @@ -186,7 +167,10 @@ HELP desc => 'Whether to clip results' } ); - @outargs = ( &drawable_out_arg('flipped') ); + @outargs = ( + { name => 'drawable', type => 'drawable', no_declare => 1, + desc => 'The flipped drawable' } + ); %invoke = ( 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. HELP - &joao_pdb_misc; + &joao_pdb_misc('2004', '2.2'); @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, { name => 'x0', type => 'float', desc => 'horz. coord. of one end of axis' }, { name => 'y0', type => 'float', @@ -242,7 +227,10 @@ HELP &transform_options_args ); - @outargs = ( &drawable_out_arg('flipped') ); + @outargs = ( + { name => 'drawable', type => 'drawable', no_declare => 1, + desc => 'The flipped drawable' } + ); transform_invoke ("Flipping", < 'drawable', type => 'drawable', + desc => 'The affected drawable' }, { name => 'x0', type => 'float', desc => 'horz. coord. of one end of axis' }, { name => 'y0', type => 'float', @@ -278,7 +267,10 @@ HELP &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", < 'drawable', type => 'drawable', + desc => 'The affected drawable' } ); my $pos = 0; @@ -332,7 +325,10 @@ HELP &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", < 'drawable', type => 'drawable', + desc => 'The affected drawable' } ); my $pos = 0; @@ -378,7 +375,10 @@ HELP &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", < 'drawable', type => 'drawable', + desc => 'The affected drawable' }, { name => 'rotate_type', type => 'enum GimpRotationType', desc => 'Type of rotation: %%desc%%' }, { name => 'auto_center', type => 'boolean', @@ -423,7 +424,10 @@ HELP desc => 'Whether to clip results' } ); - @outargs = ( &drawable_out_arg('rotated') ); + @outargs = ( + { name => 'drawable', type => 'drawable', no_declare => 1, + desc => 'The rotated drawable' } + ); %invoke = ( 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. HELP - &joao_pdb_misc; + &joao_pdb_misc('2004', '2.2'); @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, { name => 'angle', type => 'float', desc => 'The angle of rotation (radians)' }, { name => 'auto_center', type => 'boolean', @@ -475,7 +480,10 @@ HELP &transform_options_args ); - @outargs = ( &drawable_out_arg('rotated') ); + @outargs = ( + { name => 'drawable', type => 'drawable', no_declare => 1, + desc => 'The rotated drawable' } + ); transform_invoke ("Rotating", < 'drawable', type => 'drawable', + desc => 'The affected drawable' }, { name => 'angle', type => 'float', desc => 'The angle of rotation (radians)' }, { name => 'auto_center', type => 'boolean', @@ -514,7 +523,10 @@ HELP &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", < '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; - foreach $where (qw(upper-left lower-right)) { - foreach (qw(x y)) { - 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 = ( + { name => 'drawable', type => 'drawable', no_declare => 1, + desc => 'The scaled drawable' } ); - @outargs = ( &drawable_out_arg('scaled') ); - transform_invoke ("Scaling", < "$_$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, + { 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_default_args ); - @outargs = ( &drawable_out_arg('scaled') ); + @outargs = ( + { name => 'drawable', type => 'drawable', no_declare => 1, + desc => 'The scaled drawable' } + ); transform_default_invoke ("Scaling", < 'drawable', type => 'drawable', + desc => 'The affected drawable' }, { name => 'shear_type', type => &std_orientation_enum, desc => 'Type of shear: %%desc%%' }, { name => 'magnitude', type => 'float', @@ -656,7 +679,10 @@ HELP &transform_options_args ); - @outargs = ( &drawable_out_arg('sheared') ); + @outargs = ( + { name => 'drawable', type => 'drawable', no_declare => 1, + desc => 'The sheared drawable' } + ); transform_invoke ("Shearing", < 'drawable', type => 'drawable', + desc => 'The affected drawable' }, { name => 'shear_type', type => &std_orientation_enum, desc => 'Type of shear: %%desc%%' }, { name => 'magnitude', type => 'float', @@ -689,7 +716,10 @@ HELP &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", < 'drawable', type => 'drawable', + desc => 'The affected drawable' }, { name => 'source_x', type => 'float', desc => 'X coordinate of the transformation center' }, { name => 'source_y', type => 'float', @@ -740,7 +771,10 @@ HELP &transform_options_args ); - @outargs = ( &drawable_out_arg('transformed') ); + @outargs = ( + { name => 'drawable', type => 'drawable', no_declare => 1, + desc => 'The transformed drawable' } + ); transform_invoke ("2D Transform", < 'drawable', type => 'drawable', + desc => 'The affected drawable' }, { name => 'source_x', type => 'float', desc => 'X coordinate of the transformation center' }, { name => 'source_y', type => 'float', @@ -784,7 +819,10 @@ HELP &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", < 'drawable', type => 'drawable', + desc => 'The affected drawable' }, { name => 'coeff_0_0', type => 'float', desc => 'coefficient (0,0) of the transformation matrix' }, { name => 'coeff_0_1', type => 'float', @@ -837,7 +876,10 @@ HELP &transform_options_args ); - @outargs = ( &drawable_out_arg('transformed') ); + @outargs = ( + { name => 'drawable', type => 'drawable', no_declare => 1, + desc => 'The transformed drawable' } + ); transform_invoke ("2D Transforming", < 'drawable', type => 'drawable', + desc => 'The affected drawable' }, { name => 'coeff_0_0', type => 'float', desc => 'coefficient (0,0) of the transformation matrix' }, { name => 'coeff_0_1', type => 'float', @@ -889,7 +932,10 @@ HELP &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", < -# Common invoker for checking for image/drawable consistency -sub invoke { - %invoke = ( - code => < '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 => < '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 => <'; - $date = '2004'; - $since = '2.2'; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( { name => 'image', type => 'image', @@ -111,7 +119,8 @@ HELP @outargs = ( { 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 = ( @@ -127,19 +136,20 @@ sub edit_paste { $blurb = 'Paste buffer to the specified drawable.'; $help = <<'HELP'; -This procedure pastes a copy of the internal GIMP edit buffer to the specified -drawable. The GIMP edit buffer will be empty unless a call was previously made -to either 'gimp-edit-cut' or 'gimp-edit-copy'. The "paste_into" option -specifies whether to clear the current image selection, or to paste the buffer -"behind" the selection. This allows the selection to act as a mask for the -pasted buffer. Anywhere that the selection mask is non-zero, the pasted buffer -will show through. The pasted buffer will be a new layer in the image which is -designated as the image floating selection. If the image has a floating -selection at the time of pasting, the old floating selection will be anchored -to it's drawable before the new floating selection is added. This procedure -returns the new floating layer. The resulting floating selection will already -be attached to the specified drawable, and a subsequent call to -floating_sel_attach is not needed. +This procedure pastes a copy of the internal GIMP edit buffer to the +specified drawable. The GIMP edit buffer will be empty unless a call +was previously made to either 'gimp-edit-cut' or 'gimp-edit-copy'. The +"paste_into" option specifies whether to clear the current image +selection, or to paste the buffer "behind" the selection. This allows +the selection to act as a mask for the pasted buffer. Anywhere that +the selection mask is non-zero, the pasted buffer will show +through. The pasted buffer will be a new layer in the image which is +designated as the image floating selection. If the image has a +floating selection at the time of pasting, the old floating selection +will be anchored to it's drawable before the new floating selection is +added. This procedure returns the new floating layer. The resulting +floating selection will already be attached to the specified drawable, +and a subsequent call to floating_sel_attach is not needed. HELP &std_pdb_misc; @@ -185,9 +195,7 @@ previously made to either 'gimp-edit-cut' or 'gimp-edit-copy'. This procedure returns the new image. HELP - $author = $copyright = 'Michael Natterer '; - $date = '2005'; - $since = '2.4'; + &mitch_pdb_misc('2005', '2.4'); @outargs = ( { name => 'image', type => 'image', init => 1, @@ -213,12 +221,12 @@ sub edit_named_cut { $blurb = 'Cut into a named buffer.'; $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 - $author = $copyright = 'Michael Natterer '; - $date = '2005'; - $since = '2.4'; + &mitch_pdb_misc('2005', '2.4'); @inargs = ( { name => 'drawable', type => 'drawable', @@ -228,7 +236,8 @@ HELP ); @outargs = ( { 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 = ( @@ -258,12 +267,12 @@ sub edit_named_copy { $blurb = 'Copy into a named buffer.'; $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 - $author = $copyright = 'Michael Natterer '; - $date = '2005'; - $since = '2.4'; + &mitch_pdb_misc('2005', '2.4'); @inargs = ( { name => 'drawable', type => 'drawable', @@ -273,7 +282,8 @@ HELP ); @outargs = ( { 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 = ( @@ -303,12 +313,13 @@ sub edit_named_copy_visible { $blurb = 'Copy from the projection into a named buffer.'; $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 - $author = $copyright = 'Michael Natterer '; - $date = '2005'; - $since = '2.4'; + &mitch_pdb_misc('2005', '2.4'); @inargs = ( { name => 'image', type => 'image', @@ -346,13 +357,11 @@ sub edit_named_paste { $blurb = 'Paste named buffer to the specified drawable.'; $help = <<'HELP'; -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. HELP - $author = $copyright = 'Michael Natterer '; - $date = '2005'; - $since = '2.4'; + &mitch_pdb_misc('2005', '2.4'); @inargs = ( { 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. HELP - $author = $copyright = 'Michael Natterer '; - $date = '2005'; - $since = '2.4'; + &mitch_pdb_misc('2005', '2.4'); @inargs = ( { name => 'buffer_name', type => 'string', @@ -438,43 +445,75 @@ sub edit_clear { $blurb = 'Clear selected area of drawable.'; $help = <<'HELP'; -This procedure clears the specified drawable. If the drawable has an alpha -channel, the cleared pixels will become transparent. If the drawable does not -have an alpha channel, cleared pixels will be set to the background color. This -procedure only affects regions within a selection if there is a selection -active. +This procedure clears the specified drawable. If the drawable has an +alpha channel, the cleared pixels will become transparent. If the +drawable does not have an alpha channel, cleared pixels will be set to +the background color. This procedure only affects regions within a +selection if there is a selection active. HELP &std_pdb_misc; + @inargs = ( { name => 'drawable', type => 'drawable', desc => 'The drawable to clear from' } ); - &invoke('success = gimp_edit_clear (image, drawable, context)'); + + %invoke = ( + code => < 'drawable', type => 'drawable', desc => "The drawable to fill to" }, { name => 'fill_type', type => 'enum GimpFillType', desc => 'The type of fill: %%desc%%' } ); - &invoke('success = gimp_edit_fill (image, drawable, context, (GimpFillType) fill_type)'); + + %invoke = ( + code => < 'drawable', type => 'drawable', desc => 'The drawable to stroke to' } diff --git a/tools/pdbgen/pdb/fileops.pdb b/tools/pdbgen/pdb/fileops.pdb index 1c9a4a71de..4f2d812cea 100644 --- a/tools/pdbgen/pdb/fileops.pdb +++ b/tools/pdbgen/pdb/fileops.pdb @@ -18,36 +18,6 @@ # "Perlized" from C source by Manish Singh -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 { $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." HELP - &pdb_misc; + &josh_pdb_misc('1997'); @inargs = ( { name => 'run_mode', @@ -78,10 +48,13 @@ HELP %invoke = ( proc => [ 'proc->name', 'new_args' ], args => [ 'new_args', 'return_vals' ], - vars => [ 'PlugInProcDef *file_proc', 'const ProcRecord *proc', - 'gchar *uri', 'gint i' ], code => <<'CODE' { + PlugInProcDef *file_proc; + const ProcRecord *proc; + gchar *uri; + gint i; + uri = file_utils_filename_to_uri (gimp->load_procs, %%filename%%, NULL); 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. HELP - $author = $copyright = 'Sven Neumann'; - $date = '2005'; - $since = '2.4'; + &neo_pdb_misc('2005', '2.4'); @inargs = ( { name => 'run_mode', @@ -144,9 +115,11 @@ HELP %invoke = ( headers => [ qw("file/file-open.h") ], - vars => [ 'GimpPDBStatusType status', 'gchar *uri' ], code => <<'CODE' { + GimpPDBStatusType status; + gchar *uri; + uri = file_utils_filename_to_uri (gimp->load_procs, filename, NULL); if (! uri) 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. HELP - &pdb_misc; + &josh_pdb_misc('1997'); @inargs = ( { name => 'run_mode', @@ -194,10 +167,13 @@ HELP headers => [ qw() ], proc => [ 'proc->name', 'new_args' ], args => [ 'new_args', 'return_vals' ], - vars => [ 'PlugInProcDef *file_proc', 'const ProcRecord *proc', - 'gchar *uri', 'gint i' ], code => <<'CODE' { + PlugInProcDef *file_proc; + const ProcRecord *proc; + gchar *uri; + gint i; + uri = file_utils_filename_to_uri (gimp->load_procs, %%filename%%, NULL); if (! uri) @@ -264,11 +240,12 @@ HELP ); %invoke = ( - vars => [ 'gchar *uri', - 'GimpThumbnail *thumbnail = NULL', - 'GdkPixbuf *pixbuf = NULL' ], - code => <<'CODE' + code => <<'CODE' { + GimpThumbnail *thumbnail = NULL; + GdkPixbuf *pixbuf = NULL; + gchar *uri; + uri = g_filename_to_uri (filename, NULL, NULL); if (uri) @@ -331,7 +308,7 @@ will fail. This procedure may become useful if you want to explicitely save a thumbnail with a file. HELP - &pdb_misc; + &josh_pdb_misc('1997'); @inargs = ( &std_image_arg, @@ -340,17 +317,17 @@ HELP ); %invoke = ( - vars => [ 'GimpImagefile *imagefile', 'gchar *uri', - 'const gchar *image_uri' ], 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) success = FALSE; if (success) { - uri = g_filename_to_uri (filename, NULL, NULL); + gchar *uri = g_filename_to_uri (filename, NULL, NULL); + if (! uri) success = FALSE; @@ -361,6 +338,8 @@ HELP if (success) { + GimpImagefile *imagefile; + imagefile = gimp_imagefile_new (gimp, uri); success = gimp_imagefile_save_thumbnail (imagefile, NULL, gimage); 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. HELP - &pdb_misc; + &josh_pdb_misc('1997'); @inargs = ( { name => 'extension', type => 'string', no_validate => 1, @@ -394,12 +373,14 @@ HELP ); %invoke = ( - headers => [ qw( - "config/gimpbaseconfig.h") ], - vars => [ 'static gint id = 0', 'static gint pid', - 'gchar *filename', 'gchar *path' ], + headers => [ qw( "config/gimpbaseconfig.h") ], code => <<'CODE' { + static gint id = 0; + static gint pid; + gchar *filename; + gchar *path; + if (id == 0) pid = getpid (); @@ -428,14 +409,27 @@ HELP &std_pdb_misc; - &handler_args('load'); - &list_arg('load', 'magics', 'magic file information', '0,string,GIF'); + @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:")' }, + { 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 = ( - vars => [ 'ProcRecord *proc', 'PlugInProcDef *file_proc' ], code => <<'CODE' { - gchar *canonical; + ProcRecord *proc; + PlugInProcDef *file_proc; + gchar *canonical; success = FALSE; @@ -487,7 +481,17 @@ HELP &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 = ( pass_through => 'register_magic_load_handler', @@ -506,13 +510,24 @@ HELP &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 = ( - vars => [ 'ProcRecord *proc', 'PlugInProcDef *file_proc' ], code => <<'CODE' { - gchar *canonical; + ProcRecord *proc; + PlugInProcDef *file_proc; + gchar *canonical; success = FALSE; @@ -563,9 +578,7 @@ to determine the MIME type of the file opened or saved using this procedure. HELP - $author = $copyright = 'Sven Neumann'; - $date = '2004'; - $since = '2.2'; + &neo_pdb_misc('2004', '2.2'); @inargs = ( { 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. HELP - $author = $copyright = 'Sven Neumann'; - $date = '2004'; - $since = '2.2'; + &neo_pdb_misc('2004', '2.2'); @inargs = ( { name => 'load_proc', type => 'string', diff --git a/tools/pdbgen/pdb/floating_sel.pdb b/tools/pdbgen/pdb/floating_sel.pdb index b54066f956..15f05ce124 100644 --- a/tools/pdbgen/pdb/floating_sel.pdb +++ b/tools/pdbgen/pdb/floating_sel.pdb @@ -17,29 +17,6 @@ # "Perlized" from C source by Manish Singh -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 => < 'floating_sel', type => 'layer', + desc => 'The floating selection' } + ); + + %invoke = ( + code => < 'floating_sel', type => 'layer', + desc => 'The floating selection' } + ); + + %invoke = ( + code => < 'floating_sel', type => 'layer', + desc => 'The floating selection' } + ); + + %invoke = ( + code => < [ qw("core/gimplayer-floating-sel.h") ], code => < 'undo', type => 'boolean', desc => '%%desc%%' }; + @inargs = ( + { name => 'floating_sel', type => 'layer', + desc => 'The floating selection' }, + { name => 'undo', type => 'boolean', + desc => '%%desc%%' } + ); - &invoke; - $invoke{code} =~ s/\(floating_sel\);/(floating_sel, undo);/; + %invoke = ( + code => < 'undo', type => 'boolean', desc => '%%desc%%' }; + @inargs = ( + { name => 'floating_sel', type => 'layer', + desc => 'The floating selection' }, + { name => 'undo', type => 'boolean', + desc => '%%desc%%' } + ); - &invoke; - $invoke{code} =~ s/\(floating_sel\);/(floating_sel, undo);/; + %invoke = ( + code => < -sub pdb_misc { - $author = 'Sven Neumann '; - $copyright = 'Sven Neumann'; - $date = '2003'; -} - sub fonts_popup { $blurb = 'Invokes the Gimp font selection.'; + $help = 'This procedure popups the font selection dialog.'; - $help = 'This procedure popups the font selection dialog.'; - - &pdb_misc; + &neo_pdb_misc('2003'); @inargs = ( { name => 'font_callback', type => 'string', @@ -57,10 +50,9 @@ CODE sub fonts_close_popup { $blurb = 'Popdown the Gimp font selection.'; + $help = 'This procedure closes an opened font selection dialog.'; - $help = 'This procedure closes an opened font selection dialog.'; - - &pdb_misc; + &neo_pdb_misc('2003'); @inargs = ( { name => 'font_callback', type => 'string', @@ -81,10 +73,9 @@ CODE sub fonts_set_popup { $blurb = 'Sets the current font selection in a popup.'; + $help = $blurb; - $help = $blurb; - - &pdb_misc; + &neo_pdb_misc('2003'); @inargs = ( { name => 'font_callback', type => 'string', diff --git a/tools/pdbgen/pdb/fonts.pdb b/tools/pdbgen/pdb/fonts.pdb index 377f982f5c..72f48bb538 100644 --- a/tools/pdbgen/pdb/fonts.pdb +++ b/tools/pdbgen/pdb/fonts.pdb @@ -17,13 +17,6 @@ # "Perlized" from C source by Manish Singh -sub pdb_misc { - $author = $copyright = 'Sven Neumann'; - $date = '2003'; -} - -# The defs - sub fonts_refresh { $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. HELP - &pdb_misc; + &neo_pdb_misc('2003'); %invoke = ( 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. HELP - &pdb_misc; + &neo_pdb_misc('2003'); @inargs = ( { name => 'filter', type => 'string', null_ok => 1, diff --git a/tools/pdbgen/pdb/gimprc.pdb b/tools/pdbgen/pdb/gimprc.pdb index 5df2f4a2fe..58e97c8385 100644 --- a/tools/pdbgen/pdb/gimprc.pdb +++ b/tools/pdbgen/pdb/gimprc.pdb @@ -16,10 +16,6 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # "Perlized" from C source by Manish Singh -# Added a PDB entry for writing a gimprc entry, by -# Seth Burgess 15/04/99 - -# The defs sub gimprc_query { $blurb = <<'BLURB'; @@ -46,14 +42,11 @@ HELP ); @outargs = ( - { name => 'value', type => 'string', - desc => 'The value associated with the queried token', - no_declare => 1 } + { name => 'value', type => 'string', init => 1, + desc => 'The value associated with the queried token' } ); %invoke = ( - headers => [ qw("config/gimprc.h") ], - vars => [ 'gchar *value = NULL' ], code => <<'CODE' { if (strlen (token)) @@ -79,8 +72,7 @@ gimp_gimprc_query to retrieve it. This will accept _only_ string values in UTF-8 encoding. HELP - $author = $copyright = 'Seth Burgess'; - $date = '1999'; + &seth_pdb_misc('1999'); @inargs = ( { name => 'token', type => 'string', @@ -115,8 +107,6 @@ HELP &std_pdb_misc; - @inargs = ( ); - @outargs = ( { name => 'xres', type => 'float', void_ret => 1, desc => 'X resolution', alias => 'xres' }, @@ -125,7 +115,6 @@ HELP ); %invoke = ( - headers => [ qw("config/gimpdisplayconfig.h") ], code => <<'CODE' { xres = GIMP_DISPLAY_CONFIG (gimp->config)->monitor_xres; @@ -137,20 +126,17 @@ CODE sub get_default_comment { $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; - @inargs = ( ); - @outargs = ( { name => 'comment', type => 'string', desc => 'Default Image Comment' } ); %invoke = ( - headers => [ qw("config/gimpcoreconfig.h" "core/gimptemplate.h") ], + headers => [ qw("core/gimptemplate.h") ], code => <<'CODE' { comment = g_strdup (gimp->config->default_image->comment); @@ -161,13 +147,10 @@ CODE sub get_theme_dir { $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; - @inargs = ( ); - @outargs = ( { name => 'theme_dir', type => 'string', desc => 'The GUI theme dir' } @@ -186,11 +169,7 @@ sub get_color_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.'; - $author = $copyright = 'Sven Neumann'; - $date = '2005'; - $since = '2.4'; - - @inargs = ( ); + &neo_pdb_misc('2005', '2.4'); @outargs = ( { name => 'config', type => 'string', @@ -199,7 +178,7 @@ sub get_color_configuration { ); %invoke = ( - headers => [ qw("libgimpconfig/gimpconfig.h" "config/gimpcoreconfig.h") ], + headers => [ qw("libgimpconfig/gimpconfig.h") ], code => <<'CODE' { config = gimp_config_serialize_to_string (GIMP_CONFIG (gimp->config->color_management), NULL); @@ -210,13 +189,10 @@ CODE sub get_module_load_inhibit { $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; - @inargs = ( ); - @outargs = ( { name => 'load_inhibit', type => 'string', desc => 'The list of modules' } @@ -232,7 +208,7 @@ CODE ); } -@headers = qw( "core/gimp.h"); +@headers = qw( "core/gimp.h" "config/gimprc.h"); @procs = qw(gimprc_query gimprc_set get_default_comment get_monitor_resolution get_theme_dir diff --git a/tools/pdbgen/pdb/gradient.pdb b/tools/pdbgen/pdb/gradient.pdb index 3e063282e2..5553f2c25e 100644 --- a/tools/pdbgen/pdb/gradient.pdb +++ b/tools/pdbgen/pdb/gradient.pdb @@ -15,31 +15,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -sub bill_misc { - $author = 'Bill Skaggs 'name', - type => 'string', - desc => 'The gradient name' -}} - sub _gen_gradient_search_for_segment_code { my $action_on_success = shift; @@ -76,27 +51,10 @@ $action_on_success 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 { my $side = shift; - - my $other_side = other_side($side); + my $other_side = ($side eq "left") ? "right" : "left"; $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. HELP - &shlomi_misc; + &shlomi_pdb_misc('2003', '2.2'); @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', desc => "The color to set" }, { name => "opacity", type => '0 <= float <= 100.0', desc => "The opacity to set for the endpoint" } ); - @outargs = ( - ); - my @blend_params = ("&color","&(seg->${other_side}_color)"); if ($side eq "right") { @@ -144,10 +102,13 @@ This procedure retrieves the $side endpoint color of the specified segment of the specified gradient. HELP - &shlomi_misc; + &shlomi_pdb_misc('2003', '2.2'); @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 = ( @@ -183,9 +144,14 @@ This procedure retrieves the $side_endpoint position of the specified segment of the specified gradient. 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 = ( { 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. HELP - &shlomi_misc; + &shlomi_pdb_misc('2003', '2.2'); @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", desc => "The position to set the guidepoint in." } ); @@ -258,7 +227,7 @@ sub gradient_new { $blurb = "Creates a new gradient"; $help = "This procedure creates a new, uninitialized gradient"; - &shlomi_misc; + &shlomi_pdb_misc('2003', '2.2'); @inargs = ( { name => 'name', type => 'string', @@ -288,10 +257,11 @@ sub gradient_duplicate { $blurb = "Duplicates a gradient"; $help = "This procedure creates an identical gradient by a different name"; - &shlomi_misc; + &shlomi_pdb_misc('2003', '2.2'); @inargs = ( - &gradient_arg + { name => 'name', type => 'string', + desc => 'The gradient name' } ); @outargs = ( @@ -328,10 +298,11 @@ sub gradient_is_editable { $blurb = "Tests if gradient can be edited"; $help = "Returns True if you have permission to change the gradient"; - &bill_misc; + &bill_pdb_misc('2004', '2.4'); @inargs = ( - &gradient_arg + { name => 'name', type => 'string', + desc => 'The gradient name' } ); @outargs = ( @@ -361,10 +332,11 @@ sub gradient_rename { $blurb = "Rename a gradient"; $help = "This procedure renames a gradient"; - &shlomi_misc; + &shlomi_pdb_misc('2003', '2.2'); @inargs = ( - &gradient_arg, + { name => 'name', type => 'string', + desc => 'The gradient name' }, { name => 'new_name', type => 'string', desc => "The new name of the gradient" } ); @@ -395,10 +367,11 @@ sub gradient_delete { $blurb = "Deletes a gradient"; $help = "This procedure deletes a gradient"; - &shlomi_misc; + &shlomi_pdb_misc('2003', '2.2'); @inargs = ( - &gradient_arg + { name => 'name', type => 'string', + desc => 'The gradient name' } ); %invoke = ( @@ -434,11 +407,6 @@ sub sample_num_arg { desc => 'The number of samples to take' } } -sub reverse_arg { - { name => 'reverse', type => 'boolean', - desc => 'Use the reverse gradient (%%desc%%)' } -} - sub sample_outargs { @outargs = ( { 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 }. HELP - &federico_misc; + &federico_pdb_misc('1997', '2.2'); @inargs = ( - &gradient_arg, - &sample_num_arg('2 <= '), - &reverse_arg + { name => 'name', type => 'string', + desc => 'The gradient name' }, + &sample_num_arg('2 <= '), + { name => 'reverse', type => 'boolean', + desc => 'Use the reverse gradient (%%desc%%)' } ); &sample_outargs; @@ -523,16 +493,18 @@ procedure returns a list of floating-point values which correspond to the RGBA values for each sample. HELP - &federico_misc; + &federico_pdb_misc('1997', '2.2'); @inargs = ( - &gradient_arg, + { name => 'name', type => 'string', + desc => 'The gradient name' }, { name => 'positions', type => 'floatarray', desc => 'The list of positions to sample along the gradient', alias => 'pos', array => &sample_num_arg("") }, - &reverse_arg + { name => 'reverse', type => 'boolean', + desc => 'Use the reverse gradient (%%desc%%)' } ); &sample_outargs; @@ -633,9 +605,14 @@ This procedure retrieves the blending function of the segment at the specified gradient name and segment index. 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 = ( { 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. 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 = ( { name => 'coloring_type', type => 'enum GimpGradientSegmentColor', @@ -688,10 +670,11 @@ sub _gen_gradient_operate_on_segments_range $help = $args{help}; - &shlomi_misc; + &shlomi_pdb_misc('2003', '2.2'); @inargs = ( - &gradient_arg, + { name => 'name', type => 'string', + desc => 'The gradient name' }, { name => 'start_segment', type => '0 <= int32', desc => 'The index of the first segment to operate on' }, { name => 'end_segment', type => 'int32', @@ -719,6 +702,7 @@ sub _gen_gradient_operate_on_segments_range if (gradient) { GimpGradientSegment *start_seg, *end_seg; + start_seg = gimp_gradient_segment_get_nth (gradient->segments, start_segment); if (start_seg) diff --git a/tools/pdbgen/pdb/gradient_select.pdb b/tools/pdbgen/pdb/gradient_select.pdb index 887a1fc030..28cc36292a 100644 --- a/tools/pdbgen/pdb/gradient_select.pdb +++ b/tools/pdbgen/pdb/gradient_select.pdb @@ -17,26 +17,11 @@ # "Perlized" from C source by Manish Singh -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 { $blurb = 'Invokes the Gimp gradients selection.'; + $help = 'This procedure popups the gradients selection dialog.'; - $help = 'This procedure popups the gradients selection dialog.'; - - &pdb_misc; + &andy_pdb_misc('1998'); @inargs = ( { name => 'gradient_callback', type => 'string', @@ -47,7 +32,11 @@ sub gradients_popup { { name => 'initial_gradient', type => 'string', desc => 'The name of the pattern to set as the first selected', 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 = ( @@ -67,10 +56,9 @@ CODE sub gradients_close_popup { $blurb = 'Popdown the Gimp gradient selection.'; + $help = 'This procedure closes an opened gradient selection dialog.'; - $help = 'This procedure closes an opened gradient selection dialog.'; - - &pdb_misc; + &andy_pdb_misc('1998'); @inargs = ( { name => 'gradient_callback', type => 'string', @@ -92,10 +80,9 @@ CODE sub gradients_set_popup { $blurb = 'Sets the current gradient selection in a popup.'; + $help = $blurb; - $help = $blurb; - - &pdb_misc; + &andy_pdb_misc('1998'); @inargs = ( { name => 'gradient_callback', type => 'string', diff --git a/tools/pdbgen/pdb/gradients.pdb b/tools/pdbgen/pdb/gradients.pdb index 640ccdb473..2d1b85dba2 100644 --- a/tools/pdbgen/pdb/gradients.pdb +++ b/tools/pdbgen/pdb/gradients.pdb @@ -17,14 +17,6 @@ # "Perlized" from C source by Manish Singh -sub federico_misc { - $author = $copyright = 'Federico Mena Quintero'; - $date = '1997'; -} - - -# The defs - sub gradients_refresh { $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. HELP - $author = $copyright = 'Michael Natterer'; - $date = '2002'; + &mitch_pdb_misc('2002'); %invoke = ( 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. HELP - &federico_misc; + &federico_pdb_misc('1997'); @inargs = ( { name => 'filter', type => 'string', null_ok => 1, @@ -71,17 +62,16 @@ HELP ); } -sub sample_num_arg { - { name => 'num_samples', type => $_[0] . 'int32', - desc => 'The number of samples to take', alias => 'i' } -} +sub gradients_sample_uniform { + &std_pdb_deprecated ('gimp-gradient-get-uniform-samples'); -sub reverse_arg { - { name => 'reverse', type => 'boolean', - desc => 'Use the reverse gradient (%%desc%%)' } -} + @inargs = ( + { name => 'num_samples', type => '2 <= int32', + desc => 'The number of samples to take', alias => 'i' }, + { name => 'reverse', type => 'boolean', + desc => 'Use the reverse gradient (%%desc%%)' } + ); -sub sample_outargs { @outargs = ( { name => 'color_samples', type => 'floatarray', init => 1, 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 * num_samples)' } } ); -} - -sub gradients_sample_uniform { - &std_pdb_deprecated ('gimp-gradient-get-uniform-samples'); - - @inargs = ( - &sample_num_arg('2 <= '), - &reverse_arg - ); - &sample_outargs; %invoke = ( - vars => [ 'GimpGradient *gradient', 'gdouble pos, delta', - 'GimpRGB color', 'gdouble *pv' ], code => <<'CODE' { + GimpGradient *gradient; GimpGradientSegment *seg = NULL; + gdouble pos, delta; + GimpRGB color; + gdouble *pv; pos = 0.0; delta = 1.0 / (i - 1); @@ -140,17 +122,27 @@ sub gradients_sample_custom { type => 'floatarray', desc => 'The list of positions to sample along the gradient', alias => 'pos', - array => &sample_num_arg("") }, - &reverse_arg + array => { name => 'num_samples', type => 'int32', + 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 = ( - vars => [ 'GimpGradient *gradient', 'GimpRGB color', 'gdouble *pv' ], code => <<'CODE' { + GimpGradient *gradient; GimpGradientSegment *seg = NULL; + GimpRGB color; + gdouble *pv; 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 { &std_pdb_deprecated ('gimp-gradient-get-uniform-samples'); @@ -190,8 +173,13 @@ sub gradients_get_gradient_data { { name => 'name', type => 'string', desc => 'The gradient name ("" means current active gradient)', null_ok => '1' }, - &sample_size_arg, - &reverse_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 }, + { name => 'reverse', type => 'boolean', + desc => 'Use the reverse gradient (%%desc%%)' } ); @outargs = ( diff --git a/tools/pdbgen/pdb/guides.pdb b/tools/pdbgen/pdb/guides.pdb index 3bf83029a3..e951af2c16 100644 --- a/tools/pdbgen/pdb/guides.pdb +++ b/tools/pdbgen/pdb/guides.pdb @@ -17,10 +17,6 @@ # "Perlized" from C source by Manish Singh -sub pdb_misc { - $author = $copyright = 'Adam D. Moss'; - $date = '1998'; -} sub image_add_guide { 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. HELP - &pdb_misc; + &adam_pdb_misc('1998'); @inargs = ( &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. HELP - &pdb_misc; + &adam_pdb_misc('1998'); @inargs = ( &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. HELP - &pdb_misc; + &adam_pdb_misc('1998'); @inargs = ( &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. HELP - &pdb_misc; + &adam_pdb_misc('1998'); @inargs = ( &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. HELP - &pdb_misc; + &adam_pdb_misc('1998'); @inargs = ( &std_image_arg, diff --git a/tools/pdbgen/pdb/help.pdb b/tools/pdbgen/pdb/help.pdb index df5cf4e4a2..ac5cad32e4 100644 --- a/tools/pdbgen/pdb/help.pdb +++ b/tools/pdbgen/pdb/help.pdb @@ -29,8 +29,7 @@ help_domain is NULL and no help domain was registered, the help domain of the main GIMP installation is used. HELP - $author = $copyright = 'Michael Natterer '; - $date = '2000'; + &mitch_pdb_misc('2000'); @inargs = ( { name => 'help_domain', type => 'string', null_ok => 1, diff --git a/tools/pdbgen/pdb/image.pdb b/tools/pdbgen/pdb/image.pdb index 7e5c0ca05a..4f5f99d017 100644 --- a/tools/pdbgen/pdb/image.pdb +++ b/tools/pdbgen/pdb/image.pdb @@ -35,14 +35,6 @@ sub vectors_arg () {{ 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 { my $type = shift; @@ -64,15 +56,19 @@ HELP ); %invoke = ( - vars => [ 'GList *list = NULL', 'gint i' ], code => <${type}s)->list; num_${type}s = g_list_length (list); if (num_${type}s) { + gint i; + ${type}_ids = g_new (gint32, num_${type}s); + for (i = 0; i < num_${type}s; i++, list = g_list_next (list)) ${type}_ids[i] = gimp_item_get_ID (GIMP_ITEM (list->data)); } @@ -229,15 +225,14 @@ HELP &std_pdb_misc; @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', desc => 'The type of image: { %%desc%% }' } ); - foreach (qw(height width)) { - unshift @inargs, { name => $_, type => '0 < int32', - desc => "The $_ of the image" } - } - @outargs = ( { name => 'image', type => 'image', init => 1, desc => 'The ID of the newly created image' } @@ -319,14 +314,19 @@ HELP &std_pdb_misc; - @inargs = ( &std_image_arg ); - &new_dim_args; - - foreach (qw(x y)) { - push @inargs, { name => "off$_", type => 'int32', - desc => "$_ offset between upper left corner of old and - new images: (new - old)" } - } + @inargs = ( + &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%%" }, + { 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 = ( 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. HELP - $author = $copyright = 'Simon Budig'; - $date = '2004'; - - $since = '2.2'; + &simon_pdb_misc('2004', '2.2'); @inargs = ( &std_image_arg ); @@ -381,8 +378,13 @@ HELP &std_pdb_misc; - @inargs = ( &std_image_arg ); - &new_dim_args; + @inargs = ( + &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 = ( headers => [ qw("config/gimpcoreconfig.h" "core/gimpimage-scale.h") ], @@ -467,8 +469,8 @@ CODE sub image_rotate { $blurb = 'Rotates the image by the specified degrees.'; $help = 'This procedure rotates the image.'; - $author = $copyright = 'Michael Natterer'; - $date = '2003'; + + &mitch_pdb_misc('2003'); @inargs = ( &std_image_arg, @@ -654,16 +656,14 @@ sub image_lower_layer { sub image_raise_layer_to_top { &type_move('layer', 'raise_to_top', 'above'); - $copyright = "Wolfgang Hofer"; - $author = $copyright . ", Sven Neumann"; - $date = 1998; + &wolfgang_pdb_misc('1998'); + $author .= ", Sven Neumann"; } sub image_lower_layer_to_bottom { &type_move('layer', 'lower_to_bottom', 'below'); - $copyright = "Wolfgang Hofer"; - $author = $copyright . ", Sven Neumann"; - $date = 1998; + &wolfgang_pdb_misc('1998'); + $author .= ", Sven Neumann"; } 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. HELP - $author = $copyright = 'Larry Ewing'; - $date = '1998'; + &larry_pdb_misc('1998'); @inargs = ( &std_image_arg, @@ -783,7 +782,8 @@ HELP @inargs = ( &std_image_arg, - &layer_arg, + { name => 'layer', type => 'layer', + desc => 'The layer' }, { name => 'position', type => 'int32', desc => 'The layer position' } ); @@ -818,7 +818,8 @@ HELP @inargs = ( &std_image_arg, - &layer_arg + { name => 'layer', type => 'layer', + desc => 'The layer' } ); %invoke = ( code => 'gimp_image_remove_layer (gimage, layer);' ); @@ -829,7 +830,8 @@ sub image_add_layer_mask { @inargs = ( &std_image_arg, - &layer_arg, + { name => 'layer', type => 'layer', + desc => 'The layer' }, { name => 'mask', type => 'layer_mask', desc => 'The mask to add to the layer' } ); @@ -849,7 +851,8 @@ sub image_remove_layer_mask { @inargs = ( &std_image_arg, - &layer_arg, + { name => 'layer', type => 'layer', + desc => 'The layer' }, { name => 'mode', type => 'enum GimpMaskApplyMode', desc => 'Removal mode: { %%desc%% }' } ); @@ -881,7 +884,8 @@ HELP @inargs = ( &std_image_arg, - &channel_arg, + { name => 'channel', type => 'channel', + desc => 'The channel' }, { name => 'position', type => 'int32', desc => 'The channel position' } ); @@ -910,7 +914,8 @@ HELP @inargs = ( &std_image_arg, - &channel_arg + { name => 'channel', type => 'channel', + desc => 'The channel' } ); %invoke = ( code => 'gimp_image_remove_channel (gimage, channel);' ); @@ -929,7 +934,8 @@ HELP @inargs = ( &std_image_arg, - &vectors_arg, + { name => 'vectors', type => 'vectors', + desc => 'The vectors object' }, { name => 'position', type => 'int32', 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. HELP - &std_pdb_misc; - - $author = "Simon Budig"; - $date = 2005; - $since = 2.4; + &simon_pdb_misc('2005', '2.4'); @inargs = ( &std_image_arg, - &vectors_arg + { name => 'vectors', type => 'vectors', + desc => 'The vectors object' } ); %invoke = ( code => 'gimp_image_remove_vectors (gimage, vectors);' ); @@ -965,34 +968,22 @@ HELP sub image_raise_vectors { &type_move('vectors', 'raise', 'above'); - &std_pdb_misc; - $author = "Simon Budig"; - $date = 2005; - $since = 2.4; + &simon_pdb_misc('2005', '2.4'); } sub image_lower_vectors { &type_move('vectors', 'lower', 'below'); - &std_pdb_misc; - $author = "Simon Budig"; - $date = 2005; - $since = 2.4; + &simon_pdb_misc('2005', '2.4'); } sub image_raise_vectors_to_top { &type_move('vectors', 'raise_to_top', 'above'); - &std_pdb_misc; - $author = "Simon Budig"; - $date = 2005; - $since = 2.4; + &simon_pdb_misc('2005', '2.4'); } sub image_lower_vectors_to_bottom { &type_move('vectors', 'lower_to_bottom', 'below'); - &std_pdb_misc; - $author = "Simon Budig"; - $date = 2005; - $since = 2.4; + &simon_pdb_misc('2005', '2.4'); } 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. HELP - $author = $copyright = 'Wolfgang Hofer'; - $date = '1998'; + &wolfgang_pdb_misc('1998'); @inargs = ( &std_image_arg ); @@ -1183,10 +1173,9 @@ HELP ); %invoke = ( - vars => [ 'GimpLayer *floating_sel' ], code => <<'CODE' { - floating_sel = gimp_image_floating_sel (gimage); + GimpLayer *floating_sel = gimp_image_floating_sel (gimage); if (floating_sel) 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. HELP - $author = $copyright = 'Austin Donnelly'; - $date = '1998'; + &austin_pdb_misc('1998'); push @outargs, { %{$outargs[0]} }; $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. HELP - $author = $copyright = 'Austin Donnelly'; - $date = '1998'; + &austin_pdb_misc('1998'); 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. HELP -my $unit_misc = <<'CODE'; - $author = $copyright = 'Michael Natterer'; - $date = '1998'; -CODE - &image_accessors('unit', 'unit (min GIMP_UNIT_INCH)', 'unit', 1, [ < $_, - type => 'int32', - desc => "The previews $_", - init => 1 }; - } - @args; -} - sub image_thumbnail { $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. HELP - $author = $copyright = 'Andy Thomas'; - $date = '1999'; + &andy_pdb_misc('1999'); @inargs = ( &std_image_arg, @@ -1603,7 +1567,12 @@ HELP ); @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, desc => 'The thumbnail data', init => 1, array => { name => 'thumbnail_data_count', diff --git a/tools/pdbgen/pdb/layer.pdb b/tools/pdbgen/pdb/layer.pdb index 33d137f299..737acc6844 100644 --- a/tools/pdbgen/pdb/layer.pdb +++ b/tools/pdbgen/pdb/layer.pdb @@ -17,12 +17,6 @@ # "Perlized" from C source by Manish Singh -sub layer_arg () {{ - name => 'layer', - type => 'layer', - desc => 'The layer' -}} - sub layer_dim_proc { my ($op, $morehelp, @args) = @_; @@ -38,7 +32,8 @@ HELP &std_pdb_misc; @inargs = ( - &layer_arg, + { name => 'layer', type => 'layer', + desc => 'The layer' }, { name => 'new_width', type => '0 < int32', desc => 'New layer width: (%%desc%%)' }, { name => 'new_height', type => '0 < int32', @@ -81,7 +76,10 @@ sub layer_get_prop_proc { &std_pdb_misc; - @inargs = ( &layer_arg ); + @inargs = ( + { name => 'layer', type => 'layer', + desc => 'The layer' } + ); @outargs = ( { name => $prop, type => $type, @@ -106,7 +104,8 @@ sub layer_set_prop_proc { &std_pdb_misc; @inargs = ( - &layer_arg, + { name => 'layer', type => 'layer', + desc => 'The layer' }, { name => $prop, type => $type, desc => "The new layer $desc" } ); @@ -192,10 +191,7 @@ HELP %invoke = ( code => <<'CODE' { - layer = gimp_layer_new (gimage, - width, height, - type, - name, + layer = gimp_layer_new (gimage, width, height, type, name, opacity / 100.0, mode); success = (layer != NULL); } @@ -217,11 +213,11 @@ HELP &std_pdb_misc; @inargs = ( - &layer_arg, + { name => 'layer', type => 'layer', + desc => 'The layer to copy' }, { name => 'add_alpha', type => 'boolean', desc => 'Add an alpha channel to the copied layer' } ); - $inargs[0]->{desc} .= ' to copy'; @outargs = ( { name => 'layer_copy', type => 'layer', init => 1, wrap => 1, @@ -251,11 +247,11 @@ HELP &std_pdb_misc; @inargs = ( - &layer_arg, + { name => 'layer', type => 'layer', + desc => 'The layer to which to add the mask' }, { name => 'mask_type', type => 'enum GimpAddMaskType', desc => 'The type of mask: { %%desc%% }' } ); - $inargs[0]->{desc} .= ' to which to add the mask'; @outargs = ( { name => 'mask', type => 'layer_mask', @@ -283,11 +279,11 @@ HELP &std_pdb_misc; @inargs = ( - &layer_arg, + { name => 'layer', type => 'layer', + desc => 'The layer to receive the mask' }, { name => 'mask', type => 'layer_mask', desc => 'The mask to add to the layer' } ); - $inargs[0]->{desc} .= ' to receive the mask'; %invoke = ( code => <<'CODE' @@ -312,13 +308,14 @@ HELP &std_pdb_misc; @inargs = ( - &layer_arg, + { name => 'layer', type => 'layer', + desc => 'The layer from which to remove mask' }, { name => 'mode', type => 'enum GimpMaskApplyMode', 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)); @@ -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. HELP - $author = $copyright = 'Manish Singh'; - $date = '2003'; + &yosh_pdb_misc('2003'); - @inargs = ( &layer_arg ); - $inargs[0]->{desc} .= ' to resize'; + @inargs = ( + { name => 'layer', type => 'layer', + desc => 'The layer to resize' } + ); %invoke = ( code => <<'CODE' ); { @@ -390,11 +388,14 @@ HELP &std_pdb_misc; - @inargs = ( &layer_arg ); - foreach (qw(x y)) { - push @inargs, { name => "off$_", type => 'int32', - desc => "Offset in $_ direction" } - } + @inargs = ( + { name => 'layer', type => 'layer', + desc => 'The layer' }, + { name => 'offx', type => 'int32', + desc => "Offset in x direction" }, + { name => 'offy', type => 'int32', + desc => "Offset in y direction" } + ); %invoke = ( code => <<'CODE'); { @@ -428,7 +429,10 @@ HELP &std_pdb_misc; - @inargs = ( &layer_arg ); + @inargs = ( + { name => 'layer', type => 'layer', + desc => 'The layer' } + ); %invoke = ( code => 'gimp_layer_add_alpha (layer);' ); } @@ -459,7 +463,10 @@ HELP &std_pdb_misc; - @inargs = ( &layer_arg ); + @inargs = ( + { name => 'layer', type => 'layer', + desc => 'The layer' } + ); @outargs = ( { name => 'mask', type => 'channel', @@ -512,7 +519,10 @@ HELP &std_pdb_misc; - @inargs = ( &layer_arg ); + @inargs = ( + { name => 'layer', type => 'layer', + desc => 'The layer' } + ); @outargs = ( { name => 'is_floating_sel', type => 'boolean', diff --git a/tools/pdbgen/pdb/message.pdb b/tools/pdbgen/pdb/message.pdb index 3af8667923..a7b4e217f6 100644 --- a/tools/pdbgen/pdb/message.pdb +++ b/tools/pdbgen/pdb/message.pdb @@ -17,11 +17,6 @@ # "Perlized" from C source by Manish Singh -sub pdb_misc { - $author = $copyright = 'Manish Singh'; - $date = '1998'; -} - sub 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. HELP - &pdb_misc; + &yosh_pdb_misc('1998'); @inargs = ( { 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. HELP - &pdb_misc; + &yosh_pdb_misc('1998'); @outargs = ( { 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. HELP - &pdb_misc; + &yosh_pdb_misc('1998'); @inargs = ( { name => 'handler', type => 'enum GimpMessageHandlerType', @@ -86,9 +81,8 @@ HELP %invoke = ( code => 'gimp->message_handler = handler;' ); } -@headers = qw( - "core/gimp.h" "plug-in/plug-in.h" "plug-in/plug-in-progress.h" - "gimp-intl.h"); +@headers = qw( "core/gimp.h" "plug-in/plug-in.h" + "plug-in/plug-in-progress.h" "gimp-intl.h"); @procs = qw(message message_get_handler message_set_handler); %exports = (app => [@procs], lib => [@procs]); diff --git a/tools/pdbgen/pdb/misc.pdb b/tools/pdbgen/pdb/misc.pdb index e6947263fc..17a3e49ad4 100644 --- a/tools/pdbgen/pdb/misc.pdb +++ b/tools/pdbgen/pdb/misc.pdb @@ -26,8 +26,7 @@ BLURB This procedure returns the version number of the currently running gimp. HELP - $author = $copyright = 'Manish Singh'; - $date = '1999'; + &yosh_pdb_misc('1999'); @outargs = ( { name => 'version', type => 'string', @@ -47,9 +46,7 @@ BLURB This procedure returns the process ID of the currently running gimp. HELP - $author = $copyright = 'Michael Natterer'; - $date = '2005'; - $since = '2.4'; + &mitch_pdb_misc('2005', '2.4'); @outargs = ( { name => 'pid', type => 'int32', diff --git a/tools/pdbgen/pdb/paint_tools.pdb b/tools/pdbgen/pdb/paint_tools.pdb index 1a83a67b4d..81fb1166f5 100644 --- a/tools/pdbgen/pdb/paint_tools.pdb +++ b/tools/pdbgen/pdb/paint_tools.pdb @@ -21,20 +21,6 @@ # 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 () { { name => 'strokes', type => 'floatarray', desc => 'Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., @@ -47,7 +33,7 @@ sub stroke_arg () { # The defs sub airbrush { - $blurb = <<'BLURB'; + $blurb = <<'BLURB'; Paint in the current brush with varying pressure. Paint application is time-dependent. BLURB @@ -61,9 +47,10 @@ HELP &std_pdb_misc; @inargs = ( - &drawable_arg, - { name => 'pressure', type => '0 <= float <= 100', - desc => 'The pressure of the airbrush strokes (%%desc%%)' }, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, + { name => 'pressure', type => '0 <= float <= 100', + desc => 'The pressure of the airbrush strokes (%%desc%%)' }, &stroke_arg ); @@ -92,7 +79,7 @@ CODE } sub airbrush_default { - $blurb = <<'BLURB'; + $blurb = <<'BLURB'; Paint in the current brush with varying pressure. Paint application is time-dependent. 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. HELP - $author = $copyright = 'Andy Thomas'; - $date = '1999'; + &andy_pdb_misc('1999'); @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, &stroke_arg ); @@ -153,7 +140,8 @@ HELP &std_pdb_misc; @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, { name => 'src_drawable', type => 'drawable', desc => 'The source drawable' }, { 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. HELP - $author = $copyright = 'Andy Thomas'; - $date = '1999'; + &andy_pdb_misc('1999'); @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, &stroke_arg ); @@ -253,11 +241,11 @@ option dialog. It this dialog has not been activated then the dialogs default values will be used. HELP - $author = $copyright = 'Andy Thomas'; - $date = '1999'; + &andy_pdb_misc('1999'); @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, &stroke_arg ); @@ -294,7 +282,8 @@ HELP &std_pdb_misc; @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, { name => 'pressure', type => '0 <= float <= 100', desc => 'The pressure: %%desc%%' }, { 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. HELP - $author = $copyright = 'Andy Thomas'; - $date = '1999'; + &andy_pdb_misc('1999'); @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, &stroke_arg ); @@ -379,7 +368,8 @@ HELP &std_pdb_misc; @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, &stroke_arg, { name => 'hardness', type => 'enum GimpBrushApplicationMode', desc => '%%desc%%' }, @@ -426,7 +416,8 @@ HELP &std_pdb_misc; @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, &stroke_arg, { name => 'hardness', type => 'enum GimpBrushApplicationMode', desc => '%%desc%%' }, @@ -480,7 +471,8 @@ HELP &std_pdb_misc; @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, { name => 'fade_out', type => '0 <= float', desc => 'Fade out parameter: %%desc%%' }, &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. HELP - $author = $copyright = 'Andy Thomas'; - $date = '1999'; + &andy_pdb_misc('1999'); @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, &stroke_arg ); @@ -580,7 +572,8 @@ HELP &std_pdb_misc; @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, &stroke_arg ); @@ -605,9 +598,7 @@ CODE } sub smudge { - $blurb = <<'BLURB'; -Smudge image with varying pressure. -BLURB + $blurb = 'Smudge image with varying pressure.'; $help = <<'HELP'; This tool simulates a smudge using the current brush. High pressure results @@ -617,7 +608,8 @@ HELP &std_pdb_misc; @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, { name => 'pressure', type => '0 <= float <= 100', desc => 'The pressure of the smudge strokes (%%desc%%)' }, &stroke_arg @@ -659,11 +651,11 @@ smudge tool options or the options default if the tools option dialog has not been activated. HELP - $author = $copyright = 'Andy Thomas'; - $date = '1999'; + &andy_pdb_misc('1999'); @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, &stroke_arg ); @@ -696,12 +688,11 @@ BLURB Dodgeburn. More details here later. HELP - - $author = $copyright = 'Andy Thomas'; - $date = '1999'; + &andy_pdb_misc('1999'); @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, { name => 'exposure', type => '0 <= float <= 100', desc => 'The exposer of the strokes (%%desc%%)' }, { name => 'dodgeburn_type', type => 'enum GimpDodgeBurnType', @@ -752,7 +743,8 @@ HELP &std_pdb_misc; @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, &stroke_arg ); @@ -787,7 +779,8 @@ sub ink { &std_pdb_misc; @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, &stroke_arg ); } diff --git a/tools/pdbgen/pdb/palette.pdb b/tools/pdbgen/pdb/palette.pdb index c66a38c2ac..3319d6b4b4 100644 --- a/tools/pdbgen/pdb/palette.pdb +++ b/tools/pdbgen/pdb/palette.pdb @@ -17,54 +17,11 @@ # "Perlized" from C source by Manish Singh -sub bill_misc { - $author = 'Bill Skaggs '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 { $blurb = "Creates a new palette"; $help = "This procedure creates a new, uninitialized palette"; - &mitch_misc; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( { name => 'name', type => 'string', @@ -94,10 +51,11 @@ sub palette_is_editable { $blurb = "Tests if palette can be edited"; $help = "Returns True if you have permission to change the palette"; - &bill_misc; + &bill_pdb_misc('2004', '2.4'); @inargs = ( - &palette_arg + { name => 'name', type => 'string', + desc => 'The palette name' } ); @outargs = ( @@ -127,10 +85,11 @@ sub palette_duplicate { $blurb = "Duplicates a palette"; $help = "This procedure creates an identical palette by a different name"; - &mitch_misc; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( - &palette_arg + { name => 'name', type => 'string', + desc => 'The palette name' } ); @outargs = ( @@ -141,11 +100,10 @@ sub palette_duplicate { ); %invoke = ( - vars => [ 'GimpPalette *palette = NULL', - 'GimpPalette *palette_copy = NULL' ], + vars => [ 'GimpPalette *palette_copy = NULL' ], code => <<'CODE' { - palette = (GimpPalette *) + GimpPalette *palette = (GimpPalette *) gimp_container_get_child_by_name (gimp->palette_factory->container, name); if (palette) @@ -167,10 +125,11 @@ sub palette_rename { $blurb = "Rename a palette"; $help = "This procedure renames a palette"; - &mitch_misc; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( - &palette_arg, + { name => 'name', type => 'string', + desc => 'The palette name' }, { name => 'new_name', type => 'string', desc => "The new name of the palette" } ); @@ -201,17 +160,17 @@ sub palette_delete { $blurb = "Deletes a palette"; $help = "This procedure deletes a palette"; - &mitch_misc; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( - &palette_arg + { name => 'name', type => 'string', + desc => 'The palette name' } ); %invoke = ( - vars => [ 'GimpPalette *palette = NULL' ], code => <<'CODE' { - palette = (GimpPalette *) + GimpPalette *palette = (GimpPalette *) gimp_container_get_child_by_name (gimp->palette_factory->container, name); 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. HELP - &mitch_misc; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( - &palette_arg + { name => 'name', type => 'string', + desc => 'The palette name' } ); @outargs = ( @@ -275,10 +235,11 @@ This procedures retrieves the prefered number of columns to use when the palette is being displayed. HELP - &neo_misc; + &neo_pdb_misc('2005', '2.4'); @inargs = ( - &palette_arg + { name => 'name', type => 'string', + desc => 'The palette name' } ); @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. HELP - &neo_misc; + &neo_pdb_misc('2005', '2.4'); @inargs = ( - &palette_arg, + { name => 'name', type => 'string', + desc => 'The palette name' }, { name => 'columns', type => '0 <= int32 <= 64', desc => "The new number of columns" } ); %invoke = ( - vars => [ 'GimpPalette *palette = NULL' ], code => <<'CODE' { - palette = (GimpPalette *) + GimpPalette *palette = (GimpPalette *) gimp_container_get_child_by_name (gimp->palette_factory->container, name); 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. HELP - &mitch_misc; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( - &palette_arg, + { name => 'name', type => 'string', + desc => 'The palette name' }, { name => 'entry_name', type => 'string', null_ok => '1', desc => 'The name of the entry' }, { name => 'color', type => 'color', @@ -357,11 +319,10 @@ HELP ); %invoke = ( - vars => [ 'GimpPalette *palette = NULL', - 'GimpPaletteEntry *entry = NULL' ], + vars => [ 'GimpPaletteEntry *entry = NULL' ], code => <<'CODE' { - palette = (GimpPalette *) + GimpPalette *palette = (GimpPalette *) gimp_container_get_child_by_name (gimp->palette_factory->container, name); 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. HELP - &mitch_misc; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( - &palette_arg, + { name => 'name', type => 'string', + desc => 'The palette name' }, { name => 'entry_num', type => 'int32', desc => 'The index of the added entry' } ); %invoke = ( - vars => [ 'GimpPalette *palette = NULL', - 'GimpPaletteEntry *entry = NULL' ], code => <<'CODE' { - palette = (GimpPalette *) + GimpPalette *palette = (GimpPalette *) gimp_container_get_child_by_name (gimp->palette_factory->container, name); if (palette && GIMP_DATA (palette)->writable) { 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); } @@ -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. HELP - &mitch_misc; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( - &palette_arg, + { name => 'name', type => 'string', + desc => 'The palette name' }, { name => 'entry_num', type => 'int32', desc => 'The entry to retrieve' } ); @@ -437,18 +398,16 @@ HELP ); %invoke = ( - vars => [ 'GimpPalette *palette = NULL', - 'GimpPaletteEntry *entry = NULL' ], code => <<'CODE' { - palette = (GimpPalette *) + GimpPalette *palette = (GimpPalette *) gimp_container_get_child_by_name (gimp->palette_factory->container, name); if (palette) { 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; } @@ -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. HELP - &mitch_misc; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( - &palette_arg, + { name => 'name', type => 'string', + desc => 'The palette name' }, { name => 'entry_num', type => 'int32', desc => 'The entry to retrieve' }, { name => 'color', type => 'color', @@ -481,18 +441,16 @@ HELP ); %invoke = ( - vars => [ 'GimpPalette *palette = NULL', - 'GimpPaletteEntry *entry = NULL' ], code => <<'CODE' { - palette = (GimpPalette *) + GimpPalette *palette = (GimpPalette *) gimp_container_get_child_by_name (gimp->palette_factory->container, name); if (palette && GIMP_DATA (palette)->writable) { 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; @@ -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. HELP - &mitch_misc; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( - &palette_arg, + { name => 'name', type => 'string', + desc => 'The palette name' }, { name => 'entry_num', type => 'int32', desc => 'The entry to retrieve' } ); @@ -531,11 +490,10 @@ HELP ); %invoke = ( - vars => [ 'GimpPalette *palette = NULL', - 'GimpPaletteEntry *entry = NULL' ], + vars => [ 'GimpPaletteEntry *entry = NULL' ], code => <<'CODE' { - palette = (GimpPalette *) + GimpPalette *palette = (GimpPalette *) gimp_container_get_child_by_name (gimp->palette_factory->container, name); 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. HELP - &mitch_misc; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( - &palette_arg, + { name => 'name', type => 'string', + desc => 'The palette name' }, { name => 'entry_num', type => 'int32', desc => 'The entry to retrieve' }, { name => 'entry_name', type => 'string', null_ok => '1', @@ -571,18 +530,16 @@ HELP ); %invoke = ( - vars => [ 'GimpPalette *palette = NULL', - 'GimpPaletteEntry *entry = NULL' ], code => <<'CODE' { - palette = (GimpPalette *) + GimpPalette *palette = (GimpPalette *) gimp_container_get_child_by_name (gimp->palette_factory->container, name); if (palette && GIMP_DATA (palette)->writable) { 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); entry->name = g_strdup (entry_name); diff --git a/tools/pdbgen/pdb/palette_select.pdb b/tools/pdbgen/pdb/palette_select.pdb index 5ce762b6f4..62f042600e 100644 --- a/tools/pdbgen/pdb/palette_select.pdb +++ b/tools/pdbgen/pdb/palette_select.pdb @@ -17,18 +17,11 @@ # "Perlized" from C source by Manish Singh -sub pdb_misc { - $author = 'Michael Natterer '; - $copyright = 'Michael Natterer'; - $date = '2002'; -} - sub palettes_popup { $blurb = 'Invokes the Gimp palette selection.'; + $help = 'This procedure popups the palette selection dialog.'; - $help = 'This procedure popups the palette selection dialog.'; - - &pdb_misc; + &mitch_pdb_misc('2002'); @inargs = ( { name => 'palette_callback', type => 'string', @@ -57,10 +50,9 @@ CODE sub palettes_close_popup { $blurb = 'Popdown the Gimp palette selection.'; + $help = 'This procedure closes an opened palette selection dialog.'; - $help = 'This procedure closes an opened palette selection dialog.'; - - &pdb_misc; + &mitch_pdb_misc('2002'); @inargs = ( { name => 'palette_callback', type => 'string', @@ -82,10 +74,9 @@ CODE sub palettes_set_popup { $blurb = 'Sets the current palette selection in a popup.'; + $help = $blurb; - $help = $blurb; - - &pdb_misc; + &mitch_pdb_misc('2002'); @inargs = ( { name => 'palette_callback', type => 'string', diff --git a/tools/pdbgen/pdb/palettes.pdb b/tools/pdbgen/pdb/palettes.pdb index b7468b1e6d..62d4601946 100644 --- a/tools/pdbgen/pdb/palettes.pdb +++ b/tools/pdbgen/pdb/palettes.pdb @@ -17,71 +17,6 @@ # "Perlized" from C source by Manish Singh -sub rock_misc { - $author = 'Nathan Summers '; - $copyright = 'Nathan Summers'; - $date = '2001'; -} - -sub adrian_misc { - $author = 'Adrian Likins '; - $copyright = 'Adrian Likins'; - $date = '1998'; -} - -sub mitch_misc { - $author = 'Michael Natterer '; - $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 { $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. HELP - &adrian_misc; + &adrian_pdb_misc('1998'); %invoke = ( 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'. HELP - &rock_misc; + &rock_pdb_misc('2001'); @inargs = ( { name => 'filter', type => 'string', null_ok => 1, @@ -130,12 +65,14 @@ sub palettes_get_palette { &std_pdb_deprecated ('gimp-context-get-palette'); @outargs = ( - &palette_arg, - &dim_args, + { name => 'name', type => 'string', no_declare => 1, + 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 = ( vars => [ 'GimpPalette *palette' ], 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'); @inargs = ( - &palette_arg, + { name => 'name', type => 'string', + desc => 'The palette name ("" means currently active palette)', + null_ok => '1' }, { name => 'entry_num', type => 'int32', desc => 'The entry to retrieve' } ); - $inargs[0]->{desc} = 'The palette name ("" means currently active palette)'; @outargs = ( - &palette_arg, - &dim_args, + { name => 'name', type => 'string', no_declare => 1, + 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 = ( vars => [ 'GimpPalette *palette = NULL' ], 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) { diff --git a/tools/pdbgen/pdb/parasite.pdb b/tools/pdbgen/pdb/parasite.pdb index 2b28b3f699..12621acc1f 100644 --- a/tools/pdbgen/pdb/parasite.pdb +++ b/tools/pdbgen/pdb/parasite.pdb @@ -17,24 +17,6 @@ # "Perlized" from C source by Manish Singh -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 () {{ name => 'drawable', type => 'drawable', @@ -70,11 +52,18 @@ sub parasite_find { Finds and returns the named parasite that was previously attached to the gimp. 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 = ( ¶site_outarg('found') ); + @outargs = ( + { name => 'parasite', type => 'parasite', + desc => 'The found parasite', + init => 1 } + ); %invoke = ( code => <<'CODE' @@ -93,7 +82,7 @@ sub parasite_attach { This procedure attaches a parasite to the gimp. It has no return values. HELP - &pdb_misc; + &jay_pdb_misc('1998'); @inargs = ( { name => 'parasite', type => 'parasite', @@ -110,20 +99,21 @@ sub parasite_detach { This procedure detaches a parasite from the gimp. It has no return values. 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);' ); } sub parasite_list { $blurb = 'List all parasites.'; + $help = 'Returns a list of all currently attached parasites.'; - $help = 'Returns a list of all currently attached parasites.'; - - $author = $copyright = 'Marc Lehmann'; - $date = '1999'; + &marc_pdb_misc('1999'); @outargs = ( { name => 'parasites', type => 'stringarray', void_ret => 1, diff --git a/tools/pdbgen/pdb/paths.pdb b/tools/pdbgen/pdb/paths.pdb index 0cb6735548..e879883338 100644 --- a/tools/pdbgen/pdb/paths.pdb +++ b/tools/pdbgen/pdb/paths.pdb @@ -17,13 +17,6 @@ # "Perlized" from C source by Andy Thomas -sub pdb_misc { - $author = $copyright = 'Andy Thomas'; - $date = '1999'; -} - -# The defs - sub path_list { $blurb = 'List the paths associated with the passed image.'; @@ -31,7 +24,7 @@ sub path_list { List the paths associated with the passed image. HELP - &pdb_misc; + &andy_pdb_misc('1999'); @inargs = ( &std_image_arg ); $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. HELP - &pdb_misc; + &andy_pdb_misc('1999'); @inargs = ( &std_image_arg, @@ -139,7 +132,7 @@ sub path_get_current { The name of the current path. Error if no paths. HELP - &pdb_misc; + &andy_pdb_misc('1999'); @inargs = ( &std_image_arg ); $inargs[0]->{desc} = 'The ID of the image to get the current path from.'; @@ -151,10 +144,9 @@ HELP ); %invoke = ( - vars => [ 'GimpVectors *vectors' ], code => <<'CODE' { - vectors = gimp_image_get_active_vectors (gimage); + GimpVectors *vectors = gimp_image_get_active_vectors (gimage); if (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. HELP - &pdb_misc; + &andy_pdb_misc('1999'); @inargs = ( &std_image_arg, @@ -182,10 +174,9 @@ HELP $inargs[0]->{desc} = 'The ID of the image in which a path will become current.'; %invoke = ( - vars => [ 'GimpVectors *vectors' ], code => <<'CODE' { - vectors = gimp_image_get_vectors_by_name (gimage, name); + GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); if (vectors) gimp_image_set_active_vectors (gimage, vectors); @@ -203,7 +194,7 @@ sub path_set_points { Set the points associated with the named path. HELP - &pdb_misc; + &andy_pdb_misc('1999'); @inargs = ( &std_image_arg, @@ -244,9 +235,10 @@ HELP $inargs[0]->{desc} = 'The ID of the image to set the paths in.'; %invoke = ( - vars => [ 'gboolean closed = FALSE' ], code => <<'CODE' { + gboolean closed = FALSE; + if ((num_path_points / 3) % 3 == 0) closed = TRUE; else if ((num_path_points / 3) % 3 != 2) @@ -295,7 +287,7 @@ sub path_stroke_current { Stroke the current path in the passed image. HELP - &pdb_misc; + &andy_pdb_misc('1999'); @inargs = ( &std_image_arg ); $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. HELP - &pdb_misc; + &andy_pdb_misc('1999'); @inargs = ( &std_image_arg, @@ -356,11 +348,15 @@ HELP ); %invoke = ( - vars => [ 'GimpVectors *vectors', 'GimpStroke *stroke', - 'gdouble distance_along', 'gdouble stroke_length', - 'gdouble stroke_distance', 'GimpCoords position' ], code => <<'CODE' { + GimpVectors *vectors; + GimpStroke *stroke; + gdouble distance_along; + gdouble stroke_length; + gdouble stroke_distance; + GimpCoords position; + vectors = gimp_image_get_active_vectors (gimage); 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. HELP - &pdb_misc; + &andy_pdb_misc('1999'); @inargs = ( &std_image_arg, @@ -431,10 +427,9 @@ HELP ); %invoke = ( - vars => [ 'GimpVectors *vectors' ], code => <<'CODE' { - vectors = gimp_image_get_vectors_by_name (gimage, name); + GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); if (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. HELP - &pdb_misc; + &andy_pdb_misc('1999'); @inargs = ( &std_image_arg, @@ -469,10 +464,9 @@ HELP ); %invoke = ( - vars => [ 'GimpVectors *vectors' ], code => <<'CODE' { - vectors = gimp_image_get_vectors_by_name (gimage, name); + GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); if (vectors) 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. HELP - &pdb_misc; + &andy_pdb_misc('1999'); @inargs = ( &std_image_arg, @@ -508,10 +502,9 @@ HELP ); %invoke = ( - vars => [ 'GimpVectors *vectors' ], code => <<'CODE' { - vectors = gimp_image_get_vectors_by_tattoo (gimage, tattoo); + GimpVectors *vectors = gimp_image_get_vectors_by_tattoo (gimage, tattoo); if (vectors) name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors))); @@ -529,7 +522,7 @@ sub path_delete { Delete the named path. HELP - &pdb_misc; + &andy_pdb_misc('1999'); @inargs = ( &std_image_arg, @@ -539,10 +532,9 @@ HELP $inargs[0]->{desc} = 'The ID of the image to delete the path from.'; %invoke = ( - vars => [ 'GimpVectors *vectors' ], code => <<'CODE' { - vectors = gimp_image_get_vectors_by_name (gimage, name); + GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); if (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. HELP - &pdb_misc; + &andy_pdb_misc('1999'); @inargs = ( &std_image_arg, @@ -577,10 +569,9 @@ HELP ); %invoke = ( - vars => [ 'GimpVectors *vectors' ], code => <<'CODE' { - vectors = gimp_image_get_vectors_by_name (gimage, name); + GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); if (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. HELP - &pdb_misc; + &andy_pdb_misc('1999'); @inargs = ( &std_image_arg, @@ -611,10 +602,9 @@ HELP ); %invoke = ( - vars => [ 'GimpVectors *vectors' ], code => <<'CODE' { - vectors = gimp_image_get_vectors_by_name (gimage, name); + GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); if (vectors) 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. HELP - &pdb_misc; + &andy_pdb_misc('1999'); @inargs = ( &std_image_arg, @@ -646,10 +636,9 @@ HELP ); %invoke = ( - vars => [ 'GimpVectors *vectors' ], code => <<'CODE' { - vectors = gimp_image_get_vectors_by_name (gimage, name); + GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); if (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. HELP - $author = $copyright = 'Sven Neumann'; - $date = '2005'; - $since = '2.4'; + &neo_pdb_misc('2005', '2.4'); @inargs = ( &std_image_arg, @@ -680,10 +667,9 @@ HELP ); %invoke = ( - vars => [ 'GimpVectors *vectors' ], code => <<'CODE' { - vectors = gimp_image_get_vectors_by_name (gimage, name); + GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); if (vectors) 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. HELP - - $author = $copyright = 'Joao S. O. Bueno'; - $date = '2003'; + &joao_pdb_misc('2003'); @inargs = ( &std_image_arg, @@ -722,10 +706,9 @@ HELP ); %invoke = ( - vars => [ 'GimpVectors *vectors' ], code => <<'CODE' { - vectors = gimp_image_get_vectors_by_name (gimage, name); + GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); if (vectors) 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. HELP - $author = $copyright = 'Sven Neumann'; - $date = '2003'; + &neo_pdb_misc('2003'); @inargs = ( &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. HELP - $author = $copyright = 'Sven Neumann'; - $date = '2005'; - $since = '2.4'; + &neo_pdb_misc('2005', '2.4'); @inargs = ( &std_image_arg, diff --git a/tools/pdbgen/pdb/pattern.pdb b/tools/pdbgen/pdb/pattern.pdb index ce4c4eb6e2..dfc5922157 100644 --- a/tools/pdbgen/pdb/pattern.pdb +++ b/tools/pdbgen/pdb/pattern.pdb @@ -17,33 +17,19 @@ # "Perlized" from C source by Manish Singh -sub mitch_misc { - $author = 'Michael Natterer '; - $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 { $blurb = 'Retrieve information about the specified pattern.'; + $help = <<'HELP'; This procedure retrieves information about the specified pattern. This includes the pattern extents (width and height). HELP - &mitch_misc; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( - &pattern_arg + { name => 'name', type => 'string', + desc => 'The pattern name.' } ); @outargs = ( @@ -82,10 +68,11 @@ includes the pattern extents (width and height), its bpp and its pixel data. HELP - &mitch_misc; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( - &pattern_arg + { name => 'name', type => 'string', + desc => 'The pattern name.' } ); @outargs = ( diff --git a/tools/pdbgen/pdb/pattern_select.pdb b/tools/pdbgen/pdb/pattern_select.pdb index 98fa3d9e6e..614bd6561b 100644 --- a/tools/pdbgen/pdb/pattern_select.pdb +++ b/tools/pdbgen/pdb/pattern_select.pdb @@ -17,17 +17,11 @@ # "Perlized" from C source by Manish Singh -sub pdb_misc { - $author = $copyright = 'Andy Thomas'; - $date = '1998'; -} - sub patterns_popup { $blurb = 'Invokes the Gimp pattern selection.'; + $help = 'This procedure popups the pattern selection dialog.'; - $help = 'This procedure popups the pattern selection dialog.'; - - &pdb_misc; + &andy_pdb_misc('1998'); @inargs = ( { name => 'pattern_callback', type => 'string', @@ -56,10 +50,9 @@ CODE sub patterns_close_popup { $blurb = 'Popdown the Gimp pattern selection.'; + $help = 'This procedure closes an opened pattern selection dialog.'; - $help = 'This procedure closes an opened pattern selection dialog.'; - - &pdb_misc; + &andy_pdb_misc('1998'); @inargs = ( { name => 'pattern_callback', type => 'string', @@ -81,10 +74,9 @@ CODE sub patterns_set_popup { $blurb = 'Sets the current pattern selection in a popup.'; + $help = $blurb; - $help = $blurb; - - &pdb_misc; + &andy_pdb_misc('1998'); @inargs = ( { name => 'pattern_callback', type => 'string', diff --git a/tools/pdbgen/pdb/patterns.pdb b/tools/pdbgen/pdb/patterns.pdb index 156c0e95ee..6af5114f1e 100644 --- a/tools/pdbgen/pdb/patterns.pdb +++ b/tools/pdbgen/pdb/patterns.pdb @@ -17,38 +17,6 @@ # "Perlized" from C source by Manish Singh -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 { $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. HELP - $author = $copyright = 'Michael Natterer'; - $date = '2002'; + &mitch_pdb_misc('2002'); %invoke = ( code => 'gimp_data_factory_data_refresh (gimp->pattern_factory);' @@ -76,8 +43,7 @@ HELP &std_pdb_misc; @inargs = ( - { name => 'filter', - type => 'string', null_ok => 1, + { name => 'filter', type => 'string', null_ok => 1, 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'); @outargs = ( - &pattern_arg, - &dim_args, + { name => 'name', type => 'string', no_declare => 1, + 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 = ( vars => [ 'GimpPattern *pattern' ], 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'); @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 = ( - &pattern_arg, - &dim_args, + { name => 'name', type => 'string', no_declare => 1, + 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 = ( vars => [ 'GimpPattern *pattern = NULL' ], diff --git a/tools/pdbgen/pdb/plug_in.pdb b/tools/pdbgen/pdb/plug_in.pdb index ee121f9e58..213eac9252 100644 --- a/tools/pdbgen/pdb/plug_in.pdb +++ b/tools/pdbgen/pdb/plug_in.pdb @@ -17,15 +17,12 @@ # "Perlized" from C source by Manish Singh -# The defs - sub plugins_query { $blurb = 'Queries the plugin database for its contents.'; $help = 'This procedure queries the contents of the plugin database.'; - $author = $copyright = 'Andy Thomas'; - $date = '1998'; + &andy_pdb_misc('1998'); @inargs = ( { 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. HELP - $author = $copyright = 'Sven Neumann'; - $date = '2000'; + &neo_pdb_misc('2000'); @inargs = ( { 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. HELP - $author = $copyright = 'Michael Natterer '; - $date = '2000'; + &mitch_pdb_misc('2000'); @inargs = ( { name => 'domain_name', type => 'string', @@ -164,9 +159,7 @@ sub plugin_menu_register { This procedure installs an additional menu entry for the given procedure. HELP - $author = $copyright = 'Michael Natterer '; - $date = '2004'; - $since = '2.2'; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( { 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. HELP - $author = $copyright = 'Michael Natterer '; - $date = '2005'; - $since = '2.4'; + &mitch_pdb_misc('2005', '2.4'); @inargs = ( { name => 'menu_path', type => 'string', @@ -243,9 +234,7 @@ sub plugin_icon_register { This procedure installs an icon for the given procedure. HELP - $author = $copyright = 'Michael Natterer '; - $date = '2004'; - $since = '2.2'; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( { name => 'procedure_name', type => 'string', wrap => 1, diff --git a/tools/pdbgen/pdb/procedural_db.pdb b/tools/pdbgen/pdb/procedural_db.pdb index 45fa00abaa..228aa6ddb6 100644 --- a/tools/pdbgen/pdb/procedural_db.pdb +++ b/tools/pdbgen/pdb/procedural_db.pdb @@ -17,32 +17,6 @@ # "Perlized" from C source by Manish Singh -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 { my ($type, $long_type, $real_type) = @_; @@ -60,7 +34,8 @@ HELP $date = '1997'; @inargs = ( - &proc_name_arg, + { name => 'procedure', type => 'string', + desc => 'The procedure name', alias => 'proc_name' }, { name => "${type}_num", type => 'int32', 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. HELP - $author = $copyright = 'Andy Thomas'; - $date = '1998'; + &andy_pdb_misc('1998'); @outargs = ( { name => 'temp_name', type => 'string', @@ -128,9 +102,12 @@ HELP ); %invoke = ( - vars => [ 'static gint proc_number = 0' ], 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 ); } @@ -233,7 +210,10 @@ HELP &std_pdb_misc; $date = '1997'; - @inargs = ( &proc_name_arg ); + @inargs = ( + { name => 'procedure', type => 'string', + desc => 'The procedure name', alias => 'proc_name' } + ); @outargs = ( { name => 'blurb', type => 'string', void_ret => 1, wrap => 1, @@ -295,19 +275,24 @@ HELP &std_pdb_misc; $date = '1997'; - @inargs = ( &data_ident_arg ); + @inargs = ( + { name => 'identifier', type => 'string', + desc => 'The identifier associated with data' } + ); - @outargs = ( &data_arg ); - $outargs[0]->{alias} = 'data_copy'; - $outargs[0]->{init} = 1; - $outargs[0]->{wrap} = 1; - $outargs[0]->{void_ret} = 1; + @outargs = ( + { name => 'data', type => 'int8array', + desc => 'A byte array containing data', wrap => 1, init => 1, + alias => 'data_copy', void_ret => 1, + array => { name => 'bytes', type => '0 < int32', + desc => 'The number of bytes in the data' } } + ); %invoke = ( - vars => [ 'const guint8 *data' ], code => <<'CODE' { - gchar *canonical; + const guint8 *data; + gchar *canonical; 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. HELP - $author = $copyright = 'Nick Lamb'; - $date = '1998'; + &nick_pdb_misc('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 = ( - vars => [ 'const guint8 *data' ], code => <<'CODE' { - gchar *canonical; + const guint8 *data; + gchar *canonical; canonical = gimp_canonicalize_identifier (identifier); @@ -369,9 +359,14 @@ HELP &std_pdb_misc; $date = '1997'; - @inargs = ( &data_ident_arg, &data_arg ); - $inargs[1]->{wrap} = 1; - delete @{$inargs[1]->{array}}{qw(alias no_declare)}; + @inargs = ( + { name => 'identifier', type => 'string', + 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 = ( code => <<'CODE' diff --git a/tools/pdbgen/pdb/progress.pdb b/tools/pdbgen/pdb/progress.pdb index ff4535a6c6..652a765bb2 100644 --- a/tools/pdbgen/pdb/progress.pdb +++ b/tools/pdbgen/pdb/progress.pdb @@ -17,20 +17,6 @@ # "Perlized" from C source by Manish Singh -sub mitch_pdb_misc { - $author = 'Michael Natterer '; - $copyright = 'Michael Natterer'; - $date = '2004'; - $since = '2.2'; -} - -sub neo_pdb_misc { - $author = 'Sven Neumann '; - $copyright = 'Sven Neumann'; - $date = '2005'; - $since = '2.4'; -} - sub progress_init { $blurb = 'Initializes the progress bar for the current plug-in.'; @@ -77,7 +63,8 @@ HELP @inargs = ( { 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 = ( @@ -106,7 +93,7 @@ made. This usually causes the the progress bar to enter "activity mode", where a block bounces back and forth. HELP - &neo_pdb_misc; + &neo_pdb_misc('2005', '2.4'); %invoke = ( code => <<'CODE' @@ -132,12 +119,13 @@ current plug-in. Unlike gimp_progress_init() it does not change the displayed value. HELP - &neo_pdb_misc; + &neo_pdb_misc('2005', '2.4'); @inargs = ( { name => 'message', type => 'string', null_ok => 1, desc => 'Message to use in the progress dialog' } ); + %invoke = ( 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. HELP - &mitch_pdb_misc; + &mitch_pdb_misc('2004', '2.2'); @outargs = ( { name => 'window', type => 'int32', init => 1, desc => 'The progress bar\'s toplevel window' } ); + %invoke = ( 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. HELP - &mitch_pdb_misc; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( { name => 'progress_callback', type => 'string', @@ -219,7 +208,7 @@ This function uninstalls any progress callback installed with gimp_progress_install() before. HELP - &mitch_pdb_misc; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( { name => 'progress_callback', type => 'string', @@ -247,7 +236,7 @@ sub progress_cancel { This function cancels the currently running progress. HELP - &mitch_pdb_misc; + &mitch_pdb_misc('2004', '2.2'); @inargs = ( { name => 'progress_callback', type => 'string', diff --git a/tools/pdbgen/pdb/selection.pdb b/tools/pdbgen/pdb/selection.pdb index 43db78e964..fa69ad780a 100644 --- a/tools/pdbgen/pdb/selection.pdb +++ b/tools/pdbgen/pdb/selection.pdb @@ -17,32 +17,14 @@ # "Perlized" from C source by Manish Singh -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 { my $op = shift; &std_pdb_misc; - @inargs = ( &std_image_arg ); + @inargs = ( + &std_image_arg + ); %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) = @_; $blurb = "\u$op the image's selection"; - - $help = "This procedure ${op}s the selection. "; + $help = "This procedure ${op}s the selection. "; &std_pdb_misc; @@ -82,21 +63,23 @@ HELP &std_pdb_misc; - @inargs = ( &std_image_arg ); + @inargs = ( + &std_image_arg + ); @outargs = ( { 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 = ( code => 'non_empty = gimp_channel_bounds (gimp_image_get_mask (gimage), &x1, &y1, &x2, &y2);' ); @@ -112,8 +95,13 @@ HELP &std_pdb_misc; - @inargs = ( &std_image_arg ); - &coord_args('$_', '$_ coordinate of value', \@inargs); + @inargs = ( + &std_image_arg, + { name => 'x', type => 'int32', + desc => 'x coordinate of value' }, + { name => 'y', type => 'int32', + desc => 'y coordinate of value' } + ); @outargs = ( { name => 'value', type => '0 <= int32 <= 255', @@ -133,7 +121,9 @@ HELP &std_pdb_misc; - @inargs = ( &std_image_arg); + @inargs = ( + &std_image_arg + ); @outargs = ( { name => 'is_empty', type => 'boolean', @@ -155,8 +145,13 @@ HELP &std_pdb_misc; - @inargs = ( &std_image_arg ); - &coord_args('off$_', '$_ offset for translation', \@inargs); + @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);' ); } @@ -178,9 +173,12 @@ HELP @inargs = ( { 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 = ( { name => 'layer', type => 'layer', wrap => 1, @@ -250,7 +248,9 @@ HELP &std_pdb_misc; - @inargs = ( &std_image_arg ); + @inargs = ( + &std_image_arg + ); %invoke = ( code => "gimp_channel_clear (gimp_image_get_mask (gimage), NULL, TRUE);" ); } @@ -309,10 +309,10 @@ HELP ); %invoke = ( - vars => [ 'GimpImage *gimage' ], 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_DRAWABLE (layer), GIMP_CHANNEL_OP_REPLACE, FALSE, 0.0, 0.0); @@ -330,7 +330,10 @@ HELP &std_pdb_misc; - @inargs = ( &channel_arg ); + @inargs = ( + { name => 'channel', type => 'channel', + desc => 'The channel' } + ); %invoke = ( code => <<'CODE' @@ -361,7 +364,12 @@ HELP &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 = ( code => <<'CODE' @@ -394,7 +402,9 @@ HELP &std_pdb_misc; - @inargs = ( &std_image_arg ); + @inargs = ( + &std_image_arg + ); @outargs = ( { name => 'channel', type => 'channel', diff --git a/tools/pdbgen/pdb/selection_tools.pdb b/tools/pdbgen/pdb/selection_tools.pdb index 6622f6a150..1183214391 100644 --- a/tools/pdbgen/pdb/selection_tools.pdb +++ b/tools/pdbgen/pdb/selection_tools.pdb @@ -17,52 +17,6 @@ # "Perlized" from C source by Manish Singh -# 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 { $blurb = <<'BLURB'; Create a selection by selecting all pixels (in the specified drawable) with the @@ -86,21 +40,27 @@ HELP &std_pdb_misc; @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, { name => 'color', type => 'color', desc => 'The color to select' }, - &threshold_arg, - &operation_arg, + { name => 'threshold', type => '0 <= int32 <= 255', + desc => 'Threshold in intensity levels %%desc%%' }, + { name => 'operation', type => 'enum GimpChannelOps', + desc => 'The selection operation: { %%desc%% }' }, &std_antialias_arg, - &feather_select_args, - &sample_merged_arg + { name => 'feather', type => 'boolean', + 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 = ( - vars => [ 'GimpImage *gimage' ], 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, sample_merged, @@ -143,21 +103,27 @@ HELP desc => 'The width of the ellipse: %%desc%%' }, { name => 'height', type => '0 < float', desc => 'The height of the ellipse: %%desc%%' }, - &operation_arg, + { name => 'operation', type => 'enum GimpChannelOps', + desc => 'The selection operation: { %%desc%% }' }, &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 = ( code => <<'CODE' -gimp_channel_select_ellipse (gimp_image_get_mask (gimage), - (gint) x, (gint) y, - (gint) width, (gint) height, - operation, - antialias, - feather, - feather_radius, - feather_radius); +{ + gimp_channel_select_ellipse (gimp_image_get_mask (gimage), + (gint) x, (gint) y, + (gint) width, (gint) height, + operation, + antialias, + feather, + feather_radius, + feather_radius); +} CODE ); } @@ -187,22 +153,28 @@ HELP array => { type => '2 <= int32', on_success => 'num_segs /= 2;', desc => 'Number of points (count 1 coordinate as two points)' } }, - &operation_arg, + { name => 'operation', type => 'enum GimpChannelOps', + desc => 'The selection operation: { %%desc%% }' }, &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 = ( code => <<'CODE' -gimp_channel_select_polygon (gimp_image_get_mask (gimage), - _("Free Select"), - num_segs, - (GimpVector2 *) segs, - operation, - antialias, - feather, - feather_radius, - feather_radius); +{ + gimp_channel_select_polygon (gimp_image_get_mask (gimage), + _("Free Select"), + num_segs, + (GimpVector2 *) segs, + operation, + antialias, + feather, + feather_radius, + feather_radius); +} CODE ); } @@ -234,25 +206,31 @@ HELP &std_pdb_misc; @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, { name => 'x', type => 'float', desc => 'x coordinate of initial seed fill point: (image coordinates)' }, { name => 'y', type => 'float', desc => 'y coordinate of initial seed fill point: (image coordinates)' }, - &threshold_arg, - &operation_arg, + { name => 'threshold', type => '0 <= int32 <= 255', + desc => 'Threshold in intensity levels %%desc%%' }, + { name => 'operation', type => 'enum GimpChannelOps', + desc => 'The selection operation: { %%desc%% }' }, &std_antialias_arg, - &feather_select_args, - &sample_merged_arg + { name => 'feather', type => 'boolean', + 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 = ( - vars => [ 'GimpImage *gimage' ], 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), drawable, @@ -293,19 +271,25 @@ HELP desc => 'The width of the rectangle: %%desc%%' }, { name => 'height', type => '0 < float', desc => 'The height of the rectangle: %%desc%%' }, - &operation_arg, - &feather_select_args, + { name => 'operation', type => 'enum GimpChannelOps', + 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 = ( code => <<'CODE' -gimp_channel_select_rectangle (gimp_image_get_mask (gimage), - (gint) x, (gint) y, - (gint) width, (gint) height, - operation, - feather, - feather_radius, - feather_radius); +{ + gimp_channel_select_rectangle (gimp_image_get_mask (gimage), + (gint) x, (gint) y, + (gint) width, (gint) height, + operation, + feather, + feather_radius, + feather_radius); +} CODE ); } diff --git a/tools/pdbgen/pdb/text_tool.pdb b/tools/pdbgen/pdb/text_tool.pdb index aef61b0032..eef4684353 100644 --- a/tools/pdbgen/pdb/text_tool.pdb +++ b/tools/pdbgen/pdb/text_tool.pdb @@ -17,47 +17,24 @@ # "Perlized" from C source by Manish Singh -# 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 () {( - &std_image_arg, - { name => 'drawable', type => 'drawable', - desc => 'The affected drawable: (-1 for a new text layer)', - no_success => 1 }, - { name => 'x', type => 'float', - desc => 'The x coordinate for the left of the text bounding box' }, - { name => 'y', type => 'float', - desc => 'The y coordinate for the top of the text bounding box' }, - &text_arg, - { name => 'border', type => '-1 <= int32', - desc => 'The size of the border: %%desc%%' }, - &std_antialias_arg, - &size_args + &std_image_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable: (-1 for a new text layer)', + no_success => 1 }, + { name => 'x', type => 'float', + desc => 'The x coordinate for the left of the text bounding box' }, + { name => 'y', type => 'float', + desc => 'The y coordinate for the top of the text bounding box' }, + { name => 'text', type => 'string', + desc => 'The text to generate (in UTF-8 encoding)' }, + { name => 'border', type => '-1 <= int32', + desc => 'The size of the border: %%desc%%' }, + &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); @@ -72,14 +49,6 @@ sub font_prop_args { @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 { foreach (qw(width height ascent descent)) { push @outargs, { name => $_, type => 'int32', @@ -105,16 +74,21 @@ around the final rendered text. The border is measured in pixels. HELP - &pdb_misc; - $author .= ' & Sven Neumann'; - $date .= '- 2001'; + &std_pdb_misc; + $author = 'Martin Edlman & Sven Neumann'; + $date = '1998- 2001'; @inargs = ( &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 = ( code => <<'CODE' @@ -146,24 +120,28 @@ string with the specified font information. Ascent and descent for the specified font are returned as well. HELP - &pdb_misc; - $author .= ' & Sven Neumann'; - $date .= '- 2001'; + &std_pdb_misc; + $author = 'Martin Edlman & Sven Neumann'; + $date = '1998- 2001'; @inargs = ( - &text_arg, - &size_args, - &fontname_arg + { name => 'text', type => 'string', + 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%%' }, + { name => 'fontname', type => 'string', + desc => 'The name of the font' } ); &extents_outargs; $outargs[0]->{void_ret} = 1; %invoke = ( - vars => [ 'gchar *real_fontname' ], 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, &width, &height, @@ -183,7 +161,11 @@ sub text { &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 = ( code => <<'CODE' @@ -210,8 +192,12 @@ sub text_get_extents { &std_pdb_deprecated ('gimp-text-get-extents-fontname'); @inargs = ( - &text_arg, - &size_args, + { name => 'text', type => 'string', + 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 ); @@ -219,10 +205,9 @@ sub text_get_extents { $outargs[0]->{void_ret} = 1; %invoke = ( - vars => [ 'gchar *real_fontname' ], 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, &width, &height, diff --git a/tools/pdbgen/pdb/transform_tools.pdb b/tools/pdbgen/pdb/transform_tools.pdb index e062bbc1ea..996327ca4f 100644 --- a/tools/pdbgen/pdb/transform_tools.pdb +++ b/tools/pdbgen/pdb/transform_tools.pdb @@ -17,37 +17,20 @@ # "Perlized" from C source by Manish Singh -# 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 { &std_pdb_deprecated ('gimp-drawable-transform-flip-simple'); @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, { name => 'flip_type', type => &std_orientation_enum, desc => 'Type of flip: %%desc%%' } ); - @outargs = ( &drawable_out_arg('flipped') ); + @outargs = ( + { name => 'drawable', type => 'drawable', no_declare => 1, + desc => 'The flipped drawable' } + ); %invoke = ( code => <<'CODE' @@ -71,7 +54,8 @@ sub perspective { &std_pdb_deprecated ('gimp-drawable-transform-perspective-default'); @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, { name => 'interpolation', type => 'boolean', desc => 'Whether to use interpolation' } ); @@ -88,7 +72,10 @@ sub perspective { $pos++; } - @outargs = ( &drawable_out_arg('newly mapped') ); + @outargs = ( + { name => 'drawable', type => 'drawable', no_declare => 1, + desc => 'The newly mapped drawable' } + ); %invoke = ( vars => [ 'gdouble trans_info[8]' ], @@ -138,14 +125,18 @@ sub rotate { &std_pdb_deprecated ('gimp-drawable-transform-rotate-default'); @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, { name => 'interpolation', type => 'boolean', desc => 'Whether to use interpolation' }, { name => 'angle', type => 'float', desc => 'The angle of rotation (radians)' } ); - @outargs = ( &drawable_out_arg('rotated') ); + @outargs = ( + { name => 'drawable', type => 'drawable', no_declare => 1, + desc => 'The rotated drawable' } + ); %invoke = ( code => <<'CODE' @@ -190,24 +181,32 @@ sub scale { &std_pdb_deprecated ('gimp-drawable-transform-scale-default'); @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, { 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; - foreach $where (qw(upper-left lower-right)) { - foreach (qw(x y)) { - 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') ); + @outargs = ( + { name => 'drawable', type => 'drawable', no_declare => 1, + desc => 'The scaled drawable' } + ); %invoke = ( vars => [ 'gdouble trans_info[4]' ], @@ -259,7 +258,8 @@ sub shear { &std_pdb_deprecated ('gimp-drawable-transform-shear-default'); @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, { name => 'interpolation', type => 'boolean', desc => 'Whether to use interpolation' }, { name => 'shear_type', type => &std_orientation_enum, @@ -268,7 +268,10 @@ sub 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 = ( code => <<'CODE' @@ -314,7 +317,8 @@ sub transform_2d { &std_pdb_deprecated ('gimp-drawable-transform-2d-default'); @inargs = ( - &drawable_arg, + { name => 'drawable', type => 'drawable', + desc => 'The affected drawable' }, { name => 'interpolation', type => 'boolean', desc => 'Whether to use interpolation' }, { name => 'source_x', type => 'float', @@ -333,7 +337,10 @@ sub transform_2d { 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 = ( code => <<'CODE' diff --git a/tools/pdbgen/pdb/undo.pdb b/tools/pdbgen/pdb/undo.pdb index d02e28648d..9f5e53dcf1 100644 --- a/tools/pdbgen/pdb/undo.pdb +++ b/tools/pdbgen/pdb/undo.pdb @@ -17,8 +17,6 @@ # "Perlized" from C source by Manish Singh -# The defs - sub image_undo_group_start { $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'; %invoke = ( headers => [ qw("core/gimp.h" "plug-in/plug-in.h") ], - vars => [ 'gchar *undo_desc = NULL' ], code => <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'. HELP - $author = $copyright = 'Raphael Quinet'; - $date = '1999'; + &raphael_pdb_misc('1999'); @inargs = ( &std_image_arg ); @@ -138,8 +136,7 @@ HELP sub image_undo_freeze { $blurb = "Freeze the image's undo stack."; - $author = $copyright = 'Adam D. Moss'; - $date = '1999'; + &adam_pdb_misc('1999'); $help = <<'HELP'; This procedure freezes the image's undo stack, allowing subsequent operations @@ -167,8 +164,7 @@ HELP sub image_undo_thaw { $blurb = "Thaw the image's undo stack."; - $author = $copyright = 'Adam D. Moss'; - $date = '1999'; + &adam_pdb_misc('1999'); $help = <<'HELP'; This procedure thaws the image's undo stack, allowing subsequent operations to diff --git a/tools/pdbgen/pdb/unit.pdb b/tools/pdbgen/pdb/unit.pdb index c72969498d..a83e550b98 100644 --- a/tools/pdbgen/pdb/unit.pdb +++ b/tools/pdbgen/pdb/unit.pdb @@ -17,28 +17,19 @@ # "Perlized" from C source by Manish Singh -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 { my ($prop, $type, $desc) = @_; $desc = $prop unless $desc; $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 = ( { name => $prop, type => $type, @@ -57,7 +48,7 @@ sub unit_get_number_of_units { $help = 'This procedure returns the number of defined units.'; - &pdb_misc; + &mitch_pdb_misc('1999'); @outargs = ( { 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. HELP - &pdb_misc; + &mitch_pdb_misc('1999'); @outargs = ( { 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. HELP - &pdb_misc; + &mitch_pdb_misc('1999'); @inargs = ( { name => 'identifier', type => 'string', wrap => 1, @@ -111,15 +102,18 @@ HELP desc => "The new unit's plural form" } ); - @outargs = ( &unit_arg ); - $outargs[0]->{desc} = "The new unit's ID"; - $outargs[0]->{init} = 1; - $outargs[0]->{libdef} = 'GIMP_UNIT_INCH'; + @outargs = ( + { name => 'unit_id', type => 'unit', init => 1, + desc => "The new unit's ID", + alias => 'unit', wrap => 1, libdef => 'GIMP_UNIT_INCH' } + ); %invoke = ( 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 ); } @@ -142,10 +136,12 @@ TRUE on gimp exit, this unit's definition will not be saved in the user's unitrc. HELP - &pdb_misc; + &mitch_pdb_misc('1999'); @inargs = ( - &unit_arg, + { name => 'unit_id', type => 'unit', + desc => "The unit's integer ID", + alias => 'unit', wrap => 1 }, { name => 'deletion_flag', type => 'boolean', desc => 'The new deletion flag of the unit' } ); @@ -199,17 +195,13 @@ HELP } sub unit_get_singular { - $help = <<'HELP'; -This procedure returns the singular form of the unit. -HELP + $help = 'This procedure returns the singular form of the unit.'; &unit_prop_proc('singular', 'string', 'singular form'); } sub unit_get_plural { - $help = <<'HELP'; -This procedure returns the plural form of the unit. -HELP + $help = 'This procedure returns the plural form of the unit.'; &unit_prop_proc('plural', 'string', 'plural form'); } diff --git a/tools/pdbgen/pdb/vectors.pdb b/tools/pdbgen/pdb/vectors.pdb index 7f4288668c..e421e55a38 100644 --- a/tools/pdbgen/pdb/vectors.pdb +++ b/tools/pdbgen/pdb/vectors.pdb @@ -15,29 +15,6 @@ # along with this program; if not, write to the Free Software # 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 { $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. HELP - &pdb_misc; + &simon_pdb_misc('2005', '2.4'); - @inargs = ( &std_image_arg, + @inargs = ( + &std_image_arg, { name => 'name', type => 'string', - desc => 'the name of the new vector object.', - init => 1 } + desc => 'the name of the new vector object.' } ); @outargs = ( { 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 } ); @@ -71,19 +49,17 @@ CODE sub vectors_get_current { $blurb = 'Gets the current path in the given image.'; + $help = 'Gets the current path in the given image.'; - $help = <<'HELP'; -Gets the current path in the given image. -HELP - - &pdb_misc; + &simon_pdb_misc('2005', '2.4'); @inargs = ( &std_image_arg ); $inargs[0]->{desc} = 'The ID of the image to get the current path from.'; @outargs = ( { 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 } ); @@ -99,19 +75,18 @@ CODE sub vectors_get_image { $blurb = 'Returns the vectors objects image.'; + $help = 'Returns the vectors objects image.'; - $help = <<'HELP'; -Returns the vectors objects image. -HELP + &simon_pdb_misc('2005', '2.4'); - &pdb_misc; - - @inargs = ( &vectors_arg ); + @inargs = ( + { name => 'vectors', type => 'vectors', + desc => 'The vectors object' } + ); @outargs = ( { name => 'image', type => 'image', - desc => 'The vectors image', - init => 1 } + desc => 'The vectors image', init => 1 } ); %invoke = ( @@ -126,14 +101,14 @@ CODE sub vectors_get_linked { $blurb = 'Gets the linked state of the vectors object.'; + $help = 'Gets the linked state of the vectors object.'; - $help = <<'HELP'; -Gets the linked state of the vectors object. -HELP + &simon_pdb_misc('2005', '2.4'); - &pdb_misc; - - @inargs = ( &vectors_arg ); + @inargs = ( + { name => 'vectors', type => 'vectors', + desc => 'The vectors object' } + ); @outargs = ( { name => 'linked', type => 'boolean', @@ -152,16 +127,15 @@ CODE sub vectors_set_linked { $blurb = 'Sets the linked state of the vectors object.'; + $help = 'Sets the linked state of the vectors object.'; - $help = <<'HELP'; -Sets the linked state of the vectors object. -HELP + &simon_pdb_misc('2005', '2.4'); - &pdb_misc; - - @inargs = ( &vectors_arg, - { name => 'linked', type => 'boolean', - desc => 'Whether the path is linked', init => 1 } + @inargs = ( + { name => 'vectors', type => 'vectors', + desc => 'The vectors object' }, + { name => 'linked', type => 'boolean', + desc => 'Whether the path is linked' } ); %invoke = ( @@ -176,19 +150,18 @@ CODE sub vectors_get_tattoo { $blurb = 'Get the tattoo of the vectors object.'; + $help = 'Get the tattoo state of the vectors object.'; - $help = <<'HELP'; -Get the tattoo state of the vectors object. -HELP + &simon_pdb_misc('2005', '2.4'); - &pdb_misc; - - @inargs = ( &vectors_arg ); + @inargs = ( + { name => 'vectors', type => 'vectors', + desc => 'The vectors object' } + ); @outargs = ( { name => 'tattoo', type => 'int32', - desc => 'The vectors tattoo', - init => 1 } + desc => 'The vectors tattoo', init => 1 } ); %invoke = ( @@ -203,17 +176,15 @@ CODE sub vectors_set_tattoo { $blurb = 'Set the tattoo of the vectors object.'; + $help = 'Set the tattoo of the vectors object.'; - $help = <<'HELP'; -Set the tattoo of the vectors object. -HELP + &simon_pdb_misc('2005', '2.4'); - &pdb_misc; - - @inargs = ( &vectors_arg, - { name => 'tattoo', type => 'int32', - desc => 'the new tattoo', - init => 1 } + @inargs = ( + { name => 'vectors', type => 'vectors', + desc => 'The vectors object' }, + { name => 'tattoo', type => 'int32', + desc => 'the new tattoo' } ); %invoke = ( @@ -228,14 +199,14 @@ CODE sub vectors_get_visible { $blurb = 'Gets the visibility of the vectors object.'; + $help = 'Gets the visibility of the vectors object.'; - $help = <<'HELP'; -Gets the visibility of the vectors object. -HELP + &simon_pdb_misc('2005', '2.4'); - &pdb_misc; - - @inargs = ( &vectors_arg ); + @inargs = ( + { name => 'vectors', type => 'vectors', + desc => 'The vectors object' } + ); @outargs = ( { name => 'visible', type => 'boolean', @@ -254,17 +225,15 @@ CODE sub vectors_set_visible { $blurb = 'Sets the visibility of the vectors object.'; + $help = 'Sets the visibility of the vectors object.'; - $help = <<'HELP'; -Sets the visibility of the vectors object. -HELP + &simon_pdb_misc('2005', '2.4'); - &pdb_misc; - - @inargs = ( &vectors_arg, - { name => 'visible', type => 'boolean', - desc => 'Whether the path is visible', - init => 1 } + @inargs = ( + { name => 'vectors', type => 'vectors', + desc => 'The vectors object' }, + { name => 'visible', type => 'boolean', + desc => 'Whether the path is visible' } ); %invoke = ( @@ -279,19 +248,18 @@ CODE sub vectors_get_name { $blurb = 'Gets the name of the vectors object.'; + $help = 'Gets the name of the vectors object.'; - $help = <<'HELP'; -Gets the name of the vectors object. -HELP + &simon_pdb_misc('2005', '2.4'); - &pdb_misc; - - @inargs = ( &vectors_arg ); + @inargs = ( + { name => 'vectors', type => 'vectors', + desc => 'The vectors object' } + ); @outargs = ( { name => 'name', type => 'string', - desc => 'The name of the vectors object', - init => 1 } + desc => 'The name of the vectors object', init => 1 } ); %invoke = ( @@ -306,17 +274,15 @@ CODE sub vectors_set_name { $blurb = 'Sets the name of the vectors object.'; + $help = 'Sets the name of the vectors object.'; - $help = <<'HELP'; -Sets the name of the vectors object. -HELP + &simon_pdb_misc('2005', '2.4'); - &pdb_misc; - - @inargs = ( &vectors_arg, - { name => 'name', type => 'string', - desc => 'the new name of the path', - init => 1 } + @inargs = ( + { name => 'vectors', type => 'vectors', + desc => 'The vectors object' }, + { name => 'name', type => 'string', + desc => 'the new name of the path' } ); %invoke = ( @@ -337,9 +303,12 @@ sub vectors_get_strokes { Returns an Array with the stroke-IDs associated with the passed path. HELP - &pdb_misc; + &simon_pdb_misc('2005', '2.4'); - @inargs = ( &vectors_arg ); + @inargs = ( + { name => 'vectors', type => 'vectors', + desc => 'The vectors object' } + ); @outargs = ( { name => 'stroke_ids', type => 'int32array', @@ -351,13 +320,15 @@ HELP ); %invoke = ( - vars => ['gint i = 0', 'GimpStroke *cur_stroke = NULL'], code => <<"CODE" { num_strokes = gimp_vectors_get_n_strokes (vectors); if (num_strokes) { + GimpStroke *cur_stroke; + gint i = 0; + stroke_ids = g_new (gint32, num_strokes); for (cur_stroke = gimp_vectors_stroke_get_next (vectors, NULL); @@ -375,37 +346,34 @@ CODE 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'; -Measure the length of the given stroke. -HELP + &simon_pdb_misc('2005', '2.4'); - &pdb_misc; - - @inargs = ( &stroke_arg, - { name => 'prescision', type => 'float', - desc => 'The prescision used for the approximation' } ); + @inargs = ( + { name => 'vectors', type => 'vectors', + 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 = ( - { name => 'length', type => 'float', + { name => 'length', type => 'float', init => 1, desc => 'The length (in pixels) of the given stroke.' } ); %invoke = ( - vars => [ 'GimpStroke *stroke' ], 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) - { - success = FALSE; - } + if (stroke) + length = gimp_stroke_get_length (stroke, prescision); else - { - length = gimp_stroke_get_length (stroke, prescision); - } + success = FALSE; } 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. HELP - &pdb_misc; + &simon_pdb_misc('2005', '2.4'); - @inargs = ( &stroke_arg, - { name => 'dist', type => 'float', - desc => 'The given distance.' }, - { name => 'prescision', type => 'float', - desc => 'The prescision used for the approximation' } ); + @inargs = ( + { name => 'vectors', type => 'vectors', + desc => 'The vectors object' }, + { name => 'stroke_id', type => 'int32', + desc => 'The stroke ID' }, + { name => 'dist', type => 'float', + desc => 'The given distance.' }, + { name => 'prescision', type => 'float', + desc => 'The prescision used for the approximation' } + ); @outargs = ( { name => 'x_point', type => 'float', @@ -444,14 +417,14 @@ HELP ); %invoke = ( - vars => [ 'GimpStroke *stroke', - 'GimpCoords coord'], 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) { + GimpCoords coord; + valid = gimp_stroke_get_point_at_dist (stroke, dist, prescision, &coord, &slope); x_point = valid ? coord.x : 0; @@ -474,15 +447,19 @@ sub vectors_stroke_remove { Remove the stroke from a vectors object. 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 = ( - vars => [ 'GimpStroke *stroke' ], 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) gimp_vectors_stroke_remove (vectors, stroke); @@ -501,15 +478,19 @@ sub vectors_stroke_close { Closes the specified stroke. 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 = ( - vars => [ 'GimpStroke *stroke' ], 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) gimp_stroke_close (stroke); @@ -528,19 +509,23 @@ sub vectors_stroke_translate { Translate the given stroke. HELP - &pdb_misc; + &simon_pdb_misc('2005', '2.4'); - @inargs = ( &stroke_arg ); - foreach (qw(x y)) { - push @inargs, { name => "off_$_", type => 'int32', - desc => "Offset in $_ direction" } - } + @inargs = ( + { name => 'vectors', type => 'vectors', + desc => 'The vectors object' }, + { 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 = ( - vars => [ 'GimpStroke *stroke' ], 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) gimp_stroke_translate (stroke, off_x, off_y); @@ -558,19 +543,23 @@ sub vectors_stroke_scale { Scale the given stroke. HELP - &pdb_misc; + &simon_pdb_misc('2005', '2.4'); - @inargs = ( &stroke_arg ); - foreach (qw(x y)) { - push @inargs, { name => "scale_$_", type => 'float', - desc => "Scale factor in $_ direction" } - } + @inargs = ( + { name => 'vectors', type => 'vectors', + desc => 'The vectors object' }, + { 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 = ( - vars => [ 'GimpStroke *stroke' ], 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) gimp_stroke_scale (stroke, scale_x, scale_y); @@ -588,11 +577,16 @@ sub vectors_stroke_interpolate { returns polygonal approximation of the stroke. HELP - &pdb_misc; + &simon_pdb_misc('2005', '2.4'); - @inargs = ( &stroke_arg, - { name => 'prescision', type => 'float', - desc => 'The prescision used for the approximation' } ); + @inargs = ( + { name => 'vectors', type => 'vectors', + 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 = ( { name => 'closed', type => 'boolean', @@ -606,16 +600,17 @@ HELP ); %invoke = ( - vars => [ 'GimpStroke *stroke', - 'GArray *coords_array', - 'gint i' ], 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) { + GArray *coords_array; + gint i; + coords_array = gimp_stroke_interpolate (stroke, prescision, &closed); + if (coords_array) { 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. 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', desc => 'The x-coordinate of the moveto', init => 1 }, @@ -669,16 +666,17 @@ HELP ); %invoke = ( - vars => [ 'GimpStroke *stroke', - 'GimpCoords coord0' ], code => <<"CODE" { - coord0.x = x0; - coord0.y = y0; + GimpStroke *stroke; + 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; + coord0.xtilt = GIMP_COORDS_DEFAULT_TILT; + coord0.ytilt = GIMP_COORDS_DEFAULT_TILT; + coord0.wheel = GIMP_COORDS_DEFAULT_WHEEL; stroke = gimp_bezier_stroke_new_moveto (&coord0); gimp_vectors_stroke_add (vectors, stroke); @@ -695,9 +693,13 @@ sub vectors_bezier_stroke_lineto { Extends a bezier stroke with a lineto. 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', desc => 'The x-coordinate of the lineto', init => 1 }, @@ -707,22 +709,27 @@ HELP ); %invoke = ( - vars => [ 'GimpStroke *stroke', - 'GimpCoords coord0' ], code => <<"CODE" { - 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; + GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id); - stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id); 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 - success = FALSE; + { + success = FALSE; + } } CODE ); @@ -737,44 +744,49 @@ cubic bezier spline gets added that realizes the shape of a conic bezier spline. 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', - desc => 'The x-coordinate of the control point', - init => 1 }, + desc => 'The x-coordinate of the control point' }, { name => 'y0', type => 'float', - desc => 'The y-coordinate of the control point', - init => 1 }, + desc => 'The y-coordinate of the control point' }, { name => 'x1', type => 'float', - desc => 'The x-coordinate of the end point', - init => 1 }, + desc => 'The x-coordinate of the end point' }, { name => 'y1', type => 'float', - desc => 'The y-coordinate of the end point', - init => 1 } + desc => 'The y-coordinate of the end point' } ); %invoke = ( - vars => [ 'GimpStroke *stroke', - 'GimpCoords coord0, coord1' ], code => <<"CODE" { - 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; + GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id); - coord1 = coord0; - coord1.x = x1; - coord1.y = y1; - - stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id); 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 - success = FALSE; + { + success = FALSE; + } } CODE ); @@ -787,54 +799,57 @@ sub vectors_bezier_stroke_cubicto { Extends a bezier stroke with a cubic bezier spline. 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', - desc => 'The x-coordinate of the first control point', - init => 1 }, + desc => 'The x-coordinate of the first control point' }, { name => 'y0', type => 'float', - desc => 'The y-coordinate of the first control point', - init => 1 }, + desc => 'The y-coordinate of the first control point' }, { name => 'x1', type => 'float', - desc => 'The x-coordinate of the second control point', - init => 1 }, + desc => 'The x-coordinate of the second control point' }, { name => 'y1', type => 'float', - desc => 'The y-coordinate of the second control point', - init => 1 }, + desc => 'The y-coordinate of the second control point' }, { name => 'x2', type => 'float', - desc => 'The x-coordinate of the end point', - init => 1 }, + desc => 'The x-coordinate of the end point' }, { name => 'y2', type => 'float', - desc => 'The y-coordinate of the end point', - init => 1 } + desc => 'The y-coordinate of the end point' } ); %invoke = ( - vars => [ 'GimpStroke *stroke', - 'GimpCoords coord0, coord1, coord2' ], code => <<"CODE" { - 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; + GimpStroke *stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_id); - 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) - 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 - success = FALSE; + { + success = FALSE; + } } CODE ); @@ -847,24 +862,22 @@ sub vectors_bezier_stroke_new_ellipse { Adds a bezier stroke describing an ellipse the vectors object. 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', - desc => 'The x-coordinate of the center', - init => 1 }, + desc => 'The x-coordinate of the center' }, { name => 'y0', type => 'float', - desc => 'The y-coordinate of the center', - init => 1 }, + desc => 'The y-coordinate of the center' }, { name => 'radius_x', type => 'float', - desc => 'The radius in x direction', - init => 1 }, + desc => 'The radius in x direction' }, { name => 'radius_y', type => 'float', - desc => 'The radius in y direction', - init => 1 }, + desc => 'The radius in y direction' }, { name => 'angle', type => 'float', - desc => 'The angle the x-axis of the ellipse (radians, counterclockwise)', - init => 1 } + desc => 'The angle the x-axis of the ellipse + (radians, counterclockwise)' } ); @outargs = ( @@ -874,16 +887,17 @@ HELP ); %invoke = ( - vars => [ 'GimpStroke *stroke', - 'GimpCoords coord0' ], code => <<"CODE" { - coord0.x = x0; - coord0.y = y0; + GimpStroke *stroke; + 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; + coord0.xtilt = GIMP_COORDS_DEFAULT_TILT; + coord0.ytilt = GIMP_COORDS_DEFAULT_TILT; + coord0.wheel = GIMP_COORDS_DEFAULT_WHEEL; stroke = gimp_bezier_stroke_new_ellipse (&coord0, radius_x, radius_y, angle); gimp_vectors_stroke_add (vectors, stroke); @@ -894,24 +908,17 @@ CODE } - @headers = qw( "core/gimp.h" "core/gimplist.h" "core/gimpimage.h" "vectors/gimpanchor.h" "vectors/gimpbezierstroke.h" "vectors/gimpvectors.h" "vectors/gimpvectors-compat.h" "gimp-intl.h"); -@procs = qw(vectors_new - vectors_get_strokes - vectors_get_image - vectors_get_linked - vectors_set_linked - vectors_get_visible - vectors_set_visible - vectors_get_name - vectors_set_name - vectors_get_tattoo - vectors_set_tattoo +@procs = qw(vectors_new vectors_get_strokes vectors_get_image + vectors_get_linked vectors_set_linked + 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_point_at_dist vectors_stroke_remove @@ -923,8 +930,7 @@ CODE vectors_bezier_stroke_lineto vectors_bezier_stroke_conicto vectors_bezier_stroke_cubicto - vectors_bezier_stroke_new_ellipse - ); + vectors_bezier_stroke_new_ellipse); %exports = (app => [@procs], lib => [@procs]); $desc = 'Paths'; diff --git a/tools/pdbgen/stddefs.pdb b/tools/pdbgen/stddefs.pdb index 9cbce26e24..7419d47e30 100644 --- a/tools/pdbgen/stddefs.pdb +++ b/tools/pdbgen/stddefs.pdb @@ -22,6 +22,110 @@ sub std_pdb_misc { $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 { if (@_) { $blurb = $help = "This procedure is deprecated! Use '@_' instead.";