[gimp] pdb: add a new PDB group "item" and move lots of functions to it



commit 2d6f808ff8f55b1d5517f0647bf3921e8ef84660
Author: Michael Natterer <mitch gimp org>
Date:   Fri Jul 9 09:34:44 2010 +0200

    pdb: add a new PDB group "item" and move lots of functions to it
    
    The item groups has all the duplicated functionality from drawable
    and vectors (name, visible, linked etc).
    
    Hijack the unused GIMP_PDB_REGION and turn it into GIMP_PDB_ITEM;
    change all protocol aware files accordingly and bump the protocol
    version number. Change script-fu to handle the new type.

 app/pdb/Makefile.am                 |    1 +
 app/pdb/gimp-pdb-compat.c           |    9 +-
 app/pdb/internal-procs.c            |    3 +-
 app/pdb/internal-procs.h            |    1 +
 app/pdb/item-cmds.c                 | 1115 +++++++++++++++++++++++++++++++++++
 app/plug-in/plug-in-params.c        |    8 +-
 libgimp/Makefile.am                 |    2 +
 libgimp/gimp.c                      |    6 +-
 libgimp/gimp.h                      |    3 +-
 libgimp/gimp_pdb.h                  |    1 +
 libgimp/gimpenums.h                 |    9 -
 libgimp/gimpitem_pdb.c              |  661 +++++++++++++++++++++
 libgimp/gimpitem_pdb.h              |   59 ++
 libgimpbase/gimpbaseenums.c         |    4 +-
 libgimpbase/gimpbaseenums.h         |    5 +-
 libgimpbase/gimpprotocol.c          |   14 +-
 libgimpbase/gimpprotocol.h          |    5 +-
 plug-ins/script-fu/scheme-wrapper.c |   60 +--
 tools/pdbgen/Makefile.am            |    1 +
 tools/pdbgen/app.pl                 |   10 +
 tools/pdbgen/enums.pl               |    9 +-
 tools/pdbgen/groups.pl              |    1 +
 tools/pdbgen/pdb.pl                 |    9 +
 tools/pdbgen/pdb/item.pdb           |  575 ++++++++++++++++++
 24 files changed, 2480 insertions(+), 91 deletions(-)
---
diff --git a/app/pdb/Makefile.am b/app/pdb/Makefile.am
index f537ffe..37c5127 100644
--- a/app/pdb/Makefile.am
+++ b/app/pdb/Makefile.am
@@ -57,6 +57,7 @@ libappinternal_procs_a_SOURCES = \
 	guides-cmds.c			\
 	help-cmds.c			\
 	image-cmds.c			\
+	item-cmds.c			\
 	layer-cmds.c			\
 	message-cmds.c			\
 	misc-cmds.c			\
diff --git a/app/pdb/gimp-pdb-compat.c b/app/pdb/gimp-pdb-compat.c
index a234373..bbe159e 100644
--- a/app/pdb/gimp-pdb-compat.c
+++ b/app/pdb/gimp-pdb-compat.c
@@ -108,7 +108,10 @@ gimp_pdb_compat_param_spec (Gimp           *gimp,
                                    G_PARAM_READWRITE);
       break;
 
-    case GIMP_PDB_REGION:
+    case GIMP_PDB_ITEM:
+      pspec = gimp_param_spec_item_id (name, name, desc,
+                                       gimp, TRUE,
+                                       G_PARAM_READWRITE);
       break;
 
     case GIMP_PDB_DISPLAY:
@@ -220,8 +223,8 @@ gimp_pdb_compat_arg_type_to_gtype (GimpPDBArgType  type)
     case GIMP_PDB_COLOR:
       return GIMP_TYPE_RGB;
 
-    case GIMP_PDB_REGION:
-      break;
+    case GIMP_PDB_ITEM:
+      return GIMP_TYPE_ITEM_ID;
 
     case GIMP_PDB_DISPLAY:
       return GIMP_TYPE_DISPLAY_ID;
diff --git a/app/pdb/internal-procs.c b/app/pdb/internal-procs.c
index cbe9a72..6b91b85 100644
--- a/app/pdb/internal-procs.c
+++ b/app/pdb/internal-procs.c
@@ -28,7 +28,7 @@
 #include "internal-procs.h"
 
 
-/* 602 procedures registered total */
+/* 621 procedures registered total */
 
 void
 internal_procs_init (GimpPDB *pdb)
@@ -59,6 +59,7 @@ internal_procs_init (GimpPDB *pdb)
   register_guides_procs (pdb);
   register_help_procs (pdb);
   register_image_procs (pdb);
+  register_item_procs (pdb);
   register_layer_procs (pdb);
   register_message_procs (pdb);
   register_misc_procs (pdb);
diff --git a/app/pdb/internal-procs.h b/app/pdb/internal-procs.h
index f99ef2b..3f79f5a 100644
--- a/app/pdb/internal-procs.h
+++ b/app/pdb/internal-procs.h
@@ -48,6 +48,7 @@ void   register_grid_procs               (GimpPDB *pdb);
 void   register_guides_procs             (GimpPDB *pdb);
 void   register_help_procs               (GimpPDB *pdb);
 void   register_image_procs              (GimpPDB *pdb);
+void   register_item_procs               (GimpPDB *pdb);
 void   register_layer_procs              (GimpPDB *pdb);
 void   register_message_procs            (GimpPDB *pdb);
 void   register_misc_procs               (GimpPDB *pdb);
