[gimp] app, libgimp, pdb: removing gimp_image_(g|s)et_active_*() functions.



commit a6aba929dc7f864d00ef43aa4884afd2943d1605
Author: Jehan <jehan girinstud io>
Date:   Tue Jul 19 22:49:10 2022 +0200

    app, libgimp, pdb: removing gimp_image_(g|s)et_active_*() functions.
    
    We now have a concept of multiple drawables selectable in GIMP.
    Therefore let's get rid of the old single active concept.

 app/pdb/image-cmds.c     | 394 -----------------------------------------------
 app/pdb/internal-procs.c |   2 +-
 libgimp/gimp.def         |   7 -
 libgimp/gimpimage_pdb.c  | 258 -------------------------------
 libgimp/gimpimage_pdb.h  |  10 --
 pdb/groups/image.pdb     | 206 -------------------------
 6 files changed, 1 insertion(+), 876 deletions(-)
---
diff --git a/app/pdb/image-cmds.c b/app/pdb/image-cmds.c
index 6279fb21d9..aba92be6a7 100644
--- a/app/pdb/image-cmds.c
+++ b/app/pdb/image-cmds.c
@@ -553,35 +553,6 @@ image_get_vectors_invoker (GimpProcedure         *procedure,
   return return_vals;
 }
 
