pdb: deprecated gimp-layer-translate

and port all plug-ins/scripts to gimp-item-transform-translate.
This commit is contained in:
Michael Natterer 2018-04-23 15:49:23 +02:00
parent acbdc4d5b4
commit b80036e14f
11 changed files with 18 additions and 11 deletions

View File

@ -1752,11 +1752,13 @@ register_layer_procs (GimpPDB *pdb)
gimp_procedure_set_static_strings (procedure, gimp_procedure_set_static_strings (procedure,
"gimp-layer-translate", "gimp-layer-translate",
"Translate the layer by the specified offsets.", "Translate the layer by the specified offsets.",
"This procedure translates the layer by the amounts specified in the x and y arguments. These can be negative, and are considered offsets from the current position. This command only works if the layer has been added to an image. All additional layers contained in the image which have the linked flag set to TRUE w ill also be translated by the specified offsets.", "This procedure translates the layer by the amounts specified in the x and y arguments. These can be negative, and are considered offsets from the current position. This command only works if the layer has been added to an image. All additional layers contained in the image which have the linked flag set to TRUE w ill also be translated by the specified offsets.\n"
"\n"
"Deprecated: Use 'gimp-item-transform-translate' instead.",
"Spencer Kimball & Peter Mattis", "Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis", "Spencer Kimball & Peter Mattis",
"1995-1996", "1995-1996",
NULL); "gimp-item-transform-translate");
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
gimp_param_spec_layer_id ("layer", gimp_param_spec_layer_id ("layer",
"layer", "layer",

View File

@ -482,6 +482,8 @@ gimp_layer_resize_to_image_size (gint32 layer_ID)
* which have the linked flag set to TRUE w ill also be translated by * which have the linked flag set to TRUE w ill also be translated by
* the specified offsets. * the specified offsets.
* *
* Deprecated: Use gimp_item_transform_translate() instead.
*
* Returns: TRUE on success. * Returns: TRUE on success.
**/ **/
gboolean gboolean

View File

@ -65,6 +65,7 @@ gboolean gimp_layer_resize (gint32
gint offx, gint offx,
gint offy); gint offy);
gboolean gimp_layer_resize_to_image_size (gint32 layer_ID); gboolean gimp_layer_resize_to_image_size (gint32 layer_ID);
GIMP_DEPRECATED_FOR(gimp_item_transform_translate)
gboolean gimp_layer_translate (gint32 layer_ID, gboolean gimp_layer_translate (gint32 layer_ID,
gint offx, gint offx,
gint offy); gint offy);

View File

@ -613,6 +613,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
$deprecated = 'gimp-item-transform-translate';
@inargs = ( @inargs = (
{ name => 'layer', type => 'layer', { name => 'layer', type => 'layer',
desc => 'The layer' }, desc => 'The layer' },

View File

@ -1081,7 +1081,7 @@ do_optimizations (GimpRunMode run_mode,
bbox_bottom-bbox_top); bbox_bottom-bbox_top);
gimp_drawable_flush (drawable); gimp_drawable_flush (drawable);
gimp_drawable_detach (drawable); gimp_drawable_detach (drawable);
gimp_layer_translate (new_layer_id, bbox_left, bbox_top); gimp_item_transform_translate (new_layer_id, bbox_left, bbox_top);
} }
gimp_progress_update (((gdouble) this_frame_num + 1.0) / gimp_progress_update (((gdouble) this_frame_num + 1.0) /

View File

@ -1092,7 +1092,7 @@ ReadImage (FILE *fd,
frame_number++; frame_number++;
gimp_image_insert_layer (*image_ID, layer_ID, -1, 0); gimp_image_insert_layer (*image_ID, layer_ID, -1, 0);
gimp_layer_translate (layer_ID, (gint) leftpos, (gint) toppos); gimp_item_transform_translate (layer_ID, (gint) leftpos, (gint) toppos);
cur_progress = 0; cur_progress = 0;
max_progress = height; max_progress = height;

View File

@ -739,9 +739,9 @@ load_image (const gchar *filename,
gimp_image_insert_layer (image_ID, layer_ID, -1, 0); gimp_image_insert_layer (image_ID, layer_ID, -1, 0);
/* Adjust layer position to let hotspot sit on the same point. */ /* Adjust layer position to let hotspot sit on the same point. */
gimp_layer_translate (layer_ID, gimp_item_transform_translate (layer_ID,
xmcparas.x - imagesp->images[i]->xhot, xmcparas.x - imagesp->images[i]->xhot,
xmcparas.y - imagesp->images[i]->yhot); xmcparas.y - imagesp->images[i]->yhot);
g_free (framename); g_free (framename);

View File

@ -1620,7 +1620,7 @@ lay_translate(PyGimpLayer *self, PyObject *args, PyObject *kwargs)
&offs_x, &offs_y)) &offs_x, &offs_y))
return NULL; return NULL;
if (!gimp_layer_translate(self->ID, offs_x, offs_y)) { if (!gimp_item_transform_translate(self->ID, offs_x, offs_y)) {
PyErr_Format(pygimp_error, PyErr_Format(pygimp_error,
"could not translate layer (ID %d) to offset %d, %d", "could not translate layer (ID %d) to offset %d, %d",
self->ID, offs_x, offs_y); self->ID, offs_x, offs_y);

View File

@ -141,7 +141,7 @@
(gimp-layer-set-mode cast-shadow-layer LAYER-MODE-MULTIPLY) (gimp-layer-set-mode cast-shadow-layer LAYER-MODE-MULTIPLY)
(gimp-layer-set-opacity cast-shadow-layer 75) (gimp-layer-set-opacity cast-shadow-layer 75)
(plug-in-gauss-rle RUN-NONINTERACTIVE img cast-shadow-layer feather TRUE TRUE) (plug-in-gauss-rle RUN-NONINTERACTIVE img cast-shadow-layer feather TRUE TRUE)
(gimp-layer-translate cast-shadow-layer offx offy) (gimp-item-transform-translate cast-shadow-layer offx offy)
(set! csl-mask (car (gimp-layer-create-mask cast-shadow-layer ADD-MASK-BLACK))) (set! csl-mask (car (gimp-layer-create-mask cast-shadow-layer ADD-MASK-BLACK)))
(gimp-layer-add-mask cast-shadow-layer csl-mask) (gimp-layer-add-mask cast-shadow-layer csl-mask)

View File

@ -52,7 +52,7 @@
; Offset the clouds layer ; Offset the clouds layer
(if (gimp-item-is-layer drawable) (if (gimp-item-is-layer drawable)
(gimp-layer-translate diff-clouds offset-x offset-y)) (gimp-item-transform-translate diff-clouds offset-x offset-y))
; Show the solid noise dialog ; Show the solid noise dialog
(plug-in-solid-noise SF-RUN-MODE image diff-clouds 0 0 0 1 4.0 4.0) (plug-in-solid-noise SF-RUN-MODE image diff-clouds 0 0 0 1 4.0 4.0)

View File

@ -145,7 +145,7 @@
shadow-blur shadow-blur
TRUE TRUE
TRUE)) TRUE))
(gimp-layer-translate shadow-layer shadow-transl-x shadow-transl-y) (gimp-item-transform-translate shadow-layer shadow-transl-x shadow-transl-y)
(if (= from-selection TRUE) (if (= from-selection TRUE)
(begin (begin