[gimp] pdb: remove gimp-item-to-selection again



commit 29d63afbb7741c38eff3e7cf1cac9718e958772d
Author: Michael Natterer <mitch gimp org>
Date:   Sat Oct 30 22:19:22 2010 +0200

    pdb: remove gimp-item-to-selection again

 app/pdb/internal-procs.c         |    2 +-
 app/pdb/item-cmds.c              |   65 --------------------------------------
 app/pdb/selection-cmds.c         |   18 +++++-----
 libgimp/gimp.def                 |    1 -
 libgimp/gimpitem_pdb.c           |   37 ---------------------
 libgimp/gimpitem_pdb.h           |   60 +++++++++++++++++------------------
 libgimp/gimpselection_pdb.c      |    6 ++--
 plug-ins/common/lcms.c           |    2 +-
 plug-ins/file-xjt/xjt.c          |    3 +-
 plug-ins/pygimp/pygimp-vectors.c |    2 +-
 tools/pdbgen/pdb/item.pdb        |   43 +------------------------
 tools/pdbgen/pdb/selection.pdb   |    6 ++--
 12 files changed, 50 insertions(+), 195 deletions(-)
---
diff --git a/app/pdb/internal-procs.c b/app/pdb/internal-procs.c
index 48ea8c4..2050726 100644
--- a/app/pdb/internal-procs.c
+++ b/app/pdb/internal-procs.c
@@ -28,7 +28,7 @@
 #include "internal-procs.h"
 
 
-/* 641 procedures registered total */
+/* 640 procedures registered total */
 
 void
 internal_procs_init (GimpPDB *pdb)
diff --git a/app/pdb/item-cmds.c b/app/pdb/item-cmds.c
index cf2dc3f..8f56b3a 100644
--- a/app/pdb/item-cmds.c
+++ b/app/pdb/item-cmds.c
@@ -706,41 +706,6 @@ item_set_tattoo_invoker (GimpProcedure      *procedure,
                                            error ? *error : NULL);
 }
 
-static GValueArray *
-item_to_selection_invoker (GimpProcedure      *procedure,
-                           Gimp               *gimp,
-                           GimpContext        *context,
-                           GimpProgress       *progress,
-                           const GValueArray  *args,
-                           GError            **error)
-{
-  gboolean success = TRUE;
-  GimpItem *item;
-  gint32 operation;
-
-  item = gimp_value_get_item (&args->values[0], gimp);
-  operation = g_value_get_enum (&args->values[1]);
-
-  if (success)
-    {
-      if (gimp_pdb_item_is_attached (item, NULL, FALSE, error))
-        {
-          GimpPDBContext *pdb_context = GIMP_PDB_CONTEXT (context);
-
-          gimp_item_to_selection (item, operation,
-                                  pdb_context->antialias,
-                                  pdb_context->feather,
-                                  pdb_context->feather_radius_x,
-                                  pdb_context->feather_radius_y);
-        }
-      else
-        success = FALSE;
-    }
-
-  return gimp_procedure_get_return_values (procedure, success,
-                                           error ? *error : NULL);
-}
-
 void
 register_item_procs (GimpPDB *pdb)
 {
@@ -1413,34 +1378,4 @@ register_item_procs (GimpPDB *pdb)
                                                   GIMP_PARAM_READWRITE));
   gimp_pdb_register_procedure (pdb, procedure);
   g_object_unref (procedure);