-static GimpValueArray *
-image_get_active_drawable_invoker (GimpProcedure         *procedure,
-                                   Gimp                  *gimp,
-                                   GimpContext           *context,
-                                   GimpProgress          *progress,
-                                   const GimpValueArray  *args,
-                                   GError               **error)
-{
-  gboolean success = TRUE;
-  GimpValueArray *return_vals;
-  GimpImage *image;
-  GimpDrawable *drawable = NULL;
-
-  image = g_value_get_object (gimp_value_array_index (args, 0));
-
-  if (success)
-    {
-      drawable = gimp_image_get_active_drawable (image);
-    }
-
-  return_vals = gimp_procedure_get_return_values (procedure, success,
-                                                  error ? *error : NULL);
-
-  if (success)
-    g_value_set_object (gimp_value_array_index (return_vals, 1), drawable);
-
-  return return_vals;
-}
-
 static GimpValueArray *
 image_unset_active_channel_invoker (GimpProcedure         *procedure,
                                     Gimp                  *gimp,
@@ -1786,168 +1757,6 @@ image_thumbnail_invoker (GimpProcedure         *procedure,
   return return_vals;
 }
 
-static GimpValueArray *
-image_get_active_layer_invoker (GimpProcedure         *procedure,
-                                Gimp                  *gimp,
-                                GimpContext           *context,
-                                GimpProgress          *progress,
-                                const GimpValueArray  *args,
-                                GError               **error)
-{
-  gboolean success = TRUE;
-  GimpValueArray *return_vals;
-  GimpImage *image;
-  GimpLayer *active_layer = NULL;
-
-  image = g_value_get_object (gimp_value_array_index (args, 0));
-
-  if (success)
-    {
-      active_layer = gimp_image_get_active_layer (image);
-    }
-
-  return_vals = gimp_procedure_get_return_values (procedure, success,
-                                                  error ? *error : NULL);
-
-  if (success)
-    g_value_set_object (gimp_value_array_index (return_vals, 1), active_layer);
-
-  return return_vals;
-}
-
-static GimpValueArray *
-image_set_active_layer_invoker (GimpProcedure         *procedure,
-                                Gimp                  *gimp,
-                                GimpContext           *context,
-                                GimpProgress          *progress,
-                                const GimpValueArray  *args,
-                                GError               **error)
-{
-  gboolean success = TRUE;
-  GimpImage *image;
-  GimpLayer *active_layer;
-
-  image = g_value_get_object (gimp_value_array_index (args, 0));
-  active_layer = g_value_get_object (gimp_value_array_index (args, 1));
-
-  if (success)
-    {
-      if (gimp_image_set_active_layer (image, active_layer) != active_layer)
-        success = FALSE;
-    }
-
-  return gimp_procedure_get_return_values (procedure, success,
-                                           error ? *error : NULL);
-}
-
-static GimpValueArray *
-image_get_active_channel_invoker (GimpProcedure         *procedure,
-                                  Gimp                  *gimp,
-                                  GimpContext           *context,
-                                  GimpProgress          *progress,
-                                  const GimpValueArray  *args,
-                                  GError               **error)
-{
-  gboolean success = TRUE;
-  GimpValueArray *return_vals;
-  GimpImage *image;
-  GimpChannel *active_channel = NULL;
-
-  image = g_value_get_object (gimp_value_array_index (args, 0));
-
-  if (success)
-    {
-      active_channel = gimp_image_get_active_channel (image);
-    }
-
-  return_vals = gimp_procedure_get_return_values (procedure, success,
-                                                  error ? *error : NULL);
-
-  if (success)
-    g_value_set_object (gimp_value_array_index (return_vals, 1), active_channel);
-
-  return return_vals;
-}
-
-static GimpValueArray *
-image_set_active_channel_invoker (GimpProcedure         *procedure,
-                                  Gimp                  *gimp,
-                                  GimpContext           *context,
-                                  GimpProgress          *progress,
-                                  const GimpValueArray  *args,
-                                  GError               **error)
-{
-  gboolean success = TRUE;
-  GimpImage *image;
-  GimpChannel *active_channel;
-
-  image = g_value_get_object (gimp_value_array_index (args, 0));
-  active_channel = g_value_get_object (gimp_value_array_index (args, 1));
-
-  if (success)
-    {
-      if (gimp_image_set_active_channel (image, active_channel) != active_channel)
-        success = FALSE;
-    }
-
-  return gimp_procedure_get_return_values (procedure, success,
-                                           error ? *error : NULL);
-}
-
-static GimpValueArray *
-image_get_active_vectors_invoker (GimpProcedure         *procedure,
-                                  Gimp                  *gimp,
-                                  GimpContext           *context,
-                                  GimpProgress          *progress,
-                                  const GimpValueArray  *args,
-                                  GError               **error)
-{
-  gboolean success = TRUE;
-  GimpValueArray *return_vals;
-  GimpImage *image;
-  GimpVectors *active_vectors = NULL;
-
-  image = g_value_get_object (gimp_value_array_index (args, 0));
-
-  if (success)
-    {
-      active_vectors = gimp_image_get_active_vectors (image);
-    }
-
-  return_vals = gimp_procedure_get_return_values (procedure, success,
-                                                  error ? *error : NULL);
-
-  if (success)
-    g_value_set_object (gimp_value_array_index (return_vals, 1), active_vectors);
-
-  return return_vals;
-}
-
-static GimpValueArray *
-image_set_active_vectors_invoker (GimpProcedure         *procedure,
-                                  Gimp                  *gimp,
-                                  GimpContext           *context,
-                                  GimpProgress          *progress,
-                                  const GimpValueArray  *args,
-                                  GError               **error)
-{
-  gboolean success = TRUE;
-  GimpImage *image;
-  GimpVectors *active_vectors;
-
-  image = g_value_get_object (gimp_value_array_index (args, 0));
-  active_vectors = g_value_get_object (gimp_value_array_index (args, 1));
-
-  if (success)
-    {
-      if (gimp_image_set_active_vectors (image, active_vectors) != active_vectors)
-        success = FALSE;
-    }
-
-  return gimp_procedure_get_return_values (procedure, success,
-                                           error ? *error : NULL);
-}
-
 static GimpValueArray *
 image_get_selected_layers_invoker (GimpProcedure         *procedure,
                                    Gimp                  *gimp,
@@ -3408,35 +3217,6 @@ register_image_procs (GimpPDB *pdb)
   gimp_pdb_register_procedure (pdb, procedure);
   g_object_unref (procedure);
 
-  /*
-   * gimp-image-get-active-drawable
-   */
-  procedure = gimp_procedure_new (image_get_active_drawable_invoker);
-  gimp_object_set_static_name (GIMP_OBJECT (procedure),
-                               "gimp-image-get-active-drawable");
-  gimp_procedure_set_static_help (procedure,
-                                  "Get the image's active drawable",
-                                  "This procedure returns the ID of the image's active drawable. This can be 
either a layer, a channel, or a layer mask. The active drawable is specified by the active image channel. If 
that is -1, then by the active image layer. If the active image layer has a layer mask and the layer mask is 
in edit mode, then the layer mask is the active drawable.",
-                                  NULL);
-  gimp_procedure_set_static_attribution (procedure,
-                                         "Spencer Kimball & Peter Mattis",
-                                         "Spencer Kimball & Peter Mattis",
-                                         "1995-1996");
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_image ("image",
-                                                      "image",
-                                                      "The image",
-                                                      FALSE,
-                                                      GIMP_PARAM_READWRITE));
-  gimp_procedure_add_return_value (procedure,
-                                   gimp_param_spec_drawable ("drawable",
-                                                             "drawable",
-                                                             "The active drawable",
-                                                             FALSE,
-                                                             GIMP_PARAM_READWRITE));
-  gimp_pdb_register_procedure (pdb, procedure);
-  g_object_unref (procedure);
-
   /*
    * gimp-image-unset-active-channel
    */
@@ -4575,180 +4355,6 @@ register_image_procs (GimpPDB *pdb)
   gimp_pdb_register_procedure (pdb, procedure);
   g_object_unref (procedure);
 
-  /*
-   * gimp-image-get-active-layer
-   */
-  procedure = gimp_procedure_new (image_get_active_layer_invoker);
-  gimp_object_set_static_name (GIMP_OBJECT (procedure),
-                               "gimp-image-get-active-layer");
-  gimp_procedure_set_static_help (procedure,
-                                  "Returns the specified image's active layer.",
-                                  "If there is an active layer, its ID will be returned, otherwise, -1. If a 
channel is currently active, then no layer will be. If a layer mask is active, then this will return the 
associated layer.",
-                                  NULL);
-  gimp_procedure_set_static_attribution (procedure,
-                                         "Spencer Kimball & Peter Mattis",
-                                         "Spencer Kimball & Peter Mattis",
-                                         "1995-1996");
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_image ("image",
-                                                      "image",
-                                                      "The image",
-                                                      FALSE,
-                                                      GIMP_PARAM_READWRITE));
-  gimp_procedure_add_return_value (procedure,
-                                   gimp_param_spec_layer ("active-layer",
-                                                          "active layer",
-                                                          "The active layer",
-                                                          FALSE,
-                                                          GIMP_PARAM_READWRITE));
-  gimp_pdb_register_procedure (pdb, procedure);
-  g_object_unref (procedure);
-
-  /*
-   * gimp-image-set-active-layer
-   */
-  procedure = gimp_procedure_new (image_set_active_layer_invoker);
-  gimp_object_set_static_name (GIMP_OBJECT (procedure),
-                               "gimp-image-set-active-layer");
-  gimp_procedure_set_static_help (procedure,
-                                  "Sets the specified image's active layer.",
-                                  "If the layer exists, it is set as the active layer in the image. Any 
previous active layer or channel is set to inactive. An exception is a previously existing floating 
selection, in which case this procedure will return an execution error.",
-                                  NULL);
-  gimp_procedure_set_static_attribution (procedure,
-                                         "Spencer Kimball & Peter Mattis",
-                                         "Spencer Kimball & Peter Mattis",
-                                         "1995-1996");
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_image ("image",
-                                                      "image",
-                                                      "The image",
-                                                      FALSE,
-                                                      GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_layer ("active-layer",
-                                                      "active layer",
-                                                      "The new image active layer",
-                                                      FALSE,
-                                                      GIMP_PARAM_READWRITE));
-  gimp_pdb_register_procedure (pdb, procedure);
-  g_object_unref (procedure);
-
-  /*
-   * gimp-image-get-active-channel
-   */
-  procedure = gimp_procedure_new (image_get_active_channel_invoker);
-  gimp_object_set_static_name (GIMP_OBJECT (procedure),
-                               "gimp-image-get-active-channel");
-  gimp_procedure_set_static_help (procedure,
-                                  "Returns the specified image's active channel.",
-                                  "If there is an active channel, this will return the channel ID, 
otherwise, -1.",
-                                  NULL);
-  gimp_procedure_set_static_attribution (procedure,
-                                         "Spencer Kimball & Peter Mattis",
-                                         "Spencer Kimball & Peter Mattis",
-                                         "1995-1996");
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_image ("image",
-                                                      "image",
-                                                      "The image",
-                                                      FALSE,
-                                                      GIMP_PARAM_READWRITE));
-  gimp_procedure_add_return_value (procedure,
-                                   gimp_param_spec_channel ("active-channel",
-                                                            "active channel",
-                                                            "The active channel",
-                                                            FALSE,
-                                                            GIMP_PARAM_READWRITE));
-  gimp_pdb_register_procedure (pdb, procedure);
-  g_object_unref (procedure);
-
-  /*
-   * gimp-image-set-active-channel
-   */
-  procedure = gimp_procedure_new (image_set_active_channel_invoker);
-  gimp_object_set_static_name (GIMP_OBJECT (procedure),
-                               "gimp-image-set-active-channel");
-  gimp_procedure_set_static_help (procedure,
-                                  "Sets the specified image's active channel.",
-                                  "If the channel exists, it is set as the active channel in the image. Any 
previous active channel or layer is set to inactive. An exception is a previously existing floating 
selection, in which case this procedure will return an execution error.",
-                                  NULL);
-  gimp_procedure_set_static_attribution (procedure,
-                                         "Spencer Kimball & Peter Mattis",
-                                         "Spencer Kimball & Peter Mattis",
-                                         "1995-1996");
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_image ("image",
-                                                      "image",
-                                                      "The image",
-                                                      FALSE,
-                                                      GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_channel ("active-channel",
-                                                        "active channel",
-                                                        "The new image active channel",
-                                                        FALSE,
-                                                        GIMP_PARAM_READWRITE));
-  gimp_pdb_register_procedure (pdb, procedure);
-  g_object_unref (procedure);
-
-  /*
-   * gimp-image-get-active-vectors
-   */
-  procedure = gimp_procedure_new (image_get_active_vectors_invoker);
-  gimp_object_set_static_name (GIMP_OBJECT (procedure),
-                               "gimp-image-get-active-vectors");
-  gimp_procedure_set_static_help (procedure,
-                                  "Returns the specified image's active vectors.",
-                                  "If there is an active path, its ID will be returned, otherwise, -1.",
-                                  NULL);
-  gimp_procedure_set_static_attribution (procedure,
-                                         "Spencer Kimball & Peter Mattis",
-                                         "Spencer Kimball & Peter Mattis",
-                                         "1995-1996");
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_image ("image",
-                                                      "image",
-                                                      "The image",
-                                                      FALSE,
-                                                      GIMP_PARAM_READWRITE));
-  gimp_procedure_add_return_value (procedure,
-                                   gimp_param_spec_vectors ("active-vectors",
-                                                            "active vectors",
-                                                            "The active vectors",
-                                                            FALSE,
-                                                            GIMP_PARAM_READWRITE));
-  gimp_pdb_register_procedure (pdb, procedure);
-  g_object_unref (procedure);
-
-  /*
-   * gimp-image-set-active-vectors
-   */
-  procedure = gimp_procedure_new (image_set_active_vectors_invoker);
-  gimp_object_set_static_name (GIMP_OBJECT (procedure),
-                               "gimp-image-set-active-vectors");
-  gimp_procedure_set_static_help (procedure,
-                                  "Sets the specified image's active vectors.",
-                                  "If the path exists, it is set as the active path in the image.",
-                                  NULL);
-  gimp_procedure_set_static_attribution (procedure,
-                                         "Spencer Kimball & Peter Mattis",
-                                         "Spencer Kimball & Peter Mattis",
-                                         "1995-1996");
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_image ("image",
-                                                      "image",
-                                                      "The image",
-                                                      FALSE,
-                                                      GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_vectors ("active-vectors",
-                                                        "active vectors",
-                                                        "The new image active vectors",
-                                                        FALSE,
-                                                        GIMP_PARAM_READWRITE));
-  gimp_pdb_register_procedure (pdb, procedure);
-  g_object_unref (procedure);
-
   /*
    * gimp-image-get-selected-layers
    */
