tools/pdbgen/pdb/image.pdb entirely removed the deprecated functions

2004-11-16  Michael Natterer  <mitch@gimp.org>

	* tools/pdbgen/pdb/image.pdb
	* tools/pdbgen/pdb/selection.pdb: entirely removed the deprecated
	functions "selection_clear", "image_set_cmap" and "image_get_cmap".

	* app/pdb/procedural_db.c: and added them to the compat hash table
	because they have undeprecated replacements with identical
	signature.

	* libgimp/gimpselection.[ch]: added gimp_selection_clear() here
	instead because we need the symbol in libgimp.

	* app/pdb/image_cmds.c
	* app/pdb/internal_procs.c
	* app/pdb/selection_cmds.c
	* libgimp/gimpselection_pdb.[ch]: regenerated.
This commit is contained in:
Michael Natterer 2004-11-16 14:34:34 +00:00 committed by Michael Natterer
parent 8f0f5f11f5
commit 4caf20c229
14 changed files with 89 additions and 306 deletions

View file

@ -1,3 +1,21 @@
2004-11-16 Michael Natterer <mitch@gimp.org>
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/selection.pdb: entirely removed the deprecated
functions "selection_clear", "image_set_cmap" and "image_get_cmap".
* app/pdb/procedural_db.c: and added them to the compat hash table
because they have undeprecated replacements with identical
signature.
* libgimp/gimpselection.[ch]: added gimp_selection_clear() here
instead because we need the symbol in libgimp.
* app/pdb/image_cmds.c
* app/pdb/internal_procs.c
* app/pdb/selection_cmds.c
* libgimp/gimpselection_pdb.[ch]: regenerated.
2004-11-16 DindinX <dindinx@gimp.org>
* plug-ins/gfig/gfig-dobject.h: renamed the DObject type to

View file