-
-  /*
-   * gimp-item-to-selection
-   */
-  procedure = gimp_procedure_new (item_to_selection_invoker);
-  gimp_object_set_static_name (GIMP_OBJECT (procedure),
-                               "gimp-item-to-selection");
-  gimp_procedure_set_static_strings (procedure,
-                                     "gimp-item-to-selection",
-                                     "Transforms the specified item into a selection",
-                                     "This procedure renders the item's outline into the current selection of the image the item belongs to. What exactly the item's outline is depends on the item type: for layers, it's the layer's alpha channel, for vectors the vector's shape.",
-                                     "Michael Natterer <mitch gimp org>",
-                                     "Michael Natterer",
-                                     "2010",
-                                     NULL);
-  gimp_procedure_add_argument (procedure,
-                               gimp_param_spec_item_id ("item",
-                                                        "item",
-                                                        "The item to render to the selection",
-                                                        pdb->gimp, FALSE,
-                                                        GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               g_param_spec_enum ("operation",
-                                                  "operation",
-                                                  "The desired operation with current selection",
-                                                  GIMP_TYPE_CHANNEL_OPS,
-                                                  GIMP_CHANNEL_OP_ADD,
-                                                  GIMP_PARAM_READWRITE));
-  gimp_pdb_register_procedure (pdb, procedure);
-  g_object_unref (procedure);
 }
diff --git a/app/pdb/selection-cmds.c b/app/pdb/selection-cmds.c
index 34cc84a..cfbcf13 100644
--- a/app/pdb/selection-cmds.c
+++ b/app/pdb/selection-cmds.c
@@ -937,12 +937,12 @@ register_selection_procs (GimpPDB *pdb)
                                "gimp-selection-layer-alpha");
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-selection-layer-alpha",
-                                     "Deprecated: Use 'gimp-item-to-selection' instead.",
-                                     "Deprecated: Use 'gimp-item-to-selection' instead.",
+                                     "Deprecated: Use 'gimp-image-select-item' instead.",
+                                     "Deprecated: Use 'gimp-image-select-item' instead.",
                                      "",
                                      "",
                                      "",
