[gimp] pdb: deprecated gimp-layer-translate



commit b80036e14f9591c68d23fe5f71572448d00a71e5
Author: Michael Natterer <mitch gimp org>
Date:   Mon Apr 23 15:49:23 2018 +0200

    pdb: deprecated gimp-layer-translate
    
    and port all plug-ins/scripts to gimp-item-transform-translate.

 app/pdb/layer-cmds.c                             |    6 ++++--
 libgimp/gimplayer_pdb.c                          |    2 ++
 libgimp/gimplayer_pdb.h                          |    1 +
 pdb/groups/layer.pdb                             |    2 ++
 plug-ins/common/animation-optimize.c             |    2 +-
 plug-ins/common/file-gif-load.c                  |    2 +-
 plug-ins/common/file-xmc.c                       |    6 +++---
 plug-ins/pygimp/pygimp-drawable.c                |    2 +-
 plug-ins/script-fu/scripts/carve-it.scm          |    2 +-
 plug-ins/script-fu/scripts/difference-clouds.scm |    2 +-
 plug-ins/script-fu/scripts/drop-shadow.scm       |    2 +-
 11 files changed, 18 insertions(+), 11 deletions(-)
---
diff --git a/app/pdb/layer-cmds.c b/app/pdb/layer-cmds.c
index af0c45f..b63b6d9 100644
--- a/app/pdb/layer-cmds.c
+++ b/app/pdb/layer-cmds.c
@@ -1752,11 +1752,13 @@ register_layer_procs (GimpPDB *pdb)
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-layer-translate",
                                      "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",
                                      "1995-1996",
-                                     NULL);
+                                     "gimp-item-transform-translate");
   gimp_procedure_add_argument (procedure,
                                gimp_param_spec_layer_id ("layer",
                                                          "layer",
diff --git a/libgimp/gimplayer_pdb.c b/libgimp/gimplayer_pdb.c
index 38d146e..c3a83ec 100644
--- a/libgimp/gimplayer_pdb.c
+++ b/libgimp/gimplayer_pdb.c
@@ -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
  * the specified offsets.
  *
+ * Deprecated: Use gimp_item_transform_translate() instead.
+ *
  * Returns: TRUE on success.
  **/
 gboolean
diff --git a/libgimp/gimplayer_pdb.h b/libgimp/gimplayer_pdb.h
index a4584f0..9266ef5 100644
--- a/libgimp/gimplayer_pdb.h
+++ b/libgimp/gimplayer_pdb.h
@@ -65,6 +65,7 @@ gboolean               gimp_layer_resize               (gint32
                                                         gint                    offx,
                                                         gint                    offy);
 gboolean               gimp_layer_resize_to_image_size (gint32                  layer_ID);
+GIMP_DEPRECATED_FOR(gimp_item_transform_translate)
 gboolean               gimp_layer_translate            (gint32                  layer_ID,
                                                         gint                    offx,
                                                         gint                    offy);
diff --git a/pdb/groups/layer.pdb b/pdb/groups/layer.pdb
index 852099f..83560ef 100644
--- a/pdb/groups/layer.pdb
+++ b/pdb/groups/layer.pdb
@@ -613,6 +613,8 @@ HELP
 
     &std_pdb_misc;
 
+    $deprecated = 'gimp-item-transform-translate';
+
     @inargs = (
        { name => 'layer', type => 'layer',
          desc => 'The layer' },
diff --git a/plug-ins/common/animation-optimize.c b/plug-ins/common/animation-optimize.c
index 4db616f..9ff24f4 100644
--- a/plug-ins/common/animation-optimize.c
+++ b/plug-ins/common/animation-optimize.c
@@ -1081,7 +1081,7 @@ do_optimizations (GimpRunMode run_mode,
                                        bbox_bottom-bbox_top);
               gimp_drawable_flush (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) /
diff --git a/plug-ins/common/file-gif-load.c b/plug-ins/common/file-gif-load.c
index 831ec97..bc5344b 100644
--- a/plug-ins/common/file-gif-load.c
+++ b/plug-ins/common/file-gif-load.c
@@ -1092,7 +1092,7 @@ ReadImage (FILE        *fd,
   frame_number++;
 
   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;
   max_progress = height;
diff --git a/plug-ins/common/file-xmc.c b/plug-ins/common/file-xmc.c
index 87f49e2..df517ce 100644
--- a/plug-ins/common/file-xmc.c
+++ b/plug-ins/common/file-xmc.c
@@ -739,9 +739,9 @@ load_image (const gchar  *filename,
       gimp_image_insert_layer (image_ID, layer_ID, -1, 0);
 
       /* Adjust layer position to let hotspot sit on the same point. */
-      gimp_layer_translate (layer_ID,
-                            xmcparas.x - imagesp->images[i]->xhot,
-                            xmcparas.y - imagesp->images[i]->yhot);
+      gimp_item_transform_translate (layer_ID,
+                                     xmcparas.x - imagesp->images[i]->xhot,
+                                     xmcparas.y - imagesp->images[i]->yhot);
 
       g_free (framename);
 
diff --git a/plug-ins/pygimp/pygimp-drawable.c b/plug-ins/pygimp/pygimp-drawable.c
index 48333b7..25d0a82 100644
--- a/plug-ins/pygimp/pygimp-drawable.c
+++ b/plug-ins/pygimp/pygimp-drawable.c
@@ -1620,7 +1620,7 @@ lay_translate(PyGimpLayer *self, PyObject *args, PyObject *kwargs)
                                     &offs_x, &offs_y))
        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,
                     "could not translate layer (ID %d) to offset %d, %d",
                     self->ID, offs_x, offs_y);
diff --git a/plug-ins/script-fu/scripts/carve-it.scm b/plug-ins/script-fu/scripts/carve-it.scm
index cdcb529..efe2279 100644
--- a/plug-ins/script-fu/scripts/carve-it.scm
+++ b/plug-ins/script-fu/scripts/carve-it.scm
@@ -141,7 +141,7 @@
     (gimp-layer-set-mode cast-shadow-layer LAYER-MODE-MULTIPLY)
     (gimp-layer-set-opacity cast-shadow-layer 75)
     (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)))
     (gimp-layer-add-mask cast-shadow-layer csl-mask)
diff --git a/plug-ins/script-fu/scripts/difference-clouds.scm 
b/plug-ins/script-fu/scripts/difference-clouds.scm
index cd66717..f3d3b3d 100644
--- a/plug-ins/script-fu/scripts/difference-clouds.scm
+++ b/plug-ins/script-fu/scripts/difference-clouds.scm
@@ -52,7 +52,7 @@
 
     ; Offset the clouds layer
     (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
     (plug-in-solid-noise SF-RUN-MODE image diff-clouds 0 0 0 1 4.0 4.0)
diff --git a/plug-ins/script-fu/scripts/drop-shadow.scm b/plug-ins/script-fu/scripts/drop-shadow.scm
index 76435fe..d7c3c74 100644
--- a/plug-ins/script-fu/scripts/drop-shadow.scm
+++ b/plug-ins/script-fu/scripts/drop-shadow.scm
@@ -145,7 +145,7 @@
                                               shadow-blur
                                               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)
       (begin


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]