diff --git a/app/pdb/internal-procs.c b/app/pdb/internal-procs.c
index 1fa6c26fde..6e1de6ade6 100644
--- a/app/pdb/internal-procs.c
+++ b/app/pdb/internal-procs.c
@@ -30,7 +30,7 @@
 #include "internal-procs.h"
 
 
-/* 765 procedures registered total */
+/* 758 procedures registered total */
 
 void
 internal_procs_init (GimpPDB *pdb)
diff --git a/libgimp/gimp.def b/libgimp/gimp.def
index d4157e7619..c51a56bfff 100644
--- a/libgimp/gimp.def
+++ b/libgimp/gimp.def
@@ -384,10 +384,6 @@ EXPORTS
        gimp_image_freeze_channels
        gimp_image_freeze_layers
        gimp_image_freeze_vectors
-       gimp_image_get_active_channel
-       gimp_image_get_active_drawable
-       gimp_image_get_active_layer
-       gimp_image_get_active_vectors
        gimp_image_get_base_type
        gimp_image_get_by_id
        gimp_image_get_channel_by_name
@@ -488,9 +484,6 @@ EXPORTS
        gimp_image_select_polygon
        gimp_image_select_rectangle
        gimp_image_select_round_rectangle
-       gimp_image_set_active_channel
-       gimp_image_set_active_layer
-       gimp_image_set_active_vectors
        gimp_image_set_color_profile
        gimp_image_set_color_profile_from_file
        gimp_image_set_colormap