diff --git a/app/pdb/item-cmds.c b/app/pdb/item-cmds.c
new file mode 100644
index 0000000..d47cdf6
--- /dev/null
+++ b/app/pdb/item-cmds.c
@@ -0,0 +1,1115 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995-2003 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* NOTE: This file is auto-generated by pdbgen.pl. */
+
+#include "config.h"
+
+#include <gegl.h>
+
+#include "pdb-types.h"
+
+#include "core/gimpimage.h"
+#include "core/gimpitem.h"
+#include "core/gimplayermask.h"
+#include "core/gimpparamspecs.h"
+#include "core/gimpselection.h"
+#include "text/gimptextlayer.h"
+#include "vectors/gimpvectors.h"
+
+#include "gimppdb.h"
+#include "gimppdb-utils.h"
+#include "gimpprocedure.h"
+#include "internal-procs.h"
+
+#include "gimp-intl.h"
+
+
+static GValueArray *
+item_is_valid_invoker (GimpProcedure      *procedure,
+                       Gimp               *gimp,
+                       GimpContext        *context,
+                       GimpProgress       *progress,
+                       const GValueArray  *args,
+                       GError            **error)
+{
+  GValueArray *return_vals;
+  GimpItem *item;
+  gboolean valid = FALSE;
+
+  item = gimp_value_get_item (&args->values[0], gimp);
+
+  valid = (GIMP_IS_ITEM (item) &&
+           ! gimp_item_is_removed (GIMP_ITEM (item)));
+
+  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
+  g_value_set_boolean (&return_vals->values[1], valid);
+
+  return return_vals;
+}
+
+static GValueArray *
+item_get_image_invoker (GimpProcedure      *procedure,
+                        Gimp               *gimp,
+                        GimpContext        *context,
+                        GimpProgress       *progress,
+                        const GValueArray  *args,
+                        GError            **error)
+{
+  gboolean success = TRUE;
+  GValueArray *return_vals;
+  GimpItem *item;
+  GimpImage *image = NULL;
+
+  item = gimp_value_get_item (&args->values[0], gimp);
+
+  if (success)
+    {
+      image = gimp_item_get_image (GIMP_ITEM (item));
+    }
+
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
+
+  if (success)
+    gimp_value_set_image (&return_vals->values[1], image);
+
+  return return_vals;
+}
+
+static GValueArray *
+item_delete_invoker (GimpProcedure      *procedure,
+                     Gimp               *gimp,
+                     GimpContext        *context,
+                     GimpProgress       *progress,
+                     const GValueArray  *args,
+                     GError            **error)
+{
+  gboolean success = TRUE;
+  GimpItem *item;
+
+  item = gimp_value_get_item (&args->values[0], gimp);
+
+  if (success)
+    {
+      if (g_object_is_floating (item))
+        {
+          g_object_ref_sink (item);
+          g_object_unref (item);
+        }
+      else
+        success = FALSE;
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+static GValueArray *
+item_is_drawable_invoker (GimpProcedure      *procedure,
+                          Gimp               *gimp,
+                          GimpContext        *context,
+                          GimpProgress       *progress,
+                          const GValueArray  *args,
+                          GError            **error)
+{
+  gboolean success = TRUE;
+  GValueArray *return_vals;
+  GimpItem *item;
+  gboolean drawable = FALSE;
+
+  item = gimp_value_get_item (&args->values[0], gimp);
+
+  if (success)
+    {
+      drawable = GIMP_IS_DRAWABLE (item);
+    }
+
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
+
+  if (success)
+    g_value_set_boolean (&return_vals->values[1], drawable);
+
+  return return_vals;
+}
+
+static GValueArray *
+item_is_layer_invoker (GimpProcedure      *procedure,
+                       Gimp               *gimp,
+                       GimpContext        *context,
+                       GimpProgress       *progress,
+                       const GValueArray  *args,
+                       GError            **error)
+{
+  gboolean success = TRUE;
+  GValueArray *return_vals;
+  GimpItem *item;
+  gboolean layer = FALSE;
+
+  item = gimp_value_get_item (&args->values[0], gimp);
+
+  if (success)
+    {
+      layer = GIMP_IS_LAYER (item);
+    }
+
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
+
+  if (success)
+    g_value_set_boolean (&return_vals->values[1], layer);
+
+  return return_vals;
+}
+
+static GValueArray *
+item_is_channel_invoker (GimpProcedure      *procedure,
+                         Gimp               *gimp,
+                         GimpContext        *context,
+                         GimpProgress       *progress,
+                         const GValueArray  *args,
+                         GError            **error)
+{
+  gboolean success = TRUE;
+  GValueArray *return_vals;
+  GimpItem *item;
+  gboolean channel = FALSE;
+
+  item = gimp_value_get_item (&args->values[0], gimp);
+
+  if (success)
+    {
+      channel = GIMP_IS_CHANNEL (item);
+    }
+
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
+
+  if (success)
+    g_value_set_boolean (&return_vals->values[1], channel);
+
+  return return_vals;
+}
+
+static GValueArray *
+item_is_layer_mask_invoker (GimpProcedure      *procedure,
+                            Gimp               *gimp,
+                            GimpContext        *context,
+                            GimpProgress       *progress,
+                            const GValueArray  *args,
+                            GError            **error)
+{
+  gboolean success = TRUE;
+  GValueArray *return_vals;
+  GimpItem *item;
+  gboolean layer_mask = FALSE;
+
+  item = gimp_value_get_item (&args->values[0], gimp);
+
+  if (success)
+    {
+      layer_mask = GIMP_IS_LAYER_MASK (item);
+    }
+
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
+
+  if (success)
+    g_value_set_boolean (&return_vals->values[1], layer_mask);
+
+  return return_vals;
+}
+
+static GValueArray *
+item_is_selection_invoker (GimpProcedure      *procedure,
+                           Gimp               *gimp,
+                           GimpContext        *context,
+                           GimpProgress       *progress,
+                           const GValueArray  *args,
+                           GError            **error)
+{
+  gboolean success = TRUE;
+  GValueArray *return_vals;
+  GimpItem *item;
+  gboolean selection = FALSE;
+
+  item = gimp_value_get_item (&args->values[0], gimp);
+
+  if (success)
+    {
+      selection = GIMP_IS_SELECTION (item);
+    }
+
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
+
+  if (success)
+    g_value_set_boolean (&return_vals->values[1], selection);
+
+  return return_vals;
+}
+
+static GValueArray *
+item_is_vectors_invoker (GimpProcedure      *procedure,
+                         Gimp               *gimp,
+                         GimpContext        *context,
+                         GimpProgress       *progress,
+                         const GValueArray  *args,
+                         GError            **error)
+{
+  gboolean success = TRUE;
+  GValueArray *return_vals;
+  GimpItem *item;
+  gboolean vectors = FALSE;
+
+  item = gimp_value_get_item (&args->values[0], gimp);
+
+  if (success)
+    {
+      vectors = GIMP_IS_VECTORS (item);
+    }
+
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
+
+  if (success)
+    g_value_set_boolean (&return_vals->values[1], vectors);
+
+  return return_vals;
+}
+
+static GValueArray *
+item_get_name_invoker (GimpProcedure      *procedure,
+                       Gimp               *gimp,
+                       GimpContext        *context,
+                       GimpProgress       *progress,
+                       const GValueArray  *args,
+                       GError            **error)
+{
+  gboolean success = TRUE;
+  GValueArray *return_vals;
+  GimpItem *item;
+  gchar *name = NULL;
+
+  item = gimp_value_get_item (&args->values[0], gimp);
+
+  if (success)
+    {
+      name = g_strdup (gimp_object_get_name (item));
+    }
+
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
+
+  if (success)
+    g_value_take_string (&return_vals->values[1], name);
+
+  return return_vals;
+}
+
+static GValueArray *
+item_set_name_invoker (GimpProcedure      *procedure,
+                       Gimp               *gimp,
+                       GimpContext        *context,
+                       GimpProgress       *progress,
+                       const GValueArray  *args,
+                       GError            **error)
+{
+  gboolean success = TRUE;
+  GimpItem *item;
+  const gchar *name;
+
+  item = gimp_value_get_item (&args->values[0], gimp);
+  name = g_value_get_string (&args->values[1]);
+
+  if (success)
+    {
+      success = gimp_item_rename (GIMP_ITEM (item), name, error);
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+static GValueArray *
+item_get_visible_invoker (GimpProcedure      *procedure,
+                          Gimp               *gimp,
+                          GimpContext        *context,
+                          GimpProgress       *progress,
+                          const GValueArray  *args,
+                          GError            **error)
+{
+  gboolean success = TRUE;
+  GValueArray *return_vals;
+  GimpItem *item;
+  gboolean visible = FALSE;
+
+  item = gimp_value_get_item (&args->values[0], gimp);
+
+  if (success)
+    {
+      visible = gimp_item_get_visible (GIMP_ITEM (item));
+    }
+
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
+
+  if (success)
+    g_value_set_boolean (&return_vals->values[1], visible);
+
+  return return_vals;
+}
+
+static GValueArray *
+item_set_visible_invoker (GimpProcedure      *procedure,
+                          Gimp               *gimp,
+                          GimpContext        *context,
+                          GimpProgress       *progress,
+                          const GValueArray  *args,
+                          GError            **error)
+{
+  gboolean success = TRUE;
+  GimpItem *item;
+  gboolean visible;
+
+  item = gimp_value_get_item (&args->values[0], gimp);
+  visible = g_value_get_boolean (&args->values[1]);
+
+  if (success)
+    {
+      gimp_item_set_visible (GIMP_ITEM (item), visible, TRUE);
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+static GValueArray *
+item_get_linked_invoker (GimpProcedure      *procedure,
+                         Gimp               *gimp,
+                         GimpContext        *context,
+                         GimpProgress       *progress,
+                         const GValueArray  *args,
+                         GError            **error)
+{
+  gboolean success = TRUE;
+  GValueArray *return_vals;
+  GimpItem *item;
+  gboolean linked = FALSE;
+
+  item = gimp_value_get_item (&args->values[0], gimp);
+
+  if (success)
+    {
+      linked = gimp_item_get_linked (GIMP_ITEM (item));
+    }
+
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
+
+  if (success)
+    g_value_set_boolean (&return_vals->values[1], linked);
+
+  return return_vals;
+}
+
+static GValueArray *
+item_set_linked_invoker (GimpProcedure      *procedure,
+                         Gimp               *gimp,
+                         GimpContext        *context,
+                         GimpProgress       *progress,
+                         const GValueArray  *args,
+                         GError            **error)
+{
+  gboolean success = TRUE;
+  GimpItem *item;
+  gboolean linked;
+
+  item = gimp_value_get_item (&args->values[0], gimp);
+  linked = g_value_get_boolean (&args->values[1]);
+
+  if (success)
+    {
+      gimp_item_set_linked (GIMP_ITEM (item), linked, TRUE);
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+static GValueArray *
+item_get_lock_content_invoker (GimpProcedure      *procedure,
+                               Gimp               *gimp,
+                               GimpContext        *context,
+                               GimpProgress       *progress,
+                               const GValueArray  *args,
+                               GError            **error)
+{
+  gboolean success = TRUE;
+  GValueArray *return_vals;
+  GimpItem *item;
+  gboolean lock_content = FALSE;
+
+  item = gimp_value_get_item (&args->values[0], gimp);
+
+  if (success)
+    {
+      lock_content = gimp_item_get_lock_content (GIMP_ITEM (item));
+    }
+
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
+
+  if (success)
+    g_value_set_boolean (&return_vals->values[1], lock_content);
+
+  return return_vals;
+}
+
+static GValueArray *
+item_set_lock_content_invoker (GimpProcedure      *procedure,
+                               Gimp               *gimp,
+                               GimpContext        *context,
+                               GimpProgress       *progress,
+                               const GValueArray  *args,
+                               GError            **error)
+{
+  gboolean success = TRUE;
+  GimpItem *item;
+  gboolean lock_content;
+
+  item = gimp_value_get_item (&args->values[0], gimp);
+  lock_content = g_value_get_boolean (&args->values[1]);
+
+  if (success)
+    {
+      if (gimp_item_can_lock_content (GIMP_ITEM (item)))
+        gimp_item_set_lock_content (GIMP_ITEM (item), lock_content, TRUE);
+      else
+        success = FALSE;
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+static GValueArray *
+item_get_tattoo_invoker (GimpProcedure      *procedure,
+                         Gimp               *gimp,
+                         GimpContext        *context,
+                         GimpProgress       *progress,
+                         const GValueArray  *args,
+                         GError            **error)
+{
+  gboolean success = TRUE;
+  GValueArray *return_vals;
+  GimpItem *item;
+  gint32 tattoo = 0;
+
+  item = gimp_value_get_item (&args->values[0], gimp);
+
+  if (success)
+    {
+      tattoo = gimp_item_get_tattoo (GIMP_ITEM (item));
+    }
+
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
+
+  if (success)
+    g_value_set_uint (&return_vals->values[1], tattoo);
+
+  return return_vals;
+}
+
+static GValueArray *
+item_set_tattoo_invoker (GimpProcedure      *procedure,
+                         Gimp               *gimp,
+                         GimpContext        *context,
+                         GimpProgress       *progress,
+                         const GValueArray  *args,
+                         GError            **error)
+{
+  gboolean success = TRUE;
+  GimpItem *item;
+  gint32 tattoo;
+
+  item = gimp_value_get_item (&args->values[0], gimp);
+  tattoo = g_value_get_uint (&args->values[1]);
+
+  if (success)
+    {
+      gimp_item_set_tattoo (GIMP_ITEM (item), tattoo);
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
+void
+register_item_procs (GimpPDB *pdb)
+{
+  GimpProcedure *procedure;
+
+  /*
+   * gimp-item-is-valid
+   */
+  procedure = gimp_procedure_new (item_is_valid_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-item-is-valid");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-item-is-valid",
+                                     "Returns TRUE if the item is valid.",
+                                     "This procedure checks if the given item ID is valid and refers to an existing item.",
+                                     "Sven Neumann <sven gimp org>",
+                                     "Sven Neumann",
+                                     "2007",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_item_id ("item",
+                                                        "item",
+                                                        "The item to check",
+                                                        pdb->gimp, FALSE,
+                                                        GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
+  gimp_procedure_add_return_value (procedure,
+                                   g_param_spec_boolean ("valid",
+                                                         "valid",
+                                                         "Whether the item ID is valid",
+                                                         FALSE,
+                                                         GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-item-get-image
+   */
+  procedure = gimp_procedure_new (item_get_image_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-item-get-image");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-item-get-image",
+                                     "Returns the item's image.",
+                                     "This procedure returns the item's image.",
+                                     "Spencer Kimball & Peter Mattis",
+                                     "Spencer Kimball & Peter Mattis",
+                                     "1995-1996",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_item_id ("item",
+                                                        "item",
+                                                        "The item",
+                                                        pdb->gimp, FALSE,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_procedure_add_return_value (procedure,
+                                   gimp_param_spec_image_id ("image",
+                                                             "image",
+                                                             "The item's image",
+                                                             pdb->gimp, FALSE,
+                                                             GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-item-delete
+   */
+  procedure = gimp_procedure_new (item_delete_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-item-delete");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-item-delete",
+                                     "Delete a item.",
+                                     "This procedure deletes the specified item. This must not be done if the image containing this item was already deleted or if the item was already removed from the image. The only case in which this procedure is useful is if you want to get rid of a item which has not yet been added to an image.",
+                                     "Spencer Kimball & Peter Mattis",
+                                     "Spencer Kimball & Peter Mattis",
+                                     "1995-1996",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_item_id ("item",
+                                                        "item",
+                                                        "The item to delete",
+                                                        pdb->gimp, FALSE,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-item-is-drawable
+   */
+  procedure = gimp_procedure_new (item_is_drawable_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-item-is-drawable");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-item-is-drawable",
+                                     "Returns whether the item is a drawable.",
+                                     "This procedure returns TRUE if the specified item is a drawable.",
+                                     "Spencer Kimball & Peter Mattis",
+                                     "Spencer Kimball & Peter Mattis",
+                                     "1995-1996",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_item_id ("item",
+                                                        "item",
+                                                        "The item",
+                                                        pdb->gimp, FALSE,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_procedure_add_return_value (procedure,
+                                   g_param_spec_boolean ("drawable",
+                                                         "drawable",
+                                                         "TRUE if the item is a drawable, FALSE otherwise",
+                                                         FALSE,
+                                                         GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-item-is-layer
+   */
+  procedure = gimp_procedure_new (item_is_layer_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-item-is-layer");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-item-is-layer",
+                                     "Returns whether the item is a layer.",
+                                     "This procedure returns TRUE if the specified item is a layer.",
+                                     "Spencer Kimball & Peter Mattis",
+                                     "Spencer Kimball & Peter Mattis",
+                                     "1995-1996",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_item_id ("item",
+                                                        "item",
+                                                        "The item",
+                                                        pdb->gimp, FALSE,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_procedure_add_return_value (procedure,
+                                   g_param_spec_boolean ("layer",
+                                                         "layer",
+                                                         "TRUE if the item is a layer, FALSE otherwise",
+                                                         FALSE,
+                                                         GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-item-is-channel
+   */
+  procedure = gimp_procedure_new (item_is_channel_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-item-is-channel");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-item-is-channel",
+                                     "Returns whether the item is a channel.",
+                                     "This procedure returns TRUE if the specified item is a channel.",
+                                     "Spencer Kimball & Peter Mattis",
+                                     "Spencer Kimball & Peter Mattis",
+                                     "1995-1996",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_item_id ("item",
+                                                        "item",
+                                                        "The item",
+                                                        pdb->gimp, FALSE,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_procedure_add_return_value (procedure,
+                                   g_param_spec_boolean ("channel",
+                                                         "channel",
+                                                         "TRUE if the item is a channel, FALSE otherwise",
+                                                         FALSE,
+                                                         GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-item-is-layer-mask
+   */
+  procedure = gimp_procedure_new (item_is_layer_mask_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-item-is-layer-mask");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-item-is-layer-mask",
+                                     "Returns whether the item is a layer mask.",
+                                     "This procedure returns TRUE if the specified item is a layer mask.",
+                                     "Spencer Kimball & Peter Mattis",
+                                     "Spencer Kimball & Peter Mattis",
+                                     "1995-1996",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_item_id ("item",
+                                                        "item",
+                                                        "The item",
+                                                        pdb->gimp, FALSE,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_procedure_add_return_value (procedure,
+                                   g_param_spec_boolean ("layer-mask",
+                                                         "layer mask",
+                                                         "TRUE if the item is a layer mask, FALSE otherwise",
+                                                         FALSE,
+                                                         GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-item-is-selection
+   */
+  procedure = gimp_procedure_new (item_is_selection_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-item-is-selection");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-item-is-selection",
+                                     "Returns whether the item is a selection.",
+                                     "This procedure returns TRUE if the specified item is a selection.",
+                                     "Spencer Kimball & Peter Mattis",
+                                     "Spencer Kimball & Peter Mattis",
+                                     "1995-1996",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_item_id ("item",
+                                                        "item",
+                                                        "The item",
+                                                        pdb->gimp, FALSE,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_procedure_add_return_value (procedure,
+                                   g_param_spec_boolean ("selection",
+                                                         "selection",
+                                                         "TRUE if the item is a selection, FALSE otherwise",
+                                                         FALSE,
+                                                         GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-item-is-vectors
+   */
+  procedure = gimp_procedure_new (item_is_vectors_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-item-is-vectors");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-item-is-vectors",
+                                     "Returns whether the item is a vectors.",
+                                     "This procedure returns TRUE if the specified item is a vectors.",
+                                     "Spencer Kimball & Peter Mattis",
+                                     "Spencer Kimball & Peter Mattis",
+                                     "1995-1996",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_item_id ("item",
+                                                        "item",
+                                                        "The item",
+                                                        pdb->gimp, FALSE,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_procedure_add_return_value (procedure,
+                                   g_param_spec_boolean ("vectors",
+                                                         "vectors",
+                                                         "TRUE if the item is a vectors, FALSE otherwise",
+                                                         FALSE,
+                                                         GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-item-get-name
+   */
+  procedure = gimp_procedure_new (item_get_name_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-item-get-name");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-item-get-name",
+                                     "Get the name of the specified item.",
+                                     "This procedure returns the specified item's name.",
+                                     "Spencer Kimball & Peter Mattis",
+                                     "Spencer Kimball & Peter Mattis",
+                                     "1995-1996",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_item_id ("item",
+                                                        "item",
+                                                        "The item",
+                                                        pdb->gimp, FALSE,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_procedure_add_return_value (procedure,
+                                   gimp_param_spec_string ("name",
+                                                           "name",
+                                                           "The item name",
+                                                           FALSE, FALSE, FALSE,
+                                                           NULL,
+                                                           GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-item-set-name
+   */
+  procedure = gimp_procedure_new (item_set_name_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-item-set-name");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-item-set-name",
+                                     "Set the name of the specified item.",
+                                     "This procedure sets the specified item's name.",
+                                     "Spencer Kimball & Peter Mattis",
+                                     "Spencer Kimball & Peter Mattis",
+                                     "1995-1996",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_item_id ("item",
+                                                        "item",
+                                                        "The item",
+                                                        pdb->gimp, FALSE,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_string ("name",
+                                                       "name",
+                                                       "The new item name",
+                                                       FALSE, FALSE, FALSE,
+                                                       NULL,
+                                                       GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-item-get-visible
+   */
+  procedure = gimp_procedure_new (item_get_visible_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-item-get-visible");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-item-get-visible",
+                                     "Get the visibility of the specified item.",
+                                     "This procedure returns the specified item's visibility.",
+                                     "Spencer Kimball & Peter Mattis",
+                                     "Spencer Kimball & Peter Mattis",
+                                     "1995-1996",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_item_id ("item",
+                                                        "item",
+                                                        "The item",
+                                                        pdb->gimp, FALSE,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_procedure_add_return_value (procedure,
+                                   g_param_spec_boolean ("visible",
+                                                         "visible",
+                                                         "The item visibility",
+                                                         FALSE,
+                                                         GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-item-set-visible
+   */
+  procedure = gimp_procedure_new (item_set_visible_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-item-set-visible");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-item-set-visible",
+                                     "Set the visibility of the specified item.",
+                                     "This procedure sets the specified item's visibility.",
+                                     "Spencer Kimball & Peter Mattis",
+                                     "Spencer Kimball & Peter Mattis",
+                                     "1995-1996",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_item_id ("item",
+                                                        "item",
+                                                        "The item",
+                                                        pdb->gimp, FALSE,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_boolean ("visible",
+                                                     "visible",
+                                                     "The new item visibility",
+                                                     FALSE,
+                                                     GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-item-get-linked
+   */
+  procedure = gimp_procedure_new (item_get_linked_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-item-get-linked");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-item-get-linked",
+                                     "Get the linked state of the specified item.",
+                                     "This procedure returns the specified item's linked state.",
+                                     "Wolfgang Hofer",
+                                     "Wolfgang Hofer",
+                                     "1998",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_item_id ("item",
+                                                        "item",
+                                                        "The item",
+                                                        pdb->gimp, FALSE,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_procedure_add_return_value (procedure,
+                                   g_param_spec_boolean ("linked",
+                                                         "linked",
+                                                         "The item linked state (for moves)",
+                                                         FALSE,
+                                                         GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-item-set-linked
+   */
+  procedure = gimp_procedure_new (item_set_linked_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-item-set-linked");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-item-set-linked",
+                                     "Set the linked state of the specified item.",
+                                     "This procedure sets the specified item's linked state.",
+                                     "Wolfgang Hofer",
+                                     "Wolfgang Hofer",
+                                     "1998",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_item_id ("item",
+                                                        "item",
+                                                        "The item",
+                                                        pdb->gimp, FALSE,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_boolean ("linked",
+                                                     "linked",
+                                                     "The new item linked state",
+                                                     FALSE,
+                                                     GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-item-get-lock-content
+   */
+  procedure = gimp_procedure_new (item_get_lock_content_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-item-get-lock-content");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-item-get-lock-content",
+                                     "Get the 'lock content' state of the specified item.",
+                                     "This procedure returns the specified item's lock content state.",
+                                     "Michael Natterer <mitch gimp org>",
+                                     "Michael Natterer",
+                                     "2009",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_item_id ("item",
+                                                        "item",
+                                                        "The item",
+                                                        pdb->gimp, FALSE,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_procedure_add_return_value (procedure,
+                                   g_param_spec_boolean ("lock-content",
+                                                         "lock content",
+                                                         "Whether the item's pixels are locked",
+                                                         FALSE,
+                                                         GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-item-set-lock-content
+   */
+  procedure = gimp_procedure_new (item_set_lock_content_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-item-set-lock-content");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-item-set-lock-content",
+                                     "Set the 'lock content' state of the specified item.",
+                                     "This procedure sets the specified item's lock content state.",
+                                     "Michael Natterer <mitch gimp org>",
+                                     "Michael Natterer",
+                                     "2009",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_item_id ("item",
+                                                        "item",
+                                                        "The item",
+                                                        pdb->gimp, FALSE,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_boolean ("lock-content",
+                                                     "lock content",
+                                                     "The new item 'lock content' state",
+                                                     FALSE,
+                                                     GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-item-get-tattoo
+   */
+  procedure = gimp_procedure_new (item_get_tattoo_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-item-get-tattoo");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-item-get-tattoo",
+                                     "Get the tattoo of the specified item.",
+                                     "This procedure returns the specified item's tattoo. A tattoo is a unique and permanent identifier attached to a item that can be used to uniquely identify a item within an image even between sessions.",
+                                     "Jay Cox",
+                                     "Jay Cox",
+                                     "1998",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_item_id ("item",
+                                                        "item",
+                                                        "The item",
+                                                        pdb->gimp, FALSE,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_procedure_add_return_value (procedure,
+                                   g_param_spec_uint ("tattoo",
+                                                      "tattoo",
+                                                      "The item tattoo",
+                                                      1, G_MAXUINT32, 1,
+                                                      GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-item-set-tattoo
+   */
+  procedure = gimp_procedure_new (item_set_tattoo_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-item-set-tattoo");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-item-set-tattoo",
+                                     "Set the tattoo of the specified item.",
+                                     "This procedure sets the specified item's tattoo. A tattoo is a unique and permanent identifier attached to a item that can be used to uniquely identify a item within an image even between sessions.",
+                                     "Jay Cox",
+                                     "Jay Cox",
+                                     "1998",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_item_id ("item",
+                                                        "item",
+                                                        "The item",
+                                                        pdb->gimp, FALSE,
+                                                        GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_uint ("tattoo",
+                                                  "tattoo",
+                                                  "The new item tattoo",
+                                                  1, G_MAXUINT32, 1,
+                                                  GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+}
diff --git a/app/plug-in/plug-in-params.c b/app/plug-in/plug-in-params.c
index 2ca3b78..c5a5f9e 100644
--- a/app/plug-in/plug-in-params.c
+++ b/app/plug-in/plug-in-params.c
@@ -192,8 +192,8 @@ plug_in_params_to_args (GParamSpec **pspecs,
           gimp_value_set_rgb (&value, &params[i].data.d_color);
           break;
 
-        case GIMP_PDB_REGION:
-          g_message ("the \"region\" argument type is not supported");
+        case GIMP_PDB_ITEM:
+          g_value_set_int (&value, params[i].data.d_item);
           break;
 
         case GIMP_PDB_DISPLAY:
@@ -353,8 +353,8 @@ plug_in_args_to_params (GValueArray *args,
           gimp_value_get_rgb (value, &params[i].data.d_color);
           break;
 
-        case GIMP_PDB_REGION:
-          g_message ("the \"region\" argument type is not supported");
+        case GIMP_PDB_ITEM:
+          params[i].data.d_item = g_value_get_int (value);
           break;
 
         case GIMP_PDB_DISPLAY:
diff --git a/libgimp/Makefile.am b/libgimp/Makefile.am
index 43df917..403630e 100644
--- a/libgimp/Makefile.am
+++ b/libgimp/Makefile.am
@@ -92,6 +92,7 @@ PDB_WRAPPERS_C = \
 	gimpgrid_pdb.c			\
 	gimphelp_pdb.c			\
 	gimpimage_pdb.c			\
+	gimpitem_pdb.c			\
 	gimplayer_pdb.c			\
 	gimpmessage_pdb.c		\
 	gimpmisc_pdb.c			\
@@ -142,6 +143,7 @@ PDB_WRAPPERS_H = \
 	gimpguides_pdb.h		\
 	gimphelp_pdb.h			\
 	gimpimage_pdb.h			\
+	gimpitem_pdb.h			\
 	gimplayer_pdb.h			\
 	gimpmessage_pdb.h		\
 	gimpmisc_pdb.h			\
diff --git a/libgimp/gimp.c b/libgimp/gimp.c
index 66de18f..5939a87 100644
--- a/libgimp/gimp.c
+++ b/libgimp/gimp.c
@@ -750,6 +750,7 @@ gimp_run_procedure (const gchar *name,
         case GIMP_PDB_INT32:
         case GIMP_PDB_DISPLAY:
         case GIMP_PDB_IMAGE:
+        case GIMP_PDB_ITEM:
         case GIMP_PDB_LAYER:
         case GIMP_PDB_CHANNEL:
         case GIMP_PDB_DRAWABLE:
@@ -792,8 +793,6 @@ gimp_run_procedure (const gchar *name,
         case GIMP_PDB_PARASITE:
           (void) va_arg (args, GimpParasite *);
           break;
-        case GIMP_PDB_REGION:
-          break;
         case GIMP_PDB_END:
           break;
         }
@@ -848,7 +847,8 @@ gimp_run_procedure (const gchar *name,
         case GIMP_PDB_COLOR:
           params[i].data.d_color = *va_arg (args, GimpRGB *);
           break;
-        case GIMP_PDB_REGION:
+        case GIMP_PDB_ITEM:
+          params[i].data.d_item = va_arg (args, gint32);
           break;
         case GIMP_PDB_DISPLAY:
           params[i].data.d_display = va_arg (args, gint32);
diff --git a/libgimp/gimp.h b/libgimp/gimp.h
index 2c21ff7..f2e8e47 100644
--- a/libgimp/gimp.h
+++ b/libgimp/gimp.h
@@ -127,9 +127,10 @@ union _GimpParamData
   gchar           **d_stringarray;
   GimpRGB          *d_colorarray;
   GimpRGB           d_color;
-  GimpParamRegion   d_region;
+  GimpParamRegion   d_region; /* deprecated */
   gint32            d_display;
   gint32            d_image;
+  gint32            d_item;
   gint32            d_layer;
   gint32            d_layer_mask;
   gint32            d_channel;
diff --git a/libgimp/gimp_pdb.h b/libgimp/gimp_pdb.h
index 52ac61f..4a40f63 100644
--- a/libgimp/gimp_pdb.h
+++ b/libgimp/gimp_pdb.h
@@ -47,6 +47,7 @@
 #include <libgimp/gimpguides_pdb.h>
 #include <libgimp/gimphelp_pdb.h>
 #include <libgimp/gimpimage_pdb.h>
+#include <libgimp/gimpitem_pdb.h>
 #include <libgimp/gimplayer_pdb.h>
 #include <libgimp/gimpmessage_pdb.h>
 #include <libgimp/gimpmisc_pdb.h>
diff --git a/libgimp/gimpenums.h b/libgimp/gimpenums.h
index 8b5035c..d52c978 100644
--- a/libgimp/gimpenums.h
+++ b/libgimp/gimpenums.h
@@ -24,15 +24,6 @@
 G_BEGIN_DECLS
 
 
-/**
- * SECTION: gimpenums
- * @title: gimpenums
- * @short_description: Enums and definitions.
- *
- * Enums and definitions.
- **/
-
-
 #define GIMP_TYPE_BRUSH_APPLICATION_MODE (gimp_brush_application_mode_get_type ())
 
 GType gimp_brush_application_mode_get_type (void) G_GNUC_CONST;
diff --git a/libgimp/gimpitem_pdb.c b/libgimp/gimpitem_pdb.c
new file mode 100644
index 0000000..9090511
--- /dev/null
+++ b/libgimp/gimpitem_pdb.c
@@ -0,0 +1,661 @@
+/* LIBGIMP - The GIMP Library
+ * Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
+ *
+ * gimpitem_pdb.c
+ *
+ * This library is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+/* NOTE: This file is auto-generated by pdbgen.pl */
+
+#include "config.h"
+
+#include "gimp.h"
+
+
+/**
+ * SECTION: gimpitem
+ * @title: gimpitem
+ * @short_description: Functions to manipulate items.
+ *
+ * Functions to manipulate items.
+ **/
+
+
+/**
+ * gimp_item_is_valid:
+ * @item_ID: The item to check.
+ *
+ * Returns TRUE if the item is valid.
+ *
+ * This procedure checks if the given item ID is valid and refers to an
+ * existing item.
+ *
+ * Returns: Whether the item ID is valid.
+ *
+ * Since: GIMP 2.8
+ */
+gboolean
+gimp_item_is_valid (gint32 item_ID)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean valid = FALSE;
+
+  return_vals = gimp_run_procedure ("gimp-item-is-valid",
+                                    &nreturn_vals,
+                                    GIMP_PDB_ITEM, item_ID,
+                                    GIMP_PDB_END);
+
+  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
+    valid = return_vals[1].data.d_int32;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return valid;
+}
+
+/**
+ * gimp_item_get_image:
+ * @item_ID: The item.
+ *
+ * Returns the item's image.
+ *
+ * This procedure returns the item's image.
+ *
+ * Returns: The item's image.
+ *
+ * Since: GIMP 2.8
+ */
+gint32
+gimp_item_get_image (gint32 item_ID)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gint32 image_ID = -1;
+
+  return_vals = gimp_run_procedure ("gimp-item-get-image",
+                                    &nreturn_vals,
+                                    GIMP_PDB_ITEM, item_ID,
+                                    GIMP_PDB_END);
+
+  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
+    image_ID = return_vals[1].data.d_image;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return image_ID;
+}
+
+/**
+ * gimp_item_delete:
+ * @item_ID: The item to delete.
+ *
+ * Delete a item.
+ *
+ * This procedure deletes the specified item. This must not be done if
+ * the image containing this item was already deleted or if the item
+ * was already removed from the image. The only case in which this
+ * procedure is useful is if you want to get rid of a item which has
+ * not yet been added to an image.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.8
+ */
+gboolean
+gimp_item_delete (gint32 item_ID)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean success = TRUE;
+
+  return_vals = gimp_run_procedure ("gimp-item-delete",
+                                    &nreturn_vals,
+                                    GIMP_PDB_ITEM, item_ID,
+                                    GIMP_PDB_END);
+
+  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return success;
+}
+
+/**
+ * gimp_item_is_drawable:
+ * @item_ID: The item.
+ *
+ * Returns whether the item is a drawable.
+ *
+ * This procedure returns TRUE if the specified item is a drawable.
+ *
+ * Returns: TRUE if the item is a drawable, FALSE otherwise.
+ *
+ * Since: GIMP 2.8
+ */
+gboolean
+gimp_item_is_drawable (gint32 item_ID)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean drawable = FALSE;
+
+  return_vals = gimp_run_procedure ("gimp-item-is-drawable",
+                                    &nreturn_vals,
+                                    GIMP_PDB_ITEM, item_ID,
+                                    GIMP_PDB_END);
+
+  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
+    drawable = return_vals[1].data.d_int32;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return drawable;
+}
+
+/**
+ * gimp_item_is_layer:
+ * @item_ID: The item.
+ *
+ * Returns whether the item is a layer.
+ *
+ * This procedure returns TRUE if the specified item is a layer.
+ *
+ * Returns: TRUE if the item is a layer, FALSE otherwise.
+ *
+ * Since: GIMP 2.8
+ */
+gboolean
+gimp_item_is_layer (gint32 item_ID)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean layer = FALSE;
+
+  return_vals = gimp_run_procedure ("gimp-item-is-layer",
+                                    &nreturn_vals,
+                                    GIMP_PDB_ITEM, item_ID,
+                                    GIMP_PDB_END);
+
+  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
+    layer = return_vals[1].data.d_int32;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return layer;
+}
+
+/**
+ * gimp_item_is_channel:
+ * @item_ID: The item.
+ *
+ * Returns whether the item is a channel.
+ *
+ * This procedure returns TRUE if the specified item is a channel.
+ *
+ * Returns: TRUE if the item is a channel, FALSE otherwise.
+ *
+ * Since: GIMP 2.8
+ */
+gboolean
+gimp_item_is_channel (gint32 item_ID)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean channel = FALSE;
+
+  return_vals = gimp_run_procedure ("gimp-item-is-channel",
+                                    &nreturn_vals,
+                                    GIMP_PDB_ITEM, item_ID,
+                                    GIMP_PDB_END);
+
+  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
+    channel = return_vals[1].data.d_int32;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return channel;
+}
+
+/**
+ * gimp_item_is_layer_mask:
+ * @item_ID: The item.
+ *
+ * Returns whether the item is a layer mask.
+ *
+ * This procedure returns TRUE if the specified item is a layer mask.
+ *
+ * Returns: TRUE if the item is a layer mask, FALSE otherwise.
+ *
+ * Since: GIMP 2.8
+ */
+gboolean
+gimp_item_is_layer_mask (gint32 item_ID)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean layer_mask = FALSE;
+
+  return_vals = gimp_run_procedure ("gimp-item-is-layer-mask",
+                                    &nreturn_vals,
+                                    GIMP_PDB_ITEM, item_ID,
+                                    GIMP_PDB_END);
+
+  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
+    layer_mask = return_vals[1].data.d_int32;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return layer_mask;
+}
+
+/**
+ * gimp_item_is_selection:
+ * @item_ID: The item.
+ *
+ * Returns whether the item is a selection.
+ *
+ * This procedure returns TRUE if the specified item is a selection.
+ *
+ * Returns: TRUE if the item is a selection, FALSE otherwise.
+ *
+ * Since: GIMP 2.8
+ */
+gboolean
+gimp_item_is_selection (gint32 item_ID)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean selection = FALSE;
+
+  return_vals = gimp_run_procedure ("gimp-item-is-selection",
+                                    &nreturn_vals,
+                                    GIMP_PDB_ITEM, item_ID,
+                                    GIMP_PDB_END);
+
+  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
+    selection = return_vals[1].data.d_int32;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return selection;
+}
+
+/**
+ * gimp_item_is_vectors:
+ * @item_ID: The item.
+ *
+ * Returns whether the item is a vectors.
+ *
+ * This procedure returns TRUE if the specified item is a vectors.
+ *
+ * Returns: TRUE if the item is a vectors, FALSE otherwise.
+ *
+ * Since: GIMP 2.8
+ */
+gboolean
+gimp_item_is_vectors (gint32 item_ID)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean vectors = FALSE;
+
+  return_vals = gimp_run_procedure ("gimp-item-is-vectors",
+                                    &nreturn_vals,
+                                    GIMP_PDB_ITEM, item_ID,
+                                    GIMP_PDB_END);
+
+  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
+    vectors = return_vals[1].data.d_int32;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return vectors;
+}
+
+/**
+ * gimp_item_get_name:
+ * @item_ID: The item.
+ *
+ * Get the name of the specified item.
+ *
+ * This procedure returns the specified item's name.
+ *
+ * Returns: The item name.
+ *
+ * Since: GIMP 2.8
+ */
+gchar *
+gimp_item_get_name (gint32 item_ID)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gchar *name = NULL;
+
+  return_vals = gimp_run_procedure ("gimp-item-get-name",
+                                    &nreturn_vals,
+                                    GIMP_PDB_ITEM, item_ID,
+                                    GIMP_PDB_END);
+
+  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
+    name = g_strdup (return_vals[1].data.d_string);
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return name;
+}
+
+/**
+ * gimp_item_set_name:
+ * @item_ID: The item.
+ * @name: The new item name.
+ *
+ * Set the name of the specified item.
+ *
+ * This procedure sets the specified item's name.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.8
+ */
+gboolean
+gimp_item_set_name (gint32       item_ID,
+                    const gchar *name)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean success = TRUE;
+
+  return_vals = gimp_run_procedure ("gimp-item-set-name",
+                                    &nreturn_vals,
+                                    GIMP_PDB_ITEM, item_ID,
+                                    GIMP_PDB_STRING, name,
+                                    GIMP_PDB_END);
+
+  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return success;
+}
+
+/**
+ * gimp_item_get_visible:
+ * @item_ID: The item.
+ *
+ * Get the visibility of the specified item.
+ *
+ * This procedure returns the specified item's visibility.
+ *
+ * Returns: The item visibility.
+ *
+ * Since: GIMP 2.8
+ */
+gboolean
+gimp_item_get_visible (gint32 item_ID)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean visible = FALSE;
+
+  return_vals = gimp_run_procedure ("gimp-item-get-visible",
+                                    &nreturn_vals,
+                                    GIMP_PDB_ITEM, item_ID,
+                                    GIMP_PDB_END);
+
+  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
+    visible = return_vals[1].data.d_int32;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return visible;
+}
+
+/**
+ * gimp_item_set_visible:
+ * @item_ID: The item.
+ * @visible: The new item visibility.
+ *
+ * Set the visibility of the specified item.
+ *
+ * This procedure sets the specified item's visibility.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.8
+ */
+gboolean
+gimp_item_set_visible (gint32   item_ID,
+                       gboolean visible)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean success = TRUE;
+
+  return_vals = gimp_run_procedure ("gimp-item-set-visible",
+                                    &nreturn_vals,
+                                    GIMP_PDB_ITEM, item_ID,
+                                    GIMP_PDB_INT32, visible,
+                                    GIMP_PDB_END);
+
+  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return success;
+}
+
+/**
+ * gimp_item_get_linked:
+ * @item_ID: The item.
+ *
+ * Get the linked state of the specified item.
+ *
+ * This procedure returns the specified item's linked state.
+ *
+ * Returns: The item linked state (for moves).
+ *
+ * Since: GIMP 2.8
+ */
+gboolean
+gimp_item_get_linked (gint32 item_ID)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean linked = FALSE;
+
+  return_vals = gimp_run_procedure ("gimp-item-get-linked",
+                                    &nreturn_vals,
+                                    GIMP_PDB_ITEM, item_ID,
+                                    GIMP_PDB_END);
+
+  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
+    linked = return_vals[1].data.d_int32;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return linked;
+}
+
+/**
+ * gimp_item_set_linked:
+ * @item_ID: The item.
+ * @linked: The new item linked state.
+ *
+ * Set the linked state of the specified item.
+ *
+ * This procedure sets the specified item's linked state.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.8
+ */
+gboolean
+gimp_item_set_linked (gint32   item_ID,
+                      gboolean linked)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean success = TRUE;
+
+  return_vals = gimp_run_procedure ("gimp-item-set-linked",
+                                    &nreturn_vals,
+                                    GIMP_PDB_ITEM, item_ID,
+                                    GIMP_PDB_INT32, linked,
+                                    GIMP_PDB_END);
+
+  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return success;
+}
+
+/**
+ * gimp_item_get_lock_content:
+ * @item_ID: The item.
+ *
+ * Get the 'lock content' state of the specified item.
+ *
+ * This procedure returns the specified item's lock content state.
+ *
+ * Returns: Whether the item's pixels are locked.
+ *
+ * Since: GIMP 2.8
+ */
+gboolean
+gimp_item_get_lock_content (gint32 item_ID)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean lock_content = FALSE;
+
+  return_vals = gimp_run_procedure ("gimp-item-get-lock-content",
+                                    &nreturn_vals,
+                                    GIMP_PDB_ITEM, item_ID,
+                                    GIMP_PDB_END);
+
+  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
+    lock_content = return_vals[1].data.d_int32;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return lock_content;
+}
+
+/**
+ * gimp_item_set_lock_content:
+ * @item_ID: The item.
+ * @lock_content: The new item 'lock content' state.
+ *
+ * Set the 'lock content' state of the specified item.
+ *
+ * This procedure sets the specified item's lock content state.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.8
+ */
+gboolean
+gimp_item_set_lock_content (gint32   item_ID,
+                            gboolean lock_content)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean success = TRUE;
+
+  return_vals = gimp_run_procedure ("gimp-item-set-lock-content",
+                                    &nreturn_vals,
+                                    GIMP_PDB_ITEM, item_ID,
+                                    GIMP_PDB_INT32, lock_content,
+                                    GIMP_PDB_END);
+
+  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return success;
+}
+
+/**
+ * gimp_item_get_tattoo:
+ * @item_ID: The item.
+ *
+ * Get the tattoo of the specified item.
+ *
+ * This procedure returns the specified item's tattoo. A tattoo is a
+ * unique and permanent identifier attached to a item that can be used
+ * to uniquely identify a item within an image even between sessions.
+ *
+ * Returns: The item tattoo.
+ *
+ * Since: GIMP 2.8
+ */
+gint
+gimp_item_get_tattoo (gint32 item_ID)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gint tattoo = 0;
+
+  return_vals = gimp_run_procedure ("gimp-item-get-tattoo",
+                                    &nreturn_vals,
+                                    GIMP_PDB_ITEM, item_ID,
+                                    GIMP_PDB_END);
+
+  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
+    tattoo = return_vals[1].data.d_tattoo;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return tattoo;
+}
+
+/**
+ * gimp_item_set_tattoo:
+ * @item_ID: The item.
+ * @tattoo: The new item tattoo.
+ *
+ * Set the tattoo of the specified item.
+ *
+ * This procedure sets the specified item's tattoo. A tattoo is a
+ * unique and permanent identifier attached to a item that can be used
+ * to uniquely identify a item within an image even between sessions.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.8
+ */
+gboolean
+gimp_item_set_tattoo (gint32 item_ID,
+                      gint   tattoo)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean success = TRUE;
+
+  return_vals = gimp_run_procedure ("gimp-item-set-tattoo",
+                                    &nreturn_vals,
+                                    GIMP_PDB_ITEM, item_ID,
+                                    GIMP_PDB_INT32, tattoo,
+                                    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
new file mode 100644
index 0000000..1cbe246
--- /dev/null
+++ b/libgimp/gimpitem_pdb.h
@@ -0,0 +1,59 @@
+/* LIBGIMP - The GIMP Library
+ * Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
+ *
+ * gimpitem_pdb.h
+ *
+ * This library is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+/* NOTE: This file is auto-generated by pdbgen.pl */
+
+#ifndef __GIMP_ITEM_PDB_H__
+#define __GIMP_ITEM_PDB_H__
+
+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_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);
+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
+
+#endif /* __GIMP_ITEM_PDB_H__ */
diff --git a/libgimpbase/gimpbaseenums.c b/libgimpbase/gimpbaseenums.c
index 45a506b..6a0b0c5 100644
--- a/libgimpbase/gimpbaseenums.c
+++ b/libgimpbase/gimpbaseenums.c
@@ -832,7 +832,7 @@ gimp_pdb_arg_type_get_type (void)
     { GIMP_PDB_FLOATARRAY, "GIMP_PDB_FLOATARRAY", "floatarray" },
     { GIMP_PDB_STRINGARRAY, "GIMP_PDB_STRINGARRAY", "stringarray" },
     { GIMP_PDB_COLOR, "GIMP_PDB_COLOR", "color" },
-    { GIMP_PDB_REGION, "GIMP_PDB_REGION", "region" },
+    { GIMP_PDB_ITEM, "GIMP_PDB_ITEM", "item" },
     { GIMP_PDB_DISPLAY, "GIMP_PDB_DISPLAY", "display" },
     { GIMP_PDB_IMAGE, "GIMP_PDB_IMAGE", "image" },
     { GIMP_PDB_LAYER, "GIMP_PDB_LAYER", "layer" },
@@ -860,7 +860,7 @@ gimp_pdb_arg_type_get_type (void)
     { GIMP_PDB_FLOATARRAY, "GIMP_PDB_FLOATARRAY", NULL },
     { GIMP_PDB_STRINGARRAY, "GIMP_PDB_STRINGARRAY", NULL },
     { GIMP_PDB_COLOR, "GIMP_PDB_COLOR", NULL },
-    { GIMP_PDB_REGION, "GIMP_PDB_REGION", NULL },
+    { GIMP_PDB_ITEM, "GIMP_PDB_ITEM", NULL },
     { GIMP_PDB_DISPLAY, "GIMP_PDB_DISPLAY", NULL },
     { GIMP_PDB_IMAGE, "GIMP_PDB_IMAGE", NULL },
     { GIMP_PDB_LAYER, "GIMP_PDB_LAYER", NULL },
diff --git a/libgimpbase/gimpbaseenums.h b/libgimpbase/gimpbaseenums.h
index 3ad47b8..10bb510 100644
--- a/libgimpbase/gimpbaseenums.h
+++ b/libgimpbase/gimpbaseenums.h
@@ -374,7 +374,7 @@ typedef enum
   GIMP_PDB_FLOATARRAY,
   GIMP_PDB_STRINGARRAY,
   GIMP_PDB_COLOR,
-  GIMP_PDB_REGION,
+  GIMP_PDB_ITEM,
   GIMP_PDB_DISPLAY,
   GIMP_PDB_IMAGE,
   GIMP_PDB_LAYER,
@@ -389,7 +389,8 @@ typedef enum
 
   /*  the following aliases are deprecated  */
   GIMP_PDB_PATH     = GIMP_PDB_VECTORS,     /*< skip >*/
-  GIMP_PDB_BOUNDARY = GIMP_PDB_COLORARRAY   /*< skip >*/
+  GIMP_PDB_BOUNDARY = GIMP_PDB_COLORARRAY,  /*< skip >*/
+  GIMP_PDB_REGION   = GIMP_PDB_ITEM         /*< skip >*/
 } GimpPDBArgType;
 
 
diff --git a/libgimpbase/gimpprotocol.c b/libgimpbase/gimpprotocol.c
index 08310eb..ab0bdc8 100644
--- a/libgimpbase/gimpprotocol.c
+++ b/libgimpbase/gimpprotocol.c
@@ -1435,7 +1435,11 @@ _gp_params_read (GIOChannel  *channel,
             goto cleanup;
           break;
 
-        case GIMP_PDB_REGION:
+        case GIMP_PDB_ITEM:
+          if (! _gimp_wire_read_int32 (channel,
+                                       (guint32 *) &(*params)[i].data.d_item, 1,
+                                       user_data))
+            goto cleanup;
           break;
 
         case GIMP_PDB_DISPLAY:
@@ -1658,7 +1662,11 @@ _gp_params_write (GIOChannel *channel,
             return;
           break;
 
-        case GIMP_PDB_REGION:
+        case GIMP_PDB_ITEM:
+          if (! _gimp_wire_write_int32 (channel,
+                                        (const guint32 *) &params[i].data.d_item, 1,
+                                        user_data))
+            return;
           break;
 
         case GIMP_PDB_DISPLAY:
@@ -1772,7 +1780,7 @@ gp_params_destroy (GPParam *params,
         case GIMP_PDB_INT8:
         case GIMP_PDB_FLOAT:
         case GIMP_PDB_COLOR:
-        case GIMP_PDB_REGION:
+        case GIMP_PDB_ITEM:
         case GIMP_PDB_DISPLAY:
         case GIMP_PDB_IMAGE:
         case GIMP_PDB_LAYER:
diff --git a/libgimpbase/gimpprotocol.h b/libgimpbase/gimpprotocol.h
index ba1eed7..0514d63 100644
--- a/libgimpbase/gimpprotocol.h
+++ b/libgimpbase/gimpprotocol.h
@@ -26,7 +26,7 @@ G_BEGIN_DECLS
 
 /* Increment every time the protocol changes
  */
-#define GIMP_PROTOCOL_VERSION  0x0013
+#define GIMP_PROTOCOL_VERSION  0x0014
 
 
 enum
@@ -127,9 +127,10 @@ struct _GPParam
       gint32 y;
       gint32 width;
       gint32 height;
-    } d_region;
+    } d_region; /* deprecated */
     gint32        d_display;
     gint32        d_image;
+    gint32        d_item;
     gint32        d_layer;
     gint32        d_channel;
     gint32        d_drawable;
diff --git a/plug-ins/script-fu/scheme-wrapper.c b/plug-ins/script-fu/scheme-wrapper.c
index c27a0f8..93d3797 100644
--- a/plug-ins/script-fu/scheme-wrapper.c
+++ b/plug-ins/script-fu/scheme-wrapper.c
@@ -745,6 +745,7 @@ script_fu_marshal_procedure_call (scheme  *sc,
         case GIMP_PDB_INT32:
         case GIMP_PDB_DISPLAY:
         case GIMP_PDB_IMAGE:
+        case GIMP_PDB_ITEM:
         case GIMP_PDB_LAYER:
         case GIMP_PDB_CHANNEL:
         case GIMP_PDB_DRAWABLE:
@@ -1173,36 +1174,6 @@ script_fu_marshal_procedure_call (scheme  *sc,
             }
           break;
 
-        case GIMP_PDB_REGION:
-          if (! (sc->vptr->is_list (sc, sc->vptr->pair_car (a)) &&
-            sc->vptr->list_length (sc, sc->vptr->pair_car (a)) == 4))
-            success = FALSE;
-          if (success)
-            {
-              pointer region;
-
-              region = sc->vptr->pair_car (a);
-              args[i].data.d_region.x =
-                           sc->vptr->ivalue (sc->vptr->pair_car (region));
-              region = sc->vptr->pair_cdr (region);
-              args[i].data.d_region.y =
-                           sc->vptr->ivalue (sc->vptr->pair_car (region));
-              region = sc->vptr->pair_cdr (region);
-              args[i].data.d_region.width =
-                           sc->vptr->ivalue (sc->vptr->pair_car (region));
-              region = sc->vptr->pair_cdr (region);
-              args[i].data.d_region.height =
-                           sc->vptr->ivalue (sc->vptr->pair_car (region));
-#if DEBUG_MARSHALL
-              g_printerr ("      (%d %d %d %d)\n",
-                          args[i].data.d_region.x,
-                          args[i].data.d_region.y,
-                          args[i].data.d_region.width,
-                          args[i].data.d_region.height);
-#endif
-            }
-          break;
-
         case GIMP_PDB_PARASITE:
           if (!sc->vptr->is_list (sc, sc->vptr->pair_car (a)) ||
               sc->vptr->list_length (sc, sc->vptr->pair_car (a)) != 3)
@@ -1385,6 +1356,7 @@ script_fu_marshal_procedure_call (scheme  *sc,
             case GIMP_PDB_INT32:
             case GIMP_PDB_DISPLAY:
             case GIMP_PDB_IMAGE:
+            case GIMP_PDB_ITEM:
             case GIMP_PDB_LAYER:
             case GIMP_PDB_CHANNEL:
             case GIMP_PDB_DRAWABLE:
@@ -1560,32 +1532,6 @@ script_fu_marshal_procedure_call (scheme  *sc,
               }
               break;
 
-            case GIMP_PDB_REGION:
-              {
-                gint32  x, y, w, h;
-                pointer temp_val;
-
-                x = values[i + 1].data.d_region.x;
-                y = values[i + 1].data.d_region.y;
-                w = values[i + 1].data.d_region.width;
-                h = values[i + 1].data.d_region.height;
-
-                temp_val = sc->vptr->cons (sc,
-                             sc->vptr->mk_integer (sc, x),
-                             sc->vptr->cons (sc,
-                               sc->vptr->mk_integer (sc, y),
-                               sc->vptr->cons (sc,
-                                 sc->vptr->mk_integer (sc, w),
-                                 sc->vptr->cons (sc,
-                                   sc->vptr->mk_integer (sc, h),
-                                   sc->NIL))));
-                return_val = sc->vptr->cons (sc,
-                                             temp_val,
-                                             return_val);
-                break;
-              }
-              break;
-
             case GIMP_PDB_PARASITE:
               {
                 if (values[i + 1].data.d_parasite.name == NULL)
@@ -1722,9 +1668,9 @@ script_fu_marshal_destroy_args (GimpParam *params,
           break;
 
         case GIMP_PDB_COLOR:
-        case GIMP_PDB_REGION:
         case GIMP_PDB_DISPLAY:
         case GIMP_PDB_IMAGE:
+        case GIMP_PDB_ITEM:
         case GIMP_PDB_LAYER:
         case GIMP_PDB_CHANNEL:
         case GIMP_PDB_DRAWABLE:
diff --git a/tools/pdbgen/Makefile.am b/tools/pdbgen/Makefile.am
index 0b619b0..8d6d9db 100644
--- a/tools/pdbgen/Makefile.am
+++ b/tools/pdbgen/Makefile.am
@@ -26,6 +26,7 @@ pdb_sources = \
 	pdb/guides.pdb			\
 	pdb/help.pdb			\
 	pdb/image.pdb			\
+	pdb/item.pdb			\
 	pdb/layer.pdb			\
 	pdb/message.pdb			\
 	pdb/misc.pdb			\
diff --git a/tools/pdbgen/app.pl b/tools/pdbgen/app.pl
index 2a143f1..38f316e 100644
--- a/tools/pdbgen/app.pl
+++ b/tools/pdbgen/app.pl
@@ -223,6 +223,16 @@ gimp_param_spec_image_id ("$name",
                           $flags)
 CODE
     }
+    elsif ($pdbtype eq 'item') {
+	$none_ok = exists $arg->{none_ok} ? 'TRUE' : 'FALSE';
+	$pspec = <<CODE;
+gimp_param_spec_item_id ("$name",
+                         "$nick",
+                         "$blurb",
+                         pdb->gimp, $none_ok,
+                         $flags)
+CODE
+    }
     elsif ($pdbtype eq 'drawable') {
 	$none_ok = exists $arg->{none_ok} ? 'TRUE' : 'FALSE';
 	$pspec = <<CODE;
diff --git a/tools/pdbgen/enums.pl b/tools/pdbgen/enums.pl
index ed5ef50..68568d2 100644
--- a/tools/pdbgen/enums.pl
+++ b/tools/pdbgen/enums.pl
@@ -261,12 +261,12 @@ package Gimp::CodeGen::enums;
 			  GIMP_PDB_FLOAT GIMP_PDB_STRING GIMP_PDB_INT32ARRAY
 			  GIMP_PDB_INT16ARRAY GIMP_PDB_INT8ARRAY
 			  GIMP_PDB_FLOATARRAY GIMP_PDB_STRINGARRAY
-			  GIMP_PDB_COLOR GIMP_PDB_REGION GIMP_PDB_DISPLAY
+			  GIMP_PDB_COLOR GIMP_PDB_ITEM GIMP_PDB_DISPLAY
 			  GIMP_PDB_IMAGE GIMP_PDB_LAYER GIMP_PDB_CHANNEL
 			  GIMP_PDB_DRAWABLE GIMP_PDB_SELECTION
 			  GIMP_PDB_COLORARRAY GIMP_PDB_VECTORS
 			  GIMP_PDB_PARASITE GIMP_PDB_STATUS GIMP_PDB_END
-			  GIMP_PDB_PATH GIMP_PDB_BOUNDARY) ],
+			  GIMP_PDB_PATH GIMP_PDB_BOUNDARY GIMP_PDB_REGION) ],
 	  mapping => { GIMP_PDB_INT32 => '0',
 		       GIMP_PDB_INT16 => '1',
 		       GIMP_PDB_INT8 => '2',
@@ -278,7 +278,7 @@ package Gimp::CodeGen::enums;
 		       GIMP_PDB_FLOATARRAY => '8',
 		       GIMP_PDB_STRINGARRAY => '9',
 		       GIMP_PDB_COLOR => '10',
-		       GIMP_PDB_REGION => '11',
+		       GIMP_PDB_ITEM => '11',
 		       GIMP_PDB_DISPLAY => '12',
 		       GIMP_PDB_IMAGE => '13',
 		       GIMP_PDB_LAYER => '14',
@@ -291,7 +291,8 @@ package Gimp::CodeGen::enums;
 		       GIMP_PDB_STATUS => '21',
 		       GIMP_PDB_END => '22',
 		       GIMP_PDB_PATH => 'GIMP_PDB_VECTORS',
-		       GIMP_PDB_BOUNDARY => 'GIMP_PDB_COLORARRAY' }
+		       GIMP_PDB_BOUNDARY => 'GIMP_PDB_COLORARRAY',
+		       GIMP_PDB_REGION => 'GIMP_PDB_ITEM' }
 	},
     GimpPDBErrorHandler =>
 	{ contig => 1,
diff --git a/tools/pdbgen/groups.pl b/tools/pdbgen/groups.pl
index 5fc8510..0579d02 100644
--- a/tools/pdbgen/groups.pl
+++ b/tools/pdbgen/groups.pl
@@ -24,6 +24,7 @@
     guides
     help
     image
+    item
     layer
     message
     misc
diff --git a/tools/pdbgen/pdb.pl b/tools/pdbgen/pdb.pl
index 4058302..e54049d 100644
--- a/tools/pdbgen/pdb.pl
+++ b/tools/pdbgen/pdb.pl
@@ -126,6 +126,15 @@ package Gimp::CodeGen::pdb;
 		     set_value_func => 'gimp_value_set_image ($value, $var)',
 		     headers        => [ qw("core/gimpimage.h") ] },
 
+    item        => { name           => 'ITEM',
+		     type           => 'GimpItem *', 
+		     const_type     => 'GimpItem *', 
+		     id             => 1,
+		     init_value     => 'NULL',
+		     get_value_func => '$var = gimp_value_get_item ($value, gimp)',
+		     set_value_func => 'gimp_value_set_item ($value, $var)',
+		     headers        => [ qw("core/gimpitem.h") ] },
+
     layer       => { name           => 'LAYER',
 		     type           => 'GimpLayer *', 
 		     const_type     => 'GimpLayer *', 
diff --git a/tools/pdbgen/pdb/item.pdb b/tools/pdbgen/pdb/item.pdb
new file mode 100644
index 0000000..217afac
--- /dev/null
+++ b/tools/pdbgen/pdb/item.pdb
@@ -0,0 +1,575 @@
+# GIMP - The GNU Image Manipulation Program
+# Copyright (C) 1995 Spencer Kimball and Peter Mattis
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# "Perlized" from C source by Manish Singh <yosh gimp org>
+
+sub item_is_valid {
+    $blurb = 'Returns TRUE if the item is valid.';
+
+    $help = <<'HELP';
+This procedure checks if the given item ID is valid and refers to an
+existing item.
+HELP
+
+    &neo_pdb_misc('2007', '2.8');
+
+    @inargs = (
+	{ name => 'item', type => 'item', no_validate => 1,
+	  desc => 'The item to check' }
+    );
+
+    @outargs = (
+	{ name => 'valid', type => 'boolean',
+	  desc => 'Whether the item ID is valid' }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  valid = (GIMP_IS_ITEM (item) &&
+           ! gimp_item_is_removed (GIMP_ITEM (item)));
+}
+CODE
+    );
+}
+
+sub item_get_image {
+    $blurb = "Returns the item's image.";
+
+    $help = "This procedure returns the item's image.";
+
+    &std_pdb_misc;
+    $since = '2.8';
+
+    @inargs = (
+	{ name => 'item', type => 'item',
+	  desc => 'The item' }
+    );
+
+    @outargs = (
+	{ name => 'image', type => 'image',
+	  desc => "The item's image" }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  image = gimp_item_get_image (GIMP_ITEM (item));
+}
+CODE
+    );
+}
+
+sub item_delete {
+    $blurb = 'Delete a item.';
+
+    $help = <<'HELP';
+This procedure deletes the specified item. This must not be done if the
+image containing this item was already deleted or if the item was
+already removed from the image. The only case in which this procedure is
+useful is if you want to get rid of a item which has not yet been
+added to an image.
+HELP
+
+    &std_pdb_misc;
+    $since = '2.8';
+
+    @inargs = (
+	{ name => 'item', type => 'item',
+	  desc => 'The item to delete' }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  if (g_object_is_floating (item))
+    {
+      g_object_ref_sink (item);
+      g_object_unref (item);
+    }
+  else
+    success = FALSE;
+}
+CODE
+    );
+}
+
+sub item_is_drawable {
+    $blurb = 'Returns whether the item is a drawable.';
+
+    $help = <<HELP;
+This procedure returns TRUE if the specified item is a drawable.
+HELP
+
+    &std_pdb_misc;
+    $since = '2.8';
+
+    @inargs = (
+	{ name => 'item', type => 'item',
+	  desc => 'The item' }
+    );
+
+    @outargs = (
+	{ name => 'drawable', type => 'boolean',
+	  desc => 'TRUE if the item is a drawable, FALSE otherwise' }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  drawable = GIMP_IS_DRAWABLE (item);
+}
+CODE
+    );
+}
+
+sub item_is_layer {
+    $blurb = 'Returns whether the item is a layer.';
+
+    $help = <<HELP;
+This procedure returns TRUE if the specified item is a layer.
+HELP
+
+    &std_pdb_misc;
+    $since = '2.8';
+
+    @inargs = (
+	{ name => 'item', type => 'item',
+	  desc => 'The item' }
+    );
+
+    @outargs = (
+	{ name => 'layer', type => 'boolean',
+	  desc => 'TRUE if the item is a layer, FALSE otherwise' }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  layer = GIMP_IS_LAYER (item);
+}
+CODE
+    );
+}
+
+sub item_is_channel {
+    $blurb = 'Returns whether the item is a channel.';
+
+    $help = <<HELP;
+This procedure returns TRUE if the specified item is a channel.
+HELP
+
+    &std_pdb_misc;
+    $since = '2.8';
+
+    @inargs = (
+	{ name => 'item', type => 'item',
+	  desc => 'The item' }
+    );
+
+    @outargs = (
+	{ name => 'channel', type => 'boolean',
+	  desc => 'TRUE if the item is a channel, FALSE otherwise' }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  channel = GIMP_IS_CHANNEL (item);
+}
+CODE
+    );
+}
+
+sub item_is_layer_mask {
+    $blurb = 'Returns whether the item is a layer mask.';
+
+    $help = <<HELP;
+This procedure returns TRUE if the specified item is a layer mask.
+HELP
+
+    &std_pdb_misc;
+    $since = '2.8';
+
+    @inargs = (
+	{ name => 'item', type => 'item',
+	  desc => 'The item' }
+    );
+
+    @outargs = (
+	{ name => 'layer_mask', type => 'boolean',
+	  desc => 'TRUE if the item is a layer mask, FALSE otherwise' }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  layer_mask = GIMP_IS_LAYER_MASK (item);
+}
+CODE
+    );
+}
+
+sub item_is_selection {
+    $blurb = 'Returns whether the item is a selection.';
+
+    $help = <<HELP;
+This procedure returns TRUE if the specified item is a selection.
+HELP
+
+    &std_pdb_misc;
+    $since = '2.8';
+
+    @inargs = (
+	{ name => 'item', type => 'item',
+	  desc => 'The item' }
+    );
+
+    @outargs = (
+	{ name => 'selection', type => 'boolean',
+	  desc => 'TRUE if the item is a selection, FALSE otherwise' }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  selection = GIMP_IS_SELECTION (item);
+}
+CODE
+    );
+}
+
+sub item_is_vectors {
+    $blurb = 'Returns whether the item is a vectors.';
+
+    $help = <<HELP;
+This procedure returns TRUE if the specified item is a vectors.
+HELP
+
+    &std_pdb_misc;
+    $since = '2.8';
+
+    @inargs = (
+	{ name => 'item', type => 'item',
+	  desc => 'The item' }
+    );
+
+    @outargs = (
+	{ name => 'vectors', type => 'boolean',
+	  desc => 'TRUE if the item is a vectors, FALSE otherwise' }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  vectors = GIMP_IS_VECTORS (item);
+}
+CODE
+    );
+}
+
+sub item_get_name {
+    $blurb = "Get the name of the specified item.";
+
+    $help = "This procedure returns the specified item's name.";
+
+    &std_pdb_misc;
+    $since = '2.8';
+
+    @inargs = (
+	{ name => 'item', type => 'item',
+	  desc => 'The item' }
+    );
+
+    @outargs = (
+	{ name => 'name', type => 'string',
+	  desc => "The item name" }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  name = g_strdup (gimp_object_get_name (item));
+}
+CODE
+    );
+}
+
+sub item_set_name {
+    $blurb = "Set the name of the specified item.";
+
+    $help = "This procedure sets the specified item's name.";
+
+    &std_pdb_misc;
+    $since = '2.8';
+
+    @inargs = (
+	{ name => 'item', type => 'item',
+	  desc => 'The item' },
+	{ name => 'name', type => 'string',
+	  desc => "The new item name" }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  success = gimp_item_rename (GIMP_ITEM (item), name, error);
+}
+CODE
+    );
+}
+
+sub item_get_visible {
+    $blurb = "Get the visibility of the specified item.";
+
+    $help = "This procedure returns the specified item's visibility.";
+
+    &std_pdb_misc;
+    $since = '2.8';
+
+    @inargs = (
+	{ name => 'item', type => 'item',
+	  desc => 'The item' }
+    );
+
+    @outargs = (
+	{ name => 'visible', type => 'boolean',
+	  desc => "The item visibility" }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  visible = gimp_item_get_visible (GIMP_ITEM (item));
+}
+CODE
+    );
+}
+
+sub item_set_visible {
+    $blurb = "Set the visibility of the specified item.";
+
+    $help = "This procedure sets the specified item's visibility.";
+
+    &std_pdb_misc;
+    $since = '2.8';
+
+    @inargs = (
+	{ name => 'item', type => 'item',
+	  desc => 'The item' },
+	{ name => 'visible', type => 'boolean',
+	  desc => "The new item visibility" }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  gimp_item_set_visible (GIMP_ITEM (item), visible, TRUE);
+}
+CODE
+    );
+}
+
+sub item_get_linked {
+    $blurb = "Get the linked state of the specified item.";
+
+    $help = "This procedure returns the specified item's linked state.";
+
+    &wolfgang_pdb_misc('1998', '2.8');
+
+    @inargs = (
+	{ name => 'item', type => 'item',
+	  desc => 'The item' }
+    );
+
+    @outargs = (
+	{ name => 'linked', type => 'boolean',
+	  desc => "The item linked state (for moves)" }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  linked = gimp_item_get_linked (GIMP_ITEM (item));
+}
+CODE
+    );
+}
+
+sub item_set_linked {
+    $blurb = "Set the linked state of the specified item.";
+
+    $help = "This procedure sets the specified item's linked state.";
+
+    &wolfgang_pdb_misc('1998', '2.8');
+
+    @inargs = (
+	{ name => 'item', type => 'item',
+	  desc => 'The item' },
+	{ name => 'linked', type => 'boolean',
+	  desc => "The new item linked state" }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  gimp_item_set_linked (GIMP_ITEM (item), linked, TRUE);
+}
+CODE
+    );
+}
+
+sub item_get_lock_content {
+    $blurb = "Get the 'lock content' state of the specified item.";
+
+    $help = "This procedure returns the specified item's lock content state.";
+
+    &mitch_pdb_misc('2009', '2.8');
+
+    @inargs = (
+	{ name => 'item', type => 'item',
+	  desc => 'The item' }
+    );
+
+    @outargs = (
+	{ name => 'lock_content', type => 'boolean',
+	  desc => "Whether the item's pixels are locked" }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  lock_content = gimp_item_get_lock_content (GIMP_ITEM (item));
+}
+CODE
+    );
+}
+
+sub item_set_lock_content {
+    $blurb = "Set the 'lock content' state of the specified item.";
+
+    $help = "This procedure sets the specified item's lock content state.";
+
+    &mitch_pdb_misc('2009', '2.8');
+
+    @inargs = (
+	{ name => 'item', type => 'item',
+	  desc => 'The item' },
+	{ name => 'lock_content', type => 'boolean',
+	  desc => "The new item 'lock content' state" }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  if (gimp_item_can_lock_content (GIMP_ITEM (item)))
+    gimp_item_set_lock_content (GIMP_ITEM (item), lock_content, TRUE);
+  else
+    success = FALSE;
+}
+CODE
+    );
+}
+
+sub item_get_tattoo {
+    $blurb = "Get the tattoo of the specified item.";
+
+    $help = <<'HELP';
+This procedure returns the specified item's tattoo. A tattoo is a
+unique and permanent identifier attached to a item that can be
+used to uniquely identify a item within an image even between
+sessions.
+HELP
+
+    &jay_pdb_misc('1998', '2.8');
+
+    @inargs = (
+	{ name => 'item', type => 'item',
+	  desc => 'The item' }
+    );
+
+    @outargs = (
+	{ name => 'tattoo', type => 'tattoo',
+	  desc => "The item tattoo" }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  tattoo = gimp_item_get_tattoo (GIMP_ITEM (item));
+}
+CODE
+    );
+}
+
+sub item_set_tattoo {
+    $blurb = "Set the tattoo of the specified item.";
+
+    $help = <<'HELP';
+This procedure sets the specified item's tattoo. A tattoo is a
+unique and permanent identifier attached to a item that can be
+used to uniquely identify a item within an image even between
+sessions.
+HELP
+
+    &jay_pdb_misc('1998', '2.8');
+
+    @inargs = (
+	{ name => 'item', type => 'item',
+	  desc => 'The item' },
+	{ name => 'tattoo', type => 'tattoo',
+	  desc => "The new item tattoo" }
+    );
+
+    %invoke = (
+	code => <<'CODE'
+{
+  gimp_item_set_tattoo (GIMP_ITEM (item), tattoo);
+}
+CODE
+    );
+}
+
+ headers = qw("core/gimplayermask.h"
+              "core/gimpselection.h"
+              "text/gimptextlayer.h"
+	      "vectors/gimpvectors.h"
+              "gimppdb-utils.h"
+              "gimp-intl.h");
+
+ procs = qw(item_is_valid
+            item_get_image
+            item_delete
+            item_is_drawable
+            item_is_layer
+	    item_is_channel
+	    item_is_layer_mask
+	    item_is_selection
+	    item_is_vectors
+            item_get_name item_set_name
+            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);
+
+%exports = (app => [ procs], lib => [ procs]);
+
+$desc = 'Item procedures';
+$doc_title = 'gimpitem';
+$doc_short_desc = 'Functions to manipulate items.';
+$doc_long_desc = 'Functions to manipulate items.';
+
+1;



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