Commit 20946c66 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

added a const_type member to all PDB types, Removed casts from all

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

	* tools/pdbgen/pdb.pl: added a const_type member to all PDB types,
	Removed casts from all get_value_funcs which return const
	pointers, they can stay const now.

	* tools/pdbgen/app.pl: use the const_type to declare input args.

	* app/pdb/gimpprocedure.h: pass const arguments to the internal
	marshallers.

	* app/xcf/xcf.c: changed accordingly.

	* tools/pdbgen/pdb/paint_tools.pdb
	* tools/pdbgen/pdb/paths.pdb: added some const qualifiers.

	* tools/pdbgen/lib.pl: use the const_type for input args instead
	of adding the const qualifier based on the type.

	* app/pdb/_cmds.c
	* libgimp/gimpparasite_pdb.[ch]: regenerated.

	Unrelated:

	* app/pdb/gimpargument.c (gimp_arguments_destroy): no need any
	more to destroy the argument array in reverse order (we don't need
	access to the previous element because arrays in GValues memory
	manage themselves now).
parent 5fb387ea
2006-04-02 Michael Natterer <mitch@gimp.org>
* tools/pdbgen/pdb.pl: added a const_type member to all PDB types.
Removed casts from all get_value_funcs which return const
pointers, they can stay const now.
* tools/pdbgen/app.pl: use the const_type to declare input args.
* app/pdb/gimpprocedure.h: pass const arguments to the internal
marshallers.
* app/xcf/xcf.c: changed accordingly.
* tools/pdbgen/pdb/paint_tools.pdb
* tools/pdbgen/pdb/paths.pdb: added some const qualifiers.
* tools/pdbgen/lib.pl: use the const_type for input args instead
of adding the const qualifier based on the type.
* app/pdb/_cmds.c
* libgimp/gimpparasite_pdb.[ch]: regenerated.
Unrelated:
* app/pdb/gimpargument.c (gimp_arguments_destroy): no need any
more to destroy the argument array in reverse order (we don't need
access to the previous element because arrays in GValues memory
manage themselves now).
2006-04-02 Michael Natterer <mitch@gimp.org>
* app/core/gimpparasitelist.[ch] (gimp_parasite_list_add): removed
......@@ -21,7 +50,7 @@
* app/core/gimpimage-undo-push.[ch]
(gimp_image_undo_push_image,item_parasite): use "const GimpParasite*"
insted of gpointer for the parasite parameter.
instead of gpointer for the parasite parameter.
* app/core/gimpparasitelist.[ch] (gimp_parasite_list_add): added
const to the parasite parameter, return the actually added
......
......@@ -648,18 +648,18 @@ register_brush_procs (Gimp *gimp)
}
static GimpArgument *
brush_new_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpArgument *args)
brush_new_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpArgument *args)
{
gboolean success = TRUE;
GimpArgument *return_vals;
gchar *name;
const gchar *name;
gchar *actual_name = NULL;
name = (gchar *) g_value_get_string (&args[0].value);
name = g_value_get_string (&args[0].value);
if (success)
{
......@@ -701,18 +701,18 @@ static GimpProcedure brush_new_proc =
};
static GimpArgument *
brush_duplicate_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpArgument *args)
brush_duplicate_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpArgument *args)
{
gboolean success = TRUE;
GimpArgument *return_vals;
gchar *name;
const gchar *name;
gchar *copy_name = NULL;
name = (gchar *) g_value_get_string (&args[0].value);
name = g_value_get_string (&args[0].value);
if (success)
{
......@@ -759,18 +759,18 @@ static GimpProcedure brush_duplicate_proc =
};
static GimpArgument *
brush_is_generated_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpArgument *args)
brush_is_generated_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpArgument *args)
{
gboolean success = TRUE;
GimpArgument *return_vals;
gchar *name;
const gchar *name;
gboolean generated = FALSE;
name = (gchar *) g_value_get_string (&args[0].value);
name = g_value_get_string (&args[0].value);
if (success)
{
......@@ -808,20 +808,20 @@ static GimpProcedure brush_is_generated_proc =
};
static GimpArgument *
brush_rename_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpArgument *args)
brush_rename_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpArgument *args)
{
gboolean success = TRUE;
GimpArgument *return_vals;
gchar *name;
gchar *new_name;
const gchar *name;
const gchar *new_name;
gchar *actual_name = NULL;
name = (gchar *) g_value_get_string (&args[0].value);
new_name = (gchar *) g_value_get_string (&args[1].value);
name = g_value_get_string (&args[0].value);
new_name = g_value_get_string (&args[1].value);
if (success)
{
......@@ -862,16 +862,16 @@ static GimpProcedure brush_rename_proc =
};
static GimpArgument *
brush_delete_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpArgument *args)
brush_delete_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpArgument *args)
{
gboolean success = TRUE;
gchar *name;
const gchar *name;
name = (gchar *) g_value_get_string (&args[0].value);
name = g_value_get_string (&args[0].value);
if (success)
{
......@@ -916,18 +916,18 @@ static GimpProcedure brush_delete_proc =
};
static GimpArgument *
brush_is_editable_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpArgument *args)
brush_is_editable_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpArgument *args)
{
gboolean success = TRUE;
GimpArgument *return_vals;
gchar *name;
const gchar *name;
gboolean editable = FALSE;
name = (gchar *) g_value_get_string (&args[0].value);
name = g_value_get_string (&args[0].value);
if (success)
{
......@@ -965,21 +965,21 @@ static GimpProcedure brush_is_editable_proc =
};
static GimpArgument *
brush_get_info_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpArgument *args)
brush_get_info_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpArgument *args)
{
gboolean success = TRUE;
GimpArgument *return_vals;
gchar *name;
const gchar *name;
gint32 width = 0;
gint32 height = 0;
gint32 mask_bpp = 0;
gint32 color_bpp = 0;
name = (gchar *) g_value_get_string (&args[0].value);
name = g_value_get_string (&args[0].value);
if (success)
{
......@@ -1027,15 +1027,15 @@ static GimpProcedure brush_get_info_proc =
};
static GimpArgument *
brush_get_pixels_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpArgument *args)
brush_get_pixels_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpArgument *args)
{
gboolean success = TRUE;
GimpArgument *return_vals;
gchar *name;
const gchar *name;
gint32 width = 0;
gint32 height = 0;
gint32 mask_bpp = 0;
......@@ -1045,7 +1045,7 @@ brush_get_pixels_invoker (GimpProcedure *procedure,
gint32 num_color_bytes = 0;
guint8 *color_bytes = NULL;
name = (gchar *) g_value_get_string (&args[0].value);
name = g_value_get_string (&args[0].value);
if (success)
{
......@@ -1106,18 +1106,18 @@ static GimpProcedure brush_get_pixels_proc =
};
static GimpArgument *
brush_get_spacing_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpArgument *args)
brush_get_spacing_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpArgument *args)
{
gboolean success = TRUE;
GimpArgument *return_vals;
gchar *name;
const gchar *name;
gint32 spacing = 0;
name = (gchar *) g_value_get_string (&args[0].value);
name = g_value_get_string (&args[0].value);
if (success)
{
......@@ -1155,17 +1155,17 @@ static GimpProcedure brush_get_spacing_proc =
};
static GimpArgument *
brush_set_spacing_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpArgument *args)
brush_set_spacing_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpArgument *args)
{
gboolean success = TRUE;
gchar *name;
const gchar *name;
gint32 spacing;
name = (gchar *) g_value_get_string (&args[0].value);
name = g_value_get_string (&args[0].value);
spacing = g_value_get_int (&args[1].value);
if (success)
......@@ -1199,18 +1199,18 @@ static GimpProcedure brush_set_spacing_proc =
};
static GimpArgument *
brush_get_shape_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpArgument *args)
brush_get_shape_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpArgument *args)
{
gboolean success = TRUE;
GimpArgument *return_vals;
gchar *name;
const gchar *name;
gint32 shape = 0;
name = (gchar *) g_value_get_string (&args[0].value);
name = g_value_get_string (&args[0].value);
if (success)
{
......@@ -1248,18 +1248,18 @@ static GimpProcedure brush_get_shape_proc =
};
static GimpArgument *
brush_get_radius_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpArgument *args)
brush_get_radius_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpArgument *args)
{
gboolean success = TRUE;
GimpArgument *return_vals;
gchar *name;
const gchar *name;
gdouble radius = 0.0;
name = (gchar *) g_value_get_string (&args[0].value);
name = g_value_get_string (&args[0].value);
if (success)
{
......@@ -1297,18 +1297,18 @@ static GimpProcedure brush_get_radius_proc =
};
static GimpArgument *
brush_get_spikes_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpArgument *args)
brush_get_spikes_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpArgument *args)
{
gboolean success = TRUE;
GimpArgument *return_vals;
gchar *name;
const gchar *name;
gint32 spikes = 0;
name = (gchar *) g_value_get_string (&args[0].value);
name = g_value_get_string (&args[0].value);
if (success)
{
......@@ -1346,18 +1346,18 @@ static GimpProcedure brush_get_spikes_proc =
};
static GimpArgument *
brush_get_hardness_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpArgument *args)
brush_get_hardness_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpArgument *args)
{
gboolean success = TRUE;
GimpArgument *return_vals;
gchar *name;
const gchar *name;
gdouble hardness = 0.0;
name = (gchar *) g_value_get_string (&args[0].value);
name = g_value_get_string (&args[0].value);
if (success)
{
......@@ -1395,18 +1395,18 @@ static GimpProcedure brush_get_hardness_proc =
};
static GimpArgument *
brush_get_aspect_ratio_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpArgument *args)
brush_get_aspect_ratio_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpArgument *args)
{
gboolean success = TRUE;
GimpArgument *return_vals;
gchar *name;
const gchar *name;
gdouble aspect_ratio = 0.0;
name = (gchar *) g_value_get_string (&args[0].value);
name = g_value_get_string (&args[0].value);
if (success)
{
......@@ -1444,18 +1444,18 @@ static GimpProcedure brush_get_aspect_ratio_proc =
};
static GimpArgument *
brush_get_angle_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpArgument *args)
brush_get_angle_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpArgument *args)
{
gboolean success = TRUE;
GimpArgument *return_vals;
gchar *name;
const gchar *name;
gdouble angle = 0.0;
name = (gchar *) g_value_get_string (&args[0].value);
name = g_value_get_string (&args[0].value);
if (success)
{
......@@ -1493,19 +1493,19 @@ static GimpProcedure brush_get_angle_proc =
};
static GimpArgument *
brush_set_shape_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpArgument *args)
brush_set_shape_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpArgument *args)
{
gboolean success = TRUE;
GimpArgument *return_vals;
gchar *name;
const gchar *name;
gint32 shape_in;
gint32 shape_out = 0;
name = (gchar *) g_value_get_string (&args[0].value);
name = g_value_get_string (&args[0].value);
shape_in = g_value_get_enum (&args[1].value);
if (success)
......@@ -1548,19 +1548,19 @@ static GimpProcedure brush_set_shape_proc =
};
static GimpArgument *
brush_set_radius_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpArgument *args)
brush_set_radius_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpArgument *args)
{
gboolean success = TRUE;
GimpArgument *return_vals;
gchar *name;
const gchar *name;
gdouble radius_in;
gdouble radius_out = 0.0;
name = (gchar *) g_value_get_string (&args[0].value);
name = g_value_get_string (&args[0].value);
radius_in = g_value_get_double (&args[1].value);
if (success)
......@@ -1603,19 +1603,19 @@ static GimpProcedure brush_set_radius_proc =
};
static GimpArgument *
brush_set_spikes_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpArgument *args)
brush_set_spikes_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpArgument *args)
{
gboolean success = TRUE;
GimpArgument *return_vals;
gchar *name;
const gchar *name;
gint32 spikes_in;
gint32 spikes_out = 0;
name = (gchar *) g_value_get_string (&args[0].value);
name = g_value_get_string (&args[0].value);
spikes_in = g_value_get_int (&args[1].value);
if (success)
......@@ -1658,19 +1658,19 @@ static GimpProcedure brush_set_spikes_proc =
};
static GimpArgument *
brush_set_hardness_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpArgument *args)
brush_set_hardness_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpArgument *args)
{
gboolean success = TRUE;
GimpArgument *return_vals;
gchar *name;
const gchar *name;
gdouble hardness_in;
gdouble hardness_out = 0.0;
name = (gchar *) g_value_get_string (&args[0].value);
name = g_value_get_string (&args[0].value);
hardness_in = g_value_get_double (&args[1].value);
if (success)
......@@ -1713,19 +1713,19 @@ static GimpProcedure brush_set_hardness_proc =
};
static GimpArgument *
brush_set_aspect_ratio_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpArgument *args)
brush_set_aspect_ratio_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpArgument *args)
{
gboolean success = TRUE;
GimpArgument *return_vals;
gchar *name;
const gchar *name;
gdouble aspect_ratio_in;
gdouble aspect_ratio_out = 0.0;
name = (gchar *) g_value_get_string (&args[0].value);
name = g_value_get_string (&args[0].value);
aspect_ratio_in = g_value_get_double (&args[1].value);
if (success)
......@@ -1768,19 +1768,19 @@ static GimpProcedure brush_set_aspect_ratio_proc =
};
static GimpArgument *
brush_set_angle_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpArgument *args)
brush_set_angle_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpArgument *args)
{
gboolean success = TRUE;
GimpArgument *return_vals;
gchar *name;
const gchar *name;
gdouble angle_in;
gdouble angle_out = 0.0;
name = (gchar *) g_value_get_string (&args[0].value);
name = g_value_get_string (&args[0].value);
angle_in = g_value_get_double (&args[1].value);
if (success)
......
......@@ -154,23 +154,23 @@ register_brush_select_procs (Gimp *gimp)
}
static GimpArgument *
brushes_popup_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpArgument *args)
brushes_popup_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpArgument *args)
{
gboolean success = TRUE;
gchar *brush_callback;
gchar *popup_title;
gchar *initial_brush;
const gchar *brush_callback;
const gchar *popup_title;
const gchar *initial_brush;
gdouble opacity;
gint32 spacing;
gint32 paint_mode;
brush_callback = (gchar *) g_value_get_string (&args[0].value);
popup_title = (gchar *) g_value_get_string (&args[1].value);
initial_brush = (gchar *) g_value_get_string (&args[2].value);
brush_callback = g_value_get_string (&args[0].value);
popup_title = g_value_get_string (&args[1].value);
initial_brush = g_value_get_string (&args[2].value);
opacity = g_value_get_double (&args[3].value);
spacing = g_value_get_int (&args[4].value);
paint_mode = g_value_get_enum (&args[5].value);
......@@ -208,16 +208,16 @@ static GimpProcedure brushes_popup_proc =
};
static GimpArgument *
brushes_close_popup_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpArgument *args)
brushes_close_popup_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpArgument *args)
{
gboolean success = TRUE;
gchar *brush_callback;
const gchar *brush_callback;
brush_callback = (gchar *) g_value_get_string (&args[0].value);
brush_callback = g_value_get_string (&args[0].value);
if (success)
{
......@@ -248,21 +248,21 @@ static GimpProcedure brushes_close_popup_proc =
};
static GimpArgument *
brushes_set_popup_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpArgument *args)
brushes_set_popup_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpArgument *args)
{
gboolean success = TRUE;
gchar *brush_callback;
gchar *brush_name;
const gchar *brush_callback;
const gchar *brush_name;
gdouble opacity;
gint32 spacing;
gint32 paint_mode;
brush_callback = (gchar *) g_value_get_string (&args[0].value);
brush_name = (gchar *) g_value_get_string (&args[1].value);
brush_callback = g_value_get_string (&args[0].value);
brush_name = g_value_get_string (&args[1].value);
opacity = g_value_get_double (&args[2].value);
spacing = g_value_get_int (&args[3].value);
paint_mode = g_value_get_enum (&args[4].value);
......
......@@ -218,11 +218,11 @@ register_brushes_procs (Gimp *gimp)