Commit 2ff56f8d authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

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

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

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

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

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

	* libgimp/gimpcolor_pdb.c
	* libgimp/gimpdrawabletransform_pdb.c
	* libgimp/gimptransformtools_pdb.c
	* libgimp/gimpvectors_pdb.c: ditto. Changed affect only API docs.
parent d845e068
2006-03-14 Michael Natterer <mitch@gimp.org>
* tools/pdbgen/pdb/*.pdb: remove lots of perl crack:
- create almost all parameter arrays manually instead of
generating them from utility functions
- removed lots of other utility functions
- moved variable declarations into the enclosed code snippets
where possible
- some cleanup and API doc fixes
* tools/pdbgen/stddefs.pdb: added some perl crack:
define utility functions for all contributors which own more than
some functions, so they can change their names and email addresses
at a central place.
* app/pdb/[many].c: regenerated.
* libgimp/gimpcolor_pdb.c
* libgimp/gimpdrawabletransform_pdb.c
* libgimp/gimptransformtools_pdb.c
* libgimp/gimpvectors_pdb.c: ditto. Changed affect only API docs.
2006-03-13 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-guides.[ch]: added gimp_image_get_guide() and
......
......@@ -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 <weskaggs@primate.ucdavis.edu",
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"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 <weskaggs@primate.ucdavis.edu",
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"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 <weskaggs@primate.ucdavis.edu",
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"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 <weskaggs@primate.ucdavis.edu",
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"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 <weskaggs@primate.ucdavis.edu",
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"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 <weskaggs@primate.ucdavis.edu",
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"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 <weskaggs@primate.ucdavis.edu",
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"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 <weskaggs@primate.ucdavis.edu",
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"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 <weskaggs@primate.ucdavis.edu",
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"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 <weskaggs@primate.ucdavis.edu",
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"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 <weskaggs@primate.ucdavis.edu",
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"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 <weskaggs@primate.ucdavis.edu",
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"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 <weskaggs@primate.ucdavis.edu",
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"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 <weskaggs@primate.ucdavis.edu",
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"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 <weskaggs@primate.ucdavis.edu",
"Bill Skaggs <weskaggs@primate.ucdavis.edu>",
"Bill Skaggs",
"2004",
NULL,
......
......@@ -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;
......
......@@ -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 <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>",
"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 <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>",
"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 <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>",
"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 <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>",
"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 <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>",
"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 <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>",
"Michael Natterer",
"2005",
NULL,
GIMP_INTERNAL,
......
......@@ -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@gimp.org>",
"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)"
}
};
......
......@@ -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@gimp.org>",
"Sven Neumann",
"2005",
NULL,
......
......@@ -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 <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>",
"Michael Natterer",
"2004",
NULL,
GIMP_INTERNAL,
......
......@@ -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,
......
......@@ -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 <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>",
"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 <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>",
"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 <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>",
"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 <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>",
"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 <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>",
"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 <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>",
"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 <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>",
"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);
}
}
......
......@@ -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@gimp.org>",
"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@gimp.org>",
"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@gimp.org>",
"Sven Neumann",
"2004",
NULL,
......