-                                     "gimp-item-to-selection");
+                                     "gimp-image-select-item");
   gimp_procedure_add_argument (procedure,
                                gimp_param_spec_layer_id ("layer",
                                                          "layer",
@@ -960,12 +960,12 @@ register_selection_procs (GimpPDB *pdb)
                                "gimp-selection-load");
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-selection-load",
-                                     "Deprecated: Use 'gimp-item-to-selection' instead.",
-                                     "Deprecated: Use 'gimp-item-to-selection' instead.",
+                                     "Deprecated: Use 'gimp-image-select-item' instead.",
+                                     "Deprecated: Use 'gimp-image-select-item' instead.",
                                      "",
                                      "",
                                      "",
-                                     "gimp-item-to-selection");
+                                     "gimp-image-select-item");
   gimp_procedure_add_argument (procedure,
                                gimp_param_spec_channel_id ("channel",
                                                            "channel",
@@ -1012,12 +1012,12 @@ register_selection_procs (GimpPDB *pdb)
                                "gimp-selection-combine");
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-selection-combine",
-                                     "Deprecated: Use 'gimp-item-to-selection' instead.",
-                                     "Deprecated: Use 'gimp-item-to-selection' instead.",
+                                     "Deprecated: Use 'gimp-image-select-item' instead.",
+                                     "Deprecated: Use 'gimp-image-select-item' instead.",
                                      "",
                                      "",
                                      "",
-                                     "gimp-item-to-selection");
+                                     "gimp-image-select-item");
   gimp_procedure_add_argument (procedure,
                                gimp_param_spec_channel_id ("channel",
                                                            "channel",
diff --git a/libgimp/gimp.def b/libgimp/gimp.def
index 2d55323..805bcba 100644
--- a/libgimp/gimp.def
+++ b/libgimp/gimp.def
@@ -465,7 +465,6 @@ EXPORTS
 	gimp_item_set_name
 	gimp_item_set_tattoo
 	gimp_item_set_visible
-	gimp_item_to_selection
 	gimp_item_transform_2d
 	gimp_item_transform_flip
 	gimp_item_transform_flip_simple
diff --git a/libgimp/gimpitem_pdb.c b/libgimp/gimpitem_pdb.c
index cf7bec2..8a3eded 100644
--- a/libgimp/gimpitem_pdb.c
+++ b/libgimp/gimpitem_pdb.c
@@ -801,40 +801,3 @@ gimp_item_set_tattoo (gint32 item_ID,
 
   return success;
 }
-
-/**
- * gimp_item_to_selection:
- * @item_ID: The item to render to the selection.
- * @operation: The desired operation with current selection.
- *
- * Transforms the specified item into a selection
- *
- * This procedure renders the item's outline into the current selection
- * of the image the item belongs to. What exactly the item's outline is
- * depends on the item type: for layers, it's the layer's alpha
- * channel, for vectors the vector's shape.
- *
- * Returns: TRUE on success.
- *
- * Since: GIMP 2.8
- **/
-gboolean
-gimp_item_to_selection (gint32         item_ID,
-                        GimpChannelOps operation)
-{
-  GimpParam *return_vals;
-  gint nreturn_vals;
-  gboolean success = TRUE;
-
-  return_vals = gimp_run_procedure ("gimp-item-to-selection",
-                                    &nreturn_vals,
-                                    GIMP_PDB_ITEM, item_ID,
-                                    GIMP_PDB_INT32, operation,
-                                    GIMP_PDB_END);
-
-  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
-
-  gimp_destroy_params (return_vals, nreturn_vals);
-
-  return success;
-}
diff --git a/libgimp/gimpitem_pdb.h b/libgimp/gimpitem_pdb.h
index e101935..76a7c45 100644
--- a/libgimp/gimpitem_pdb.h
+++ b/libgimp/gimpitem_pdb.h
@@ -28,37 +28,35 @@ G_BEGIN_DECLS
 /* For information look into the C source or the html documentation */
 
 
-gboolean gimp_item_is_valid         (gint32          item_ID);
-gint32   gimp_item_get_image        (gint32          item_ID);
-gboolean gimp_item_delete           (gint32          item_ID);
-gboolean gimp_item_is_drawable      (gint32          item_ID);
-gboolean gimp_item_is_layer         (gint32          item_ID);
-gboolean gimp_item_is_text_layer    (gint32          item_ID);
-gboolean gimp_item_is_channel       (gint32          item_ID);
-gboolean gimp_item_is_layer_mask    (gint32          item_ID);
-gboolean gimp_item_is_selection     (gint32          item_ID);
-gboolean gimp_item_is_vectors       (gint32          item_ID);
-gboolean gimp_item_is_group         (gint32          item_ID);
-gint32   gimp_item_get_parent       (gint32          item_ID);
-gint*    gimp_item_get_children     (gint32          item_ID,
-                                     gint           *num_children);
-gchar*   gimp_item_get_name         (gint32          item_ID);
-gboolean gimp_item_set_name         (gint32          item_ID,
-                                     const gchar    *name);
-gboolean gimp_item_get_visible      (gint32          item_ID);
-gboolean gimp_item_set_visible      (gint32          item_ID,
-                                     gboolean        visible);
-gboolean gimp_item_get_linked       (gint32          item_ID);
-gboolean gimp_item_set_linked       (gint32          item_ID,
-                                     gboolean        linked);
-gboolean gimp_item_get_lock_content (gint32          item_ID);
-gboolean gimp_item_set_lock_content (gint32          item_ID,
-                                     gboolean        lock_content);
-gint     gimp_item_get_tattoo       (gint32          item_ID);
-gboolean gimp_item_set_tattoo       (gint32          item_ID,
-                                     gint            tattoo);
-gboolean gimp_item_to_selection     (gint32          item_ID,
-                                     GimpChannelOps  operation);
+gboolean gimp_item_is_valid         (gint32       item_ID);
+gint32   gimp_item_get_image        (gint32       item_ID);
+gboolean gimp_item_delete           (gint32       item_ID);
+gboolean gimp_item_is_drawable      (gint32       item_ID);
+gboolean gimp_item_is_layer         (gint32       item_ID);
+gboolean gimp_item_is_text_layer    (gint32       item_ID);
+gboolean gimp_item_is_channel       (gint32       item_ID);
+gboolean gimp_item_is_layer_mask    (gint32       item_ID);
+gboolean gimp_item_is_selection     (gint32       item_ID);
+gboolean gimp_item_is_vectors       (gint32       item_ID);
+gboolean gimp_item_is_group         (gint32       item_ID);
+gint32   gimp_item_get_parent       (gint32       item_ID);
+gint*    gimp_item_get_children     (gint32       item_ID,
+                                     gint        *num_children);
+gchar*   gimp_item_get_name         (gint32       item_ID);
+gboolean gimp_item_set_name         (gint32       item_ID,
+                                     const gchar *name);
+gboolean gimp_item_get_visible      (gint32       item_ID);
+gboolean gimp_item_set_visible      (gint32       item_ID,
+                                     gboolean     visible);
+gboolean gimp_item_get_linked       (gint32       item_ID);
+gboolean gimp_item_set_linked       (gint32       item_ID,
+                                     gboolean     linked);
+gboolean gimp_item_get_lock_content (gint32       item_ID);
+gboolean gimp_item_set_lock_content (gint32       item_ID,
+                                     gboolean     lock_content);
+gint     gimp_item_get_tattoo       (gint32       item_ID);
+gboolean gimp_item_set_tattoo       (gint32       item_ID,
+                                     gint         tattoo);
 
 
 G_END_DECLS
diff --git a/libgimp/gimpselection_pdb.c b/libgimp/gimpselection_pdb.c
index 852aa6f..b9560b2 100644
--- a/libgimp/gimpselection_pdb.c
+++ b/libgimp/gimpselection_pdb.c
@@ -506,7 +506,7 @@ gimp_selection_shrink (gint32 image_ID,
  * gimp_selection_layer_alpha:
  * @layer_ID: Layer with alpha.
  *
- * Deprecated: Use gimp_item_to_selection() instead.
+ * Deprecated: Use gimp_image_select_item() instead.
  *
  * Returns: TRUE on success.
  **/
@@ -533,7 +533,7 @@ gimp_selection_layer_alpha (gint32 layer_ID)
  * gimp_selection_load:
  * @channel_ID: The channel.
  *
- * Deprecated: Use gimp_item_to_selection() instead.
+ * Deprecated: Use gimp_image_select_item() instead.
  *
  * Returns: TRUE on success.
  **/
@@ -593,7 +593,7 @@ gimp_selection_save (gint32 image_ID)
  * @channel_ID: The channel.
  * @operation: The selection operation.
  *
- * Deprecated: Use gimp_item_to_selection() instead.
+ * Deprecated: Use gimp_image_select_item() instead.
  *
  * Returns: TRUE on success.
  **/
diff --git a/plug-ins/common/lcms.c b/plug-ins/common/lcms.c
index f92fd3b..6c75607 100644
--- a/plug-ins/common/lcms.c
+++ b/plug-ins/common/lcms.c
@@ -915,7 +915,7 @@ lcms_image_apply_profile (gint32                    image,
 
   if (saved_selection != -1)
     {
-      gimp_item_to_selection (saved_selection, GIMP_CHANNEL_OP_REPLACE);
+      gimp_image_select_item (image, saved_selection, GIMP_CHANNEL_OP_REPLACE);
       gimp_image_remove_channel (image, saved_selection);
     }
 
diff --git a/plug-ins/file-xjt/xjt.c b/plug-ins/file-xjt/xjt.c
index cd64419..79263e4 100644
--- a/plug-ins/file-xjt/xjt.c
+++ b/plug-ins/file-xjt/xjt.c
@@ -3602,7 +3602,8 @@ load_xjt_image (const gchar  *filename,
           if (xjt_debug) printf ("XJT-DEBUG: SELECTION loaded channel id = %d\n",
                                  (int) l_channel_id);
 
-          gimp_item_to_selection (l_channel_id, GIMP_CHANNEL_OP_REPLACE);
+          gimp_image_select_item (l_image_id, l_channel_id,
+                                  GIMP_CHANNEL_OP_REPLACE);
 
           /* delete the channel after load into selection */
           gimp_drawable_delete (l_channel_id);
diff --git a/plug-ins/pygimp/pygimp-vectors.c b/plug-ins/pygimp/pygimp-vectors.c
index a2b9c7b..2fd6f2b 100644
--- a/plug-ins/pygimp/pygimp-vectors.c
+++ b/plug-ins/pygimp/pygimp-vectors.c
@@ -635,7 +635,7 @@ vectors_to_selection(PyGimpVectors *self, PyObject *args, PyObject *kwargs)
     gimp_context_set_antialias(antialias);
     gimp_context_set_feather(feather);
     gimp_context_set_feather_radius(feather_radius_x, feather_radius_y);
-    gimp_item_to_selection(self->ID, operation);
+    gimp_image_select_item(gimp_item_get_image(self->ID), self->ID, operation);
     gimp_context_pop();
 
     Py_INCREF(Py_None);
diff --git a/tools/pdbgen/pdb/item.pdb b/tools/pdbgen/pdb/item.pdb
index ddba7e5..932e9bd 100644
--- a/tools/pdbgen/pdb/item.pdb
+++ b/tools/pdbgen/pdb/item.pdb
@@ -682,46 +682,6 @@ CODE
     );
 }
 
-sub item_to_selection {
-    $blurb = 'Transforms the specified item into a selection';
-
-    $help = <<'HELP';
-This procedure renders the item's outline into the current selection
-of the image the item belongs to. What exactly the item's outline is
-depends on the item type: for layers, it's the layer's alpha channel,
-for vectors the vector's shape.
-HELP
-
-    &mitch_pdb_misc('2010', '2.8');
-
-    @inargs = (
-        { name => 'item', type => 'item',
-          desc => 'The item to render to the selection' },
-        { name => 'operation', type => 'enum GimpChannelOps',
-          desc => 'The desired operation with current selection' }
-    );
-
-    %invoke = (
-        code => <<'CODE'
-{
-  if (gimp_pdb_item_is_attached (item, NULL, FALSE, error))
-    {
-      GimpPDBContext *pdb_context = GIMP_PDB_CONTEXT (context);
-
-      gimp_item_to_selection (item, operation,
-                              pdb_context->antialias,
-                              pdb_context->feather,
-                              pdb_context->feather_radius_x,
-                              pdb_context->feather_radius_y);
-    }
-  else
-    success = FALSE;
-}
-CODE
-    );
-
-}
-
 @headers = qw("core/gimplayermask.h"
               "core/gimplist.h"
               "core/gimpselection.h"
@@ -748,8 +708,7 @@ CODE
             item_get_visible item_set_visible
             item_get_linked item_set_linked
             item_get_lock_content item_set_lock_content
-            item_get_tattoo item_set_tattoo
-            item_to_selection);
+            item_get_tattoo item_set_tattoo);
 
 %exports = (app => [ procs], lib => [ procs]);
 
diff --git a/tools/pdbgen/pdb/selection.pdb b/tools/pdbgen/pdb/selection.pdb
index 5d3003d..aed5701 100644
--- a/tools/pdbgen/pdb/selection.pdb
+++ b/tools/pdbgen/pdb/selection.pdb
@@ -411,7 +411,7 @@ CODE
 }
 
 sub selection_layer_alpha {
-    &std_pdb_deprecated ('gimp-item-to-selection');
+    &std_pdb_deprecated ('gimp-image-select-item');
 
     @inargs = (
 	{ name => 'layer', type => 'layer',
@@ -433,7 +433,7 @@ CODE
 }
 
 sub selection_load {
-    &std_pdb_deprecated ('gimp-item-to-selection');
+    &std_pdb_deprecated ('gimp-image-select-item');
 
     @inargs = (
 	{ name => 'channel', type => 'channel',
@@ -455,7 +455,7 @@ CODE
 }
 
 sub selection_combine {
-    &std_pdb_deprecated ('gimp-item-to-selection');
+    &std_pdb_deprecated ('gimp-image-select-item');
 
     @inargs = (
 	{ name => 'channel', type => 'channel',



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