@ -130,6 +130,8 @@ procedural_db_init_procs (Gimp *gimp,
{ "gimp_gradients_set_gradient", "gimp_context_set_gradient" },
{ "gimp_image_active_drawable", "gimp_image_get_active_drawable" },
{ "gimp_image_floating_selection", "gimp_image_get_floating_sel" },
{ "gimp_image_get_cmap", "gimp_image_get_colormap" },
{ "gimp_image_set_cmap", "gimp_image_set_colormap" },
{ "gimp_layer_delete", "gimp_drawable_delete" },
{ "gimp_layer_get_linked", "gimp_drawable_get_linked" },
{ "gimp_layer_get_name", "gimp_drawable_get_name" },
@ -150,6 +152,7 @@ procedural_db_init_procs (Gimp *gimp,
{ "gimp_palettes_set_palette", "gimp_context_set_palette" },
{ "gimp_patterns_list", "gimp_patterns_get_list" },
{ "gimp_patterns_set_pattern", "gimp_context_set_pattern" },
{ "gimp_selection_clear", "gimp_selection_none" },
{ "gimp_temp_PDB_name", "gimp_procedural_db_temp_name" },
{ "gimp_undo_push_group_start", "gimp_image_undo_group_start" },
{ "gimp_undo_push_group_end", "gimp_image_undo_group_end" },

View file

@ -130,6 +130,8 @@ procedural_db_init_procs (Gimp *gimp,
{ "gimp_gradients_set_gradient", "gimp_context_set_gradient" },
{ "gimp_image_active_drawable", "gimp_image_get_active_drawable" },
{ "gimp_image_floating_selection", "gimp_image_get_floating_sel" },
{ "gimp_image_get_cmap", "gimp_image_get_colormap" },
{ "gimp_image_set_cmap", "gimp_image_set_colormap" },
{ "gimp_layer_delete", "gimp_drawable_delete" },
{ "gimp_layer_get_linked", "gimp_drawable_get_linked" },
{ "gimp_layer_get_name", "gimp_drawable_get_name" },
@ -150,6 +152,7 @@ procedural_db_init_procs (Gimp *gimp,
{ "gimp_palettes_set_palette", "gimp_context_set_palette" },
{ "gimp_patterns_list", "gimp_patterns_get_list" },
{ "gimp_patterns_set_pattern", "gimp_context_set_pattern" },
{ "gimp_selection_clear", "gimp_selection_none" },
{ "gimp_temp_PDB_name", "gimp_procedural_db_temp_name" },
{ "gimp_undo_push_group_start", "gimp_image_undo_group_start" },
{ "gimp_undo_push_group_end", "gimp_image_undo_group_end" },

View file

@ -130,6 +130,8 @@ procedural_db_init_procs (Gimp *gimp,
{ "gimp_gradients_set_gradient", "gimp_context_set_gradient" },
{ "gimp_image_active_drawable", "gimp_image_get_active_drawable" },
{ "gimp_image_floating_selection", "gimp_image_get_floating_sel" },
{ "gimp_image_get_cmap", "gimp_image_get_colormap" },
{ "gimp_image_set_cmap", "gimp_image_set_colormap" },
{ "gimp_layer_delete", "gimp_drawable_delete" },
{ "gimp_layer_get_linked", "gimp_drawable_get_linked" },
{ "gimp_layer_get_name", "gimp_drawable_get_name" },
@ -150,6 +152,7 @@ procedural_db_init_procs (Gimp *gimp,
{ "gimp_palettes_set_palette", "gimp_context_set_palette" },
{ "gimp_patterns_list", "gimp_patterns_get_list" },
{ "gimp_patterns_set_pattern", "gimp_context_set_pattern" },
{ "gimp_selection_clear", "gimp_selection_none" },
{ "gimp_temp_PDB_name", "gimp_procedural_db_temp_name" },
{ "gimp_undo_push_group_start", "gimp_image_undo_group_start" },
{ "gimp_undo_push_group_end", "gimp_image_undo_group_end" },

View file

@ -88,8 +88,6 @@ static ProcRecord image_merge_visible_layers_proc;
static ProcRecord image_merge_down_proc;
static ProcRecord image_add_layer_mask_proc;
static ProcRecord image_remove_layer_mask_proc;
static ProcRecord image_get_cmap_proc;
static ProcRecord image_set_cmap_proc;
static ProcRecord image_get_colormap_proc;
static ProcRecord image_set_colormap_proc;
static ProcRecord image_clean_all_proc;
@ -156,8 +154,6 @@ register_image_procs (Gimp *gimp)
procedural_db_register (gimp, &image_merge_down_proc);
procedural_db_register (gimp, &image_add_layer_mask_proc);
procedural_db_register (gimp, &image_remove_layer_mask_proc);
procedural_db_register (gimp, &image_get_cmap_proc);
procedural_db_register (gimp, &image_set_cmap_proc);
procedural_db_register (gimp, &image_get_colormap_proc);
procedural_db_register (gimp, &image_set_colormap_proc);
procedural_db_register (gimp, &image_clean_all_proc);
@ -2616,142 +2612,6 @@ static ProcRecord image_remove_layer_mask_proc =
{ { image_remove_layer_mask_invoker } }
};
static Argument *
image_get_cmap_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpImage *gimage;
gint32 num_bytes = 0;
guint8 *cmap = NULL;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
success = FALSE;
if (success)
{
num_bytes = 3 * gimp_image_get_colormap_size (gimage);
cmap = g_memdup (gimp_image_get_colormap (gimage), num_bytes);
}
return_args = procedural_db_return_args (&image_get_cmap_proc, success);
if (success)
{
return_args[1].value.pdb_int = num_bytes;
return_args[2].value.pdb_pointer = cmap;
}
return return_args;
}
static ProcArg image_get_cmap_inargs[] =
{
{
GIMP_PDB_IMAGE,
"image",
"The image"
}
};
static ProcArg image_get_cmap_outargs[] =
{
{
GIMP_PDB_INT32,
"num_bytes",
"Number of bytes in the colormap array: 0 < num_bytes"
},
{
GIMP_PDB_INT8ARRAY,
"cmap",
"The image's colormap"
}
};
static ProcRecord image_get_cmap_proc =
{
"gimp_image_get_cmap",
"This procedure is deprecated! Use 'gimp_image_get_colormap' instead.",
"This procedure is deprecated! Use 'gimp_image_get_colormap' instead.",
"",
"",
"",
"gimp_image_get_colormap",
GIMP_INTERNAL,
1,
image_get_cmap_inargs,
2,
image_get_cmap_outargs,
{ { image_get_cmap_invoker } }
};
static Argument *
image_set_cmap_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
GimpImage *gimage;
gint32 num_bytes;
guint8 *cmap;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
success = FALSE;
num_bytes = args[1].value.pdb_int;
if (num_bytes < 0 || num_bytes > 768)
success = FALSE;
cmap = (guint8 *) args[2].value.pdb_pointer;
if (success)
gimp_image_set_colormap (gimage, cmap, num_bytes / 3, TRUE);
return procedural_db_return_args (&image_set_cmap_proc, success);
}
static ProcArg image_set_cmap_inargs[] =
{
{
GIMP_PDB_IMAGE,
"image",
"The image"
},
{
GIMP_PDB_INT32,
"num_bytes",
"Number of bytes in the colormap array: 0 <= num_bytes <= 768"
},
{
GIMP_PDB_INT8ARRAY,
"cmap",
"The new colormap values"
}
};
static ProcRecord image_set_cmap_proc =
{
"gimp_image_set_cmap",
"This procedure is deprecated! Use 'gimp_image_set_colormap' instead.",
"This procedure is deprecated! Use 'gimp_image_set_colormap' instead.",
"",
"",
"",
"gimp_image_set_colormap",
GIMP_INTERNAL,
3,
image_set_cmap_inargs,
0,
NULL,
{ { image_set_cmap_invoker } }
};
static Argument *
image_get_colormap_invoker (Gimp *gimp,
GimpContext *context,

View file

@ -74,7 +74,7 @@ void register_transform_tools_procs (Gimp *gimp);
void register_undo_procs (Gimp *gimp);
void register_unit_procs (Gimp *gimp);
/* 434 procedures registered total */
/* 431 procedures registered total */
void
internal_procs_init (Gimp *gimp,
@ -86,10 +86,10 @@ internal_procs_init (Gimp *gimp,
(* status_callback) (_("Internal Procedures"), _("Brush"), 0.0);
register_brush_procs (gimp);
(* status_callback) (NULL, _("Brush UI"), 0.018);
(* status_callback) (NULL, _("Brush UI"), 0.019);
register_brush_select_procs (gimp);
(* status_callback) (NULL, _("Brushes"), 0.025);
(* status_callback) (NULL, _("Brushes"), 0.026);
register_brushes_procs (gimp);
(* status_callback) (NULL, _("Channel"), 0.039);
@ -98,58 +98,58 @@ internal_procs_init (Gimp *gimp,
(* status_callback) (NULL, _("Color"), 0.06);
register_color_procs (gimp);
(* status_callback) (NULL, _("Context"), 0.094);
(* status_callback) (NULL, _("Context"), 0.095);
register_context_procs (gimp);
(* status_callback) (NULL, _("Convert"), 0.145);
(* status_callback) (NULL, _("Convert"), 0.146);
register_convert_procs (gimp);
(* status_callback) (NULL, _("Display procedures"), 0.152);
(* status_callback) (NULL, _("Display procedures"), 0.153);
register_display_procs (gimp);
(* status_callback) (NULL, _("Drawable procedures"), 0.161);
(* status_callback) (NULL, _("Drawable procedures"), 0.162);
register_drawable_procs (gimp);
(* status_callback) (NULL, _("Transformation procedures"), 0.237);
(* status_callback) (NULL, _("Transformation procedures"), 0.239);
register_drawable_transform_procs (gimp);
(* status_callback) (NULL, _("Edit procedures"), 0.274);
(* status_callback) (NULL, _("Edit procedures"), 0.276);
register_edit_procs (gimp);
(* status_callback) (NULL, _("File Operations"), 0.293);
(* status_callback) (NULL, _("File Operations"), 0.295);
register_fileops_procs (gimp);
(* status_callback) (NULL, _("Floating selections"), 0.316);
(* status_callback) (NULL, _("Floating selections"), 0.318);
register_floating_sel_procs (gimp);
(* status_callback) (NULL, _("Font UI"), 0.329);
(* status_callback) (NULL, _("Font UI"), 0.332);
register_font_select_procs (gimp);
(* status_callback) (NULL, _("Fonts"), 0.336);
(* status_callback) (NULL, _("Fonts"), 0.339);
register_fonts_procs (gimp);
(* status_callback) (NULL, _("Gimprc procedures"), 0.341);
(* status_callback) (NULL, _("Gimprc procedures"), 0.343);
register_gimprc_procs (gimp);
(* status_callback) (NULL, _("Gradient"), 0.355);
(* status_callback) (NULL, _("Gradient"), 0.357);
register_gradient_procs (gimp);
(* status_callback) (NULL, _("Gradient UI"), 0.422);
(* status_callback) (NULL, _("Gradient UI"), 0.425);
register_gradient_select_procs (gimp);
(* status_callback) (NULL, _("Gradients"), 0.429);
(* status_callback) (NULL, _("Gradients"), 0.432);
register_gradients_procs (gimp);
(* status_callback) (NULL, _("Guide procedures"), 0.44);
(* status_callback) (NULL, _("Guide procedures"), 0.443);
register_guides_procs (gimp);
(* status_callback) (NULL, _("Help procedures"), 0.454);
(* status_callback) (NULL, _("Help procedures"), 0.457);
register_help_procs (gimp);
(* status_callback) (NULL, _("Image"), 0.456);
(* status_callback) (NULL, _("Image"), 0.459);
register_image_procs (gimp);
(* status_callback) (NULL, _("Layer"), 0.604);
(* status_callback) (NULL, _("Layer"), 0.603);
register_layer_procs (gimp);
(* status_callback) (NULL, _("Message procedures"), 0.666);
@ -164,40 +164,40 @@ internal_procs_init (Gimp *gimp,
(* status_callback) (NULL, _("Palette"), 0.712);
register_palette_procs (gimp);
(* status_callback) (NULL, _("Palette UI"), 0.737);
(* status_callback) (NULL, _("Palette UI"), 0.738);
register_palette_select_procs (gimp);
(* status_callback) (NULL, _("Palettes"), 0.744);
(* status_callback) (NULL, _("Palettes"), 0.745);
register_palettes_procs (gimp);
(* status_callback) (NULL, _("Parasite procedures"), 0.753);
(* status_callback) (NULL, _("Parasite procedures"), 0.754);
register_parasite_procs (gimp);
(* status_callback) (NULL, _("Paths"), 0.781);
(* status_callback) (NULL, _("Paths"), 0.782);
register_paths_procs (gimp);
(* status_callback) (NULL, _("Pattern"), 0.816);
(* status_callback) (NULL, _("Pattern"), 0.817);
register_pattern_procs (gimp);
(* status_callback) (NULL, _("Pattern UI"), 0.82);
(* status_callback) (NULL, _("Pattern UI"), 0.821);
register_pattern_select_procs (gimp);
(* status_callback) (NULL, _("Patterns"), 0.827);
(* status_callback) (NULL, _("Patterns"), 0.828);
register_patterns_procs (gimp);
(* status_callback) (NULL, _("Plug-in"), 0.836);
(* status_callback) (NULL, _("Plug-in"), 0.838);
register_plug_in_procs (gimp);
(* status_callback) (NULL, _("Procedural database"), 0.848);
(* status_callback) (NULL, _("Procedural database"), 0.849);
register_procedural_db_procs (gimp);
(* status_callback) (NULL, _("Progress"), 0.869);
(* status_callback) (NULL, _("Progress"), 0.87);
register_progress_procs (gimp);
(* status_callback) (NULL, _("Image mask"), 0.88);
(* status_callback) (NULL, _("Image mask"), 0.882);
register_selection_procs (gimp);
(* status_callback) (NULL, _("Selection Tool procedures"), 0.922);
(* status_callback) (NULL, _("Selection Tool procedures"), 0.921);
register_selection_tools_procs (gimp);
(* status_callback) (NULL, _("Text procedures"), 0.933);

View file

@ -130,6 +130,8 @@ procedural_db_init_procs (Gimp *gimp,
{ "gimp_gradients_set_gradient", "gimp_context_set_gradient" },
{ "gimp_image_active_drawable", "gimp_image_get_active_drawable" },
{ "gimp_image_floating_selection", "gimp_image_get_floating_sel" },
{ "gimp_image_get_cmap", "gimp_image_get_colormap" },
{ "gimp_image_set_cmap", "gimp_image_set_colormap" },
{ "gimp_layer_delete", "gimp_drawable_delete" },
{ "gimp_layer_get_linked", "gimp_drawable_get_linked" },
{ "gimp_layer_get_name", "gimp_drawable_get_name" },
@ -150,6 +152,7 @@ procedural_db_init_procs (Gimp *gimp,
{ "gimp_palettes_set_palette", "gimp_context_set_palette" },
{ "gimp_patterns_list", "gimp_patterns_get_list" },
{ "gimp_patterns_set_pattern", "gimp_context_set_pattern" },
{ "gimp_selection_clear", "gimp_selection_none" },
{ "gimp_temp_PDB_name", "gimp_procedural_db_temp_name" },
{ "gimp_undo_push_group_start", "gimp_image_undo_group_start" },
{ "gimp_undo_push_group_end", "gimp_image_undo_group_end" },

View file

@ -39,7 +39,6 @@ static ProcRecord selection_value_proc;
static ProcRecord selection_is_empty_proc;
static ProcRecord selection_translate_proc;
static ProcRecord selection_float_proc;
static ProcRecord selection_clear_proc;
static ProcRecord selection_invert_proc;
static ProcRecord selection_sharpen_proc;
static ProcRecord selection_all_proc;
@ -61,7 +60,6 @@ register_selection_procs (Gimp *gimp)
procedural_db_register (gimp, &selection_is_empty_proc);
procedural_db_register (gimp, &selection_translate_proc);
procedural_db_register (gimp, &selection_float_proc);
procedural_db_register (gimp, &selection_clear_proc);
procedural_db_register (gimp, &selection_invert_proc);
procedural_db_register (gimp, &selection_sharpen_proc);
procedural_db_register (gimp, &selection_all_proc);
@ -447,51 +445,6 @@ static ProcRecord selection_float_proc =
{ { selection_float_invoker } }
};
static Argument *
selection_clear_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
GimpImage *gimage;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
success = FALSE;
if (success)
gimp_channel_clear (gimp_image_get_mask (gimage), NULL, TRUE);
return procedural_db_return_args (&selection_clear_proc, success);
}
static ProcArg selection_clear_inargs[] =
{
{
GIMP_PDB_IMAGE,
"image",
"The image"
}
};
static ProcRecord selection_clear_proc =
{
"gimp_selection_clear",
"This procedure is deprecated! Use 'gimp_selection_none' instead.",
"This procedure is deprecated! Use 'gimp_selection_none' instead.",
"",
"",
"",
"gimp_selection_none",
GIMP_INTERNAL,
1,
selection_clear_inargs,
0,
NULL,
{ { selection_clear_invoker } }
};
static Argument *
selection_invert_invoker (Gimp *gimp,
GimpContext *context,

View file

@ -51,3 +51,17 @@ gimp_selection_float (gint32 image_ID,
offx,
offy);
}
/**
* gimp_selection_clear:
* @image_ID: The image.
*
* This procedure is deprecated! Use gimp_selection_none() instead.
*
* Returns: TRUE on success.
*/
gboolean
gimp_selection_clear (gint32 image_ID)
{
return gimp_selection_none (image_ID);
}

View file

@ -27,10 +27,16 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gint32 gimp_selection_float (gint32 image_ID,
gint32 drawable_ID,
gint offx,
gint offy);
gint32 gimp_selection_float (gint32 image_ID,
gint32 drawable_ID,
gint offx,
gint offy);
#ifndef GIMP_DISABLE_DEPRECATED
gboolean gimp_selection_clear (gint32 image_ID);
#endif /* GIMP_DISABLE_DEPRECATED */
G_END_DECLS

View file

@ -234,33 +234,6 @@ _gimp_selection_float (gint32 drawable_ID,
return layer_ID;
}
/**
* gimp_selection_clear:
* @image_ID: The image.
*
* This procedure is deprecated! Use gimp_selection_none() instead.
*
* Returns: TRUE on success.
*/
gboolean
gimp_selection_clear (gint32 image_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_selection_clear",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_selection_invert:
* @image_ID: The image.

View file

@ -45,9 +45,6 @@ gboolean gimp_selection_translate (gint32 image_ID,
gint32 _gimp_selection_float (gint32 drawable_ID,
gint offx,
gint offy);
#ifndef GIMP_DISABLE_DEPRECATED
gboolean gimp_selection_clear (gint32 image_ID);
#endif /* GIMP_DISABLE_DEPRECATED */
gboolean gimp_selection_invert (gint32 image_ID);
gboolean gimp_selection_sharpen (gint32 image_ID);
gboolean gimp_selection_all (gint32 image_ID);

View file

@ -948,47 +948,6 @@ HELP
%invoke = ( code => 'base_type = gimp_image_base_type (gimage);' );
}
sub image_get_cmap {
&std_pdb_deprecated ('gimp_image_get_colormap');
@inargs = ( &std_image_arg );
@outargs = (
{ name => 'cmap', type => 'int8array', init => 1, wrap => 1,
desc => "The image's colormap",
array => { name => 'num_bytes', init => 1,
desc => 'Number of bytes in the colormap array:
%%desc%%' } }
);
%invoke = (
headers => [ qw("core/gimpimage-colormap.h") ],
code => <<'CODE'
{
num_bytes = 3 * gimp_image_get_colormap_size (gimage);
cmap = g_memdup (gimp_image_get_colormap (gimage), num_bytes);
}
CODE
);
}
sub image_set_cmap {
&std_pdb_deprecated ('gimp_image_set_colormap');
@inargs = (
&std_image_arg,
{ name => 'cmap', type => 'int8array', wrap => 1,
desc => "The new colormap values",
array => { name => 'num_bytes', type => '0 <= int32 <= 768',
desc => 'Number of bytes in the colormap array:
%%desc%%' } }
);
%invoke = (
headers => [ qw("core/gimpimage-colormap.h") ],
code => 'gimp_image_set_colormap (gimage, cmap, num_bytes / 3, TRUE);' );
}
sub image_get_colormap {
$blurb = "Returns the image's colormap";
@ -1623,11 +1582,10 @@ unshift @procs, qw(image_list image_new image_duplicate image_delete
image_raise_channel image_lower_channel
image_flatten image_merge_visible_layers image_merge_down
image_add_layer_mask image_remove_layer_mask
image_get_cmap image_set_cmap
image_get_colormap image_set_colormap
image_clean_all image_is_dirty
image_thumbnail);
%exports = (app => [@procs], lib => [@procs[0..34,39..63]]);
%exports = (app => [@procs], lib => [@procs[0..34,37..61]]);
$desc = 'Image';

View file

@ -206,14 +206,6 @@ CODE
);
}
sub selection_clear {
&std_pdb_deprecated ('gimp_selection_none');
@inargs = ( &std_image_arg );
%invoke = ( code => "gimp_channel_clear (gimp_image_get_mask (gimage), NULL, TRUE);" );
}
sub selection_invert {
&selection_simple_proc('invert');
@ -418,7 +410,7 @@ HELP
@headers = qw("core/gimpchannel-select.h" "gimp-intl.h");
@procs = qw(selection_bounds selection_value selection_is_empty
selection_translate selection_float selection_clear
selection_translate selection_float
selection_invert selection_sharpen selection_all selection_none
selection_feather selection_border selection_grow selection_shrink
selection_layer_alpha selection_load selection_save