pdb: deprecate all non-clipboard functions in the "edit" group

Still have to port script-fu scripts...
This commit is contained in:
Michael Natterer 2018-04-15 16:39:59 +02:00
parent 1305926f38
commit 5ee67deea5
7 changed files with 113 additions and 72 deletions

View File

@ -1271,11 +1271,13 @@ register_edit_procs (GimpPDB *pdb)
gimp_procedure_set_static_strings (procedure,
"gimp-edit-clear",
"Clear selected area of drawable.",
"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.",
"",
"",
"",
NULL);
"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.\n"
"\n"
"Deprecated: Use 'gimp-drawable-edit-clear' instead.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
"gimp-drawable-edit-clear");
gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable_id ("drawable",
"drawable",
@ -1294,11 +1296,13 @@ register_edit_procs (GimpPDB *pdb)
gimp_procedure_set_static_strings (procedure,
"gimp-edit-fill",
"Fill selected area of drawable.",
"This procedure fills the specified drawable with the fill mode. If the fill mode is foreground, the current foreground color is used. If the fill mode is background, the current background color is used. Other fill modes should not be used. This procedure only affects regions within a selection if there is a selection active. If you want to fill the whole drawable, regardless of the selection, use 'gimp-drawable-fill'.",
"This procedure fills the specified drawable with the fill mode. If the fill mode is foreground, the current foreground color is used. If the fill mode is background, the current background color is used. Other fill modes should not be used. This procedure only affects regions within a selection if there is a selection active. If you want to fill the whole drawable, regardless of the selection, use 'gimp-drawable-fill'.\n"
"\n"
"Deprecated: Use 'gimp-drawable-edit-fill' instead.",
"Spencer Kimball & Peter Mattis & Raphael Quinet",
"Spencer Kimball & Peter Mattis",
"1995-2000",
NULL);
"gimp-drawable-edit-fill");
gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable_id ("drawable",
"drawable",
@ -1324,11 +1328,13 @@ register_edit_procs (GimpPDB *pdb)
gimp_procedure_set_static_strings (procedure,
"gimp-edit-bucket-fill",
"Fill the area specified either by the current selection if there is one, or by a seed fill starting at the specified coordinates.",
"This tool requires information on the paint application mode, and the fill mode, which can either be in the foreground color, or in the currently active pattern. If there is no selection, a seed fill is executed at the specified coordinates and extends outward in keeping with the threshold parameter. If there is a selection in the target image, the threshold, sample merged, x, and y arguments are unused. If the sample_merged parameter is TRUE, the data of the composite image will be used instead of that for the specified drawable. This is equivalent to sampling for colors after merging all visible layers. In the case of merged sampling, the x and y coordinates are relative to the image's origin; otherwise, they are relative to the drawable's origin.",
"This tool requires information on the paint application mode, and the fill mode, which can either be in the foreground color, or in the currently active pattern. If there is no selection, a seed fill is executed at the specified coordinates and extends outward in keeping with the threshold parameter. If there is a selection in the target image, the threshold, sample merged, x, and y arguments are unused. If the sample_merged parameter is TRUE, the data of the composite image will be used instead of that for the specified drawable. This is equivalent to sampling for colors after merging all visible layers. In the case of merged sampling, the x and y coordinates are relative to the image's origin; otherwise, they are relative to the drawable's origin.\n"
"\n"
"Deprecated: Use 'gimp-drawable-edit-bucket-fill' instead.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
NULL);
"gimp-drawable-edit-bucket-fill");
gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable_id ("drawable",
"drawable",
@ -1391,11 +1397,13 @@ register_edit_procs (GimpPDB *pdb)
gimp_procedure_set_static_strings (procedure,
"gimp-edit-bucket-fill-full",
"Fill the area specified either by the current selection if there is one, or by a seed fill starting at the specified coordinates.",
"This tool requires information on the paint application mode, and the fill mode, which can either be in the foreground color, or in the currently active pattern. If there is no selection, a seed fill is executed at the specified coordinates and extends outward in keeping with the threshold parameter. If there is a selection in the target image, the threshold, sample merged, x, and y arguments are unused. If the sample_merged parameter is TRUE, the data of the composite image will be used instead of that for the specified drawable. This is equivalent to sampling for colors after merging all visible layers. In the case of merged sampling, the x and y coordinates are relative to the image's origin; otherwise, they are relative to the drawable's origin.",
"This tool requires information on the paint application mode, and the fill mode, which can either be in the foreground color, or in the currently active pattern. If there is no selection, a seed fill is executed at the specified coordinates and extends outward in keeping with the threshold parameter. If there is a selection in the target image, the threshold, sample merged, x, and y arguments are unused. If the sample_merged parameter is TRUE, the data of the composite image will be used instead of that for the specified drawable. This is equivalent to sampling for colors after merging all visible layers. In the case of merged sampling, the x and y coordinates are relative to the image's origin; otherwise, they are relative to the drawable's origin.\n"
"\n"
"Deprecated: Use 'gimp-drawable-edit-bucket-fill' instead.",
"David Gowers",
"David Gowers",
"2006",
NULL);
"gimp-drawable-edit-bucket-fill");
gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable_id ("drawable",
"drawable",
@ -1471,11 +1479,13 @@ register_edit_procs (GimpPDB *pdb)
gimp_procedure_set_static_strings (procedure,
"gimp-edit-blend",
"Blend between the starting and ending coordinates with the specified blend mode and gradient type.",
"This tool requires information on the paint application mode, the blend mode, and the gradient type. It creates the specified variety of blend using the starting and ending coordinates as defined for each gradient type. For shapeburst gradient types, the context's distance metric is also relevant and can be updated with 'gimp-context-set-distance-metric'.",
"This tool requires information on the paint application mode, the blend mode, and the gradient type. It creates the specified variety of blend using the starting and ending coordinates as defined for each gradient type. For shapeburst gradient types, the context's distance metric is also relevant and can be updated with 'gimp-context-set-distance-metric'.\n"
"\n"
"Deprecated: Use 'gimp-drawable-edit-gradient-fill' instead.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
NULL);
"gimp-drawable-edit-gradient-fill");
gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable_id ("drawable",
"drawable",
@ -1588,11 +1598,13 @@ register_edit_procs (GimpPDB *pdb)
gimp_procedure_set_static_strings (procedure,
"gimp-edit-stroke",
"Stroke the current selection",
"This procedure strokes the current selection, painting along the selection boundary with the active brush and foreground color. The paint is applied to the specified drawable regardless of the active selection.",
"This procedure strokes the current selection, painting along the selection boundary with the active brush and foreground color. The paint is applied to the specified drawable regardless of the active selection.\n"
"\n"
"Deprecated: Use 'gimp-drawable-edit-stroke-selection' instead.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
NULL);
"gimp-drawable-edit-stroke-selection");
gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable_id ("drawable",
"drawable",
@ -1611,11 +1623,13 @@ register_edit_procs (GimpPDB *pdb)
gimp_procedure_set_static_strings (procedure,
"gimp-edit-stroke-vectors",
"Stroke the specified vectors object",
"This procedure strokes the specified vectors object, painting along the path with the active brush and foreground color.",
"This procedure strokes the specified vectors object, painting along the path with the active brush and foreground color.\n"
"\n"
"Deprecated: Use 'gimp-drawable-edit-stroke-item' instead.",
"Simon Budig",
"Simon Budig",
"2006",
NULL);
"gimp-drawable-edit-stroke-item");
gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable_id ("drawable",
"drawable",

View File

@ -428,6 +428,8 @@ gimp_edit_named_paste_as_new_image (const gchar *buffer_name)
* to the background color. This procedure only affects regions within
* a selection if there is a selection active.
*
* Deprecated: Use gimp_drawable_edit_clear() instead.
*
* Returns: TRUE on success.
**/
gboolean
@ -464,6 +466,8 @@ gimp_edit_clear (gint32 drawable_ID)
* If you want to fill the whole drawable, regardless of the selection,
* use gimp_drawable_fill().
*
* Deprecated: Use gimp_drawable_edit_fill() instead.
*
* Returns: TRUE on success.
**/
gboolean
@ -514,6 +518,8 @@ gimp_edit_fill (gint32 drawable_ID,
* coordinates are relative to the image's origin; otherwise, they are
* relative to the drawable's origin.
*
* Deprecated: Use gimp_drawable_edit_bucket_fill() instead.
*
* Returns: TRUE on success.
**/
gboolean
@ -578,6 +584,8 @@ gimp_edit_bucket_fill (gint32 drawable_ID,
* coordinates are relative to the image's origin; otherwise, they are
* relative to the drawable's origin.
*
* Deprecated: Use gimp_drawable_edit_bucket_fill() instead.
*
* Returns: TRUE on success.
*
* Since: 2.4
@ -648,6 +656,8 @@ gimp_edit_bucket_fill_full (gint32 drawable_ID,
* distance metric is also relevant and can be updated with
* gimp_context_set_distance_metric().
*
* Deprecated: Use gimp_drawable_edit_gradient_fill() instead.
*
* Returns: TRUE on success.
**/
gboolean
@ -710,6 +720,8 @@ gimp_edit_blend (gint32 drawable_ID,
* paint is applied to the specified drawable regardless of the active
* selection.
*
* Deprecated: Use gimp_drawable_edit_stroke_selection() instead.
*
* Returns: TRUE on success.
**/
gboolean
@ -741,6 +753,8 @@ gimp_edit_stroke (gint32 drawable_ID)
* This procedure strokes the specified vectors object, painting along
* the path with the active brush and foreground color.
*
* Deprecated: Use gimp_drawable_edit_stroke_item() instead.
*
* Returns: TRUE on success.
*
* Since: 2.4

View File

@ -48,9 +48,12 @@ gint32 gimp_edit_named_paste (gint32 drawable_ID,
const gchar *buffer_name,
gboolean paste_into);
gint32 gimp_edit_named_paste_as_new_image (const gchar *buffer_name);
GIMP_DEPRECATED_FOR(gimp_drawable_edit_clear)
gboolean gimp_edit_clear (gint32 drawable_ID);
GIMP_DEPRECATED_FOR(gimp_drawable_edit_fill)
gboolean gimp_edit_fill (gint32 drawable_ID,
GimpFillType fill_type);
GIMP_DEPRECATED_FOR(gimp_drawable_edit_bucket_fill)
gboolean gimp_edit_bucket_fill (gint32 drawable_ID,
GimpBucketFillMode fill_mode,
GimpLayerMode paint_mode,
@ -59,6 +62,7 @@ gboolean gimp_edit_bucket_fill (gint32 drawable_ID,
gboolean sample_merged,
gdouble x,
gdouble y);
GIMP_DEPRECATED_FOR(gimp_drawable_edit_bucket_fill)
gboolean gimp_edit_bucket_fill_full (gint32 drawable_ID,
GimpBucketFillMode fill_mode,
GimpLayerMode paint_mode,
@ -69,6 +73,7 @@ gboolean gimp_edit_bucket_fill_full (gint32 drawable_ID,
GimpSelectCriterion select_criterion,
gdouble x,
gdouble y);
GIMP_DEPRECATED_FOR(gimp_drawable_edit_gradient_fill)
gboolean gimp_edit_blend (gint32 drawable_ID,
GimpBlendMode blend_mode,
GimpLayerMode paint_mode,
@ -85,7 +90,9 @@ gboolean gimp_edit_blend (gint32 drawable_ID,
gdouble y1,
gdouble x2,
gdouble y2);
GIMP_DEPRECATED_FOR(gimp_drawable_edit_stroke_selection)
gboolean gimp_edit_stroke (gint32 drawable_ID);
GIMP_DEPRECATED_FOR(gimp_drawable_edit_stroke_item)
gboolean gimp_edit_stroke_vectors (gint32 drawable_ID,
gint32 vectors_ID);

View File

@ -100,7 +100,7 @@ export_merge (gint32 image_ID,
100.0, GIMP_LAYER_MODE_NORMAL);
gimp_image_insert_layer (image_ID, transp, -1, 1);
gimp_selection_none (image_ID);
gimp_edit_clear (transp);
gimp_drawable_edit_clear (transp);
nvisible++;
}

View File

@ -517,6 +517,10 @@ the background color. This procedure only affects regions within a
selection if there is a selection active.
HELP
&std_pdb_misc;
$deprecated = 'gimp-drawable-edit-clear';
@inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable to clear from' }
@ -557,6 +561,8 @@ HELP
$author .= ' & Raphael Quinet';
$date = '1995-2000';
$deprecated = 'gimp-drawable-edit-fill';
@inargs = (
{ name => 'drawable', type => 'drawable',
desc => "The drawable to fill to" },
@ -614,6 +620,8 @@ HELP
&std_pdb_misc;
$deprecated = 'gimp-drawable-edit-bucket-fill';
@inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
@ -712,6 +720,8 @@ HELP
&david_pdb_misc('2006', '2.4');
$deprecated = 'gimp-drawable-edit-bucket-fill';
@inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
@ -812,6 +822,8 @@ HELP
&std_pdb_misc;
$deprecated = 'gimp-drawable-edit-gradient-fill';
@inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The affected drawable' },
@ -929,6 +941,8 @@ HELP
&std_pdb_misc;
$deprecated = 'gimp-drawable-edit-stroke-selection';
@inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable to stroke to' }
@ -975,6 +989,8 @@ HELP
&simon_pdb_misc('2006', '2.4');
$deprecated = 'gimp-drawable-edit-stroke-item';
@inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable to stroke to' },

View File

@ -1902,33 +1902,35 @@ load_file_chooser_response (GtkFileChooser *chooser,
void
paint_layer_fill (gdouble x1, gdouble y1, gdouble x2, gdouble y2)
{
GimpBucketFillMode fill_mode = GIMP_BUCKET_FILL_FG;
GimpFillType fill_type = GIMP_FILL_FOREGROUND;
Style *current_style;
current_style = gfig_context_get_current_style ();
gimp_context_push ();
gimp_context_set_paint_mode (GIMP_LAYER_MODE_NORMAL_LEGACY);
gimp_context_set_opacity (100.0);
gimp_context_set_gradient_repeat_mode (GIMP_REPEAT_NONE);
gimp_context_set_gradient_reverse (FALSE);
switch (current_style->fill_type)
{
case FILL_NONE:
return;
case FILL_COLOR:
fill_mode = GIMP_BUCKET_FILL_FG;
fill_type = GIMP_FILL_FOREGROUND;
break;
case FILL_PATTERN:
fill_mode = GIMP_BUCKET_FILL_PATTERN;
fill_type = GIMP_FILL_PATTERN;
break;
case FILL_GRADIENT:
gimp_edit_blend (gfig_context->drawable_id,
GIMP_BLEND_CUSTOM,
GIMP_LAYER_MODE_NORMAL_LEGACY,
gimp_drawable_edit_gradient_fill (gfig_context->drawable_id,
GIMP_GRADIENT_SHAPEBURST_DIMPLED,
100.0, /* opacity */
0.0, /* offset */
GIMP_REPEAT_NONE,
FALSE, /* reverse */
FALSE, /* supersampling */
0, /* max_depth */
0.0, /* threshold */
@ -1937,14 +1939,9 @@ paint_layer_fill (gdouble x1, gdouble y1, gdouble x2, gdouble y2)
0.0, 0.0); /* (x2, y2) - ignored */
return;
case FILL_VERTICAL:
gimp_edit_blend (gfig_context->drawable_id,
GIMP_BLEND_CUSTOM,
GIMP_LAYER_MODE_NORMAL_LEGACY,
gimp_drawable_edit_gradient_fill (gfig_context->drawable_id,
GIMP_GRADIENT_LINEAR,
100.0,
0.0,
GIMP_REPEAT_NONE,
FALSE,
FALSE,
0,
0.0,
@ -1953,14 +1950,9 @@ paint_layer_fill (gdouble x1, gdouble y1, gdouble x2, gdouble y2)
x1, y2);
return;
case FILL_HORIZONTAL:
gimp_edit_blend (gfig_context->drawable_id,
GIMP_BLEND_CUSTOM,
GIMP_LAYER_MODE_NORMAL_LEGACY,
gimp_drawable_edit_gradient_fill (gfig_context->drawable_id,
GIMP_GRADIENT_LINEAR,
100.0,
0.0,
GIMP_REPEAT_NONE,
FALSE,
FALSE,
0,
0.0,
@ -1970,14 +1962,12 @@ paint_layer_fill (gdouble x1, gdouble y1, gdouble x2, gdouble y2)
return;
}
gimp_edit_bucket_fill (gfig_context->drawable_id,
fill_mode, /* Fill mode */
GIMP_LAYER_MODE_NORMAL_LEGACY,
current_style->fill_opacity, /* Fill opacity */
0.0, /* threshold - ignored */
FALSE, /* Sample merged - ignored */
0.0, /* x - ignored */
0.0); /* y - ignored */
gimp_context_set_opacity (current_style->fill_opacity);
gimp_drawable_edit_fill (gfig_context->drawable_id,
fill_type);
gimp_context_pop ();
}
void

View File

@ -433,7 +433,7 @@ create_image (cairo_surface_t *surface,
if (! gimp_selection_is_empty (image))
{
gimp_layer_add_alpha (layer);
gimp_edit_clear (layer);
gimp_drawable_edit_clear (layer);
gimp_selection_none (image);
}
}