[gimp] libgimp: add GType and GParamSpec types for all IDs, like image, drawable



commit 427b01a634243807e7795b219b8390344a74d687
Author: Michael Natterer <mitch gimp org>
Date:   Fri Jul 26 16:05:11 2019 +0200

    libgimp: add GType and GParamSpec types for all IDs, like image, drawable
    
    Same set of functions and types as in app/, but purely ID-based.

 libgimp/Makefile.am      |    1 +
 libgimp/Makefile.gi      |    2 +
 libgimp/gimp.def         |   45 ++
 libgimp/gimpparamspecs.c | 1333 ++++++++++++++++++++++++++++++++++++++++++++++
 libgimp/gimpparamspecs.h |  391 ++++++++++++++
 5 files changed, 1772 insertions(+)
---
diff --git a/libgimp/Makefile.am b/libgimp/Makefile.am
index 462e14c851..3c948e20d8 100644
--- a/libgimp/Makefile.am
+++ b/libgimp/Makefile.am
@@ -145,6 +145,7 @@ gimpinclude_HEADERS = \
        gimpimagecolorprofile.h         \
        gimplayer.h                     \
        gimppaletteselect.h             \
+       gimpparamspecs.h                \
        gimppatternselect.h             \
        gimpplugin.h                    \
        gimpproceduraldb.h              \
diff --git a/libgimp/Makefile.gi b/libgimp/Makefile.gi
index 5f1dfc9296..f4db5b974a 100644
--- a/libgimp/Makefile.gi
+++ b/libgimp/Makefile.gi
@@ -134,6 +134,8 @@ libgimp_introspectable = \
        $(top_srcdir)/libgimp/gimplayer.h               \
        $(top_srcdir)/libgimp/gimppaletteselect.c       \
        $(top_srcdir)/libgimp/gimppaletteselect.h       \
+       $(top_srcdir)/libgimp/gimpparamspecs.c          \
+       $(top_srcdir)/libgimp/gimpparamspecs.h          \
        $(top_srcdir)/libgimp/gimppatternselect.c       \
        $(top_srcdir)/libgimp/gimppatternselect.h       \
        $(top_srcdir)/libgimp/gimppixbuf.c              \
diff --git a/libgimp/gimp.def b/libgimp/gimp.def
index 2d885cc5d1..6d04d221e1 100644
--- a/libgimp/gimp.def
+++ b/libgimp/gimp.def
@@ -44,6 +44,7 @@ EXPORTS
        gimp_channel_get_color
        gimp_channel_get_opacity
        gimp_channel_get_show_masked
+       gimp_channel_id_get_type
        gimp_channel_new
        gimp_channel_new_from_component
        gimp_channel_set_color
@@ -177,6 +178,7 @@ EXPORTS
        gimp_detach_parasite
        gimp_display_delete
        gimp_display_get_window_handle
+       gimp_display_id_get_type
        gimp_display_is_valid
        gimp_display_name
        gimp_display_new
@@ -214,6 +216,7 @@ EXPORTS
        gimp_drawable_height
        gimp_drawable_histogram
        gimp_drawable_hue_saturation
+       gimp_drawable_id_get_type
        gimp_drawable_invert
        gimp_drawable_is_gray
        gimp_drawable_is_indexed
@@ -405,6 +408,7 @@ EXPORTS
        gimp_image_grid_set_spacing
        gimp_image_grid_set_style
        gimp_image_height
+       gimp_image_id_get_type
        gimp_image_insert_channel
        gimp_image_insert_layer
        gimp_image_insert_vectors
@@ -479,6 +483,7 @@ EXPORTS
        gimp_item_get_parent
        gimp_item_get_tattoo
        gimp_item_get_visible
+       gimp_item_id_get_type
        gimp_item_is_channel
        gimp_item_is_drawable
        gimp_item_is_group
@@ -525,7 +530,9 @@ EXPORTS
        gimp_layer_get_opacity
        gimp_layer_get_show_mask
        gimp_layer_group_new
+       gimp_layer_id_get_type
        gimp_layer_is_floating_sel
+       gimp_layer_mask_id_get_type
        gimp_layer_mode_get_type
        gimp_layer_new
        gimp_layer_new_from_drawable
@@ -576,6 +583,24 @@ EXPORTS
        gimp_palettes_popup
        gimp_palettes_refresh
        gimp_palettes_set_popup
+       gimp_param_channel_id_get_type
+       gimp_param_display_id_get_type
+       gimp_param_drawable_id_get_type
+       gimp_param_image_id_get_type
+       gimp_param_item_id_get_type
+       gimp_param_layer_id_get_type
+       gimp_param_layer_mask_id_get_type
+       gimp_param_selection_id_get_type
+       gimp_param_spec_channel_id
+       gimp_param_spec_display_id
+       gimp_param_spec_drawable_id
+       gimp_param_spec_image_id
+       gimp_param_spec_item_id
+       gimp_param_spec_layer_id
+       gimp_param_spec_layer_mask_id
+       gimp_param_spec_selection_id
+       gimp_param_spec_vectors_id
+       gimp_param_vectors_id_get_type
        gimp_pattern_get_info
        gimp_pattern_get_pixels
        gimp_pattern_select_destroy
@@ -653,6 +678,7 @@ EXPORTS
        gimp_selection_float
        gimp_selection_flood
        gimp_selection_grow
+       gimp_selection_id_get_type
        gimp_selection_invert
        gimp_selection_is_empty
        gimp_selection_none
@@ -702,6 +728,24 @@ EXPORTS
        gimp_tile_width
        gimp_uninstall_temp_proc
        gimp_user_time
+       gimp_value_get_channel_id
+       gimp_value_get_display_id
+       gimp_value_get_drawable_id
+       gimp_value_get_image_id
+       gimp_value_get_item_id
+       gimp_value_get_layer_id
+       gimp_value_get_layer_mask_id
+       gimp_value_get_selection_id
+       gimp_value_get_vectors_id
+       gimp_value_set_channel_id
+       gimp_value_set_display_id
+       gimp_value_set_drawable_id
+       gimp_value_set_image_id
+       gimp_value_set_item_id
+       gimp_value_set_layer_id
+       gimp_value_set_layer_mask_id
+       gimp_value_set_selection_id
+       gimp_value_set_vectors_id
        gimp_vectors_bezier_stroke_conicto
        gimp_vectors_bezier_stroke_cubicto
        gimp_vectors_bezier_stroke_lineto
@@ -711,6 +755,7 @@ EXPORTS
        gimp_vectors_export_to_file
        gimp_vectors_export_to_string
        gimp_vectors_get_strokes
+       gimp_vectors_id_get_type
        gimp_vectors_import_from_file
        gimp_vectors_import_from_string
        gimp_vectors_new