diff --git a/libgimp/gimpimage_pdb.c b/libgimp/gimpimage_pdb.c
index 2ba5995bf7..e691fe6939 100644
--- a/libgimp/gimpimage_pdb.c
+++ b/libgimp/gimpimage_pdb.c
@@ -605,45 +605,6 @@ gimp_image_get_vectors (GimpImage *image,
   return vectors;
 }
 
-/**
- * gimp_image_get_active_drawable:
- * @image: The image.
- *
- * Get the image's active drawable
- *
- * This procedure returns the ID of the image's active drawable. This
- * can be either a layer, a channel, or a layer mask. The active
- * drawable is specified by the active image channel. If that is -1,
- * then by the active image layer. If the active image layer has a
- * layer mask and the layer mask is in edit mode, then the layer mask
- * is the active drawable.
- *
- * Returns: (transfer none): The active drawable.
- **/
-GimpDrawable *
-gimp_image_get_active_drawable (GimpImage *image)
-{
-  GimpValueArray *args;
-  GimpValueArray *return_vals;
-  GimpDrawable *drawable = NULL;
-
-  args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE, image,
-                                          G_TYPE_NONE);
-
-  return_vals = gimp_pdb_run_procedure_array (gimp_get_pdb (),
-                                              "gimp-image-get-active-drawable",
-                                              args);
-  gimp_value_array_unref (args);
-
-  if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
-    drawable = GIMP_VALUES_GET_DRAWABLE (return_vals, 1);
-
-  gimp_value_array_unref (return_vals);
-
-  return drawable;
-}
-
 /**
  * gimp_image_unset_active_channel:
  * @image: The image.
@@ -2086,225 +2047,6 @@ _gimp_image_thumbnail (GimpImage  *image,
   return success;
 }
 
-/**
- * gimp_image_get_active_layer:
- * @image: The image.
- *
- * Returns the specified image's active layer.
- *
- * If there is an active layer, its ID will be returned, otherwise, -1.
- * If a channel is currently active, then no layer will be. If a layer
- * mask is active, then this will return the associated layer.
- *
- * Returns: (transfer none): The active layer.
- **/
-GimpLayer *
-gimp_image_get_active_layer (GimpImage *image)
-{
-  GimpValueArray *args;
-  GimpValueArray *return_vals;
-  GimpLayer *active_layer = NULL;
-
-  args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE, image,
-                                          G_TYPE_NONE);
-
-  return_vals = gimp_pdb_run_procedure_array (gimp_get_pdb (),
-                                              "gimp-image-get-active-layer",
-                                              args);
-  gimp_value_array_unref (args);
-
-  if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
-    active_layer = GIMP_VALUES_GET_LAYER (return_vals, 1);
-
-  gimp_value_array_unref (return_vals);
-
-  return active_layer;
-}
-
-/**
- * gimp_image_set_active_layer:
- * @image: The image.
- * @active_layer: The new image active layer.
- *
- * Sets the specified image's active layer.
- *
- * If the layer exists, it is set as the active layer in the image. Any
- * previous active layer or channel is set to inactive. An exception is
- * a previously existing floating selection, in which case this
- * procedure will return an execution error.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_image_set_active_layer (GimpImage *image,
-                             GimpLayer *active_layer)
-{
-  GimpValueArray *args;
-  GimpValueArray *return_vals;
-  gboolean success = TRUE;
-
-  args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE, image,
-                                          GIMP_TYPE_LAYER, active_layer,
-                                          G_TYPE_NONE);
-
-  return_vals = gimp_pdb_run_procedure_array (gimp_get_pdb (),
-                                              "gimp-image-set-active-layer",
-                                              args);
-  gimp_value_array_unref (args);
-
-  success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
-
-  gimp_value_array_unref (return_vals);
-
-  return success;
-}
-
-/**
- * gimp_image_get_active_channel:
- * @image: The image.
- *
- * Returns the specified image's active channel.
- *
- * If there is an active channel, this will return the channel ID,
- * otherwise, -1.
- *
- * Returns: (transfer none): The active channel.
- **/
-GimpChannel *
-gimp_image_get_active_channel (GimpImage *image)
-{
-  GimpValueArray *args;
-  GimpValueArray *return_vals;
-  GimpChannel *active_channel = NULL;
-
-  args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE, image,
-                                          G_TYPE_NONE);
-
-  return_vals = gimp_pdb_run_procedure_array (gimp_get_pdb (),
-                                              "gimp-image-get-active-channel",
-                                              args);
-  gimp_value_array_unref (args);
-
-  if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
-    active_channel = GIMP_VALUES_GET_CHANNEL (return_vals, 1);
-
-  gimp_value_array_unref (return_vals);
-
-  return active_channel;
-}
-
-/**
- * gimp_image_set_active_channel:
- * @image: The image.
- * @active_channel: The new image active channel.
- *
- * Sets the specified image's active channel.
- *
- * If the channel exists, it is set as the active channel in the image.
- * Any previous active channel or layer is set to inactive. An
- * exception is a previously existing floating selection, in which case
- * this procedure will return an execution error.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_image_set_active_channel (GimpImage   *image,
-                               GimpChannel *active_channel)
-{
-  GimpValueArray *args;
-  GimpValueArray *return_vals;
-  gboolean success = TRUE;
-
-  args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE, image,
-                                          GIMP_TYPE_CHANNEL, active_channel,
-                                          G_TYPE_NONE);
-
-  return_vals = gimp_pdb_run_procedure_array (gimp_get_pdb (),
-                                              "gimp-image-set-active-channel",
-                                              args);
-  gimp_value_array_unref (args);
-
-  success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
-
-  gimp_value_array_unref (return_vals);
-
-  return success;
-}
-
-/**
- * gimp_image_get_active_vectors:
- * @image: The image.
- *
- * Returns the specified image's active vectors.
- *
- * If there is an active path, its ID will be returned, otherwise, -1.
- *
- * Returns: (transfer none): The active vectors.
- **/
-GimpVectors *
-gimp_image_get_active_vectors (GimpImage *image)
-{
-  GimpValueArray *args;
-  GimpValueArray *return_vals;
-  GimpVectors *active_vectors = NULL;
-
-  args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE, image,
-                                          G_TYPE_NONE);
-
-  return_vals = gimp_pdb_run_procedure_array (gimp_get_pdb (),
-                                              "gimp-image-get-active-vectors",
-                                              args);
-  gimp_value_array_unref (args);
-
-  if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
-    active_vectors = GIMP_VALUES_GET_VECTORS (return_vals, 1);
-
-  gimp_value_array_unref (return_vals);
-
-  return active_vectors;
-}
-
-/**
- * gimp_image_set_active_vectors:
- * @image: The image.
- * @active_vectors: The new image active vectors.
- *
- * Sets the specified image's active vectors.
- *
- * If the path exists, it is set as the active path in the image.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_image_set_active_vectors (GimpImage   *image,
-                               GimpVectors *active_vectors)
-{
-  GimpValueArray *args;
-  GimpValueArray *return_vals;
-  gboolean success = TRUE;
-
-  args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE, image,
-                                          GIMP_TYPE_VECTORS, active_vectors,
-                                          G_TYPE_NONE);
-
-  return_vals = gimp_pdb_run_procedure_array (gimp_get_pdb (),
-                                              "gimp-image-set-active-vectors",
-                                              args);
-  gimp_value_array_unref (args);
-
-  success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
-
-  gimp_value_array_unref (return_vals);
-
-  return success;
-}
-
 /**
  * gimp_image_get_selected_layers: (skip)
  * @image: The image.
diff --git a/libgimp/gimpimage_pdb.h b/libgimp/gimpimage_pdb.h
index 14a0579073..50d34554c1 100644
--- a/libgimp/gimpimage_pdb.h
+++ b/libgimp/gimpimage_pdb.h
@@ -54,7 +54,6 @@ GimpChannel**            gimp_image_get_channels               (GimpImage
                                                                 gint                *num_channels);
 GimpVectors**            gimp_image_get_vectors                (GimpImage           *image,
                                                                 gint                *num_vectors);
-GimpDrawable*            gimp_image_get_active_drawable        (GimpImage           *image);
 gboolean                 gimp_image_unset_active_channel       (GimpImage           *image);
 GimpLayer*               gimp_image_get_floating_sel           (GimpImage           *image);
 GimpDrawable*            gimp_image_floating_sel_attached_to   (GimpImage           *image);
@@ -134,15 +133,6 @@ G_GNUC_INTERNAL gboolean _gimp_image_thumbnail                 (GimpImage
                                                                 gint                *bpp,
                                                                 gint                *thumbnail_data_count,
                                                                 guint8             **thumbnail_data);
-GimpLayer*               gimp_image_get_active_layer           (GimpImage           *image);
-gboolean                 gimp_image_set_active_layer           (GimpImage           *image,
-                                                                GimpLayer           *active_layer);
-GimpChannel*             gimp_image_get_active_channel         (GimpImage           *image);
-gboolean                 gimp_image_set_active_channel         (GimpImage           *image,
-                                                                GimpChannel         *active_channel);
-GimpVectors*             gimp_image_get_active_vectors         (GimpImage           *image);
-gboolean                 gimp_image_set_active_vectors         (GimpImage           *image,
-                                                                GimpVectors         *active_vectors);
 GimpLayer**              gimp_image_get_selected_layers        (GimpImage           *image,
                                                                 gint                *num_layers);
 gboolean                 gimp_image_set_selected_layers        (GimpImage           *image,
diff --git a/pdb/groups/image.pdb b/pdb/groups/image.pdb
index dc8cbd95d0..cb443fb3e0 100644
--- a/pdb/groups/image.pdb
+++ b/pdb/groups/image.pdb
@@ -1408,38 +1408,6 @@ CODE
     );
 }
 
-sub image_get_active_drawable {
-    $blurb = "Get the image's active drawable";
-
-    $help = <<'HELP';
-This procedure returns the ID of the image's active drawable. This can be
-either a layer, a channel, or a layer mask. The active drawable is specified by
-the active image channel. If that is -1, then by the active image layer. If the
-active image layer has a layer mask and the layer mask is in edit mode, then
-the layer mask is the active drawable.
-HELP
-
-    &std_pdb_misc;
-
-    @inargs = (
-        { name => 'image', type => 'image',
-          desc => 'The image' }
-    );
-
-    @outargs = (
-        { name => 'drawable', type => 'drawable',
-          desc => 'The active drawable' }
-    );
-
-    %invoke = (
-        code => <<'CODE'
-{
-  drawable = gimp_image_get_active_drawable (image);
-}
-CODE
-    );
-}
-
 sub image_get_base_type {
     $blurb = 'Get the base type of the image.';
 
@@ -1876,36 +1844,6 @@ CODE
     );
 }
 
-sub image_get_active_layer {
-    $blurb = "Returns the specified image's active layer.";
-
-    $help = <<'HELP';
-If there is an active layer, its ID will be returned, otherwise, -1.  If a
-channel is currently active, then no layer will be. If a layer mask is active,
-then this will return the associated layer.
-HELP
-
-    &std_pdb_misc;
-
-    @inargs = (
-        { name => 'image', type => 'image',
-          desc => 'The image' }
-    );
-
-    @outargs = (
-        { name => 'active_layer', type => 'layer',
-          desc => 'The active layer' }
-    );
-
-    %invoke = (
-        code => <<'CODE'
-{
-  active_layer = gimp_image_get_active_layer (image);
-}
-CODE
-    );
-}
-
 sub image_set_selected_layers {
     $blurb = "Sets the specified image's selected layers.";
 
@@ -1946,146 +1884,6 @@ CODE
     );
 }
 
-sub image_set_active_layer {
-    $blurb = "Sets the specified image's active layer.";
-
-    $help = <<'HELP';
-If the layer exists, it is set as the active layer in the image. Any
-previous active layer or channel is set to inactive. An exception is a
-previously existing floating selection, in which case this procedure
-will return an execution error.
-HELP
-
-    &std_pdb_misc;
-
-    @inargs = (
-        { name => 'image', type => 'image',
-          desc => 'The image' },
-        { name => 'active_layer', type => 'layer',
-          desc => 'The new image active layer' }
-    );
-
-    %invoke = (
-        code => <<'CODE'
-{
-  if (gimp_image_set_active_layer (image, active_layer) != active_layer)
-    success = FALSE;
-}
-CODE
-    );
-}
-
-sub image_get_active_channel {
-    $blurb = "Returns the specified image's active channel.";
-
-    $help = <<'HELP';
-If there is an active channel, this will return the channel ID, otherwise, -1.
-HELP
-
-    &std_pdb_misc;
-
-    @inargs = (
-        { name => 'image', type => 'image',
-          desc => 'The image' }
-    );
-
-    @outargs = (
-        { name => 'active_channel', type => 'channel',
-          desc => 'The active channel' }
-    );
-
-    %invoke = (
-        code => <<'CODE'
-{
-  active_channel = gimp_image_get_active_channel (image);
-}
-CODE
-    );
-}
-
-sub image_set_active_channel {
-    $blurb = "Sets the specified image's active channel.";
-
-    $help = <<'HELP';
-If the channel exists, it is set as the active channel in the
-image. Any previous active channel or layer is set to inactive. An
-exception is a previously existing floating selection, in which case
-this procedure will return an execution error.
-HELP
-
-    &std_pdb_misc;
-
-    @inargs = (
-        { name => 'image', type => 'image',
-          desc => 'The image' },
-        { name => 'active_channel', type => 'channel',
-          desc => 'The new image active channel' }
-    );
-
-    %invoke = (
-        code => <<'CODE'
-{
-  if (gimp_image_set_active_channel (image, active_channel) != active_channel)
-    success = FALSE;
-}
-CODE
-    );
-}
-
-sub image_get_active_vectors {
-    $blurb = "Returns the specified image's active vectors.";
-
-    $help = <<'HELP';
-If there is an active path, its ID will be returned, otherwise, -1.
-HELP
-
-    &std_pdb_misc;
-
-    @inargs = (
-        { name => 'image', type => 'image',
-          desc => 'The image' }
-    );
-
-    @outargs = (
-        { name => 'active_vectors', type => 'vectors',
-          desc => 'The active vectors' }
-    );
-
-    %invoke = (
-        code => <<'CODE'
-{
-  active_vectors = gimp_image_get_active_vectors (image);
-}
-CODE
-    );
-}
-
-sub image_set_active_vectors {
-    $blurb = "Sets the specified image's active vectors.";
-
-    $help = <<'HELP';
-If the path exists, it is set as the active path in the image.
-HELP
-
-    &std_pdb_misc;
-
-    @inargs = (
-        { name => 'image', type => 'image',
-          desc => 'The image' },
-        { name => 'active_vectors', type => 'vectors',
-          desc => 'The new image active vectors' }
-    );
-
-    %invoke = (
-        code => <<'CODE'
-{
-  if (gimp_image_set_active_vectors (image, active_vectors) != active_vectors)
-    success = FALSE;
-}
-CODE
-    );
-}
-
 sub image_get_selected_drawables {
     $blurb = "Get the image's selected drawables";
 
@@ -3195,7 +2993,6 @@ CODE
             image_get_layers
             image_get_channels
             image_get_vectors
-            image_get_active_drawable
             image_unset_active_channel
             image_get_floating_sel
             image_floating_sel_attached_to
@@ -3217,9 +3014,6 @@ CODE
             image_get_metadata image_set_metadata
             image_clean_all image_is_dirty
             image_thumbnail
-            image_get_active_layer image_set_active_layer
-            image_get_active_channel image_set_active_channel
-            image_get_active_vectors image_set_active_vectors
             image_get_selected_layers image_set_selected_layers
             image_get_selected_drawables
             image_get_selection


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