[gimp] pdb: make all item-transform procedures honor the "linked" flag



commit a9fb4f9a3910f794587bb66d89fa4aac1fcdf075
Author: Michael Natterer <mitch gimp org>
Date:   Mon Apr 23 17:10:46 2018 +0200

    pdb: make all item-transform procedures honor the "linked" flag
    
    and improve their documentation.

 app/pdb/item-transform-cmds.c   |  136 ++++++++++++++++++--
 libgimp/gimpitemtransform_pdb.c |  243 ++++++++++++++++++++++------------
 pdb/groups/item_transform.pdb   |  277 +++++++++++++++++++++++++++------------
 3 files changed, 476 insertions(+), 180 deletions(-)
---
diff --git a/app/pdb/item-transform-cmds.c b/app/pdb/item-transform-cmds.c
index 4e2ebfc..05307ef 100644
--- a/app/pdb/item-transform-cmds.c
+++ b/app/pdb/item-transform-cmds.c
@@ -149,6 +149,12 @@ item_transform_flip_simple_invoker (GimpProcedure         *procedure,
               else
                 success = FALSE;
             }
+          else if (gimp_item_get_linked (item))
+            {
+              gimp_item_linked_flip (item, context,
+                                     flip_type, axis,
+                                     pdb_context->transform_resize);
+            }
           else
             {
               gimp_item_flip (item, context,
@@ -233,6 +239,14 @@ item_transform_flip_invoker (GimpProcedure         *procedure,
               else
                 success = FALSE;
             }
+          else if (gimp_item_get_linked (item))
+            {
+              gimp_item_linked_transform (item, context, &matrix,
+                                          pdb_context->transform_direction,
+                                          pdb_context->interpolation,
+                                          pdb_context->transform_resize,
+                                          progress);
+            }
           else
             {
               gimp_item_transform (item, context, &matrix,
@@ -333,6 +347,14 @@ item_transform_perspective_invoker (GimpProcedure         *procedure,
               else
                 success = FALSE;
             }
+          else if (gimp_item_get_linked (item))
+            {
+              gimp_item_linked_transform (item, context, &matrix,
+                                          pdb_context->transform_direction,
+                                          pdb_context->interpolation,
+                                          pdb_context->transform_resize,
+                                          progress);
+            }
           else
             {
               gimp_item_transform (item, context, &matrix,
@@ -416,6 +438,13 @@ item_transform_rotate_simple_invoker (GimpProcedure         *procedure,
               else
                 success = FALSE;
             }
+          else if (gimp_item_get_linked (item))
+            {
+              gimp_item_linked_rotate (item, context,
+                                       rotate_type,
+                                       center_x, center_y,
+                                       pdb_context->transform_resize);
+            }
           else
             {
               gimp_item_rotate (item, context,
@@ -506,6 +535,14 @@ item_transform_rotate_invoker (GimpProcedure         *procedure,
               else
                 success = FALSE;
             }
+          else if (gimp_item_get_linked (item))
+            {
+              gimp_item_linked_transform (item, context, &matrix,
+                                          pdb_context->transform_direction,
+                                          pdb_context->interpolation,
+                                          pdb_context->transform_resize,
+                                          progress);
+            }
           else
             {
               gimp_item_transform (item, context, &matrix,
@@ -598,6 +635,14 @@ item_transform_scale_invoker (GimpProcedure         *procedure,
               else
                 success = FALSE;
             }
+          else if (gimp_item_get_linked (item))
+            {
+              gimp_item_linked_transform (item, context, &matrix,
+                                          pdb_context->transform_direction,
+                                          pdb_context->interpolation,
+                                          pdb_context->transform_resize,
+                                          progress);
+            }
           else
             {
               gimp_item_transform (item, context, &matrix,
@@ -685,6 +730,14 @@ item_transform_shear_invoker (GimpProcedure         *procedure,
               else
                 success = FALSE;
             }
+          else if (gimp_item_get_linked (item))
+            {
+              gimp_item_linked_transform (item, context, &matrix,
+                                          pdb_context->transform_direction,
+                                          pdb_context->interpolation,
+                                          pdb_context->transform_resize,
+                                          progress);
+            }
           else
             {
               gimp_item_transform (item, context, &matrix,
@@ -783,6 +836,14 @@ item_transform_2d_invoker (GimpProcedure         *procedure,
               else
                 success = FALSE;
             }
+          else if (gimp_item_get_linked (item))
+            {
+              gimp_item_linked_transform (item, context, &matrix,
+                                          pdb_context->transform_direction,
+                                          pdb_context->interpolation,
+                                          pdb_context->transform_resize,
+                                          progress);
+            }
           else
             {
               gimp_item_transform (item, context, &matrix,
@@ -889,6 +950,14 @@ item_transform_matrix_invoker (GimpProcedure         *procedure,
               else
                 success = FALSE;
             }
+          else if (gimp_item_get_linked (item))
+            {
+              gimp_item_linked_transform (item, context, &matrix,
+                                          pdb_context->transform_direction,
+                                          pdb_context->interpolation,
+                                          pdb_context->transform_resize,
+                                          progress);
+            }
           else
             {
               gimp_item_transform (item, context, &matrix,
@@ -969,7 +1038,11 @@ register_item_transform_procs (GimpPDB *pdb)
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-item-transform-flip-simple",
                                      "Flip the specified item either vertically or horizontally.",
-                                     "This procedure flips the specified item. If a selection exists and the 
item is a drawable, the portion of the drawable which lies under the selection is cut from the drawable and 
made into a floating selection which is then flipped. If auto_center is set to TRUE, the flip is around the 
selection's center. Otherwise, the coordinate of the axis needs to be specified. The return value is the ID 
of the flipped item. If there was no selection or the item is not a drawable, this will be equal to the item 
ID supplied as input. Otherwise, this will be the newly created and flipped drawable.\n"
+                                     "This procedure flips the specified item.\n"
+                                     "\n"
+                                     "If a selection exists and the item is a drawable, the portion of the 
drawable which lies under the selection is cut from the drawable and made into a floating selection which is 
then flipped. If auto_center is set to TRUE, the flip is around the selection's center. Otherwise, the 
coordinate of the axis needs to be specified. The return value is the ID of the flipped floating selection.\n"
+                                     "\n"
+                                     "If there is no selection or the item is not a drawable, the entire 
item will be flipped around its center if auto_center is set to TRUE, otherwise the coordinate of the axis 
needs to be specified. Additionally, if the item has its linked flag set to TRUE, all additional items 
contained in the image which have the linked flag set to TRUE will also be flipped around the same axis. The 
return value will be equal to the item ID supplied as input.\n"
                                      "\n"
                                      "This procedure is affected by the following context setters: 
'gimp-context-set-transform-resize'.",
                                      "Michael Natterer <mitch gimp org>",
@@ -1021,7 +1094,11 @@ register_item_transform_procs (GimpPDB *pdb)
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-item-transform-flip",
                                      "Flip the specified item around a given line.",
-                                     "This procedure flips the specified item. If a selection exists and the 
item is a drawable , the portion of the drawable which lies under the selection is cut from the drawable and 
made into a floating selection which is then flipped. The axis to flip around is specified by specifying two 
points from that line. The return value is the ID of the flipped item. If there was no selection or the item 
is not a drawable, this will be equal to the item ID supplied as input. Otherwise, this will be the newly 
created and flipped drawable.\n"
+                                     "This procedure flips the specified item.\n"
+                                     "\n"
+                                     "If a selection exists and the item is a drawable, the portion of the 
drawable which lies under the selection is cut from the drawable and made into a floating selection which is 
then flipped. The axis to flip around is specified by specifying two points from that line. The return value 
is the ID of the flipped floating selection.\n"
+                                     "\n"
+                                     "If there is no selection or the item is not a drawable, the entire 
item will be flipped around the specified axis. Additionally, if the item has its linked flag set to TRUE, 
all additional items contained in the image which have the linked flag set to TRUE will also be flipped 
around the same axis. The return value will be equal to the item ID supplied as input.\n"
                                      "\n"
                                      "This procedure is affected by the following context setters: 
'gimp-context-set-interpolation', 'gimp-context-set-transform-direction', 
'gimp-context-set-transform-resize'.",
                                      "Michael Natterer <mitch gimp org>",
@@ -1076,8 +1153,13 @@ register_item_transform_procs (GimpPDB *pdb)
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-item-transform-perspective",
                                      "Perform a possibly non-affine transformation on the specified item.",
-                                     "This procedure performs a possibly non-affine transformation on the 
specified item by allowing the corners of the original bounding box to be arbitrarily remapped to any values. 
The specified item is remapped if no selection exists or it is not a drawable. However, if a selection exists 
and the item is a drawable, the portion of the drawable which lies under the selection is cut from the 
drawable and made into a floating selection which is then remapped as specified. The return value is the ID 
of the remapped item. If there was no selection or the item is not a drawable, this will be equal to the item 
ID supplied as input. Otherwise, this will be the newly created and remapped drawable. The 4 coordinates 
specify the new locations of each corner of the original bounding box. By specifying these values, any affine 
transformation (rotation, scaling, translation) can be affected. Additionally, these values can be specified 
such that the resu
 lting transformed item will appear to have\n"
-                                     "been projected via a perspective transform.\n"
+                                     "This procedure performs a possibly non-affine transformation on the 
specified item by allowing the corners of the original bounding box to be arbitrarily remapped to any 
values.\n"
+                                     "\n"
+                                     "The 4 coordinates specify the new locations of each corner of the 
original bounding box. By specifying these values, any affine transformation (rotation, scaling, translation) 
can be affected. Additionally, these values can be specified such that the resulting transformed item will 
appear to have been projected via a perspective transform.\n"
+                                     "\n"
+                                     "If a selection exists and the item is a drawable, the portion of the 
drawable which lies under the selection is cut from the drawable and made into a floating selection which is 
then transformed as specified. The return value is the ID of the transformed floating selection.\n"
+                                     "\n"
+                                     "If there is no selection or the item is not a drawable, the entire 
item will be transformed according to the specified mapping. Additionally, if the item has its linked flag 
set to TRUE, all additional items contained in the image which have the linked flag set to TRUE will also be 
transformed the same way. The return value will be equal to the item ID supplied as input.\n"
                                      "\n"
                                      "This procedure is affected by the following context setters: 
'gimp-context-set-interpolation', 'gimp-context-set-transform-direction', 
'gimp-context-set-transform-resize'.",
                                      "Michael Natterer <mitch gimp org>",
@@ -1141,7 +1223,7 @@ register_item_transform_procs (GimpPDB *pdb)
   gimp_procedure_add_return_value (procedure,
                                    gimp_param_spec_item_id ("item",
                                                             "item",
-                                                            "The newly mapped item",
+                                                            "The transformed item",
                                                             pdb->gimp, FALSE,
                                                             GIMP_PARAM_READWRITE));
   gimp_pdb_register_procedure (pdb, procedure);
@@ -1156,7 +1238,11 @@ register_item_transform_procs (GimpPDB *pdb)
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-item-transform-rotate-simple",
                                      "Rotate the specified item about given coordinates through the 
specified angle.",
-                                     "This function rotates the specified item. If a selection exists and 
the item is a drawable, the portion of the drawable which lies under the selection is cut from the drawable 
and made into a floating selection which is then rotated by the specified amount. The return value is the ID 
of the rotated item. If there was no selection or the item is not a drawable, this will be equal to the item 
ID supplied as input. Otherwise, this will be the newly created and rotated drawable.\n"
+                                     "This function rotates the specified item.\n"
+                                     "\n"
+                                     "If a selection exists and the item is a drawable, the portion of the 
drawable which lies under the selection is cut from the drawable and made into a floating selection which is 
then rotated by the specified amount. If auto_center is set to TRUE, the rotation is around the selection's 
center. Otherwise, the coordinate of the center point needs to be specified. The return value is the ID of 
the rotated floating selection.\n"
+                                     "\n"
+                                     "If there is no selection or the item is not a drawable, the entire 
item will be rotated around its center if auto_center is set to TRUE, otherwise the coordinate of the center 
point needs to be specified. Additionally, if the item has its linked flag set to TRUE, all additional items 
contained in the image which have the linked flag set to TRUE will also be rotated around the same center 
point. The return value will be equal to the item ID supplied as input.\n"
                                      "\n"
                                      "This procedure is affected by the following context setters: 
'gimp-context-set-transform-resize'.",
                                      "Michael Natterer <mitch gimp org>",
@@ -1212,7 +1298,11 @@ register_item_transform_procs (GimpPDB *pdb)
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-item-transform-rotate",
                                      "Rotate the specified item about given coordinates through the 
specified angle.",
-                                     "This function rotates the specified item. If a selection exists and 
the item is a drawable, the portion of the drawable which lies under the selection is cut from the drawable 
and made into a floating selection which is then rotated by the specified amount. The return value is the ID 
of the rotated item. If there was no selection or the item is not a drawable, this will be equal to the item 
ID supplied as input. Otherwise, this will be the newly created and rotated drawable.\n"
+                                     "This function rotates the specified item.\n"
+                                     "\n"
+                                     "If a selection exists and the item is a drawable, the portion of the 
drawable which lies under the selection is cut from the drawable and made into a floating selection which is 
then rotated by the specified amount. If auto_center is set to TRUE, the rotation is around the selection's 
center. Otherwise, the coordinate of the center point needs to be specified. The return value is the ID of 
the rotated floating selection.\n"
+                                     "\n"
+                                     "If there is no selection or the item is not a drawable, the entire 
item will be rotated around its center if auto_center is set to TRUE, otherwise the coordinate of the center 
point needs to be specified. Additionally, if the item has its linked flag set to TRUE, all additional items 
contained in the image which have the linked flag set to TRUE will also be rotated around the same center 
point. The return value will be equal to the item ID supplied as input.\n"
                                      "\n"
                                      "This procedure is affected by the following context setters: 
'gimp-context-set-interpolation', 'gimp-context-set-transform-direction', 
'gimp-context-set-transform-resize'.",
                                      "Michael Natterer <mitch gimp org>",
@@ -1267,7 +1357,13 @@ register_item_transform_procs (GimpPDB *pdb)
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-item-transform-scale",
                                      "Scale the specified item.",
-                                     "This procedure scales the specified item. If a selection exists and 
the item is a drawable, the portion of the drawable which lies under the selection is cut from the drawable 
and made into a floating selection which is then scaled by the specified amount. The return value is the ID 
of the scaled item. If there was no selection or the item is not a drawable, this will be equal to the item 
ID supplied as input. Otherwise, this will be the newly created and scaled drawable.\n"
+                                     "This procedure scales the specified item.\n"
+                                     "\n"
+                                     "The 2 coordinates specify the new locations of the top-left and 
bottom-roght corners of the original bounding box.\n"
+                                     "\n"
+                                     "If a selection exists and the item is a drawable, the portion of the 
drawable which lies under the selection is cut from the drawable and made into a floating selection which is 
then scaled as specified. The return value is the ID of the scaled floating selection.\n"
+                                     "\n"
+                                     "If there is no selection or the item is not a drawable, the entire 
item will be scaled according to the specified coordinates. Additionally, if the item has its linked flag set 
to TRUE, all additional items contained in the image which have the linked flag set to TRUE will also be 
scaled the same way. The return value will be equal to the item ID supplied as input.\n"
                                      "\n"
                                      "This procedure is affected by the following context setters: 
'gimp-context-set-interpolation', 'gimp-context-set-transform-direction', 
'gimp-context-set-transform-resize'.",
                                      "Michael Natterer <mitch gimp org>",
@@ -1322,7 +1418,13 @@ register_item_transform_procs (GimpPDB *pdb)
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-item-transform-shear",
                                      "Shear the specified item about its center by the specified magnitude.",
-                                     "This procedure shears the specified item. If a selection exists and 
the item is a drawable, the portion of the drawable which lies under the selection is cut from the drawable 
and made into a floating selection which is then sheard by the specified amount. The return value is the ID 
of the sheard item. If there was no selection or the item is not a drawable, this will be equal to the item 
ID supplied as input. Otherwise, this will be the newly created and sheard drawable. The shear type parameter 
indicates whether the shear will be applied horizontally or vertically. The magnitude can be either positive 
or negative and indicates the extent (in pixels) to shear by.\n"
+                                     "This procedure shears the specified item.\n"
+                                     "\n"
+                                     "The shear type parameter indicates whether the shear will be applied 
horizontally or vertically. The magnitude can be either positive or negative and indicates the extent (in 
pixels) to shear by.\n"
+                                     "\n"
+                                     "If a selection exists and the item is a drawable, the portion of the 
drawable which lies under the selection is cut from the drawable and made into a floating selection which is 
then sheared as specified. The return value is the ID of the sheared floating selection.\n"
+                                     "\n"
+                                     "If there is no selection or the item is not a drawable, the entire 
item will be sheared according to the specified parameters. Additionally, if the item has its linked flag set 
to TRUE, all additional items contained in the image which have the linked flag set to TRUE will also be 
sheared the same way. The return value will be equal to the item ID supplied as input.\n"
                                      "\n"
                                      "This procedure is affected by the following context setters: 
'gimp-context-set-interpolation', 'gimp-context-set-transform-direction', 
'gimp-context-set-transform-resize'.",
                                      "Michael Natterer <mitch gimp org>",
@@ -1368,7 +1470,13 @@ register_item_transform_procs (GimpPDB *pdb)
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-item-transform-2d",
                                      "Transform the specified item in 2d.",
-                                     "This procedure transforms the specified item. If a selection exists 
and the item is a drawable, the portion of the drawable which lies under the selection is cut from the 
drawable and made into a floating selection which is then transformed. The transformation is done by scaling 
the image by the x and y scale factors about the point (source_x, source_y), then rotating around the same 
point, then translating that point to the new position (dest_x, dest_y). The return value is the ID of the 
rotated drawable. If there was no selection or the item is not a drawable, this will be equal to the item ID 
supplied as input. Otherwise, this will be the newly created and transformed drawable.\n"
+                                     "This procedure transforms the specified item.\n"
+                                     "\n"
+                                     "The transformation is done by scaling by the x and y scale factors 
about the point (source_x, source_y), then rotating around the same point, then translating that point to the 
new position (dest_x, dest_y).\n"
+                                     "\n"
+                                     "If a selection exists and the item is a drawable, the portion of the 
drawable which lies under the selection is cut from the drawable and made into a floating selection which is 
then transformed as specified. The return value is the ID of the transformed floating selection.\n"
+                                     "\n"
+                                     "If there is no selection or the item is not a drawable, the entire 
item will be transformed according to the specified parameters. Additionally, if the item has its linked flag 
set to TRUE, all additional items contained in the image which have the linked flag set to TRUE will also be 
transformed the same way. The return value will be equal to the item ID supplied as input.\n"
                                      "\n"
                                      "This procedure is affected by the following context setters: 
'gimp-context-set-interpolation', 'gimp-context-set-transform-direction', 
'gimp-context-set-transform-resize'.",
                                      "Michael Natterer <mitch gimp org>",
@@ -1441,7 +1549,13 @@ register_item_transform_procs (GimpPDB *pdb)
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-item-transform-matrix",
                                      "Transform the specified item in 2d.",
-                                     "This procedure transforms the specified item. If a selection exists 
and the item is a drawable, the portion of the drawable which lies under the selection is cut from the 
drawable and made into a floating selection which is then transformed. The transformation is done by 
assembling a 3x3 matrix from the coefficients passed. The return value is the ID of the transformed item. If 
there was no selection or the item is not a drawable, this will be equal to the item ID supplied as input. 
Otherwise, this will be the newly created and transformed drawable.\n"
+                                     "This procedure transforms the specified item.\n"
+                                     "\n"
+                                     "The transformation is done by assembling a 3x3 matrix from the 
coefficients passed.\n"
+                                     "\n"
+                                     "If a selection exists and the item is a drawable, the portion of the 
drawable which lies under the selection is cut from the drawable and made into a floating selection which is 
then transformed as specified. The return value is the ID of the transformed floating selection.\n"
+                                     "\n"
+                                     "If there is no selection or the item is not a drawable, the entire 
item will be transformed according to the specified matrix. Additionally, if the item has its linked flag set 
to TRUE, all additional items contained in the image which have the linked flag set to TRUE will also be 
transformed the same way. The return value will be equal to the item ID supplied as input.\n"
                                      "\n"
                                      "This procedure is affected by the following context setters: 
'gimp-context-set-interpolation', 'gimp-context-set-transform-direction', 
'gimp-context-set-transform-resize'.",
                                      "Michael Natterer <mitch gimp org>",
diff --git a/libgimp/gimpitemtransform_pdb.c b/libgimp/gimpitemtransform_pdb.c
index 9362910..376d123 100644
--- a/libgimp/gimpitemtransform_pdb.c
+++ b/libgimp/gimpitemtransform_pdb.c
@@ -89,15 +89,22 @@ gimp_item_transform_translate (gint32  item_ID,
  *
  * Flip the specified item either vertically or horizontally.
  *
- * This procedure flips the specified item. If a selection exists and
- * the item is a drawable, the portion of the drawable which lies under
- * the selection is cut from the drawable and made into a floating
- * selection which is then flipped. If auto_center is set to TRUE, the
- * flip is around the selection's center. Otherwise, the coordinate of
- * the axis needs to be specified. The return value is the ID of the
- * flipped item. If there was no selection or the item is not a
- * drawable, this will be equal to the item ID supplied as input.
- * Otherwise, this will be the newly created and flipped drawable.
+ * This procedure flips the specified item.
+ *
+ * If a selection exists and the item is a drawable, the portion of the
+ * drawable which lies under the selection is cut from the drawable and
+ * made into a floating selection which is then flipped. If auto_center
+ * is set to TRUE, the flip is around the selection's center.
+ * Otherwise, the coordinate of the axis needs to be specified. The
+ * return value is the ID of the flipped floating selection.
+ *
+ * If there is no selection or the item is not a drawable, the entire
+ * item will be flipped around its center if auto_center is set to
+ * TRUE, otherwise the coordinate of the axis needs to be specified.
+ * Additionally, if the item has its linked flag set to TRUE, all
+ * additional items contained in the image which have the linked flag
+ * set to TRUE will also be flipped around the same axis. The return
+ * value will be equal to the item ID supplied as input.
  *
  * This procedure is affected by the following context setters:
  * gimp_context_set_transform_resize().
@@ -142,15 +149,20 @@ gimp_item_transform_flip_simple (gint32              item_ID,
  *
  * Flip the specified item around a given line.
  *
- * This procedure flips the specified item. If a selection exists and
- * the item is a drawable , the portion of the drawable which lies
- * under the selection is cut from the drawable and made into a
- * floating selection which is then flipped. The axis to flip around is
- * specified by specifying two points from that line. The return value
- * is the ID of the flipped item. If there was no selection or the item
- * is not a drawable, this will be equal to the item ID supplied as
- * input. Otherwise, this will be the newly created and flipped
- * drawable.
+ * This procedure flips the specified item.
+ *
+ * If a selection exists and the item is a drawable, the portion of the
+ * drawable which lies under the selection is cut from the drawable and
+ * made into a floating selection which is then flipped. The axis to
+ * flip around is specified by specifying two points from that line.
+ * The return value is the ID of the flipped floating selection.
+ *
+ * If there is no selection or the item is not a drawable, the entire
+ * item will be flipped around the specified axis. Additionally, if the
+ * item has its linked flag set to TRUE, all additional items contained
+ * in the image which have the linked flag set to TRUE will also be
+ * flipped around the same axis. The return value will be equal to the
+ * item ID supplied as input.
  *
  * This procedure is affected by the following context setters:
  * gimp_context_set_interpolation(),
@@ -205,27 +217,34 @@ gimp_item_transform_flip (gint32  item_ID,
  *
  * This procedure performs a possibly non-affine transformation on the
  * specified item by allowing the corners of the original bounding box
- * to be arbitrarily remapped to any values. The specified item is
- * remapped if no selection exists or it is not a drawable. However, if
- * a selection exists and the item is a drawable, the portion of the
+ * to be arbitrarily remapped to any values.
+ *
+ * The 4 coordinates specify the new locations of each corner of the
+ * original bounding box. By specifying these values, any affine
+ * transformation (rotation, scaling, translation) can be affected.
+ * Additionally, these values can be specified such that the resulting
+ * transformed item will appear to have been projected via a
+ * perspective transform.
+ *
+ * If a selection exists and the item is a drawable, the portion of the
  * drawable which lies under the selection is cut from the drawable and
- * made into a floating selection which is then remapped as specified.
- * The return value is the ID of the remapped item. If there was no
- * selection or the item is not a drawable, this will be equal to the
- * item ID supplied as input. Otherwise, this will be the newly created
- * and remapped drawable. The 4 coordinates specify the new locations
- * of each corner of the original bounding box. By specifying these
- * values, any affine transformation (rotation, scaling, translation)
- * can be affected. Additionally, these values can be specified such
- * that the resulting transformed item will appear to have been
- * projected via a perspective transform.
+ * made into a floating selection which is then transformed as
+ * specified. The return value is the ID of the transformed floating
+ * selection.
+ *
+ * If there is no selection or the item is not a drawable, the entire
+ * item will be transformed according to the specified mapping.
+ * Additionally, if the item has its linked flag set to TRUE, all
+ * additional items contained in the image which have the linked flag
+ * set to TRUE will also be transformed the same way. The return value
+ * will be equal to the item ID supplied as input.
  *
  * This procedure is affected by the following context setters:
  * gimp_context_set_interpolation(),
  * gimp_context_set_transform_direction(),
  * gimp_context_set_transform_resize().
  *
- * Returns: The newly mapped item.
+ * Returns: The transformed item.
  *
  * Since: 2.8
  **/
@@ -276,14 +295,24 @@ gimp_item_transform_perspective (gint32  item_ID,
  * Rotate the specified item about given coordinates through the
  * specified angle.
  *
- * This function rotates the specified item. If a selection exists and
- * the item is a drawable, the portion of the drawable which lies under
- * the selection is cut from the drawable and made into a floating
- * selection which is then rotated by the specified amount. The return
- * value is the ID of the rotated item. If there was no selection or
- * the item is not a drawable, this will be equal to the item ID
- * supplied as input. Otherwise, this will be the newly created and
- * rotated drawable.
+ * This function rotates the specified item.
+ *
+ * If a selection exists and the item is a drawable, the portion of the
+ * drawable which lies under the selection is cut from the drawable and
+ * made into a floating selection which is then rotated by the
+ * specified amount. If auto_center is set to TRUE, the rotation is
+ * around the selection's center. Otherwise, the coordinate of the
+ * center point needs to be specified. The return value is the ID of
+ * the rotated floating selection.
+ *
+ * If there is no selection or the item is not a drawable, the entire
+ * item will be rotated around its center if auto_center is set to
+ * TRUE, otherwise the coordinate of the center point needs to be
+ * specified. Additionally, if the item has its linked flag set to
+ * TRUE, all additional items contained in the image which have the
+ * linked flag set to TRUE will also be rotated around the same center
+ * point. The return value will be equal to the item ID supplied as
+ * input.
  *
  * This procedure is affected by the following context setters:
  * gimp_context_set_transform_resize().
@@ -331,14 +360,24 @@ gimp_item_transform_rotate_simple (gint32           item_ID,
  * Rotate the specified item about given coordinates through the
  * specified angle.
  *
- * This function rotates the specified item. If a selection exists and
- * the item is a drawable, the portion of the drawable which lies under
- * the selection is cut from the drawable and made into a floating
- * selection which is then rotated by the specified amount. The return
- * value is the ID of the rotated item. If there was no selection or
- * the item is not a drawable, this will be equal to the item ID
- * supplied as input. Otherwise, this will be the newly created and
- * rotated drawable.
+ * This function rotates the specified item.
+ *
+ * If a selection exists and the item is a drawable, the portion of the
+ * drawable which lies under the selection is cut from the drawable and
+ * made into a floating selection which is then rotated by the
+ * specified amount. If auto_center is set to TRUE, the rotation is
+ * around the selection's center. Otherwise, the coordinate of the
+ * center point needs to be specified. The return value is the ID of
+ * the rotated floating selection.
+ *
+ * If there is no selection or the item is not a drawable, the entire
+ * item will be rotated around its center if auto_center is set to
+ * TRUE, otherwise the coordinate of the center point needs to be
+ * specified. Additionally, if the item has its linked flag set to
+ * TRUE, all additional items contained in the image which have the
+ * linked flag set to TRUE will also be rotated around the same center
+ * point. The return value will be equal to the item ID supplied as
+ * input.
  *
  * This procedure is affected by the following context setters:
  * gimp_context_set_interpolation(),
@@ -387,14 +426,22 @@ gimp_item_transform_rotate (gint32   item_ID,
  *
  * Scale the specified item.
  *
- * This procedure scales the specified item. If a selection exists and
- * the item is a drawable, the portion of the drawable which lies under
- * the selection is cut from the drawable and made into a floating
- * selection which is then scaled by the specified amount. The return
- * value is the ID of the scaled item. If there was no selection or the
- * item is not a drawable, this will be equal to the item ID supplied
- * as input. Otherwise, this will be the newly created and scaled
- * drawable.
+ * This procedure scales the specified item.
+ *
+ * The 2 coordinates specify the new locations of the top-left and
+ * bottom-roght corners of the original bounding box.
+ *
+ * If a selection exists and the item is a drawable, the portion of the
+ * drawable which lies under the selection is cut from the drawable and
+ * made into a floating selection which is then scaled as specified.
+ * The return value is the ID of the scaled floating selection.
+ *
+ * If there is no selection or the item is not a drawable, the entire
+ * item will be scaled according to the specified coordinates.
+ * Additionally, if the item has its linked flag set to TRUE, all
+ * additional items contained in the image which have the linked flag
+ * set to TRUE will also be scaled the same way. The return value will
+ * be equal to the item ID supplied as input.
  *
  * This procedure is affected by the following context setters:
  * gimp_context_set_interpolation(),
@@ -442,17 +489,23 @@ gimp_item_transform_scale (gint32  item_ID,
  * Shear the specified item about its center by the specified
  * magnitude.
  *
- * This procedure shears the specified item. If a selection exists and
- * the item is a drawable, the portion of the drawable which lies under
- * the selection is cut from the drawable and made into a floating
- * selection which is then sheard by the specified amount. The return
- * value is the ID of the sheard item. If there was no selection or the
- * item is not a drawable, this will be equal to the item ID supplied
- * as input. Otherwise, this will be the newly created and sheard
- * drawable. The shear type parameter indicates whether the shear will
- * be applied horizontally or vertically. The magnitude can be either
- * positive or negative and indicates the extent (in pixels) to shear
- * by.
+ * This procedure shears the specified item.
+ *
+ * The shear type parameter indicates whether the shear will be applied
+ * horizontally or vertically. The magnitude can be either positive or
+ * negative and indicates the extent (in pixels) to shear by.
+ *
+ * If a selection exists and the item is a drawable, the portion of the
+ * drawable which lies under the selection is cut from the drawable and
+ * made into a floating selection which is then sheared as specified.
+ * The return value is the ID of the sheared floating selection.
+ *
+ * If there is no selection or the item is not a drawable, the entire
+ * item will be sheared according to the specified parameters.
+ * Additionally, if the item has its linked flag set to TRUE, all
+ * additional items contained in the image which have the linked flag
+ * set to TRUE will also be sheared the same way. The return value will
+ * be equal to the item ID supplied as input.
  *
  * This procedure is affected by the following context setters:
  * gimp_context_set_interpolation(),
@@ -500,17 +553,25 @@ gimp_item_transform_shear (gint32              item_ID,
  *
  * Transform the specified item in 2d.
  *
- * This procedure transforms the specified item. If a selection exists
- * and the item is a drawable, the portion of the drawable which lies
- * under the selection is cut from the drawable and made into a
- * floating selection which is then transformed. The transformation is
- * done by scaling the image by the x and y scale factors about the
- * point (source_x, source_y), then rotating around the same point,
- * then translating that point to the new position (dest_x, dest_y).
- * The return value is the ID of the rotated drawable. If there was no
- * selection or the item is not a drawable, this will be equal to the
- * item ID supplied as input. Otherwise, this will be the newly created
- * and transformed drawable.
+ * This procedure transforms the specified item.
+ *
+ * The transformation is done by scaling by the x and y scale factors
+ * about the point (source_x, source_y), then rotating around the same
+ * point, then translating that point to the new position (dest_x,
+ * dest_y).
+ *
+ * If a selection exists and the item is a drawable, the portion of the
+ * drawable which lies under the selection is cut from the drawable and
+ * made into a floating selection which is then transformed as
+ * specified. The return value is the ID of the transformed floating
+ * selection.
+ *
+ * If there is no selection or the item is not a drawable, the entire
+ * item will be transformed according to the specified parameters.
+ * Additionally, if the item has its linked flag set to TRUE, all
+ * additional items contained in the image which have the linked flag
+ * set to TRUE will also be transformed the same way. The return value
+ * will be equal to the item ID supplied as input.
  *
  * This procedure is affected by the following context setters:
  * gimp_context_set_interpolation(),
@@ -570,15 +631,23 @@ gimp_item_transform_2d (gint32  item_ID,
  *
  * Transform the specified item in 2d.
  *
- * This procedure transforms the specified item. If a selection exists
- * and the item is a drawable, the portion of the drawable which lies
- * under the selection is cut from the drawable and made into a
- * floating selection which is then transformed. The transformation is
- * done by assembling a 3x3 matrix from the coefficients passed. The
- * return value is the ID of the transformed item. If there was no
- * selection or the item is not a drawable, this will be equal to the
- * item ID supplied as input. Otherwise, this will be the newly created
- * and transformed drawable.
+ * This procedure transforms the specified item.
+ *
+ * The transformation is done by assembling a 3x3 matrix from the
+ * coefficients passed.
+ *
+ * If a selection exists and the item is a drawable, the portion of the
+ * drawable which lies under the selection is cut from the drawable and
+ * made into a floating selection which is then transformed as
+ * specified. The return value is the ID of the transformed floating
+ * selection.
+ *
+ * If there is no selection or the item is not a drawable, the entire
+ * item will be transformed according to the specified matrix.
+ * Additionally, if the item has its linked flag set to TRUE, all
+ * additional items contained in the image which have the linked flag
+ * set to TRUE will also be transformed the same way. The return value
+ * will be equal to the item ID supplied as input.
  *
  * This procedure is affected by the following context setters:
  * gimp_context_set_interpolation(),
diff --git a/pdb/groups/item_transform.pdb b/pdb/groups/item_transform.pdb
index 8267ebb..59d59ad 100644
--- a/pdb/groups/item_transform.pdb
+++ b/pdb/groups/item_transform.pdb
@@ -79,6 +79,14 @@ $assemble_matrix
           else
             success = FALSE;
         }
+      else if (gimp_item_get_linked (item))
+        {
+          gimp_item_linked_transform (item, context, &matrix,
+                                      pdb_context->transform_direction,
+                                      pdb_context->interpolation,
+                                      pdb_context->transform_resize,
+                                      progress);
+        }
       else
         {
           gimp_item_transform (item, context, &matrix,
@@ -158,15 +166,24 @@ Flip the specified item either vertically or horizontally.
 BLURB
 
     $help = <<'HELP';
-This procedure flips the specified item. If a selection exists and the
-item is a drawable, the portion of the drawable which lies under the
-selection is cut from the drawable and made into a floating selection
-which is then flipped. If auto_center is set to TRUE, the flip is
-around the selection's center. Otherwise, the coordinate of the axis
-needs to be specified. The return value is the ID of the flipped
-item. If there was no selection or the item is not a drawable, this
-will be equal to the item ID supplied as input.  Otherwise, this will
-be the newly created and flipped drawable.
+This procedure flips the specified item.
+
+
+If a selection exists and the item is a drawable, the portion of the
+drawable which lies under the selection is cut from the drawable and
+made into a floating selection which is then flipped. If auto_center
+is set to TRUE, the flip is around the selection's center. Otherwise,
+the coordinate of the axis needs to be specified. The return value is
+the ID of the flipped floating selection.
+
+
+If there is no selection or the item is not a drawable, the entire
+item will be flipped around its center if auto_center is set to TRUE,
+otherwise the coordinate of the axis needs to be specified.
+Additionally, if the item has its linked flag set to TRUE, all
+additional items contained in the image which have the linked flag set
+to TRUE will also be flipped around the same axis. The return value
+will be equal to the item ID supplied as input.
 
 
 This procedure is affected by the following context setters:
@@ -229,6 +246,12 @@ HELP
           else
             success = FALSE;
         }
+      else if (gimp_item_get_linked (item))
+        {
+          gimp_item_linked_flip (item, context,
+                                 flip_type, axis,
+                                 pdb_context->transform_resize);
+        }
       else
         {
           gimp_item_flip (item, context,
@@ -248,14 +271,22 @@ Flip the specified item around a given line.
 BLURB
 
     $help = <<'HELP';
-This procedure flips the specified item. If a selection exists and the
-item is a drawable , the portion of the drawable which lies under the
-selection is cut from the drawable and made into a floating selection
-which is then flipped. The axis to flip around is specified by
-specifying two points from that line. The return value is the ID of
-the flipped item. If there was no selection or the item is not a
-drawable, this will be equal to the item ID supplied as input.
-Otherwise, this will be the newly created and flipped drawable.
+This procedure flips the specified item.
+
+
+If a selection exists and the item is a drawable, the portion of the
+drawable which lies under the selection is cut from the drawable and
+made into a floating selection which is then flipped. The axis to flip
+around is specified by specifying two points from that line. The
+return value is the ID of the flipped floating selection.
+
+
+If there is no selection or the item is not a drawable, the entire
+item will be flipped around the specified axis. Additionally, if the
+item has its linked flag set to TRUE, all additional items contained
+in the image which have the linked flag set to TRUE will also be
+flipped around the same axis. The return value will be equal to the
+item ID supplied as input.
 
 
 This procedure is affected by the following context setters:
@@ -298,20 +329,29 @@ BLURB
     $help = <<'HELP';
 This procedure performs a possibly non-affine transformation on the
 specified item by allowing the corners of the original bounding box to
-be arbitrarily remapped to any values. The specified item is remapped
-if no selection exists or it is not a drawable. However, if a
-selection exists and the item is a drawable, the portion of the
+be arbitrarily remapped to any values.
+
+
+The 4 coordinates specify the new locations of each corner of the
+original bounding box. By specifying these values, any affine
+transformation (rotation, scaling, translation) can be affected.
+Additionally, these values can be specified such that the resulting
+transformed item will appear to have been projected via a perspective
+transform.
+
+
+If a selection exists and the item is a drawable, the portion of the
 drawable which lies under the selection is cut from the drawable and
-made into a floating selection which is then remapped as
-specified. The return value is the ID of the remapped item. If there
-was no selection or the item is not a drawable, this will be equal to
-the item ID supplied as input. Otherwise, this will be the newly
-created and remapped drawable. The 4 coordinates specify the new
-locations of each corner of the original bounding box. By specifying
-these values, any affine transformation (rotation, scaling,
-translation) can be affected. Additionally, these values can be
-specified such that the resulting transformed item will appear to
-have been projected via a perspective transform.
+made into a floating selection which is then transformed as specified.
+The return value is the ID of the transformed floating selection.
+
+
+If there is no selection or the item is not a drawable, the entire
+item will be transformed according to the specified mapping.
+Additionally, if the item has its linked flag set to TRUE, all
+additional items contained in the image which have the linked flag set
+to TRUE will also be transformed the same way. The return value will be
+equal to the item ID supplied as input.
 
 
 This procedure is affected by the following context setters:
@@ -352,7 +392,7 @@ HELP
 
     @outargs = (
        { name => 'item', type => 'item', no_declare => 1,
-         desc => 'The newly mapped item' }
+         desc => 'The transformed item' }
     );
 
     transform_invoke ("Perspective", <<CODE);
@@ -371,13 +411,25 @@ Rotate the specified item about given coordinates through the specified angle.
 BLURB
 
     $help = <<'HELP';
-This function rotates the specified item. If a selection exists and
-the item is a drawable, the portion of the drawable which lies under
-the selection is cut from the drawable and made into a floating
-selection which is then rotated by the specified amount. The return
-value is the ID of the rotated item. If there was no selection or the
-item is not a drawable, this will be equal to the item ID supplied as
-input. Otherwise, this will be the newly created and rotated drawable.
+This function rotates the specified item.
+
+
+If a selection exists and the item is a drawable, the portion of the
+drawable which lies under the selection is cut from the drawable and
+made into a floating selection which is then rotated by the specified
+amount. If auto_center is set to TRUE, the rotation is around the
+selection's center. Otherwise, the coordinate of the center point
+needs to be specified. The return value is the ID of the rotated
+floating selection.
+
+
+If there is no selection or the item is not a drawable, the entire
+item will be rotated around its center if auto_center is set to TRUE,
+otherwise the coordinate of the center point needs to be specified.
+Additionally, if the item has its linked flag set to TRUE, all
+additional items contained in the image which have the linked flag set
+to TRUE will also be rotated around the same center point. The return
+value will be equal to the item ID supplied as input.
 
 
 This procedure is affected by the following context setters:
@@ -443,6 +495,13 @@ HELP
           else
             success = FALSE;
         }
+      else if (gimp_item_get_linked (item))
+        {
+          gimp_item_linked_rotate (item, context,
+                                   rotate_type,
+                                   center_x, center_y,
+                                   pdb_context->transform_resize);
+        }
       else
         {
           gimp_item_rotate (item, context,
@@ -464,13 +523,25 @@ specified angle.
 BLURB
 
     $help = <<'HELP';
-This function rotates the specified item. If a selection exists and
-the item is a drawable, the portion of the drawable which lies under
-the selection is cut from the drawable and made into a floating
-selection which is then rotated by the specified amount. The return
-value is the ID of the rotated item. If there was no selection or the
-item is not a drawable, this will be equal to the item ID supplied as
-input. Otherwise, this will be the newly created and rotated drawable.
+This function rotates the specified item.
+
+
+If a selection exists and the item is a drawable, the portion of the
+drawable which lies under the selection is cut from the drawable and
+made into a floating selection which is then rotated by the specified
+amount. If auto_center is set to TRUE, the rotation is around the
+selection's center. Otherwise, the coordinate of the center point
+needs to be specified. The return value is the ID of the rotated
+floating selection.
+
+
+If there is no selection or the item is not a drawable, the entire
+item will be rotated around its center if auto_center is set to TRUE,
+otherwise the coordinate of the center point needs to be specified.
+Additionally, if the item has its linked flag set to TRUE, all
+additional items contained in the image which have the linked flag set
+to TRUE will also be rotated around the same center point. The return
+value will be equal to the item ID supplied as input.
 
 
 This procedure is affected by the following context setters:
@@ -514,13 +585,25 @@ sub item_transform_scale {
     $blurb = 'Scale the specified item.';
 
     $help = <<'HELP';
-This procedure scales the specified item. If a selection exists and
-the item is a drawable, the portion of the drawable which lies under
-the selection is cut from the drawable and made into a floating
-selection which is then scaled by the specified amount. The return
-value is the ID of the scaled item. If there was no selection or the
-item is not a drawable, this will be equal to the item ID supplied as
-input. Otherwise, this will be the newly created and scaled drawable.
+This procedure scales the specified item.
+
+
+The 2 coordinates specify the new locations of the top-left and
+bottom-roght corners of the original bounding box.
+
+
+If a selection exists and the item is a drawable, the portion of the
+drawable which lies under the selection is cut from the drawable and
+made into a floating selection which is then scaled as specified.  The
+return value is the ID of the scaled floating selection.
+
+
+If there is no selection or the item is not a drawable, the entire
+item will be scaled according to the specified coordinates.
+Additionally, if the item has its linked flag set to TRUE, all
+additional items contained in the image which have the linked flag set
+to TRUE will also be scaled the same way. The return value will be
+equal to the item ID supplied as input.
 
 
 This procedure is affected by the following context setters:
@@ -567,16 +650,26 @@ Shear the specified item about its center by the specified magnitude.
 BLURB
 
     $help = <<'HELP';
-This procedure shears the specified item. If a selection exists and
-the item is a drawable, the portion of the drawable which lies under
-the selection is cut from the drawable and made into a floating
-selection which is then sheard by the specified amount. The return
-value is the ID of the sheard item. If there was no selection or the
-item is not a drawable, this will be equal to the item ID supplied as
-input. Otherwise, this will be the newly created and sheard
-drawable. The shear type parameter indicates whether the shear will be
-applied horizontally or vertically. The magnitude can be either
-positive or negative and indicates the extent (in pixels) to shear by.
+This procedure shears the specified item.
+
+
+The shear type parameter indicates whether the shear will be applied
+horizontally or vertically. The magnitude can be either positive or
+negative and indicates the extent (in pixels) to shear by.
+
+
+If a selection exists and the item is a drawable, the portion of the
+drawable which lies under the selection is cut from the drawable and
+made into a floating selection which is then sheared as specified.
+The return value is the ID of the sheared floating selection.
+
+
+If there is no selection or the item is not a drawable, the entire
+item will be sheared according to the specified parameters.
+Additionally, if the item has its linked flag set to TRUE, all
+additional items contained in the image which have the linked flag set
+to TRUE will also be sheared the same way. The return value will be
+equal to the item ID supplied as input.
 
 
 This procedure is affected by the following context setters:
@@ -614,17 +707,27 @@ sub item_transform_2d {
     $blurb = 'Transform the specified item in 2d.';
 
     $help = <<'HELP';
-This procedure transforms the specified item. If a selection exists
-and the item is a drawable, the portion of the drawable which lies
-under the selection is cut from the drawable and made into a floating
-selection which is then transformed. The transformation is done by
-scaling the image by the x and y scale factors about the point
-(source_x, source_y), then rotating around the same point, then
-translating that point to the new position (dest_x, dest_y). The
-return value is the ID of the rotated drawable. If there was no
-selection or the item is not a drawable, this will be equal to the
-item ID supplied as input. Otherwise, this will be the newly created
-and transformed drawable.
+This procedure transforms the specified item.
+
+
+The transformation is done by scaling by the x and y scale factors
+about the point (source_x, source_y), then rotating around the same
+point, then translating that point to the new position (dest_x,
+dest_y).
+
+
+If a selection exists and the item is a drawable, the portion of the
+drawable which lies under the selection is cut from the drawable and
+made into a floating selection which is then transformed as specified.
+The return value is the ID of the transformed floating selection.
+
+
+If there is no selection or the item is not a drawable, the entire
+item will be transformed according to the specified parameters.
+Additionally, if the item has its linked flag set to TRUE, all
+additional items contained in the image which have the linked flag set
+to TRUE will also be transformed the same way. The return value will
+be equal to the item ID supplied as input.
 
 
 This procedure is affected by the following context setters:
@@ -672,15 +775,25 @@ sub item_transform_matrix {
     $blurb = 'Transform the specified item in 2d.';
 
     $help = <<'HELP';
-This procedure transforms the specified item. If a selection exists
-and the item is a drawable, the portion of the drawable which lies
-under the selection is cut from the drawable and made into a floating
-selection which is then transformed. The transformation is done by
-assembling a 3x3 matrix from the coefficients passed.  The return
-value is the ID of the transformed item. If there was no selection or
-the item is not a drawable, this will be equal to the item ID supplied
-as input. Otherwise, this will be the newly created and transformed
-drawable.
+This procedure transforms the specified item.
+
+
+The transformation is done by assembling a 3x3 matrix from the
+coefficients passed.
+
+
+If a selection exists and the item is a drawable, the portion of the
+drawable which lies under the selection is cut from the drawable and
+made into a floating selection which is then transformed as specified.
+The return value is the ID of the transformed floating selection.
+
+
+If there is no selection or the item is not a drawable, the entire
+item will be transformed according to the specified matrix.
+Additionally, if the item has its linked flag set to TRUE, all
+additional items contained in the image which have the linked flag set
+to TRUE will also be transformed the same way. The return value will
+be equal to the item ID supplied as input.
 
 
 This procedure is affected by the following context setters:


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