diff --git a/libgimp/gimpparamspecs.c b/libgimp/gimpparamspecs.c
new file mode 100644
index 0000000000..3291cbbe59
--- /dev/null
+++ b/libgimp/gimpparamspecs.c
@@ -0,0 +1,1333 @@
+/* LIBGIMP - The GIMP Library
+ * Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
+ *
+ * gimpparamspecs.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
+ * <https://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gegl.h>
+
+#include "libgimpbase/gimpbase.h"
+
+#include "gimp.h"
+
+
+/*
+ * GIMP_TYPE_IMAGE_ID
+ */
+
+GType
+gimp_image_id_get_type (void)
+{
+  static GType type = 0;
+
+  if (! type)
+    {
+      const GTypeInfo info = { 0, };
+
+      type = g_type_register_static (G_TYPE_INT, "GimpImageID", &info, 0);
+    }
+
+  return type;
+}
+
+
+/*
+ * GIMP_TYPE_PARAM_IMAGE_ID
+ */
+
+static void       gimp_param_image_id_class_init  (GParamSpecClass *klass);
+static void       gimp_param_image_id_init        (GParamSpec      *pspec);
+static void       gimp_param_image_id_set_default (GParamSpec      *pspec,
+                                                   GValue          *value);
+static gboolean   gimp_param_image_id_validate    (GParamSpec      *pspec,
+                                                   GValue          *value);
+static gint       gimp_param_image_id_values_cmp  (GParamSpec      *pspec,
+                                                   const GValue    *value1,
+                                                   const GValue    *value2);
+
+GType
+gimp_param_image_id_get_type (void)
+{
+  static GType type = 0;
+
+  if (! type)
+    {
+      const GTypeInfo info =
+      {
+        sizeof (GParamSpecClass),
+        NULL, NULL,
+        (GClassInitFunc) gimp_param_image_id_class_init,
+        NULL, NULL,
+        sizeof (GimpParamSpecImageID),
+        0,
+        (GInstanceInitFunc) gimp_param_image_id_init
+      };
+
+      type = g_type_register_static (G_TYPE_PARAM_INT,
+                                     "GimpParamImageID", &info, 0);
+    }
+
+  return type;
+}
+
+static void
+gimp_param_image_id_class_init (GParamSpecClass *klass)
+{
+  klass->value_type        = GIMP_TYPE_IMAGE_ID;
+  klass->value_set_default = gimp_param_image_id_set_default;
+  klass->value_validate    = gimp_param_image_id_validate;
+  klass->values_cmp        = gimp_param_image_id_values_cmp;
+}
+
+static void
+gimp_param_image_id_init (GParamSpec *pspec)
+{
+  GimpParamSpecImageID *ispec = GIMP_PARAM_SPEC_IMAGE_ID (pspec);
+
+  ispec->none_ok = FALSE;
+}
+
+static void
+gimp_param_image_id_set_default (GParamSpec *pspec,
+                                 GValue     *value)
+{
+  value->data[0].v_int = -1;
+}
+
+static gboolean
+gimp_param_image_id_validate (GParamSpec *pspec,
+                              GValue     *value)
+{
+  GimpParamSpecImageID *ispec    = GIMP_PARAM_SPEC_IMAGE_ID (pspec);
+  gint                  image_id = value->data[0].v_int;
+
+  if (ispec->none_ok && (image_id == 0 || image_id == -1))
+    return FALSE;
+
+  if (! gimp_image_is_valid (image_id))
+    {
+      value->data[0].v_int = -1;
+      return TRUE;
+    }
+
+  return FALSE;
+}
+
+static gint
+gimp_param_image_id_values_cmp (GParamSpec   *pspec,
+                                const GValue *value1,
+                                const GValue *value2)
+{
+  gint image_id1 = value1->data[0].v_int;
+  gint image_id2 = value2->data[0].v_int;
+
+  /*  try to return at least *something*, it's useless anyway...  */
+
+  if (image_id1 < image_id2)
+    return -1;
+  else if (image_id1 > image_id2)
+    return 1;
+  else
+    return 0;
+}
+
+GParamSpec *
+gimp_param_spec_image_id (const gchar *name,
+                          const gchar *nick,
+                          const gchar *blurb,
+                          gboolean     none_ok,
+                          GParamFlags  flags)
+{
+  GimpParamSpecImageID *ispec;
+
+  ispec = g_param_spec_internal (GIMP_TYPE_PARAM_IMAGE_ID,
+                                 name, nick, blurb, flags);
+
+  ispec->none_ok = none_ok ? TRUE : FALSE;
+
+  return G_PARAM_SPEC (ispec);
+}
+
+gint32
+gimp_value_get_image_id (const GValue *value)
+{
+  g_return_val_if_fail (GIMP_VALUE_HOLDS_IMAGE_ID (value), -1);
+
+  return value->data[0].v_int;
+}
+
+void
+gimp_value_set_image_id (GValue *value,
+                         gint32  image_id)
+{
+  g_return_if_fail (GIMP_VALUE_HOLDS_IMAGE_ID (value));
+  g_return_if_fail (image_id == -1 || image_id == 0 ||
+                    gimp_image_is_valid (image_id));
+
+  value->data[0].v_int = image_id;
+}
+
+
+/*
+ * GIMP_TYPE_ITEM_ID
+ */
+
+GType
+gimp_item_id_get_type (void)
+{
+  static GType type = 0;
+
+  if (! type)
+    {
+      const GTypeInfo info = { 0, };
+
+      type = g_type_register_static (G_TYPE_INT, "GimpItemID", &info, 0);
+    }
+
+  return type;
+}
+
+
+/*
+ * GIMP_TYPE_PARAM_ITEM_ID
+ */
+
+static void       gimp_param_item_id_class_init  (GParamSpecClass *klass);
+static void       gimp_param_item_id_init        (GParamSpec      *pspec);
+static void       gimp_param_item_id_set_default (GParamSpec      *pspec,
+                                                  GValue          *value);
+static gboolean   gimp_param_item_id_validate    (GParamSpec      *pspec,
+                                                  GValue          *value);
+static gint       gimp_param_item_id_values_cmp  (GParamSpec      *pspec,
+                                                  const GValue    *value1,
+                                                  const GValue    *value2);
+
+GType
+gimp_param_item_id_get_type (void)
+{
+  static GType type = 0;
+
+  if (! type)
+    {
+      const GTypeInfo info =
+      {
+        sizeof (GParamSpecClass),
+        NULL, NULL,
+        (GClassInitFunc) gimp_param_item_id_class_init,
+        NULL, NULL,
+        sizeof (GimpParamSpecItemID),
+        0,
+        (GInstanceInitFunc) gimp_param_item_id_init
+      };
+
+      type = g_type_register_static (G_TYPE_PARAM_INT,
+                                     "GimpParamItemID", &info, 0);
+    }
+
+  return type;
+}
+
+static void
+gimp_param_item_id_class_init (GParamSpecClass *klass)
+{
+  klass->value_type        = GIMP_TYPE_ITEM_ID;
+  klass->value_set_default = gimp_param_item_id_set_default;
+  klass->value_validate    = gimp_param_item_id_validate;
+  klass->values_cmp        = gimp_param_item_id_values_cmp;
+}
+
+static void
+gimp_param_item_id_init (GParamSpec *pspec)
+{
+  GimpParamSpecItemID *ispec = GIMP_PARAM_SPEC_ITEM_ID (pspec);
+
+  ispec->none_ok = FALSE;
+}
+
+static void
+gimp_param_item_id_set_default (GParamSpec *pspec,
+                                GValue     *value)
+{
+  value->data[0].v_int = -1;
+}
+
+static gboolean
+gimp_param_item_id_validate (GParamSpec *pspec,
+                             GValue     *value)
+{
+  GimpParamSpecItemID *ispec   = GIMP_PARAM_SPEC_ITEM_ID (pspec);
+  gint                 item_id = value->data[0].v_int;
+
+  if (ispec->none_ok && (item_id == 0 || item_id == -1))
+    return FALSE;
+
+  if (! gimp_item_is_valid (item_id))
+    {
+      value->data[0].v_int = -1;
+      return TRUE;
+    }
+
+  return FALSE;
+}
+
+static gint
+gimp_param_item_id_values_cmp (GParamSpec   *pspec,
+                               const GValue *value1,
+                               const GValue *value2)
+{
+  gint item_id1 = value1->data[0].v_int;
+  gint item_id2 = value2->data[0].v_int;
+
+  /*  try to return at least *something*, it's useless anyway...  */
+
+  if (item_id1 < item_id2)
+    return -1;
+  else if (item_id1 > item_id2)
+    return 1;
+  else
+    return 0;
+}
+
+GParamSpec *
+gimp_param_spec_item_id (const gchar *name,
+                         const gchar *nick,
+                         const gchar *blurb,
+                         gboolean     none_ok,
+                         GParamFlags  flags)
+{
+  GimpParamSpecItemID *ispec;
+
+  ispec = g_param_spec_internal (GIMP_TYPE_PARAM_ITEM_ID,
+                                 name, nick, blurb, flags);
+
+  ispec->none_ok = none_ok;
+
+  return G_PARAM_SPEC (ispec);
+}
+
+gint32
+gimp_value_get_item_id (const GValue *value)
+{
+  g_return_val_if_fail (GIMP_VALUE_HOLDS_ITEM_ID (value), -1);
+
+  return value->data[0].v_int;
+}
+
+void
+gimp_value_set_item_id (GValue *value,
+                        gint32  item_id)
+{
+  g_return_if_fail (item_id == -1 || item_id == 0 ||
+                    gimp_item_is_valid (item_id));
+
+  /* This could all be less messy, see
+   * https://gitlab.gnome.org/GNOME/glib/issues/66
+   */
+
+  if (GIMP_VALUE_HOLDS_ITEM_ID (value))
+    {
+      value->data[0].v_int = item_id;
+    }
+  else if (GIMP_VALUE_HOLDS_DRAWABLE_ID (value) &&
+           (item_id == -1 || item_id == 0 ||
+            gimp_item_is_drawable (item_id)))
+    {
+      gimp_value_set_drawable_id (value, item_id);
+    }
+  else if (GIMP_VALUE_HOLDS_LAYER_ID (value) &&
+           (item_id == -1 || item_id == 0 ||
+            gimp_item_is_layer (item_id)))
+    {
+      gimp_value_set_layer_id (value, item_id);
+    }
+  else if (GIMP_VALUE_HOLDS_CHANNEL_ID (value) &&
+           (item_id == -1 || item_id == 0 ||
+            gimp_item_is_channel (item_id)))
+    {
+      gimp_value_set_channel_id (value, item_id);
+    }
+  else if (GIMP_VALUE_HOLDS_LAYER_MASK_ID (value) &&
+           (item_id == -1 || item_id == 0 ||
+            gimp_item_is_layer_mask (item_id)))
+    {
+      gimp_value_set_layer_mask_id (value, item_id);
+    }
+  else if (GIMP_VALUE_HOLDS_SELECTION_ID (value) &&
+           (item_id == -1 || item_id == 0 ||
+            gimp_item_is_selection (item_id)))
+    {
+      gimp_value_set_selection_id (value, item_id);
+    }
+  else if (GIMP_VALUE_HOLDS_VECTORS_ID (value) &&
+           (item_id == -1 || item_id == 0 ||
+            gimp_item_is_vectors (item_id)))
+    {
+      gimp_value_set_vectors_id (value, item_id);
+    }
+  else
+    {
+      g_return_if_reached ();
+    }
+}
+
+
+/*
+ * GIMP_TYPE_DRAWABLE_ID
+ */
+
+GType
+gimp_drawable_id_get_type (void)
+{
+  static GType type = 0;
+
+  if (! type)
+    {
+      const GTypeInfo info = { 0, };
+
+      type = g_type_register_static (G_TYPE_INT, "GimpDrawableID", &info, 0);
+    }
+
+  return type;
+}
+
+
+/*
+ * GIMP_TYPE_PARAM_DRAWABLE_ID
+ */
+
+static void       gimp_param_drawable_id_class_init (GParamSpecClass *klass);
+static void       gimp_param_drawable_id_init       (GParamSpec      *pspec);
+static gboolean   gimp_param_drawable_id_validate   (GParamSpec      *pspec,
+                                                     GValue          *value);
+
+GType
+gimp_param_drawable_id_get_type (void)
+{
+  static GType type = 0;
+
+  if (! type)
+    {
+      const GTypeInfo info =
+      {
+        sizeof (GParamSpecClass),
+        NULL, NULL,
+        (GClassInitFunc) gimp_param_drawable_id_class_init,
+        NULL, NULL,
+        sizeof (GimpParamSpecDrawableID),
+        0,
+        (GInstanceInitFunc) gimp_param_drawable_id_init
+      };
+
+      type = g_type_register_static (GIMP_TYPE_PARAM_ITEM_ID,
+                                     "GimpParamDrawableID", &info, 0);
+    }
+
+  return type;
+}
+
+static void
+gimp_param_drawable_id_class_init (GParamSpecClass *klass)
+{
+  klass->value_type     = GIMP_TYPE_DRAWABLE_ID;
+  klass->value_validate = gimp_param_drawable_id_validate;
+}
+
+static void
+gimp_param_drawable_id_init (GParamSpec *pspec)
+{
+}
+
+static gboolean
+gimp_param_drawable_id_validate (GParamSpec *pspec,
+                                 GValue     *value)
+{
+  GimpParamSpecItemID *ispec   = GIMP_PARAM_SPEC_ITEM_ID (pspec);
+  gint                 item_id = value->data[0].v_int;
+
+  if (ispec->none_ok && (item_id == 0 || item_id == -1))
+    return FALSE;
+
+  if (! gimp_item_is_drawable (item_id))
+    {
+      value->data[0].v_int = -1;
+      return TRUE;
+    }
+
+  return FALSE;
+}
+
+GParamSpec *
+gimp_param_spec_drawable_id (const gchar *name,
+                             const gchar *nick,
+                             const gchar *blurb,
+                             gboolean     none_ok,
+                             GParamFlags  flags)
+{
+  GimpParamSpecItemID *ispec;
+
+  ispec = g_param_spec_internal (GIMP_TYPE_PARAM_DRAWABLE_ID,
+                                 name, nick, blurb, flags);
+
+  ispec->none_ok = none_ok ? TRUE : FALSE;
+
+  return G_PARAM_SPEC (ispec);
+}
+
+gint32
+gimp_value_get_drawable_id (const GValue *value)
+{
+  g_return_val_if_fail (GIMP_VALUE_HOLDS_DRAWABLE_ID (value), -1);
+
+  return value->data[0].v_int;
+}
+
+void
+gimp_value_set_drawable_id (GValue *value,
+                            gint32  drawable_id)
+{
+  g_return_if_fail (GIMP_VALUE_HOLDS_DRAWABLE_ID (value));
+  g_return_if_fail (drawable_id == -1 || drawable_id == 0 ||
+                    (gimp_item_is_valid (drawable_id) &&
+                     gimp_item_is_drawable (drawable_id)));
+
+  if (GIMP_VALUE_HOLDS_DRAWABLE_ID (value))
+    {
+      value->data[0].v_int = drawable_id;
+    }
+  else if (GIMP_VALUE_HOLDS_LAYER_ID (value) &&
+           (drawable_id == -1 || drawable_id == 0 ||
+            gimp_item_is_layer (drawable_id)))
+    {
+      gimp_value_set_layer_id (value, drawable_id);
+    }
+  else if (GIMP_VALUE_HOLDS_CHANNEL_ID (value) &&
+           (drawable_id == -1 || drawable_id == 0 ||
+            gimp_item_is_channel (drawable_id)))
+    {
+      gimp_value_set_channel_id (value, drawable_id);
+    }
+  else if (GIMP_VALUE_HOLDS_LAYER_MASK_ID (value) &&
+           (drawable_id == -1 || drawable_id == 0 ||
+            gimp_item_is_layer_mask (drawable_id)))
+    {
+      gimp_value_set_layer_mask_id (value, drawable_id);
+    }
+  else if (GIMP_VALUE_HOLDS_SELECTION_ID (value) &&
+           (drawable_id == -1 || drawable_id == 0 ||
+            gimp_item_is_selection (drawable_id)))
+    {
+      gimp_value_set_selection_id (value, drawable_id);
+    }
+  else
+    {
+      g_return_if_reached ();
+    }
+}
+
+
+/*
+ * GIMP_TYPE_LAYER_ID
+ */
+
+GType
+gimp_layer_id_get_type (void)
+{
+  static GType type = 0;
+
+  if (! type)
+    {
+      const GTypeInfo info = { 0, };
+
+      type = g_type_register_static (G_TYPE_INT, "GimpLayerID", &info, 0);
+    }
+
+  return type;
+}
+
+
+/*
+ * GIMP_TYPE_PARAM_LAYER_ID
+ */
+
+static void       gimp_param_layer_id_class_init (GParamSpecClass *klass);
+static void       gimp_param_layer_id_init       (GParamSpec      *pspec);
+static gboolean   gimp_param_layer_id_validate   (GParamSpec      *pspec,
+                                                  GValue          *value);
+
+GType
+gimp_param_layer_id_get_type (void)
+{
+  static GType type = 0;
+
+  if (! type)
+    {
+      const GTypeInfo info =
+      {
+        sizeof (GParamSpecClass),
+        NULL, NULL,
+        (GClassInitFunc) gimp_param_layer_id_class_init,
+        NULL, NULL,
+        sizeof (GimpParamSpecLayerID),
+        0,
+        (GInstanceInitFunc) gimp_param_layer_id_init
+      };
+
+      type = g_type_register_static (GIMP_TYPE_PARAM_DRAWABLE_ID,
+                                     "GimpParamLayerID", &info, 0);
+    }
+
+  return type;
+}
+
+static void
+gimp_param_layer_id_class_init (GParamSpecClass *klass)
+{
+  klass->value_type     = GIMP_TYPE_LAYER_ID;
+  klass->value_validate = gimp_param_layer_id_validate;
+}
+
+static void
+gimp_param_layer_id_init (GParamSpec *pspec)
+{
+}
+
+static gboolean
+gimp_param_layer_id_validate (GParamSpec *pspec,
+                              GValue     *value)
+{
+  GimpParamSpecItemID *ispec   = GIMP_PARAM_SPEC_ITEM_ID (pspec);
+  gint                 item_id = value->data[0].v_int;
+
+  if (ispec->none_ok && (item_id == 0 || item_id == -1))
+    return FALSE;
+
+  if (! gimp_item_is_layer (item_id))
+    {
+      value->data[0].v_int = -1;
+      return TRUE;
+    }
+
+  return FALSE;
+}
+
+GParamSpec *
+gimp_param_spec_layer_id (const gchar *name,
+                          const gchar *nick,
+                          const gchar *blurb,
+                          gboolean     none_ok,
+                          GParamFlags  flags)
+{
+  GimpParamSpecItemID *ispec;
+
+  ispec = g_param_spec_internal (GIMP_TYPE_PARAM_LAYER_ID,
+                                 name, nick, blurb, flags);
+
+  ispec->none_ok = none_ok ? TRUE : FALSE;
+
+  return G_PARAM_SPEC (ispec);
+}
+
+gint32
+gimp_value_get_layer_id (const GValue *value)
+{
+  g_return_val_if_fail (GIMP_VALUE_HOLDS_LAYER_ID (value), -1);
+
+  return value->data[0].v_int;
+}
+
+void
+gimp_value_set_layer_id (GValue *value,
+                         gint32  layer_id)
+{
+  g_return_if_fail (GIMP_VALUE_HOLDS_LAYER_ID (value));
+  g_return_if_fail (layer_id == -1 || layer_id == 0 ||
+                    (gimp_item_is_valid (layer_id) &&
+                     gimp_item_is_layer (layer_id)));
+
+  value->data[0].v_int = layer_id;
+}
+
+
+/*
+ * GIMP_TYPE_CHANNEL_ID
+ */
+
+GType
+gimp_channel_id_get_type (void)
+{
+  static GType type = 0;
+
+  if (! type)
+    {
+      const GTypeInfo info = { 0, };
+
+      type = g_type_register_static (G_TYPE_INT, "GimpChannelID", &info, 0);
+    }
+
+  return type;
+}
+
+
+/*
+ * GIMP_TYPE_PARAM_CHANNEL_ID
+ */
+
+static void       gimp_param_channel_id_class_init (GParamSpecClass *klass);
+static void       gimp_param_channel_id_init       (GParamSpec      *pspec);
+static gboolean   gimp_param_channel_id_validate   (GParamSpec      *pspec,
+                                                    GValue          *value);
+
+GType
+gimp_param_channel_id_get_type (void)
+{
+  static GType type = 0;
+
+  if (! type)
+    {
+      const GTypeInfo info =
+      {
+        sizeof (GParamSpecClass),
+        NULL, NULL,
+        (GClassInitFunc) gimp_param_channel_id_class_init,
+        NULL, NULL,
+        sizeof (GimpParamSpecChannelID),
+        0,
+        (GInstanceInitFunc) gimp_param_channel_id_init
+      };
+
+      type = g_type_register_static (GIMP_TYPE_PARAM_DRAWABLE_ID,
+                                     "GimpParamChannelID", &info, 0);
+    }
+
+  return type;
+}
+
+static void
+gimp_param_channel_id_class_init (GParamSpecClass *klass)
+{
+  klass->value_type     = GIMP_TYPE_CHANNEL_ID;
+  klass->value_validate = gimp_param_channel_id_validate;
+}
+
+static void
+gimp_param_channel_id_init (GParamSpec *pspec)
+{
+}
+
+static gboolean
+gimp_param_channel_id_validate (GParamSpec *pspec,
+                                GValue     *value)
+{
+  GimpParamSpecItemID *ispec   = GIMP_PARAM_SPEC_ITEM_ID (pspec);
+  gint                 item_id = value->data[0].v_int;
+
+  if (ispec->none_ok && (item_id == 0 || item_id == -1))
+    return FALSE;
+
+  if (! gimp_item_is_channel (item_id))
+    {
+      value->data[0].v_int = -1;
+      return TRUE;
+    }
+
+  return FALSE;
+}
+
+GParamSpec *
+gimp_param_spec_channel_id (const gchar *name,
+                            const gchar *nick,
+                            const gchar *blurb,
+                            gboolean     none_ok,
+                            GParamFlags  flags)
+{
+  GimpParamSpecItemID *ispec;
+
+  ispec = g_param_spec_internal (GIMP_TYPE_PARAM_CHANNEL_ID,
+                                 name, nick, blurb, flags);
+
+  ispec->none_ok = none_ok ? TRUE : FALSE;
+
+  return G_PARAM_SPEC (ispec);
+}
+
+gint32
+gimp_value_get_channel_id (const GValue *value)
+{
+  g_return_val_if_fail (GIMP_VALUE_HOLDS_CHANNEL_ID (value), -1);
+
+  return value->data[0].v_int;
+}
+
+void
+gimp_value_set_channel_id (GValue *value,
+                           gint32  channel_id)
+{
+  g_return_if_fail (GIMP_VALUE_HOLDS_CHANNEL_ID (value));
+  g_return_if_fail (channel_id == -1 || channel_id == 0 ||
+                    (gimp_item_is_valid (channel_id) &&
+                     gimp_item_is_channel (channel_id)));
+
+  if (GIMP_VALUE_HOLDS_CHANNEL_ID (value))
+    {
+      value->data[0].v_int = channel_id;
+    }
+  else if (GIMP_VALUE_HOLDS_LAYER_MASK_ID (value) &&
+           (channel_id == -1 || channel_id == 0 ||
+            gimp_item_is_layer_mask (channel_id)))
+    {
+      gimp_value_set_layer_mask_id (value, channel_id);
+    }
+  else if (GIMP_VALUE_HOLDS_SELECTION_ID (value) &&
+           (channel_id == -1 || channel_id == 0 ||
+            gimp_item_is_selection (channel_id)))
+    {
+      gimp_value_set_selection_id (value, channel_id);
+    }
+  else
+    {
+      g_return_if_reached ();
+    }
+}
+
+
+/*
+ * GIMP_TYPE_LAYER_MASK_ID
+ */
+
+GType
+gimp_layer_mask_id_get_type (void)
+{
+  static GType type = 0;
+
+  if (! type)
+    {
+      const GTypeInfo info = { 0, };
+
+      type = g_type_register_static (G_TYPE_INT, "GimpLayerMaskID", &info, 0);
+    }
+
+  return type;
+}
+
+
+/*
+ * GIMP_TYPE_PARAM_LAYER_MASK_ID
+ */
+
+static void       gimp_param_layer_mask_id_class_init (GParamSpecClass *klass);
+static void       gimp_param_layer_mask_id_init       (GParamSpec      *pspec);
+static gboolean   gimp_param_layer_mask_id_validate   (GParamSpec      *pspec,
+                                                       GValue          *value);
+
+GType
+gimp_param_layer_mask_id_get_type (void)
+{
+  static GType type = 0;
+
+  if (! type)
+    {
+      const GTypeInfo info =
+      {
+        sizeof (GParamSpecClass),
+        NULL, NULL,
+        (GClassInitFunc) gimp_param_layer_mask_id_class_init,
+        NULL, NULL,
+        sizeof (GimpParamSpecLayerMaskID),
+        0,
+        (GInstanceInitFunc) gimp_param_layer_mask_id_init
+      };
+
+      type = g_type_register_static (GIMP_TYPE_PARAM_CHANNEL_ID,
+                                     "GimpParamLayerMaskID", &info, 0);
+    }
+
+  return type;
+}
+
+static void
+gimp_param_layer_mask_id_class_init (GParamSpecClass *klass)
+{
+  klass->value_type     = GIMP_TYPE_LAYER_MASK_ID;
+  klass->value_validate = gimp_param_layer_mask_id_validate;
+}
+
+static void
+gimp_param_layer_mask_id_init (GParamSpec *pspec)
+{
+}
+
+static gboolean
+gimp_param_layer_mask_id_validate (GParamSpec *pspec,
+                                   GValue     *value)
+{
+  GimpParamSpecItemID *ispec   = GIMP_PARAM_SPEC_ITEM_ID (pspec);
+  gint                 item_id = value->data[0].v_int;
+
+  if (ispec->none_ok && (item_id == 0 || item_id == -1))
+    return FALSE;
+
+  if (! gimp_item_is_layer_mask (item_id))
+    {
+      value->data[0].v_int = -1;
+      return TRUE;
+    }
+
+  return FALSE;
+}
+
+GParamSpec *
+gimp_param_spec_layer_mask_id (const gchar *name,
+                               const gchar *nick,
+                               const gchar *blurb,
+                               gboolean     none_ok,
+                               GParamFlags  flags)
+{
+  GimpParamSpecItemID *ispec;
+
+  ispec = g_param_spec_internal (GIMP_TYPE_PARAM_LAYER_MASK_ID,
+                                 name, nick, blurb, flags);
+
+  ispec->none_ok = none_ok ? TRUE : FALSE;
+
+  return G_PARAM_SPEC (ispec);
+}
+
+gint32
+gimp_value_get_layer_mask_id (const GValue *value)
+{
+  g_return_val_if_fail (GIMP_VALUE_HOLDS_LAYER_MASK_ID (value), -1);
+
+  return value->data[0].v_int;
+}
+
+void
+gimp_value_set_layer_mask_id (GValue *value,
+                              gint32  layer_mask_id)
+{
+  g_return_if_fail (GIMP_VALUE_HOLDS_LAYER_MASK_ID (value));
+  g_return_if_fail (layer_mask_id == -1 || layer_mask_id == 0 ||
+                    (gimp_item_is_valid (layer_mask_id) &&
+                     gimp_item_is_layer_mask (layer_mask_id)));
+
+  value->data[0].v_int = layer_mask_id;
+}
+
+
+/*
+ * GIMP_TYPE_SELECTION_ID
+ */
+
+GType
+gimp_selection_id_get_type (void)
+{
+  static GType type = 0;
+
+  if (! type)
+    {
+      const GTypeInfo info = { 0, };
+
+      type = g_type_register_static (G_TYPE_INT, "GimpSelectionID", &info, 0);
+    }
+
+  return type;
+}
+
+
+/*
+ * GIMP_TYPE_PARAM_SELECTION_ID
+ */
+
+static void       gimp_param_selection_id_class_init (GParamSpecClass *klass);
+static void       gimp_param_selection_id_init       (GParamSpec      *pspec);
+static gboolean   gimp_param_selection_id_validate   (GParamSpec      *pspec,
+                                                      GValue          *value);
+
+GType
+gimp_param_selection_id_get_type (void)
+{
+  static GType type = 0;
+
+  if (! type)
+    {
+      const GTypeInfo info =
+      {
+        sizeof (GParamSpecClass),
+        NULL, NULL,
+        (GClassInitFunc) gimp_param_selection_id_class_init,
+        NULL, NULL,
+        sizeof (GimpParamSpecSelectionID),
+        0,
+        (GInstanceInitFunc) gimp_param_selection_id_init
+      };
+
+      type = g_type_register_static (GIMP_TYPE_PARAM_CHANNEL_ID,
+                                     "GimpParamSelectionID", &info, 0);
+    }
+
+  return type;
+}
+
+static void
+gimp_param_selection_id_class_init (GParamSpecClass *klass)
+{
+  klass->value_type     = GIMP_TYPE_SELECTION_ID;
+  klass->value_validate = gimp_param_selection_id_validate;
+}
+
+static void
+gimp_param_selection_id_init (GParamSpec *pspec)
+{
+}
+
+static gboolean
+gimp_param_selection_id_validate (GParamSpec *pspec,
+                                  GValue     *value)
+{
+  GimpParamSpecItemID *ispec   = GIMP_PARAM_SPEC_ITEM_ID (pspec);
+  gint                 item_id = value->data[0].v_int;
+
+  if (ispec->none_ok && (item_id == 0 || item_id == -1))
+    return FALSE;
+
+  if (! gimp_item_is_selection (item_id))
+    {
+      value->data[0].v_int = -1;
+      return TRUE;
+    }
+
+  return FALSE;
+}
+
+GParamSpec *
+gimp_param_spec_selection_id (const gchar *name,
+                              const gchar *nick,
+                              const gchar *blurb,
+                              gboolean     none_ok,
+                              GParamFlags  flags)
+{
+  GimpParamSpecItemID *ispec;
+
+  ispec = g_param_spec_internal (GIMP_TYPE_PARAM_SELECTION_ID,
+                                 name, nick, blurb, flags);
+
+  ispec->none_ok = none_ok ? TRUE : FALSE;
+
+  return G_PARAM_SPEC (ispec);
+}
+
+gint32
+gimp_value_get_selection_id (const GValue *value)
+{
+  g_return_val_if_fail (GIMP_VALUE_HOLDS_SELECTION_ID (value), -1);
+
+  return value->data[0].v_int;
+}
+
+void
+gimp_value_set_selection_id (GValue *value,
+                             gint32  selection_id)
+{
+  g_return_if_fail (GIMP_VALUE_HOLDS_SELECTION_ID (value));
+  g_return_if_fail (selection_id == -1 || selection_id == 0 ||
+                    (gimp_item_is_valid (selection_id) &&
+                     gimp_item_is_selection (selection_id)));
+
+  value->data[0].v_int = selection_id;
+}
+
+
+/*
+ * GIMP_TYPE_VECTORS_ID
+ */
+
+GType
+gimp_vectors_id_get_type (void)
+{
+  static GType type = 0;
+
+  if (! type)
+    {
+      const GTypeInfo info = { 0, };
+
+      type = g_type_register_static (G_TYPE_INT, "GimpVectorsID", &info, 0);
+    }
+
+  return type;
+}
+
+
+/*
+ * GIMP_TYPE_PARAM_VECTORS_ID
+ */
+
+static void       gimp_param_vectors_id_class_init (GParamSpecClass *klass);
+static void       gimp_param_vectors_id_init       (GParamSpec      *pspec);
+static gboolean   gimp_param_vectors_id_validate   (GParamSpec      *pspec,
+                                                    GValue          *value);
+
+GType
+gimp_param_vectors_id_get_type (void)
+{
+  static GType type = 0;
+
+  if (! type)
+    {
+      const GTypeInfo info =
+      {
+        sizeof (GParamSpecClass),
+        NULL, NULL,
+        (GClassInitFunc) gimp_param_vectors_id_class_init,
+        NULL, NULL,
+        sizeof (GimpParamSpecVectorsID),
+        0,
+        (GInstanceInitFunc) gimp_param_vectors_id_init
+      };
+
+      type = g_type_register_static (GIMP_TYPE_PARAM_ITEM_ID,
+                                     "GimpParamVectorsID", &info, 0);
+    }
+
+  return type;
+}
+
+static void
+gimp_param_vectors_id_class_init (GParamSpecClass *klass)
+{
+  klass->value_type     = GIMP_TYPE_VECTORS_ID;
+  klass->value_validate = gimp_param_vectors_id_validate;
+}
+
+static void
+gimp_param_vectors_id_init (GParamSpec *pspec)
+{
+}
+
+static gboolean
+gimp_param_vectors_id_validate (GParamSpec *pspec,
+                                GValue     *value)
+{
+  GimpParamSpecItemID *ispec   = GIMP_PARAM_SPEC_ITEM_ID (pspec);
+  gint                 item_id = value->data[0].v_int;
+
+  if (ispec->none_ok && (item_id == 0 || item_id == -1))
+    return FALSE;
+
+  if (! gimp_item_is_vectors (item_id))
+    {
+      value->data[0].v_int = -1;
+      return TRUE;
+    }
+
+  return FALSE;
+}
+
+GParamSpec *
+gimp_param_spec_vectors_id (const gchar *name,
+                            const gchar *nick,
+                            const gchar *blurb,
+                            gboolean     none_ok,
+                            GParamFlags  flags)
+{
+  GimpParamSpecItemID *ispec;
+
+  ispec = g_param_spec_internal (GIMP_TYPE_PARAM_VECTORS_ID,
+                                 name, nick, blurb, flags);
+
+  ispec->none_ok = none_ok ? TRUE : FALSE;
+
+  return G_PARAM_SPEC (ispec);
+}
+
+gint32
+gimp_value_get_vectors_id (const GValue *value)
+{
+  g_return_val_if_fail (GIMP_VALUE_HOLDS_VECTORS_ID (value), -1);
+
+  return value->data[0].v_int;
+}
+
+void
+gimp_value_set_vectors_id (GValue *value,
+                           gint32  vectors_id)
+{
+  g_return_if_fail (GIMP_VALUE_HOLDS_VECTORS_ID (value));
+  g_return_if_fail (vectors_id == -1 || vectors_id == 0 ||
+                    (gimp_item_is_valid (vectors_id) &&
+                     gimp_item_is_vectors (vectors_id)));
+
+  value->data[0].v_int = vectors_id;
+}
+
+
+/*
+ * GIMP_TYPE_DISPLAY_ID
+ */
+
+GType
+gimp_display_id_get_type (void)
+{
+  static GType type = 0;
+
+  if (! type)
+    {
+      const GTypeInfo info = { 0, };
+
+      type = g_type_register_static (G_TYPE_INT, "GimpDisplayID", &info, 0);
+    }
+
+  return type;
+}
+
+
+/*
+ * GIMP_TYPE_PARAM_DISPLAY_ID
+ */
+
+static void       gimp_param_display_id_class_init  (GParamSpecClass *klass);
+static void       gimp_param_display_id_init        (GParamSpec      *pspec);
+static void       gimp_param_display_id_set_default (GParamSpec      *pspec,
+                                                     GValue          *value);
+static gboolean   gimp_param_display_id_validate    (GParamSpec      *pspec,
+                                                     GValue          *value);
+static gint       gimp_param_display_id_values_cmp  (GParamSpec      *pspec,
+                                                     const GValue    *value1,
+                                                     const GValue    *value2);
+
+GType
+gimp_param_display_id_get_type (void)
+{
+  static GType type = 0;
+
+  if (! type)
+    {
+      const GTypeInfo info =
+      {
+        sizeof (GParamSpecClass),
+        NULL, NULL,
+        (GClassInitFunc) gimp_param_display_id_class_init,
+        NULL, NULL,
+        sizeof (GimpParamSpecDisplayID),
+        0,
+        (GInstanceInitFunc) gimp_param_display_id_init
+      };
+
+      type = g_type_register_static (G_TYPE_PARAM_INT,
+                                     "GimpParamDisplayID", &info, 0);
+    }
+
+  return type;
+}
+
+static void
+gimp_param_display_id_class_init (GParamSpecClass *klass)
+{
+  klass->value_type        = GIMP_TYPE_DISPLAY_ID;
+  klass->value_set_default = gimp_param_display_id_set_default;
+  klass->value_validate    = gimp_param_display_id_validate;
+  klass->values_cmp        = gimp_param_display_id_values_cmp;
+}
+
+static void
+gimp_param_display_id_init (GParamSpec *pspec)
+{
+  GimpParamSpecDisplayID *ispec = GIMP_PARAM_SPEC_DISPLAY_ID (pspec);
+
+  ispec->none_ok = FALSE;
+}
+
+static void
+gimp_param_display_id_set_default (GParamSpec *pspec,
+                                   GValue     *value)
+{
+  value->data[0].v_int = -1;
+}
+
+static gboolean
+gimp_param_display_id_validate (GParamSpec *pspec,
+                                GValue     *value)
+{
+  GimpParamSpecDisplayID *ispec      = GIMP_PARAM_SPEC_DISPLAY_ID (pspec);
+  gint                    display_id = value->data[0].v_int;
+
+  if (ispec->none_ok && (display_id == 0 || display_id == -1))
+    return FALSE;
+
+  if (! gimp_display_is_valid (display_id))
+    {
+      value->data[0].v_int = -1;
+      return TRUE;
+    }
+
+  return FALSE;
+}
+
+static gint
+gimp_param_display_id_values_cmp (GParamSpec   *pspec,
+                                  const GValue *value1,
+                                  const GValue *value2)
+{
+  gint display_id1 = value1->data[0].v_int;
+  gint display_id2 = value2->data[0].v_int;
+
+  /*  try to return at least *something*, it's useless anyway...  */
+
+  if (display_id1 < display_id2)
+    return -1;
+  else if (display_id1 > display_id2)
+    return 1;
+  else
+    return 0;
+}
+
+GParamSpec *
+gimp_param_spec_display_id (const gchar *name,
+                            const gchar *nick,
+                            const gchar *blurb,
+                            gboolean     none_ok,
+                            GParamFlags  flags)
+{
+  GimpParamSpecDisplayID *ispec;
+
+  ispec = g_param_spec_internal (GIMP_TYPE_PARAM_DISPLAY_ID,
+                                 name, nick, blurb, flags);
+
+  ispec->none_ok = none_ok ? TRUE : FALSE;
+
+  return G_PARAM_SPEC (ispec);
+}
+
+gint32
+gimp_value_get_display_id (const GValue *value)
+{
+  g_return_val_if_fail (GIMP_VALUE_HOLDS_DISPLAY_ID (value), -1);
+
+  return value->data[0].v_int;
+}
+
+void
+gimp_value_set_display_id (GValue *value,
+                           gint32  display_id)
+{
+  g_return_if_fail (GIMP_VALUE_HOLDS_DISPLAY_ID (value));
+  g_return_if_fail (display_id == -1 || display_id == 0 ||
+                    gimp_display_is_valid (display_id));
+
+  value->data[0].v_int = display_id;
+}
diff --git a/libgimp/gimpparamspecs.h b/libgimp/gimpparamspecs.h
new file mode 100644
index 0000000000..d289fea25d
--- /dev/null
+++ b/libgimp/gimpparamspecs.h
@@ -0,0 +1,391 @@
+/* LIBGIMP - The GIMP Library
+ * Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
+ *
+ * gimpparamspecs.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
+ * <https://www.gnu.org/licenses/>.
+ */
+
+#if !defined (__GIMP_H_INSIDE__) && !defined (GIMP_COMPILATION)
+#error "Only <libgimp/gimp.h> can be included directly."
+#endif
+
+#ifndef __LIBGIMP_GIMP_PARAM_SPECS_H__
+#define __LIBGIMP_GIMP_PARAM_SPECS_H__
+
+G_BEGIN_DECLS
+
+/* For information look into the C source or the html documentation */
+
+
+/*
+ * GIMP_TYPE_IMAGE_ID
+ */
+
+#define GIMP_TYPE_IMAGE_ID               (gimp_image_id_get_type ())
+#define GIMP_VALUE_HOLDS_IMAGE_ID(value) (G_TYPE_CHECK_VALUE_TYPE ((value),\
+                                          GIMP_TYPE_IMAGE_ID))
+
+GType   gimp_image_id_get_type           (void) G_GNUC_CONST;
+
+
+/*
+ * GIMP_TYPE_PARAM_IMAGE_ID
+ */
+
+#define GIMP_TYPE_PARAM_IMAGE_ID           (gimp_param_image_id_get_type ())
+#define GIMP_PARAM_SPEC_IMAGE_ID(pspec)    (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_IMAGE_ID, 
GimpParamSpecImageID))
+#define GIMP_IS_PARAM_SPEC_IMAGE_ID(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_IMAGE_ID))
+
+typedef struct _GimpParamSpecImageID GimpParamSpecImageID;
+
+struct _GimpParamSpecImageID
+{
+  GParamSpecInt  parent_instance;
+
+  gboolean       none_ok;
+};
+
+GType        gimp_param_image_id_get_type (void) G_GNUC_CONST;
+
+GParamSpec * gimp_param_spec_image_id     (const gchar  *name,
+                                           const gchar  *nick,
+                                           const gchar  *blurb,
+                                           gboolean      none_ok,
+                                           GParamFlags   flags);
+
+gint32       gimp_value_get_image_id      (const GValue *value);
+void         gimp_value_set_image_id      (GValue       *value,
+                                           gint32        image_id);
+
+
+/*
+ * GIMP_TYPE_ITEM_ID
+ */
+
+#define GIMP_TYPE_ITEM_ID               (gimp_item_id_get_type ())
+#define GIMP_VALUE_HOLDS_ITEM_ID(value) (G_TYPE_CHECK_VALUE_TYPE ((value),\
+                                         GIMP_TYPE_ITEM_ID))
+
+GType   gimp_item_id_get_type           (void) G_GNUC_CONST;
+
+
+/*
+ * GIMP_TYPE_PARAM_ITEM_ID
+ */
+
+#define GIMP_TYPE_PARAM_ITEM_ID           (gimp_param_item_id_get_type ())
+#define GIMP_PARAM_SPEC_ITEM_ID(pspec)    (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_ITEM_ID, 
GimpParamSpecItemID))
+#define GIMP_IS_PARAM_SPEC_ITEM_ID(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_ITEM_ID))
+
+typedef struct _GimpParamSpecItemID GimpParamSpecItemID;
+
+struct _GimpParamSpecItemID
+{
+  GParamSpecInt  parent_instance;
+
+  gboolean       none_ok;
+};
+
+GType        gimp_param_item_id_get_type (void) G_GNUC_CONST;
+
+GParamSpec * gimp_param_spec_item_id     (const gchar  *name,
+                                          const gchar  *nick,
+                                          const gchar  *blurb,
+                                          gboolean      none_ok,
+                                          GParamFlags   flags);
+
+gint32       gimp_value_get_item_id      (const GValue *value);
+void         gimp_value_set_item_id      (GValue       *value,
+                                          gint32        item_id);
+
+
+/*
+ * GIMP_TYPE_DRAWABLE_ID
+ */
+
+#define GIMP_TYPE_DRAWABLE_ID               (gimp_drawable_id_get_type ())
+#define GIMP_VALUE_HOLDS_DRAWABLE_ID(value) (G_TYPE_CHECK_VALUE_TYPE ((value),\
+                                             GIMP_TYPE_DRAWABLE_ID))
+
+GType   gimp_drawable_id_get_type           (void) G_GNUC_CONST;
+
+
+/*
+ * GIMP_TYPE_PARAM_DRAWABLE_ID
+ */
+
+#define GIMP_TYPE_PARAM_DRAWABLE_ID           (gimp_param_drawable_id_get_type ())
+#define GIMP_PARAM_SPEC_DRAWABLE_ID(pspec)    (G_TYPE_CHECK_INSTANCE_CAST ((pspec), 
GIMP_TYPE_PARAM_DRAWABLE_ID, GimpParamSpecDrawableID))
+#define GIMP_IS_PARAM_SPEC_DRAWABLE_ID(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), 
GIMP_TYPE_PARAM_DRAWABLE_ID))
+
+typedef struct _GimpParamSpecDrawableID GimpParamSpecDrawableID;
+
+struct _GimpParamSpecDrawableID
+{
+  GimpParamSpecItemID parent_instance;
+};
+
+GType         gimp_param_drawable_id_get_type (void) G_GNUC_CONST;
+
+GParamSpec  * gimp_param_spec_drawable_id     (const gchar  *name,
+                                               const gchar  *nick,
+                                               const gchar  *blurb,
+                                               gboolean      none_ok,
+                                               GParamFlags   flags);
+
+gint32         gimp_value_get_drawable_id     (const GValue *value);
+void           gimp_value_set_drawable_id     (GValue       *value,
+                                               gint32        drawable_id);
+
+
+/*
+ * GIMP_TYPE_LAYER_ID
+ */
+
+#define GIMP_TYPE_LAYER_ID               (gimp_layer_id_get_type ())
+#define GIMP_VALUE_HOLDS_LAYER_ID(value) (G_TYPE_CHECK_VALUE_TYPE ((value),\
+                                          GIMP_TYPE_LAYER_ID))
+
+GType   gimp_layer_id_get_type           (void) G_GNUC_CONST;
+
+
+/*
+ * GIMP_TYPE_PARAM_LAYER_ID
+ */
+
+#define GIMP_TYPE_PARAM_LAYER_ID           (gimp_param_layer_id_get_type ())
+#define GIMP_PARAM_SPEC_LAYER_ID(pspec)    (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_LAYER_ID, 
GimpParamSpecLayerID))
+#define GIMP_IS_PARAM_SPEC_LAYER_ID(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_LAYER_ID))
+
+typedef struct _GimpParamSpecLayerID GimpParamSpecLayerID;
+
+struct _GimpParamSpecLayerID
+{
+  GimpParamSpecDrawableID parent_instance;
+};
+
+GType        gimp_param_layer_id_get_type (void) G_GNUC_CONST;
+
+GParamSpec * gimp_param_spec_layer_id     (const gchar  *name,
+                                           const gchar  *nick,
+                                           const gchar  *blurb,
+                                           gboolean      none_ok,
+                                           GParamFlags   flags);
+
+gint32       gimp_value_get_layer_id      (const GValue *value);
+void         gimp_value_set_layer_id      (GValue       *value,
+                                           gint32        layer_id);
+
+
+/*
+ * GIMP_TYPE_CHANNEL_ID
+ */
+
+#define GIMP_TYPE_CHANNEL_ID               (gimp_channel_id_get_type ())
+#define GIMP_VALUE_HOLDS_CHANNEL_ID(value) (G_TYPE_CHECK_VALUE_TYPE ((value),\
+                                            GIMP_TYPE_CHANNEL_ID))
+
+GType   gimp_channel_id_get_type           (void) G_GNUC_CONST;
+
+
+/*
+ * GIMP_TYPE_PARAM_CHANNEL_ID
+ */
+
+#define GIMP_TYPE_PARAM_CHANNEL_ID           (gimp_param_channel_id_get_type ())
+#define GIMP_PARAM_SPEC_CHANNEL_ID(pspec)    (G_TYPE_CHECK_INSTANCE_CAST ((pspec), 
GIMP_TYPE_PARAM_CHANNEL_ID, GimpParamSpecChannelID))
+#define GIMP_IS_PARAM_SPEC_CHANNEL_ID(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), 
GIMP_TYPE_PARAM_CHANNEL_ID))
+
+typedef struct _GimpParamSpecChannelID GimpParamSpecChannelID;
+
+struct _GimpParamSpecChannelID
+{
+  GimpParamSpecDrawableID parent_instance;
+};
+
+GType         gimp_param_channel_id_get_type (void) G_GNUC_CONST;
+
+GParamSpec  * gimp_param_spec_channel_id     (const gchar  *name,
+                                              const gchar  *nick,
+                                              const gchar  *blurb,
+                                              gboolean      none_ok,
+                                              GParamFlags   flags);
+
+gint32        gimp_value_get_channel_id      (const GValue *value);
+void          gimp_value_set_channel_id      (GValue       *value,
+                                              gint32        channel_id);
+
+
+/*
+ * GIMP_TYPE_LAYER_MASK_ID
+ */
+
+#define GIMP_TYPE_LAYER_MASK_ID               (gimp_layer_mask_id_get_type ())
+#define GIMP_VALUE_HOLDS_LAYER_MASK_ID(value) (G_TYPE_CHECK_VALUE_TYPE ((value),\
+                                               GIMP_TYPE_LAYER_MASK_ID))
+
+GType   gimp_layer_mask_id_get_type           (void) G_GNUC_CONST;
+
+
+/*
+ * GIMP_TYPE_PARAM_LAYER_MASK_ID
+ */
+
+#define GIMP_TYPE_PARAM_LAYER_MASK_ID           (gimp_param_layer_mask_id_get_type ())
+#define GIMP_PARAM_SPEC_LAYER_MASK_ID(pspec)    (G_TYPE_CHECK_INSTANCE_CAST ((pspec), 
GIMP_TYPE_PARAM_LAYER_MASK_ID, GimpParamSpecLayerMaskID))
+#define GIMP_IS_PARAM_SPEC_LAYER_MASK_ID(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), 
GIMP_TYPE_PARAM_LAYER_MASK_ID))
+
+typedef struct _GimpParamSpecLayerMaskID GimpParamSpecLayerMaskID;
+
+struct _GimpParamSpecLayerMaskID
+{
+  GimpParamSpecChannelID parent_instance;
+};
+
+GType           gimp_param_layer_mask_id_get_type (void) G_GNUC_CONST;
+
+GParamSpec    * gimp_param_spec_layer_mask_id     (const gchar   *name,
+                                                   const gchar   *nick,
+                                                   const gchar   *blurb,
+                                                   gboolean       none_ok,
+                                                   GParamFlags    flags);
+
+gint32          gimp_value_get_layer_mask_id      (const GValue  *value);
+void            gimp_value_set_layer_mask_id      (GValue        *value,
+                                                   gint32         layer_mask_id);
+
+
+/*
+ * GIMP_TYPE_SELECTION_ID
+ */
+
+#define GIMP_TYPE_SELECTION_ID               (gimp_selection_id_get_type ())
+#define GIMP_VALUE_HOLDS_SELECTION_ID(value) (G_TYPE_CHECK_VALUE_TYPE ((value),\
+                                              GIMP_TYPE_SELECTION_ID))
+
+GType   gimp_selection_id_get_type           (void) G_GNUC_CONST;
+
+
+/*
+ * GIMP_TYPE_PARAM_SELECTION_ID
+ */
+
+#define GIMP_TYPE_PARAM_SELECTION_ID           (gimp_param_selection_id_get_type ())
+#define GIMP_PARAM_SPEC_SELECTION_ID(pspec)    (G_TYPE_CHECK_INSTANCE_CAST ((pspec), 
GIMP_TYPE_PARAM_SELECTION_ID, GimpParamSpecSelectionID))
+#define GIMP_IS_PARAM_SPEC_SELECTION_ID(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), 
GIMP_TYPE_PARAM_SELECTION_ID))
+
+typedef struct _GimpParamSpecSelectionID GimpParamSpecSelectionID;
+
+struct _GimpParamSpecSelectionID
+{
+  GimpParamSpecChannelID parent_instance;
+};
+
+GType           gimp_param_selection_id_get_type (void) G_GNUC_CONST;
+
+GParamSpec    * gimp_param_spec_selection_id     (const gchar   *name,
+                                                  const gchar   *nick,
+                                                  const gchar   *blurb,
+                                                  gboolean       none_ok,
+                                                  GParamFlags    flags);
+
+gint32          gimp_value_get_selection_id      (const GValue  *value);
+void            gimp_value_set_selection_id      (GValue        *value,
+                                                  gint32         selection_id);
+
+
+/*
+ * GIMP_TYPE_VECTORS_ID
+ */
+
+#define GIMP_TYPE_VECTORS_ID               (gimp_vectors_id_get_type ())
+#define GIMP_VALUE_HOLDS_VECTORS_ID(value) (G_TYPE_CHECK_VALUE_TYPE ((value),\
+                                            GIMP_TYPE_VECTORS_ID))
+
+GType   gimp_vectors_id_get_type           (void) G_GNUC_CONST;
+
+
+/*
+ * GIMP_TYPE_PARAM_VECTORS_ID
+ */
+
+#define GIMP_TYPE_PARAM_VECTORS_ID           (gimp_param_vectors_id_get_type ())
+#define GIMP_PARAM_SPEC_VECTORS_ID(pspec)    (G_TYPE_CHECK_INSTANCE_CAST ((pspec), 
GIMP_TYPE_PARAM_VECTORS_ID, GimpParamSpecVectorsID))
+#define GIMP_IS_PARAM_SPEC_VECTORS_ID(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), 
GIMP_TYPE_PARAM_VECTORS_ID))
+
+typedef struct _GimpParamSpecVectorsID GimpParamSpecVectorsID;
+
+struct _GimpParamSpecVectorsID
+{
+  GimpParamSpecItemID parent_instance;
+};
+
+GType         gimp_param_vectors_id_get_type (void) G_GNUC_CONST;
+
+GParamSpec  * gimp_param_spec_vectors_id     (const gchar  *name,
+                                              const gchar  *nick,
+                                              const gchar  *blurb,
+                                              gboolean      none_ok,
+                                              GParamFlags   flags);
+
+gint32        gimp_value_get_vectors_id      (const GValue *value);
+void          gimp_value_set_vectors_id      (GValue       *value,
+                                              gint32        vectors_id);
+
+
+/*
+ * GIMP_TYPE_DISPLAY_ID
+ */
+
+#define GIMP_TYPE_DISPLAY_ID               (gimp_display_id_get_type ())
+#define GIMP_VALUE_HOLDS_DISPLAY_ID(value) (G_TYPE_CHECK_VALUE_TYPE ((value),\
+                                            GIMP_TYPE_DISPLAY_ID))
+
+GType   gimp_display_id_get_type           (void) G_GNUC_CONST;
+
+
+/*
+ * GIMP_TYPE_PARAM_DISPLAY_ID
+ */
+
+#define GIMP_TYPE_PARAM_DISPLAY_ID           (gimp_param_display_id_get_type ())
+#define GIMP_PARAM_SPEC_DISPLAY_ID(pspec)    (G_TYPE_CHECK_INSTANCE_CAST ((pspec), 
GIMP_TYPE_PARAM_DISPLAY_ID, GimpParamSpecDisplayID))
+#define GIMP_IS_PARAM_SPEC_DISPLAY_ID(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), 
GIMP_TYPE_PARAM_DISPLAY_ID))
+
+typedef struct _GimpParamSpecDisplayID GimpParamSpecDisplayID;
+
+struct _GimpParamSpecDisplayID
+{
+  GParamSpecInt  parent_instance;
+
+  gboolean       none_ok;
+};
+
+GType        gimp_param_display_id_get_type (void) G_GNUC_CONST;
+
+GParamSpec * gimp_param_spec_display_id     (const gchar  *name,
+                                             const gchar  *nick,
+                                             const gchar  *blurb,
+                                             gboolean      none_ok,
+                                             GParamFlags   flags);
+
+gint32       gimp_value_get_display_id      (const GValue *value);
+void         gimp_value_set_display_id      (GValue       *value,
+                                             gint32        display_id);
+
+G_END_DECLS
+
+#endif  /*  __LIBGIMP_GIMP_PARAM_SPECS_H__  */


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