[gimp] pdb, libgimp: remove double API generation from PDB.
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] pdb, libgimp: remove double API generation from PDB.
- Date: Tue, 3 Sep 2019 11:33:53 +0000 (UTC)
commit 71ccaa21ee541e9182406db6b2ee146d6c256e7e
Author: Jehan <jehan girinstud io>
Date: Tue Sep 3 13:31:27 2019 +0200
pdb, libgimp: remove double API generation from PDB.
All plug-ins got ported. Let's remove support for the old API with IDs
instead of objects.
libgimp/gimp_pdb.h | 16 -
libgimp/gimpbrush_pdb.h | 16 -
libgimp/gimpbrushes_pdb.h | 16 -
libgimp/gimpbrushselect_pdb.h | 16 -
libgimp/gimpbuffer_pdb.h | 16 -
libgimp/gimpchannel_pdb.c | 391 ---
libgimp/gimpchannel_pdb.h | 43 -
libgimp/gimpcontext_pdb.h | 16 -
libgimp/gimpdebug_pdb.h | 16 -
libgimp/gimpdisplay_pdb.c | 175 --
libgimp/gimpdisplay_pdb.h | 27 +-
libgimp/gimpdrawable_pdb.c | 1019 +------
libgimp/gimpdrawable_pdb.h | 84 -
libgimp/gimpdrawablecolor_pdb.c | 834 +-----
libgimp/gimpdrawablecolor_pdb.h | 88 -
libgimp/gimpdrawableedit_pdb.c | 339 ---
libgimp/gimpdrawableedit_pdb.h | 42 -
libgimp/gimpdynamics_pdb.h | 16 -
libgimp/gimpedit_pdb.c | 470 ----
libgimp/gimpedit_pdb.h | 41 -
libgimp/gimpfileops_pdb.c | 261 --
libgimp/gimpfileops_pdb.h | 106 +-
libgimp/gimpfloatingsel_pdb.c | 168 --
libgimp/gimpfloatingsel_pdb.h | 24 -
libgimp/gimpfonts_pdb.h | 16 -
libgimp/gimpfontselect_pdb.h | 16 -
libgimp/gimpgimprc_pdb.h | 16 -
libgimp/gimpgradient_pdb.h | 16 -
libgimp/gimpgradients_pdb.h | 16 -
libgimp/gimpgradientselect_pdb.h | 16 -
libgimp/gimphelp_pdb.h | 16 -
libgimp/gimpimage_pdb.c | 5298 +++++++----------------------------
libgimp/gimpimage_pdb.h | 225 +-
libgimp/gimpimagecolorprofile_pdb.c | 100 -
libgimp/gimpimagecolorprofile_pdb.h | 23 -
libgimp/gimpimageconvert_pdb.c | 193 --
libgimp/gimpimageconvert_pdb.h | 59 +-
libgimp/gimpimagegrid_pdb.c | 463 ---
libgimp/gimpimagegrid_pdb.h | 48 -
libgimp/gimpimageguides_pdb.c | 262 --
libgimp/gimpimageguides_pdb.h | 33 -
libgimp/gimpimagesamplepoints_pdb.c | 193 --
libgimp/gimpimagesamplepoints_pdb.h | 29 -
libgimp/gimpimageselect_pdb.c | 446 ---
libgimp/gimpimageselect_pdb.h | 58 -
libgimp/gimpimagetransform_pdb.c | 284 --
libgimp/gimpimagetransform_pdb.h | 39 -
libgimp/gimpimageundo_pdb.c | 304 --
libgimp/gimpimageundo_pdb.h | 29 -
libgimp/gimpitem_pdb.c | 1439 ++--------
libgimp/gimpitem_pdb.h | 90 +-
libgimp/gimpitemtransform_pdb.c | 790 +-----
libgimp/gimpitemtransform_pdb.h | 82 -
libgimp/gimplayer_pdb.c | 1944 ++-----------
libgimp/gimplayer_pdb.h | 105 -
libgimp/gimpmessage_pdb.h | 16 -
libgimp/gimppainttools_pdb.c | 1106 +-------
libgimp/gimppainttools_pdb.h | 102 -
libgimp/gimppalette_pdb.h | 16 -
libgimp/gimppalettes_pdb.h | 16 -
libgimp/gimppaletteselect_pdb.h | 16 -
libgimp/gimppattern_pdb.h | 16 -
libgimp/gimppatterns_pdb.h | 16 -
libgimp/gimppatternselect_pdb.h | 16 -
libgimp/gimppdb_pdb.h | 16 -
libgimp/gimpplugin_pdb.h | 16 -
libgimp/gimpprogress_pdb.h | 19 +-
libgimp/gimpselection_pdb.c | 834 +-----
libgimp/gimpselection_pdb.h | 56 -
libgimp/gimptextlayer_pdb.c | 1783 ++----------
libgimp/gimptextlayer_pdb.h | 95 -
libgimp/gimptexttool_pdb.c | 79 -
libgimp/gimptexttool_pdb.h | 61 +-
libgimp/gimpunit_pdb.h | 16 -
libgimp/gimpvectors_pdb.c | 1740 ++----------
libgimp/gimpvectors_pdb.h | 145 -
pdb/lib.pl | 150 +-
pdb/pdb.pl | 20 +-
plug-ins/pygimp/Makefile.am | 1 -
79 files changed, 2334 insertions(+), 20905 deletions(-)
---
diff --git a/libgimp/gimp_pdb.h b/libgimp/gimp_pdb.h
index df90de3c6b..25ef652825 100644
--- a/libgimp/gimp_pdb.h
+++ b/libgimp/gimp_pdb.h
@@ -40,22 +40,6 @@ GimpParasite* gimp_get_parasite (const gchar *name);
gchar** gimp_get_parasite_list (gint *num_parasites);
gchar* gimp_temp_name (const gchar *extension);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimpbrush_pdb.h b/libgimp/gimpbrush_pdb.h
index 02e7bfc1c2..f56c5685b9 100644
--- a/libgimp/gimpbrush_pdb.h
+++ b/libgimp/gimpbrush_pdb.h
@@ -76,22 +76,6 @@ gdouble gimp_brush_get_angle (const gchar *n
gdouble gimp_brush_set_angle (const gchar *name,
gdouble angle_in);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimpbrushes_pdb.h b/libgimp/gimpbrushes_pdb.h
index 79a4ad0d70..d4f013a124 100644
--- a/libgimp/gimpbrushes_pdb.h
+++ b/libgimp/gimpbrushes_pdb.h
@@ -36,22 +36,6 @@ gboolean gimp_brushes_refresh (void);
gchar** gimp_brushes_get_list (const gchar *filter,
gint *num_brushes);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimpbrushselect_pdb.h b/libgimp/gimpbrushselect_pdb.h
index 5f65453308..ae401f2d59 100644
--- a/libgimp/gimpbrushselect_pdb.h
+++ b/libgimp/gimpbrushselect_pdb.h
@@ -45,22 +45,6 @@ gboolean gimp_brushes_set_popup (const gchar *brush_callback,
gint spacing,
GimpLayerMode paint_mode);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimpbuffer_pdb.h b/libgimp/gimpbuffer_pdb.h
index f559fe556d..83b919664e 100644
--- a/libgimp/gimpbuffer_pdb.h
+++ b/libgimp/gimpbuffer_pdb.h
@@ -42,22 +42,6 @@ gint gimp_buffer_get_height (const gchar *buffer_name);
gint gimp_buffer_get_bytes (const gchar *buffer_name);
GimpImageBaseType gimp_buffer_get_image_type (const gchar *buffer_name);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimpchannel_pdb.c b/libgimp/gimpchannel_pdb.c
index 1b97081de7..07cf0dc6e1 100644
--- a/libgimp/gimpchannel_pdb.c
+++ b/libgimp/gimpchannel_pdb.c
@@ -145,57 +145,6 @@ gimp_channel_new_from_component (GimpImage *image,
return channel;
}
-/**
- * _gimp_channel_new_from_component: (skip)
- * @image_ID: The image to which to add the channel.
- * @component: The image component.
- * @name: The channel name.
- *
- * Create a new channel from a color component
- *
- * This procedure creates a new channel from a color component.
- * The new channel still needs to be added to the image, as this is not
- * automatic. Add the new channel with gimp_image_insert_channel().
- * Other attributes, such as channel visibility, should be set with
- * explicit procedure calls.
- *
- * Returns: The newly created channel.
- *
- * Since: 2.4
- **/
-gint32
-_gimp_channel_new_from_component (gint32 image_ID,
- GimpChannelType component,
- const gchar *name)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 channel_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_CHANNEL_TYPE, component,
- G_TYPE_STRING, name,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-channel-new-from-component",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-channel-new-from-component",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- channel_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return channel_ID;
-}
-
/**
* gimp_channel_copy:
* @channel: The channel to copy.
@@ -237,47 +186,6 @@ gimp_channel_copy (GimpChannel *channel)
return channel_copy;
}
-/**
- * _gimp_channel_copy: (skip)
- * @channel_ID: The channel to copy.
- *
- * Copy a channel.
- *
- * This procedure copies the specified channel and returns the copy.
- * The new channel still needs to be added to the image, as this is not
- * automatic. Add the new channel with gimp_image_insert_channel().
- *
- * Returns: The newly copied channel.
- **/
-gint32
-_gimp_channel_copy (gint32 channel_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 channel_copy_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_CHANNEL, gimp_item_get_by_id (channel_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-channel-copy",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-channel-copy",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- channel_copy_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return channel_copy_ID;
-}
-
/**
* gimp_channel_combine_masks:
* @channel1: The channel1.
@@ -329,57 +237,6 @@ gimp_channel_combine_masks (GimpChannel *channel1,
return success;
}
-/**
- * _gimp_channel_combine_masks: (skip)
- * @channel1_ID: The channel1.
- * @channel2_ID: The channel2.
- * @operation: The selection operation.
- * @offx: x offset between upper left corner of channels: (second - first).
- * @offy: y offset between upper left corner of channels: (second - first).
- *
- * Combine two channel masks.
- *
- * This procedure combines two channel masks. The result is stored in
- * the first channel.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_channel_combine_masks (gint32 channel1_ID,
- gint32 channel2_ID,
- GimpChannelOps operation,
- gint offx,
- gint offy)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_CHANNEL, gimp_item_get_by_id (channel1_ID),
- GIMP_TYPE_CHANNEL, gimp_item_get_by_id (channel2_ID),
- GIMP_TYPE_CHANNEL_OPS, operation,
- G_TYPE_INT, offx,
- G_TYPE_INT, offy,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-channel-combine-masks",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-channel-combine-masks",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_channel_get_show_masked:
* @channel: The channel.
@@ -421,47 +278,6 @@ gimp_channel_get_show_masked (GimpChannel *channel)
return show_masked;
}
-/**
- * _gimp_channel_get_show_masked: (skip)
- * @channel_ID: The channel.
- *
- * Get the composite method of the specified channel.
- *
- * This procedure returns the specified channel's composite method. If
- * it is TRUE, then the channel is composited with the image so that
- * masked regions are shown. Otherwise, selected regions are shown.
- *
- * Returns: The channel composite method.
- **/
-gboolean
-_gimp_channel_get_show_masked (gint32 channel_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean show_masked = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_CHANNEL, gimp_item_get_by_id (channel_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-channel-get-show-masked",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-channel-get-show-masked",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- show_masked = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return show_masked;
-}
-
/**
* gimp_channel_set_show_masked:
* @channel: The channel.
@@ -505,49 +321,6 @@ gimp_channel_set_show_masked (GimpChannel *channel,
return success;
}
-/**
- * _gimp_channel_set_show_masked: (skip)
- * @channel_ID: The channel.
- * @show_masked: The new channel composite method.
- *
- * Set the composite method of the specified channel.
- *
- * This procedure sets the specified channel's composite method. If it
- * is TRUE, then the channel is composited with the image so that
- * masked regions are shown. Otherwise, selected regions are shown.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_channel_set_show_masked (gint32 channel_ID,
- gboolean show_masked)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_CHANNEL, gimp_item_get_by_id (channel_ID),
- G_TYPE_BOOLEAN, show_masked,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-channel-set-show-masked",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-channel-set-show-masked",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_channel_get_opacity:
* @channel: The channel.
@@ -587,45 +360,6 @@ gimp_channel_get_opacity (GimpChannel *channel)
return opacity;
}
-/**
- * _gimp_channel_get_opacity: (skip)
- * @channel_ID: The channel.
- *
- * Get the opacity of the specified channel.
- *
- * This procedure returns the specified channel's opacity.
- *
- * Returns: The channel opacity.
- **/
-gdouble
-_gimp_channel_get_opacity (gint32 channel_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gdouble opacity = 0.0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_CHANNEL, gimp_item_get_by_id (channel_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-channel-get-opacity",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-channel-get-opacity",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- opacity = g_value_get_double (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return opacity;
-}
-
/**
* gimp_channel_set_opacity:
* @channel: The channel.
@@ -667,47 +401,6 @@ gimp_channel_set_opacity (GimpChannel *channel,
return success;
}
-/**
- * _gimp_channel_set_opacity: (skip)
- * @channel_ID: The channel.
- * @opacity: The new channel opacity.
- *
- * Set the opacity of the specified channel.
- *
- * This procedure sets the specified channel's opacity.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_channel_set_opacity (gint32 channel_ID,
- gdouble opacity)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_CHANNEL, gimp_item_get_by_id (channel_ID),
- G_TYPE_DOUBLE, opacity,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-channel-set-opacity",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-channel-set-opacity",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_channel_get_color:
* @channel: The channel.
@@ -751,49 +444,6 @@ gimp_channel_get_color (GimpChannel *channel,
return success;
}
-/**
- * _gimp_channel_get_color: (skip)
- * @channel_ID: The channel.
- * @color: (out caller-allocates): The channel compositing color.
- *
- * Get the compositing color of the specified channel.
- *
- * This procedure returns the specified channel's compositing color.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_channel_get_color (gint32 channel_ID,
- GimpRGB *color)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_CHANNEL, gimp_item_get_by_id (channel_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-channel-get-color",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-channel-get-color",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- if (success)
- gimp_value_get_rgb (gimp_value_array_index (return_vals, 1), &*color);
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_channel_set_color:
* @channel: The channel.
@@ -834,44 +484,3 @@ gimp_channel_set_color (GimpChannel *channel,
return success;
}
-
-/**
- * _gimp_channel_set_color: (skip)
- * @channel_ID: The channel.
- * @color: The new channel compositing color.
- *
- * Set the compositing color of the specified channel.
- *
- * This procedure sets the specified channel's compositing color.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_channel_set_color (gint32 channel_ID,
- const GimpRGB *color)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_CHANNEL, gimp_item_get_by_id (channel_ID),
- GIMP_TYPE_RGB, color,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-channel-set-color",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-channel-set-color",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
diff --git a/libgimp/gimpchannel_pdb.h b/libgimp/gimpchannel_pdb.h
index 49a70ca5dc..d963035a57 100644
--- a/libgimp/gimpchannel_pdb.h
+++ b/libgimp/gimpchannel_pdb.h
@@ -32,10 +32,6 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
G_GNUC_INTERNAL GimpChannel* _gimp_channel_new (GimpImage *image,
gint width,
gint height,
@@ -62,45 +58,6 @@ gboolean gimp_channel_get_color (GimpChannel *c
gboolean gimp_channel_set_color (GimpChannel *channel,
const GimpRGB *color);
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_channel_new_from_component _gimp_channel_new_from_component
-#define gimp_channel_copy _gimp_channel_copy
-#define gimp_channel_combine_masks _gimp_channel_combine_masks
-#define gimp_channel_get_show_masked _gimp_channel_get_show_masked
-#define gimp_channel_set_show_masked _gimp_channel_set_show_masked
-#define gimp_channel_get_opacity _gimp_channel_get_opacity
-#define gimp_channel_set_opacity _gimp_channel_set_opacity
-#define gimp_channel_get_color _gimp_channel_get_color
-#define gimp_channel_set_color _gimp_channel_set_color
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-gint32 _gimp_channel_new_from_component (gint32 image_ID,
- GimpChannelType component,
- const gchar *name);
-gint32 _gimp_channel_copy (gint32 channel_ID);
-gboolean _gimp_channel_combine_masks (gint32 channel1_ID,
- gint32 channel2_ID,
- GimpChannelOps operation,
- gint offx,
- gint offy);
-gboolean _gimp_channel_get_show_masked (gint32 channel_ID);
-gboolean _gimp_channel_set_show_masked (gint32 channel_ID,
- gboolean show_masked);
-gdouble _gimp_channel_get_opacity (gint32 channel_ID);
-gboolean _gimp_channel_set_opacity (gint32 channel_ID,
- gdouble opacity);
-gboolean _gimp_channel_get_color (gint32 channel_ID,
- GimpRGB *color);
-gboolean _gimp_channel_set_color (gint32 channel_ID,
- const GimpRGB *color);
-
G_END_DECLS
diff --git a/libgimp/gimpcontext_pdb.h b/libgimp/gimpcontext_pdb.h
index e03a0886c1..743037e309 100644
--- a/libgimp/gimpcontext_pdb.h
+++ b/libgimp/gimpcontext_pdb.h
@@ -151,22 +151,6 @@ gboolean gimp_context_set_ink_blob_aspect_ratio (gdouble
gdouble gimp_context_get_ink_blob_angle (void);
gboolean gimp_context_set_ink_blob_angle (gdouble
angle);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimpdebug_pdb.h b/libgimp/gimpdebug_pdb.h
index 2508311b7b..234dc18128 100644
--- a/libgimp/gimpdebug_pdb.h
+++ b/libgimp/gimpdebug_pdb.h
@@ -35,22 +35,6 @@ G_BEGIN_DECLS
gboolean gimp_debug_timer_start (void);
gdouble gimp_debug_timer_end (void);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimpdisplay_pdb.c b/libgimp/gimpdisplay_pdb.c
index beb5e40ad3..11c5654bcb 100644
--- a/libgimp/gimpdisplay_pdb.c
+++ b/libgimp/gimpdisplay_pdb.c
@@ -120,50 +120,6 @@ gimp_display_new (GimpImage *image)
return display;
}
-/**
- * _gimp_display_new: (skip)
- * @image_ID: The image.
- *
- * Create a new display for the specified image.
- *
- * Creates a new display for the specified image. If the image already
- * has a display, another is added. Multiple displays are handled
- * transparently by GIMP. The newly created display is returned and can
- * be subsequently destroyed with a call to gimp_display_delete(). This
- * procedure only makes sense for use with the GIMP UI, and will result
- * in an execution error if called when GIMP has no UI.
- *
- * Returns: The new display.
- **/
-gint32
-_gimp_display_new (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 display_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-display-new",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-display-new",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- display_ID = gimp_display_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return display_ID;
-}
-
/**
* gimp_display_delete:
* @display: The display to delete.
@@ -206,48 +162,6 @@ gimp_display_delete (GimpDisplay *display)
return success;
}
-/**
- * _gimp_display_delete: (skip)
- * @display_ID: The display to delete.
- *
- * Delete the specified display.
- *
- * This procedure removes the specified display. If this is the last
- * remaining display for the underlying image, then the image is
- * deleted also. Note that the display is closed no matter if the image
- * is dirty or not. Better save the image before calling this
- * procedure.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_display_delete (gint32 display_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DISPLAY, gimp_display_get_by_id (display_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-display-delete",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-display-delete",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_display_get_window_handle:
* @display: The display to get the window handle from.
@@ -293,51 +207,6 @@ gimp_display_get_window_handle (GimpDisplay *display)
return window;
}
-/**
- * _gimp_display_get_window_handle: (skip)
- * @display_ID: The display to get the window handle from.
- *
- * Get a handle to the native window for an image display.
- *
- * This procedure returns a handle to the native window for a given
- * image display. For example in the X backend of GDK, a native window
- * handle is an Xlib XID. A value of 0 is returned for an invalid
- * display or if this function is unimplemented for the windowing
- * system that is being used.
- *
- * Returns: The native window handle or 0.
- *
- * Since: 2.4
- **/
-gint
-_gimp_display_get_window_handle (gint32 display_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint window = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DISPLAY, gimp_display_get_by_id (display_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-display-get-window-handle",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-display-get-window-handle",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- window = g_value_get_int (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return window;
-}
-
/**
* gimp_displays_flush:
*
@@ -420,47 +289,3 @@ gimp_displays_reconnect (GimpImage *old_image,
return success;
}
-
-/**
- * _gimp_displays_reconnect: (skip)
- * @old_image_ID: The old image (must have at least one display).
- * @new_image_ID: The new image (must not have a display).
- *
- * Reconnect displays from one image to another image.
- *
- * This procedure connects all displays of the old_image to the
- * new_image. If the old_image has no display or new_image already has
- * a display the reconnect is not performed and the procedure returns
- * without success. You should rarely need to use this function.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_displays_reconnect (gint32 old_image_ID,
- gint32 new_image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (old_image_ID),
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (new_image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-displays-reconnect",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-displays-reconnect",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
diff --git a/libgimp/gimpdisplay_pdb.h b/libgimp/gimpdisplay_pdb.h
index 45f6db1917..de389fbce0 100644
--- a/libgimp/gimpdisplay_pdb.h
+++ b/libgimp/gimpdisplay_pdb.h
@@ -32,37 +32,14 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-gboolean gimp_display_id_is_valid (gint display_id);
-gboolean gimp_displays_flush (void);
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
+gboolean gimp_display_id_is_valid (gint display_id);
GimpDisplay* gimp_display_new (GimpImage *image);
gboolean gimp_display_delete (GimpDisplay *display);
gint gimp_display_get_window_handle (GimpDisplay *display);
+gboolean gimp_displays_flush (void);
gboolean gimp_displays_reconnect (GimpImage *old_image,
GimpImage *new_image);
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_display_new _gimp_display_new
-#define gimp_display_delete _gimp_display_delete
-#define gimp_display_get_window_handle _gimp_display_get_window_handle
-#define gimp_displays_reconnect _gimp_displays_reconnect
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-gint32 _gimp_display_new (gint32 image_ID);
-gboolean _gimp_display_delete (gint32 display_ID);
-gint _gimp_display_get_window_handle (gint32 display_ID);
-gboolean _gimp_displays_reconnect (gint32 old_image_ID,
- gint32 new_image_ID);
-
G_END_DECLS
diff --git a/libgimp/gimpdrawable_pdb.c b/libgimp/gimpdrawable_pdb.c
index bb9cb93927..1fb93e5b0a 100644
--- a/libgimp/gimpdrawable_pdb.c
+++ b/libgimp/gimpdrawable_pdb.c
@@ -162,45 +162,6 @@ gimp_drawable_type (GimpDrawable *drawable)
return type;
}
-/**
- * _gimp_drawable_type: (skip)
- * @drawable_ID: The drawable.
- *
- * Returns the drawable's type.
- *
- * This procedure returns the drawable's type.
- *
- * Returns: The drawable's type.
- **/
-GimpImageType
-_gimp_drawable_type (gint32 drawable_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- GimpImageType type = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-type",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-type",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- type = g_value_get_enum (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return type;
-}
-
/**
* gimp_drawable_type_with_alpha:
* @drawable: The drawable.
@@ -243,48 +204,6 @@ gimp_drawable_type_with_alpha (GimpDrawable *drawable)
return type_with_alpha;
}
-/**
- * _gimp_drawable_type_with_alpha: (skip)
- * @drawable_ID: The drawable.
- *
- * Returns the drawable's type with alpha.
- *
- * This procedure returns the drawable's type as if had an alpha
- * channel. If the type is currently Gray, for instance, the returned
- * type would be GrayA. If the drawable already has an alpha channel,
- * the drawable's type is simply returned.
- *
- * Returns: The drawable's type with alpha.
- **/
-GimpImageType
-_gimp_drawable_type_with_alpha (gint32 drawable_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- GimpImageType type_with_alpha = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-type-with-alpha",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-type-with-alpha",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- type_with_alpha = g_value_get_enum (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return type_with_alpha;
-}
-
/**
* gimp_drawable_has_alpha:
* @drawable: The drawable.
@@ -326,47 +245,6 @@ gimp_drawable_has_alpha (GimpDrawable *drawable)
return has_alpha;
}
-/**
- * _gimp_drawable_has_alpha: (skip)
- * @drawable_ID: The drawable.
- *
- * Returns TRUE if the drawable has an alpha channel.
- *
- * This procedure returns whether the specified drawable has an alpha
- * channel. This can only be true for layers, and the associated type
- * will be one of: { RGBA , GRAYA, INDEXEDA }.
- *
- * Returns: Does the drawable have an alpha channel?
- **/
-gboolean
-_gimp_drawable_has_alpha (gint32 drawable_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean has_alpha = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-has-alpha",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-has-alpha",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- has_alpha = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return has_alpha;
-}
-
/**
* gimp_drawable_is_rgb:
* @drawable: The drawable.
@@ -407,46 +285,6 @@ gimp_drawable_is_rgb (GimpDrawable *drawable)
return is_rgb;
}
-/**
- * _gimp_drawable_is_rgb: (skip)
- * @drawable_ID: The drawable.
- *
- * Returns whether the drawable is an RGB type.
- *
- * This procedure returns TRUE if the specified drawable is of type {
- * RGB, RGBA }.
- *
- * Returns: TRUE if the drawable is an RGB type.
- **/
-gboolean
-_gimp_drawable_is_rgb (gint32 drawable_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean is_rgb = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-is-rgb",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-is-rgb",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- is_rgb = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return is_rgb;
-}
-
/**
* gimp_drawable_is_gray:
* @drawable: The drawable.
@@ -487,46 +325,6 @@ gimp_drawable_is_gray (GimpDrawable *drawable)
return is_gray;
}
-/**
- * _gimp_drawable_is_gray: (skip)
- * @drawable_ID: The drawable.
- *
- * Returns whether the drawable is a grayscale type.
- *
- * This procedure returns TRUE if the specified drawable is of type {
- * Gray, GrayA }.
- *
- * Returns: TRUE if the drawable is a grayscale type.
- **/
-gboolean
-_gimp_drawable_is_gray (gint32 drawable_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean is_gray = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-is-gray",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-is-gray",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- is_gray = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return is_gray;
-}
-
/**
* gimp_drawable_is_indexed:
* @drawable: The drawable.
@@ -567,46 +365,6 @@ gimp_drawable_is_indexed (GimpDrawable *drawable)
return is_indexed;
}
-/**
- * _gimp_drawable_is_indexed: (skip)
- * @drawable_ID: The drawable.
- *
- * Returns whether the drawable is an indexed type.
- *
- * This procedure returns TRUE if the specified drawable is of type {
- * Indexed, IndexedA }.
- *
- * Returns: TRUE if the drawable is an indexed type.
- **/
-gboolean
-_gimp_drawable_is_indexed (gint32 drawable_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean is_indexed = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-is-indexed",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-is-indexed",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- is_indexed = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return is_indexed;
-}
-
/**
* gimp_drawable_bpp:
* @drawable: The drawable.
@@ -647,61 +405,61 @@ gimp_drawable_bpp (GimpDrawable *drawable)
}
/**
- * _gimp_drawable_bpp: (skip)
- * @drawable_ID: The drawable.
+ * gimp_drawable_width:
+ * @drawable: The drawable.
*
- * Returns the bytes per pixel.
+ * Returns the width of the drawable.
*
- * This procedure returns the number of bytes per pixel.
+ * This procedure returns the specified drawable's width in pixels.
*
- * Returns: Bytes per pixel.
+ * Returns: Width of drawable.
**/
gint
-_gimp_drawable_bpp (gint32 drawable_ID)
+gimp_drawable_width (GimpDrawable *drawable)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gint bpp = 0;
+ gint width = 0;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
+ GIMP_TYPE_DRAWABLE, drawable,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-bpp",
+ "gimp-drawable-width",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-drawable-bpp",
+ return_vals = gimp_run_procedure_array ("gimp-drawable-width",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- bpp = g_value_get_int (gimp_value_array_index (return_vals, 1));
+ width = g_value_get_int (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return bpp;
+ return width;
}
/**
- * gimp_drawable_width:
+ * gimp_drawable_height:
* @drawable: The drawable.
*
- * Returns the width of the drawable.
+ * Returns the height of the drawable.
*
- * This procedure returns the specified drawable's width in pixels.
+ * This procedure returns the specified drawable's height in pixels.
*
- * Returns: Width of drawable.
+ * Returns: Height of drawable.
**/
gint
-gimp_drawable_width (GimpDrawable *drawable)
+gimp_drawable_height (GimpDrawable *drawable)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gint width = 0;
+ gint height = 0;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_DRAWABLE, drawable,
@@ -709,132 +467,15 @@ gimp_drawable_width (GimpDrawable *drawable)
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-width",
+ "gimp-drawable-height",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-drawable-width",
+ return_vals = gimp_run_procedure_array ("gimp-drawable-height",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- width = g_value_get_int (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return width;
-}
-
-/**
- * _gimp_drawable_width: (skip)
- * @drawable_ID: The drawable.
- *
- * Returns the width of the drawable.
- *
- * This procedure returns the specified drawable's width in pixels.
- *
- * Returns: Width of drawable.
- **/
-gint
-_gimp_drawable_width (gint32 drawable_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint width = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-width",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-width",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- width = g_value_get_int (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return width;
-}
-
-/**
- * gimp_drawable_height:
- * @drawable: The drawable.
- *
- * Returns the height of the drawable.
- *
- * This procedure returns the specified drawable's height in pixels.
- *
- * Returns: Height of drawable.
- **/
-gint
-gimp_drawable_height (GimpDrawable *drawable)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint height = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, drawable,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-height",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-height",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- height = g_value_get_int (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return height;
-}
-
-/**
- * _gimp_drawable_height: (skip)
- * @drawable_ID: The drawable.
- *
- * Returns the height of the drawable.
- *
- * This procedure returns the specified drawable's height in pixels.
- *
- * Returns: Height of drawable.
- **/
-gint
-_gimp_drawable_height (gint32 drawable_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint height = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-height",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-height",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- height = g_value_get_int (gimp_value_array_index (return_vals, 1));
+ height = g_value_get_int (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
@@ -894,59 +535,6 @@ gimp_drawable_offsets (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_drawable_offsets: (skip)
- * @drawable_ID: The drawable.
- * @offset_x: (out): x offset of drawable.
- * @offset_y: (out): y offset of drawable.
- *
- * Returns the offsets for the drawable.
- *
- * This procedure returns the specified drawable's offsets. This only
- * makes sense if the drawable is a layer since channels are anchored.
- * The offsets of a channel will be returned as 0.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_drawable_offsets (gint32 drawable_ID,
- gint *offset_x,
- gint *offset_y)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-offsets",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-offsets",
- args);
- gimp_value_array_unref (args);
-
- *offset_x = 0;
- *offset_y = 0;
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- if (success)
- {
- *offset_x = g_value_get_int (gimp_value_array_index (return_vals, 1));
- *offset_y = g_value_get_int (gimp_value_array_index (return_vals, 2));
- }
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_drawable_mask_bounds:
* @drawable: The drawable.
@@ -1012,71 +600,6 @@ gimp_drawable_mask_bounds (GimpDrawable *drawable,
return non_empty;
}
-/**
- * _gimp_drawable_mask_bounds: (skip)
- * @drawable_ID: The drawable.
- * @x1: (out): x coordinate of the upper left corner of selection bounds.
- * @y1: (out): y coordinate of the upper left corner of selection bounds.
- * @x2: (out): x coordinate of the lower right corner of selection bounds.
- * @y2: (out): y coordinate of the lower right corner of selection bounds.
- *
- * Find the bounding box of the current selection in relation to the
- * specified drawable.
- *
- * This procedure returns whether there is a selection. If there is
- * one, the upper left and lower right-hand corners of its bounding box
- * are returned. These coordinates are specified relative to the
- * drawable's origin, and bounded by the drawable's extents. Please
- * note that the pixel specified by the lower right-hand coordinate of
- * the bounding box is not part of the selection. The selection ends at
- * the upper left corner of this pixel. This means the width of the
- * selection can be calculated as (x2 - x1), its height as (y2 - y1).
- * Note that the returned boolean does NOT correspond with the returned
- * region being empty or not, it always returns whether the selection
- * is non_empty. See gimp_drawable_mask_intersect() for a boolean
- * return value which is more useful in most cases.
- *
- * Returns: TRUE if there is a selection.
- **/
-gboolean
-_gimp_drawable_mask_bounds (gint32 drawable_ID,
- gint *x1,
- gint *y1,
- gint *x2,
- gint *y2)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean non_empty = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-mask-bounds",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-mask-bounds",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- {
- non_empty = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
- *x1 = g_value_get_int (gimp_value_array_index (return_vals, 2));
- *y1 = g_value_get_int (gimp_value_array_index (return_vals, 3));
- *x2 = g_value_get_int (gimp_value_array_index (return_vals, 4));
- *y2 = g_value_get_int (gimp_value_array_index (return_vals, 5));
- }
-
- gimp_value_array_unref (return_vals);
-
- return non_empty;
-}
-
/**
* gimp_drawable_mask_intersect:
* @drawable: The drawable.
@@ -1137,66 +660,6 @@ gimp_drawable_mask_intersect (GimpDrawable *drawable,
return non_empty;
}
-/**
- * _gimp_drawable_mask_intersect: (skip)
- * @drawable_ID: The drawable.
- * @x: (out): x coordinate of the upper left corner of the intersection.
- * @y: (out): y coordinate of the upper left corner of the intersection.
- * @width: (out): width of the intersection.
- * @height: (out): height of the intersection.
- *
- * Find the bounding box of the current selection in relation to the
- * specified drawable.
- *
- * This procedure returns whether there is an intersection between the
- * drawable and the selection. Unlike gimp_drawable_mask_bounds(), the
- * intersection's bounds are returned as x, y, width, height.
- * If there is no selection this function returns TRUE and the returned
- * bounds are the extents of the whole drawable.
- *
- * Returns: TRUE if the returned area is not empty.
- *
- * Since: 2.2
- **/
-gboolean
-_gimp_drawable_mask_intersect (gint32 drawable_ID,
- gint *x,
- gint *y,
- gint *width,
- gint *height)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean non_empty = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-mask-intersect",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-mask-intersect",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- {
- non_empty = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
- *x = g_value_get_int (gimp_value_array_index (return_vals, 2));
- *y = g_value_get_int (gimp_value_array_index (return_vals, 3));
- *width = g_value_get_int (gimp_value_array_index (return_vals, 4));
- *height = g_value_get_int (gimp_value_array_index (return_vals, 5));
- }
-
- gimp_value_array_unref (return_vals);
-
- return non_empty;
-}
-
/**
* gimp_drawable_merge_shadow:
* @drawable: The drawable.
@@ -1241,159 +704,23 @@ gimp_drawable_merge_shadow (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_drawable_merge_shadow: (skip)
- * @drawable_ID: The drawable.
- * @undo: Push merge to undo stack?
- *
- * Merge the shadow buffer with the specified drawable.
- *
- * This procedure combines the contents of the drawable's shadow buffer
- * (for temporary processing) with the specified drawable. The 'undo'
- * parameter specifies whether to add an undo step for the operation.
- * Requesting no undo is useful for such applications as 'auto-apply'.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_drawable_merge_shadow (gint32 drawable_ID,
- gboolean undo)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_BOOLEAN, undo,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-merge-shadow",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-merge-shadow",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_drawable_free_shadow:
* @drawable: The drawable.
*
* Free the specified drawable's shadow data (if it exists).
*
- * This procedure is intended as a memory saving device. If any shadow
- * memory has been allocated, it will be freed automatically when the
- * drawable is removed from the image, or when the plug-in procedure
- * which allocated it returns.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.6
- **/
-gboolean
-gimp_drawable_free_shadow (GimpDrawable *drawable)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, drawable,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-free-shadow",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-free-shadow",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_drawable_free_shadow: (skip)
- * @drawable_ID: The drawable.
- *
- * Free the specified drawable's shadow data (if it exists).
- *
- * This procedure is intended as a memory saving device. If any shadow
- * memory has been allocated, it will be freed automatically when the
- * drawable is removed from the image, or when the plug-in procedure
- * which allocated it returns.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.6
- **/
-gboolean
-_gimp_drawable_free_shadow (gint32 drawable_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-free-shadow",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-free-shadow",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_drawable_update:
- * @drawable: The drawable.
- * @x: x coordinate of upper left corner of update region.
- * @y: y coordinate of upper left corner of update region.
- * @width: Width of update region.
- * @height: Height of update region.
- *
- * Update the specified region of the drawable.
- *
- * This procedure updates the specified region of the drawable. The (x,
- * y) coordinate pair is relative to the drawable's origin, not to the
- * image origin. Therefore, the entire drawable can be updated using
- * (0, 0, width, height).
- *
+ * This procedure is intended as a memory saving device. If any shadow
+ * memory has been allocated, it will be freed automatically when the
+ * drawable is removed from the image, or when the plug-in procedure
+ * which allocated it returns.
+ *
* Returns: TRUE on success.
+ *
+ * Since: 2.6
**/
gboolean
-gimp_drawable_update (GimpDrawable *drawable,
- gint x,
- gint y,
- gint width,
- gint height)
+gimp_drawable_free_shadow (GimpDrawable *drawable)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -1402,18 +729,14 @@ gimp_drawable_update (GimpDrawable *drawable,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_DRAWABLE, drawable,
- G_TYPE_INT, x,
- G_TYPE_INT, y,
- G_TYPE_INT, width,
- G_TYPE_INT, height,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-update",
+ "gimp-drawable-free-shadow",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-drawable-update",
+ return_vals = gimp_run_procedure_array ("gimp-drawable-free-shadow",
args);
gimp_value_array_unref (args);
@@ -1425,8 +748,8 @@ gimp_drawable_update (GimpDrawable *drawable,
}
/**
- * _gimp_drawable_update: (skip)
- * @drawable_ID: The drawable.
+ * gimp_drawable_update:
+ * @drawable: The drawable.
* @x: x coordinate of upper left corner of update region.
* @y: y coordinate of upper left corner of update region.
* @width: Width of update region.
@@ -1442,11 +765,11 @@ gimp_drawable_update (GimpDrawable *drawable,
* Returns: TRUE on success.
**/
gboolean
-_gimp_drawable_update (gint32 drawable_ID,
- gint x,
- gint y,
- gint width,
- gint height)
+gimp_drawable_update (GimpDrawable *drawable,
+ gint x,
+ gint y,
+ gint width,
+ gint height)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -1454,7 +777,7 @@ _gimp_drawable_update (gint32 drawable_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
+ GIMP_TYPE_DRAWABLE, drawable,
G_TYPE_INT, x,
G_TYPE_INT, y,
G_TYPE_INT, width,
@@ -1533,61 +856,6 @@ gimp_drawable_get_pixel (GimpDrawable *drawable,
return pixel;
}
-/**
- * _gimp_drawable_get_pixel: (skip)
- * @drawable_ID: The drawable.
- * @x_coord: The x coordinate.
- * @y_coord: The y coordinate.
- * @num_channels: (out): The number of channels for the pixel.
- *
- * Gets the value of the pixel at the specified coordinates.
- *
- * This procedure gets the pixel value at the specified coordinates.
- * The 'num_channels' argument must always be equal to the
- * bytes-per-pixel value for the specified drawable.
- *
- * Returns: (array length=num_channels): The pixel value.
- * The returned value must be freed with g_free().
- **/
-guint8 *
-_gimp_drawable_get_pixel (gint32 drawable_ID,
- gint x_coord,
- gint y_coord,
- gint *num_channels)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- guint8 *pixel = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_INT, x_coord,
- G_TYPE_INT, y_coord,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-get-pixel",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-get-pixel",
- args);
- gimp_value_array_unref (args);
-
- *num_channels = 0;
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- {
- *num_channels = g_value_get_int (gimp_value_array_index (return_vals, 1));
- pixel = gimp_value_dup_uint8_array (gimp_value_array_index (return_vals, 2));
- }
-
- gimp_value_array_unref (return_vals);
-
- return pixel;
-}
-
/**
* gimp_drawable_set_pixel:
* @drawable: The drawable.
@@ -1643,61 +911,6 @@ gimp_drawable_set_pixel (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_drawable_set_pixel: (skip)
- * @drawable_ID: The drawable.
- * @x_coord: The x coordinate.
- * @y_coord: The y coordinate.
- * @num_channels: The number of channels for the pixel.
- * @pixel: (array length=num_channels) (element-type guint8): The pixel value.
- *
- * Sets the value of the pixel at the specified coordinates.
- *
- * This procedure sets the pixel value at the specified coordinates.
- * The 'num_channels' argument must always be equal to the
- * bytes-per-pixel value for the specified drawable. Note that this
- * function is not undoable, you should use it only on drawables you
- * just created yourself.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_drawable_set_pixel (gint32 drawable_ID,
- gint x_coord,
- gint y_coord,
- gint num_channels,
- const guint8 *pixel)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_INT, x_coord,
- G_TYPE_INT, y_coord,
- G_TYPE_INT, num_channels,
- GIMP_TYPE_UINT8_ARRAY, NULL,
- G_TYPE_NONE);
- gimp_value_set_uint8_array (gimp_value_array_index (args, 4), pixel, num_channels);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-set-pixel",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-set-pixel",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_drawable_fill:
* @drawable: The drawable.
@@ -1749,57 +962,6 @@ gimp_drawable_fill (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_drawable_fill: (skip)
- * @drawable_ID: The drawable.
- * @fill_type: The type of fill.
- *
- * Fill the drawable with the specified fill mode.
- *
- * This procedure fills the drawable. If the fill mode is foreground
- * the current foreground color is used. If the fill mode is
- * background, the current background color is used. If the fill type
- * is white, then white is used. Transparent fill only affects layers
- * with an alpha channel, in which case the alpha channel is set to
- * transparent. If the drawable has no alpha channel, it is filled to
- * white. No fill leaves the drawable's contents undefined.
- * This procedure is unlike gimp_edit_fill() or the bucket fill tool
- * because it fills regardless of a selection. Its main purpose is to
- * fill a newly created drawable before adding it to the image. This
- * operation cannot be undone.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_drawable_fill (gint32 drawable_ID,
- GimpFillType fill_type)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- GIMP_TYPE_FILL_TYPE, fill_type,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-fill",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-fill",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_drawable_offset:
* @drawable: The drawable to offset.
@@ -1856,62 +1018,6 @@ gimp_drawable_offset (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_drawable_offset: (skip)
- * @drawable_ID: The drawable to offset.
- * @wrap_around: wrap image around or fill vacated regions.
- * @fill_type: fill vacated regions of drawable with background or transparent.
- * @offset_x: offset by this amount in X direction.
- * @offset_y: offset by this amount in Y direction.
- *
- * Offset the drawable by the specified amounts in the X and Y
- * directions
- *
- * This procedure offsets the specified drawable by the amounts
- * specified by 'offset_x' and 'offset_y'. If 'wrap_around' is set to
- * TRUE, then portions of the drawable which are offset out of bounds
- * are wrapped around. Alternatively, the undefined regions of the
- * drawable can be filled with transparency or the background color, as
- * specified by the 'fill-type' parameter.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_drawable_offset (gint32 drawable_ID,
- gboolean wrap_around,
- GimpOffsetType fill_type,
- gint offset_x,
- gint offset_y)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_BOOLEAN, wrap_around,
- GIMP_TYPE_OFFSET_TYPE, fill_type,
- G_TYPE_INT, offset_x,
- G_TYPE_INT, offset_y,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-offset",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-offset",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* _gimp_drawable_thumbnail:
* @drawable: The drawable.
@@ -2116,50 +1222,3 @@ gimp_drawable_foreground_extract (GimpDrawable *drawable,
return success;
}
-
-/**
- * _gimp_drawable_foreground_extract: (skip)
- * @drawable_ID: The drawable.
- * @mode: The algorithm to use.
- * @mask_ID: Tri-Map.
- *
- * Extract the foreground of a drawable using a given trimap.
- *
- * Image Segmentation by Uniform Color Clustering, see
- * https://www.inf.fu-berlin.de/inst/pubs/tr-b-05-07.pdf
- *
- * Returns: TRUE on success.
- *
- * Since: 2.4
- **/
-gboolean
-_gimp_drawable_foreground_extract (gint32 drawable_ID,
- GimpForegroundExtractMode mode,
- gint32 mask_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- GIMP_TYPE_FOREGROUND_EXTRACT_MODE, mode,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (mask_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-foreground-extract",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-foreground-extract",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
diff --git a/libgimp/gimpdrawable_pdb.h b/libgimp/gimpdrawable_pdb.h
index b46f0d7783..f472f2b5b5 100644
--- a/libgimp/gimpdrawable_pdb.h
+++ b/libgimp/gimpdrawable_pdb.h
@@ -32,10 +32,6 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
G_GNUC_INTERNAL gchar* _gimp_drawable_get_format (GimpDrawable *drawable);
G_GNUC_INTERNAL gchar* _gimp_drawable_get_thumbnail_format (GimpDrawable *drawable);
GimpImageType gimp_drawable_type (GimpDrawable *drawable);
@@ -108,86 +104,6 @@ gboolean gimp_drawable_foreground_extract (GimpDrawable
GimpForegroundExtractMode mode,
GimpDrawable *mask);
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_drawable_type _gimp_drawable_type
-#define gimp_drawable_type_with_alpha _gimp_drawable_type_with_alpha
-#define gimp_drawable_has_alpha _gimp_drawable_has_alpha
-#define gimp_drawable_is_rgb _gimp_drawable_is_rgb
-#define gimp_drawable_is_gray _gimp_drawable_is_gray
-#define gimp_drawable_is_indexed _gimp_drawable_is_indexed
-#define gimp_drawable_bpp _gimp_drawable_bpp
-#define gimp_drawable_width _gimp_drawable_width
-#define gimp_drawable_height _gimp_drawable_height
-#define gimp_drawable_offsets _gimp_drawable_offsets
-#define gimp_drawable_mask_bounds _gimp_drawable_mask_bounds
-#define gimp_drawable_mask_intersect _gimp_drawable_mask_intersect
-#define gimp_drawable_merge_shadow _gimp_drawable_merge_shadow
-#define gimp_drawable_free_shadow _gimp_drawable_free_shadow
-#define gimp_drawable_update _gimp_drawable_update
-#define gimp_drawable_get_pixel _gimp_drawable_get_pixel
-#define gimp_drawable_set_pixel _gimp_drawable_set_pixel
-#define gimp_drawable_fill _gimp_drawable_fill
-#define gimp_drawable_offset _gimp_drawable_offset
-#define gimp_drawable_foreground_extract _gimp_drawable_foreground_extract
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-GimpImageType _gimp_drawable_type (gint32 drawable_ID);
-GimpImageType _gimp_drawable_type_with_alpha (gint32 drawable_ID);
-gboolean _gimp_drawable_has_alpha (gint32 drawable_ID);
-gboolean _gimp_drawable_is_rgb (gint32 drawable_ID);
-gboolean _gimp_drawable_is_gray (gint32 drawable_ID);
-gboolean _gimp_drawable_is_indexed (gint32 drawable_ID);
-gint _gimp_drawable_bpp (gint32 drawable_ID);
-gint _gimp_drawable_width (gint32 drawable_ID);
-gint _gimp_drawable_height (gint32 drawable_ID);
-gboolean _gimp_drawable_offsets (gint32 drawable_ID,
- gint *offset_x,
- gint *offset_y);
-gboolean _gimp_drawable_mask_bounds (gint32 drawable_ID,
- gint *x1,
- gint *y1,
- gint *x2,
- gint *y2);
-gboolean _gimp_drawable_mask_intersect (gint32 drawable_ID,
- gint *x,
- gint *y,
- gint *width,
- gint *height);
-gboolean _gimp_drawable_merge_shadow (gint32 drawable_ID,
- gboolean undo);
-gboolean _gimp_drawable_free_shadow (gint32 drawable_ID);
-gboolean _gimp_drawable_update (gint32 drawable_ID,
- gint x,
- gint y,
- gint width,
- gint height);
-guint8* _gimp_drawable_get_pixel (gint32 drawable_ID,
- gint x_coord,
- gint y_coord,
- gint *num_channels);
-gboolean _gimp_drawable_set_pixel (gint32 drawable_ID,
- gint x_coord,
- gint y_coord,
- gint num_channels,
- const guint8 *pixel);
-gboolean _gimp_drawable_fill (gint32 drawable_ID,
- GimpFillType fill_type);
-gboolean _gimp_drawable_offset (gint32 drawable_ID,
- gboolean wrap_around,
- GimpOffsetType fill_type,
- gint offset_x,
- gint offset_y);
-gboolean _gimp_drawable_foreground_extract (gint32 drawable_ID,
- GimpForegroundExtractMode mode,
- gint32 mask_ID);
-
G_END_DECLS
diff --git a/libgimp/gimpdrawablecolor_pdb.c b/libgimp/gimpdrawablecolor_pdb.c
index d12f43423f..21c681d4da 100644
--- a/libgimp/gimpdrawablecolor_pdb.c
+++ b/libgimp/gimpdrawablecolor_pdb.c
@@ -83,54 +83,6 @@ gimp_drawable_brightness_contrast (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_drawable_brightness_contrast: (skip)
- * @drawable_ID: The drawable.
- * @brightness: Brightness adjustment.
- * @contrast: Contrast adjustment.
- *
- * Modify brightness/contrast in the specified drawable.
- *
- * This procedures allows the brightness and contrast of the specified
- * drawable to be modified. Both 'brightness' and 'contrast' parameters
- * are defined between -0.5 and 0.5.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-_gimp_drawable_brightness_contrast (gint32 drawable_ID,
- gdouble brightness,
- gdouble contrast)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_DOUBLE, brightness,
- G_TYPE_DOUBLE, contrast,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-brightness-contrast",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-brightness-contrast",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_drawable_color_balance:
* @drawable: The drawable.
@@ -193,68 +145,6 @@ gimp_drawable_color_balance (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_drawable_color_balance: (skip)
- * @drawable_ID: The drawable.
- * @transfer_mode: Transfer mode.
- * @preserve_lum: Preserve luminosity values at each pixel.
- * @cyan_red: Cyan-Red color balance.
- * @magenta_green: Magenta-Green color balance.
- * @yellow_blue: Yellow-Blue color balance.
- *
- * Modify the color balance of the specified drawable.
- *
- * Modify the color balance of the specified drawable. There are three
- * axis which can be modified: cyan-red, magenta-green, and
- * yellow-blue. Negative values increase the amount of the former,
- * positive values increase the amount of the latter. Color balance can
- * be controlled with the 'transfer_mode' setting, which allows
- * shadows, mid-tones, and highlights in an image to be affected
- * differently. The 'preserve-lum' parameter, if TRUE, ensures that the
- * luminosity of each pixel remains fixed.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-_gimp_drawable_color_balance (gint32 drawable_ID,
- GimpTransferMode transfer_mode,
- gboolean preserve_lum,
- gdouble cyan_red,
- gdouble magenta_green,
- gdouble yellow_blue)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- GIMP_TYPE_TRANSFER_MODE, transfer_mode,
- G_TYPE_BOOLEAN, preserve_lum,
- G_TYPE_DOUBLE, cyan_red,
- G_TYPE_DOUBLE, magenta_green,
- G_TYPE_DOUBLE, yellow_blue,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-color-balance",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-color-balance",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_drawable_colorize_hsl:
* @drawable: The drawable.
@@ -307,58 +197,6 @@ gimp_drawable_colorize_hsl (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_drawable_colorize_hsl: (skip)
- * @drawable_ID: The drawable.
- * @hue: Hue in degrees.
- * @saturation: Saturation in percent.
- * @lightness: Lightness in percent.
- *
- * Render the drawable as a grayscale image seen through a colored
- * glass.
- *
- * Desaturates the drawable, then tints it with the specified color.
- * This tool is only valid on RGB color images. It will not operate on
- * grayscale drawables.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-_gimp_drawable_colorize_hsl (gint32 drawable_ID,
- gdouble hue,
- gdouble saturation,
- gdouble lightness)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_DOUBLE, hue,
- G_TYPE_DOUBLE, saturation,
- G_TYPE_DOUBLE, lightness,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-colorize-hsl",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-colorize-hsl",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_drawable_curves_explicit:
* @drawable: The drawable.
@@ -414,61 +252,6 @@ gimp_drawable_curves_explicit (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_drawable_curves_explicit: (skip)
- * @drawable_ID: The drawable.
- * @channel: The channel to modify.
- * @num_values: The number of values in the new curve.
- * @values: (array length=num_values) (element-type gdouble): The explicit curve.
- *
- * Modifies the intensity curve(s) for specified drawable.
- *
- * Modifies the intensity mapping for one channel in the specified
- * drawable. The channel can be either an intensity component, or the
- * value. The 'values' parameter is an array of doubles which
- * explicitly defines how each pixel value in the drawable will be
- * modified. Use the gimp_curves_spline() function to modify intensity
- * levels with Catmull Rom splines.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-_gimp_drawable_curves_explicit (gint32 drawable_ID,
- GimpHistogramChannel channel,
- gint num_values,
- const gdouble *values)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- GIMP_TYPE_HISTOGRAM_CHANNEL, channel,
- G_TYPE_INT, num_values,
- GIMP_TYPE_FLOAT_ARRAY, NULL,
- G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 3), values, num_values);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-curves-explicit",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-curves-explicit",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_drawable_curves_spline:
* @drawable: The drawable.
@@ -524,61 +307,6 @@ gimp_drawable_curves_spline (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_drawable_curves_spline: (skip)
- * @drawable_ID: The drawable.
- * @channel: The channel to modify.
- * @num_points: The number of values in the control point array.
- * @points: (array length=num_points) (element-type gdouble): The spline control points: { cp1.x, cp1.y,
cp2.x, cp2.y, ... }.
- *
- * Modifies the intensity curve(s) for specified drawable.
- *
- * Modifies the intensity mapping for one channel in the specified
- * drawable. The channel can be either an intensity component, or the
- * value. The 'points' parameter is an array of doubles which define a
- * set of control points which describe a Catmull Rom spline which
- * yields the final intensity curve. Use the gimp_curves_explicit()
- * function to explicitly modify intensity levels.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-_gimp_drawable_curves_spline (gint32 drawable_ID,
- GimpHistogramChannel channel,
- gint num_points,
- const gdouble *points)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- GIMP_TYPE_HISTOGRAM_CHANNEL, channel,
- G_TYPE_INT, num_points,
- GIMP_TYPE_FLOAT_ARRAY, NULL,
- G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 3), points, num_points);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-curves-spline",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-curves-spline",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_drawable_desaturate:
* @drawable: The drawable.
@@ -625,52 +353,6 @@ gimp_drawable_desaturate (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_drawable_desaturate: (skip)
- * @drawable_ID: The drawable.
- * @desaturate_mode: The formula to use to desaturate.
- *
- * Desaturate the contents of the specified drawable, with the
- * specified formula.
- *
- * This procedure desaturates the contents of the specified drawable,
- * with the specified formula. This procedure only works on drawables
- * of type RGB color.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-_gimp_drawable_desaturate (gint32 drawable_ID,
- GimpDesaturateMode desaturate_mode)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- GIMP_TYPE_DESATURATE_MODE, desaturate_mode,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-desaturate",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-desaturate",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_drawable_equalize:
* @drawable: The drawable.
@@ -720,55 +402,6 @@ gimp_drawable_equalize (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_drawable_equalize: (skip)
- * @drawable_ID: The drawable.
- * @mask_only: Equalization option.
- *
- * Equalize the contents of the specified drawable.
- *
- * This procedure equalizes the contents of the specified drawable.
- * Each intensity channel is equalized independently. The equalized
- * intensity is given as inten' = (255 - inten). The 'mask_only' option
- * specifies whether to adjust only the area of the image within the
- * selection bounds, or the entire image based on the histogram of the
- * selected area. If there is no selection, the entire image is
- * adjusted based on the histogram for the entire image.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-_gimp_drawable_equalize (gint32 drawable_ID,
- gboolean mask_only)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_BOOLEAN, mask_only,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-equalize",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-equalize",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_drawable_histogram:
* @drawable: The drawable.
@@ -831,192 +464,40 @@ gimp_drawable_histogram (GimpDrawable *drawable,
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-histogram",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-histogram",
- args);
- gimp_value_array_unref (args);
-
- *mean = 0.0;
- *std_dev = 0.0;
- *median = 0.0;
- *pixels = 0.0;
- *count = 0.0;
- *percentile = 0.0;
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- if (success)
- {
- *mean = g_value_get_double (gimp_value_array_index (return_vals, 1));
- *std_dev = g_value_get_double (gimp_value_array_index (return_vals, 2));
- *median = g_value_get_double (gimp_value_array_index (return_vals, 3));
- *pixels = g_value_get_double (gimp_value_array_index (return_vals, 4));
- *count = g_value_get_double (gimp_value_array_index (return_vals, 5));
- *percentile = g_value_get_double (gimp_value_array_index (return_vals, 6));
- }
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_drawable_histogram: (skip)
- * @drawable_ID: The drawable.
- * @channel: The channel to query.
- * @start_range: Start of the intensity measurement range.
- * @end_range: End of the intensity measurement range.
- * @mean: (out): Mean intensity value.
- * @std_dev: (out): Standard deviation of intensity values.
- * @median: (out): Median intensity value.
- * @pixels: (out): Alpha-weighted pixel count for entire image.
- * @count: (out): Alpha-weighted pixel count for range.
- * @percentile: (out): Percentile that range falls under.
- *
- * Returns information on the intensity histogram for the specified
- * drawable.
- *
- * This tool makes it possible to gather information about the
- * intensity histogram of a drawable. A channel to examine is first
- * specified. This can be either value, red, green, or blue, depending
- * on whether the drawable is of type color or grayscale. Second, a
- * range of intensities are specified. The gimp_drawable_histogram()
- * function returns statistics based on the pixels in the drawable that
- * fall under this range of values. Mean, standard deviation, median,
- * number of pixels, and percentile are all returned. Additionally, the
- * total count of pixels in the image is returned. Counts of pixels are
- * weighted by any associated alpha values and by the current selection
- * mask. That is, pixels that lie outside an active selection mask will
- * not be counted. Similarly, pixels with transparent alpha values will
- * not be counted. The returned mean, std_dev and median are in the
- * range (0..255) for 8-bit images or if the plug-in is not
- * precision-aware, and in the range (0.0..1.0) otherwise.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-_gimp_drawable_histogram (gint32 drawable_ID,
- GimpHistogramChannel channel,
- gdouble start_range,
- gdouble end_range,
- gdouble *mean,
- gdouble *std_dev,
- gdouble *median,
- gdouble *pixels,
- gdouble *count,
- gdouble *percentile)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- GIMP_TYPE_HISTOGRAM_CHANNEL, channel,
- G_TYPE_DOUBLE, start_range,
- G_TYPE_DOUBLE, end_range,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-histogram",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-histogram",
- args);
- gimp_value_array_unref (args);
-
- *mean = 0.0;
- *std_dev = 0.0;
- *median = 0.0;
- *pixels = 0.0;
- *count = 0.0;
- *percentile = 0.0;
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- if (success)
- {
- *mean = g_value_get_double (gimp_value_array_index (return_vals, 1));
- *std_dev = g_value_get_double (gimp_value_array_index (return_vals, 2));
- *median = g_value_get_double (gimp_value_array_index (return_vals, 3));
- *pixels = g_value_get_double (gimp_value_array_index (return_vals, 4));
- *count = g_value_get_double (gimp_value_array_index (return_vals, 5));
- *percentile = g_value_get_double (gimp_value_array_index (return_vals, 6));
- }
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_drawable_hue_saturation:
- * @drawable: The drawable.
- * @hue_range: Range of affected hues.
- * @hue_offset: Hue offset in degrees.
- * @lightness: Lightness modification.
- * @saturation: Saturation modification.
- * @overlap: Overlap other hue channels.
- *
- * Modify hue, lightness, and saturation in the specified drawable.
- *
- * This procedure allows the hue, lightness, and saturation in the
- * specified drawable to be modified. The 'hue-range' parameter
- * provides the capability to limit range of affected hues. The
- * 'overlap' parameter provides blending into neighboring hue channels
- * when rendering.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-gimp_drawable_hue_saturation (GimpDrawable *drawable,
- GimpHueRange hue_range,
- gdouble hue_offset,
- gdouble lightness,
- gdouble saturation,
- gdouble overlap)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, drawable,
- GIMP_TYPE_HUE_RANGE, hue_range,
- G_TYPE_DOUBLE, hue_offset,
- G_TYPE_DOUBLE, lightness,
- G_TYPE_DOUBLE, saturation,
- G_TYPE_DOUBLE, overlap,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-hue-saturation",
+ "gimp-drawable-histogram",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-drawable-hue-saturation",
+ return_vals = gimp_run_procedure_array ("gimp-drawable-histogram",
args);
gimp_value_array_unref (args);
+ *mean = 0.0;
+ *std_dev = 0.0;
+ *median = 0.0;
+ *pixels = 0.0;
+ *count = 0.0;
+ *percentile = 0.0;
+
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (success)
+ {
+ *mean = g_value_get_double (gimp_value_array_index (return_vals, 1));
+ *std_dev = g_value_get_double (gimp_value_array_index (return_vals, 2));
+ *median = g_value_get_double (gimp_value_array_index (return_vals, 3));
+ *pixels = g_value_get_double (gimp_value_array_index (return_vals, 4));
+ *count = g_value_get_double (gimp_value_array_index (return_vals, 5));
+ *percentile = g_value_get_double (gimp_value_array_index (return_vals, 6));
+ }
+
gimp_value_array_unref (return_vals);
return success;
}
/**
- * _gimp_drawable_hue_saturation: (skip)
- * @drawable_ID: The drawable.
+ * gimp_drawable_hue_saturation:
+ * @drawable: The drawable.
* @hue_range: Range of affected hues.
* @hue_offset: Hue offset in degrees.
* @lightness: Lightness modification.
@@ -1036,12 +517,12 @@ gimp_drawable_hue_saturation (GimpDrawable *drawable,
* Since: 2.10
**/
gboolean
-_gimp_drawable_hue_saturation (gint32 drawable_ID,
- GimpHueRange hue_range,
- gdouble hue_offset,
- gdouble lightness,
- gdouble saturation,
- gdouble overlap)
+gimp_drawable_hue_saturation (GimpDrawable *drawable,
+ GimpHueRange hue_range,
+ gdouble hue_offset,
+ gdouble lightness,
+ gdouble saturation,
+ gdouble overlap)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -1049,7 +530,7 @@ _gimp_drawable_hue_saturation (gint32 drawable_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
+ GIMP_TYPE_DRAWABLE, drawable,
GIMP_TYPE_HUE_RANGE, hue_range,
G_TYPE_DOUBLE, hue_offset,
G_TYPE_DOUBLE, lightness,
@@ -1119,52 +600,6 @@ gimp_drawable_invert (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_drawable_invert: (skip)
- * @drawable_ID: The drawable.
- * @linear: Whether to invert in linear space.
- *
- * Invert the contents of the specified drawable.
- *
- * This procedure inverts the contents of the specified drawable. Each
- * intensity channel is inverted independently. The inverted intensity
- * is given as inten' = (255 - inten). If 'linear' is TRUE, the
- * drawable is inverted in linear space.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-_gimp_drawable_invert (gint32 drawable_ID,
- gboolean linear)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_BOOLEAN, linear,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-invert",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-invert",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_drawable_levels:
* @drawable: The drawable.
@@ -1240,81 +675,6 @@ gimp_drawable_levels (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_drawable_levels: (skip)
- * @drawable_ID: The drawable.
- * @channel: The channel to modify.
- * @low_input: Intensity of lowest input.
- * @high_input: Intensity of highest input.
- * @clamp_input: Clamp input values before applying output levels.
- * @gamma: Gamma adjustment factor.
- * @low_output: Intensity of lowest output.
- * @high_output: Intensity of highest output.
- * @clamp_output: Clamp final output values.
- *
- * Modifies intensity levels in the specified drawable.
- *
- * This tool allows intensity levels in the specified drawable to be
- * remapped according to a set of parameters. The low/high input levels
- * specify an initial mapping from the source intensities. The gamma
- * value determines how intensities between the low and high input
- * intensities are interpolated. A gamma value of 1.0 results in a
- * linear interpolation. Higher gamma values result in more high-level
- * intensities. Lower gamma values result in more low-level
- * intensities. The low/high output levels constrain the final
- * intensity mapping--that is, no final intensity will be lower than
- * the low output level and no final intensity will be higher than the
- * high output level. This tool is only valid on RGB color and
- * grayscale images.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-_gimp_drawable_levels (gint32 drawable_ID,
- GimpHistogramChannel channel,
- gdouble low_input,
- gdouble high_input,
- gboolean clamp_input,
- gdouble gamma,
- gdouble low_output,
- gdouble high_output,
- gboolean clamp_output)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- GIMP_TYPE_HISTOGRAM_CHANNEL, channel,
- G_TYPE_DOUBLE, low_input,
- G_TYPE_DOUBLE, high_input,
- G_TYPE_BOOLEAN, clamp_input,
- G_TYPE_DOUBLE, gamma,
- G_TYPE_DOUBLE, low_output,
- G_TYPE_DOUBLE, high_output,
- G_TYPE_BOOLEAN, clamp_output,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-levels",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-levels",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_drawable_levels_stretch:
* @drawable: The drawable.
@@ -1357,48 +717,6 @@ gimp_drawable_levels_stretch (GimpDrawable *drawable)
return success;
}
-/**
- * _gimp_drawable_levels_stretch: (skip)
- * @drawable_ID: The drawable.
- *
- * Automatically modifies intensity levels in the specified drawable.
- *
- * This procedure allows intensity levels in the specified drawable to
- * be remapped according to a set of guessed parameters. It is
- * equivalent to clicking the \"Auto\" button in the Levels tool.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-_gimp_drawable_levels_stretch (gint32 drawable_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-levels-stretch",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-levels-stretch",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_drawable_posterize:
* @drawable: The drawable.
@@ -1443,50 +761,6 @@ gimp_drawable_posterize (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_drawable_posterize: (skip)
- * @drawable_ID: The drawable.
- * @levels: Levels of posterization.
- *
- * Posterize the specified drawable.
- *
- * This procedures reduces the number of shades allows in each
- * intensity channel to the specified 'levels' parameter.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-_gimp_drawable_posterize (gint32 drawable_ID,
- gint levels)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_INT, levels,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-posterize",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-posterize",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_drawable_threshold:
* @drawable: The drawable.
@@ -1538,55 +812,3 @@ gimp_drawable_threshold (GimpDrawable *drawable,
return success;
}
-
-/**
- * _gimp_drawable_threshold: (skip)
- * @drawable_ID: The drawable.
- * @channel: The channel to base the threshold on.
- * @low_threshold: The low threshold value.
- * @high_threshold: The high threshold value.
- *
- * Threshold the specified drawable.
- *
- * This procedures generates a threshold map of the specified drawable.
- * All pixels between the values of 'low_threshold' and
- * 'high_threshold', on the scale of 'channel' are replaced with white,
- * and all other pixels with black.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-_gimp_drawable_threshold (gint32 drawable_ID,
- GimpHistogramChannel channel,
- gdouble low_threshold,
- gdouble high_threshold)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- GIMP_TYPE_HISTOGRAM_CHANNEL, channel,
- G_TYPE_DOUBLE, low_threshold,
- G_TYPE_DOUBLE, high_threshold,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-threshold",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-threshold",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
diff --git a/libgimp/gimpdrawablecolor_pdb.h b/libgimp/gimpdrawablecolor_pdb.h
index c5fdacc834..0d1ebf3b69 100644
--- a/libgimp/gimpdrawablecolor_pdb.h
+++ b/libgimp/gimpdrawablecolor_pdb.h
@@ -32,10 +32,6 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
gboolean gimp_drawable_brightness_contrast (GimpDrawable *drawable,
gdouble brightness,
gdouble contrast);
@@ -96,90 +92,6 @@ gboolean gimp_drawable_threshold (GimpDrawable *drawable,
gdouble low_threshold,
gdouble high_threshold);
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_drawable_brightness_contrast _gimp_drawable_brightness_contrast
-#define gimp_drawable_color_balance _gimp_drawable_color_balance
-#define gimp_drawable_colorize_hsl _gimp_drawable_colorize_hsl
-#define gimp_drawable_curves_explicit _gimp_drawable_curves_explicit
-#define gimp_drawable_curves_spline _gimp_drawable_curves_spline
-#define gimp_drawable_desaturate _gimp_drawable_desaturate
-#define gimp_drawable_equalize _gimp_drawable_equalize
-#define gimp_drawable_histogram _gimp_drawable_histogram
-#define gimp_drawable_hue_saturation _gimp_drawable_hue_saturation
-#define gimp_drawable_invert _gimp_drawable_invert
-#define gimp_drawable_levels _gimp_drawable_levels
-#define gimp_drawable_levels_stretch _gimp_drawable_levels_stretch
-#define gimp_drawable_posterize _gimp_drawable_posterize
-#define gimp_drawable_threshold _gimp_drawable_threshold
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-gboolean _gimp_drawable_brightness_contrast (gint32 drawable_ID,
- gdouble brightness,
- gdouble contrast);
-gboolean _gimp_drawable_color_balance (gint32 drawable_ID,
- GimpTransferMode transfer_mode,
- gboolean preserve_lum,
- gdouble cyan_red,
- gdouble magenta_green,
- gdouble yellow_blue);
-gboolean _gimp_drawable_colorize_hsl (gint32 drawable_ID,
- gdouble hue,
- gdouble saturation,
- gdouble lightness);
-gboolean _gimp_drawable_curves_explicit (gint32 drawable_ID,
- GimpHistogramChannel channel,
- gint num_values,
- const gdouble *values);
-gboolean _gimp_drawable_curves_spline (gint32 drawable_ID,
- GimpHistogramChannel channel,
- gint num_points,
- const gdouble *points);
-gboolean _gimp_drawable_desaturate (gint32 drawable_ID,
- GimpDesaturateMode desaturate_mode);
-gboolean _gimp_drawable_equalize (gint32 drawable_ID,
- gboolean mask_only);
-gboolean _gimp_drawable_histogram (gint32 drawable_ID,
- GimpHistogramChannel channel,
- gdouble start_range,
- gdouble end_range,
- gdouble *mean,
- gdouble *std_dev,
- gdouble *median,
- gdouble *pixels,
- gdouble *count,
- gdouble *percentile);
-gboolean _gimp_drawable_hue_saturation (gint32 drawable_ID,
- GimpHueRange hue_range,
- gdouble hue_offset,
- gdouble lightness,
- gdouble saturation,
- gdouble overlap);
-gboolean _gimp_drawable_invert (gint32 drawable_ID,
- gboolean linear);
-gboolean _gimp_drawable_levels (gint32 drawable_ID,
- GimpHistogramChannel channel,
- gdouble low_input,
- gdouble high_input,
- gboolean clamp_input,
- gdouble gamma,
- gdouble low_output,
- gdouble high_output,
- gboolean clamp_output);
-gboolean _gimp_drawable_levels_stretch (gint32 drawable_ID);
-gboolean _gimp_drawable_posterize (gint32 drawable_ID,
- gint levels);
-gboolean _gimp_drawable_threshold (gint32 drawable_ID,
- GimpHistogramChannel channel,
- gdouble low_threshold,
- gdouble high_threshold);
-
G_END_DECLS
diff --git a/libgimp/gimpdrawableedit_pdb.c b/libgimp/gimpdrawableedit_pdb.c
index 650fc99cb2..c28934284c 100644
--- a/libgimp/gimpdrawableedit_pdb.c
+++ b/libgimp/gimpdrawableedit_pdb.c
@@ -79,51 +79,6 @@ gimp_drawable_edit_clear (GimpDrawable *drawable)
return success;
}
-/**
- * _gimp_drawable_edit_clear: (skip)
- * @drawable_ID: The drawable to clear from.
- *
- * Clear selected area of drawable.
- *
- * This procedure clears the specified drawable. If the drawable has an
- * alpha channel, the cleared pixels will become transparent. If the
- * drawable does not have an alpha channel, cleared pixels will be set
- * to the background color. This procedure only affects regions within
- * a selection if there is a selection active.
- *
- * This procedure is affected by the following context setters:
- * gimp_context_set_background().
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_drawable_edit_clear (gint32 drawable_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-edit-clear",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-edit-clear",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_drawable_edit_fill:
* @drawable: The drawable to fill to.
@@ -173,55 +128,6 @@ gimp_drawable_edit_fill (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_drawable_edit_fill: (skip)
- * @drawable_ID: The drawable to fill to.
- * @fill_type: The type of fill.
- *
- * Fill selected area of drawable.
- *
- * This procedure fills the specified drawable according to fill mode.
- * This procedure only affects regions within a selection if there is a
- * selection active. If you want to fill the whole drawable, regardless
- * of the selection, use gimp_drawable_fill().
- *
- * This procedure is affected by the following context setters:
- * gimp_context_set_opacity(), gimp_context_set_paint_mode(),
- * gimp_context_set_foreground(), gimp_context_set_background(),
- * gimp_context_set_pattern().
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_drawable_edit_fill (gint32 drawable_ID,
- GimpFillType fill_type)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- GIMP_TYPE_FILL_TYPE, fill_type,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-edit-fill",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-edit-fill",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_drawable_edit_bucket_fill:
* @drawable: The affected drawable.
@@ -283,67 +189,6 @@ gimp_drawable_edit_bucket_fill (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_drawable_edit_bucket_fill: (skip)
- * @drawable_ID: The affected drawable.
- * @fill_type: The type of fill.
- * @x: The x coordinate of this bucket fill's application.
- * @y: The y coordinate of this bucket fill's application.
- *
- * Fill the area by a seed fill starting at the specified coordinates.
- *
- * This procedure does a seed fill at the specified coordinates, using
- * various parameters from the current context.
- * In the case of merged sampling, the x and y coordinates are relative
- * to the image's origin; otherwise, they are relative to the
- * drawable's origin.
- *
- * This procedure is affected by the following context setters:
- * gimp_context_set_opacity(), gimp_context_set_paint_mode(),
- * gimp_context_set_foreground(), gimp_context_set_background(),
- * gimp_context_set_pattern(), gimp_context_set_sample_threshold(),
- * gimp_context_set_sample_merged(),
- * gimp_context_set_sample_criterion(),
- * gimp_context_set_diagonal_neighbors(), gimp_context_set_antialias().
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-_gimp_drawable_edit_bucket_fill (gint32 drawable_ID,
- GimpFillType fill_type,
- gdouble x,
- gdouble y)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- GIMP_TYPE_FILL_TYPE, fill_type,
- G_TYPE_DOUBLE, x,
- G_TYPE_DOUBLE, y,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-edit-bucket-fill",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-edit-bucket-fill",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_drawable_edit_gradient_fill:
* @drawable: The affected drawable.
@@ -425,87 +270,6 @@ gimp_drawable_edit_gradient_fill (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_drawable_edit_gradient_fill: (skip)
- * @drawable_ID: The affected drawable.
- * @gradient_type: The type of gradient.
- * @offset: Offset relates to the starting and ending coordinates specified for the blend. This parameter is
mode dependent.
- * @supersample: Do adaptive supersampling.
- * @supersample_max_depth: Maximum recursion levels for supersampling.
- * @supersample_threshold: Supersampling threshold.
- * @dither: Use dithering to reduce banding.
- * @x1: The x coordinate of this gradient's starting point.
- * @y1: The y coordinate of this gradient's starting point.
- * @x2: The x coordinate of this gradient's ending point.
- * @y2: The y coordinate of this gradient's ending point.
- *
- * Draw a gradient between the starting and ending coordinates with the
- * specified gradient type.
- *
- * This tool requires information on the gradient type. It creates the
- * specified variety of gradient using the starting and ending
- * coordinates as defined for each gradient type. For shapeburst
- * gradient types, the context's distance metric is also relevant and
- * can be updated with gimp_context_set_distance_metric().
- *
- * This procedure is affected by the following context setters:
- * gimp_context_set_opacity(), gimp_context_set_paint_mode(),
- * gimp_context_set_foreground(), gimp_context_set_background(),
- * gimp_context_set_gradient() and all gradient property settings,
- * gimp_context_set_distance_metric().
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-_gimp_drawable_edit_gradient_fill (gint32 drawable_ID,
- GimpGradientType gradient_type,
- gdouble offset,
- gboolean supersample,
- gint supersample_max_depth,
- gdouble supersample_threshold,
- gboolean dither,
- gdouble x1,
- gdouble y1,
- gdouble x2,
- gdouble y2)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- GIMP_TYPE_GRADIENT_TYPE, gradient_type,
- G_TYPE_DOUBLE, offset,
- G_TYPE_BOOLEAN, supersample,
- G_TYPE_INT, supersample_max_depth,
- G_TYPE_DOUBLE, supersample_threshold,
- G_TYPE_BOOLEAN, dither,
- G_TYPE_DOUBLE, x1,
- G_TYPE_DOUBLE, y1,
- G_TYPE_DOUBLE, x2,
- G_TYPE_DOUBLE, y2,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-edit-gradient-fill",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-edit-gradient-fill",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_drawable_edit_stroke_selection:
* @drawable: The drawable to stroke to.
@@ -555,55 +319,6 @@ gimp_drawable_edit_stroke_selection (GimpDrawable *drawable)
return success;
}
-/**
- * _gimp_drawable_edit_stroke_selection: (skip)
- * @drawable_ID: The drawable to stroke to.
- *
- * Stroke the current selection
- *
- * This procedure strokes the current selection, painting along the
- * selection boundary with the active paint method and brush, or using
- * a plain line with configurable properties. The paint is applied to
- * the specified drawable regardless of the active selection.
- *
- * This procedure is affected by the following context setters:
- * gimp_context_set_opacity(), gimp_context_set_paint_mode(),
- * gimp_context_set_paint_method(), gimp_context_set_stroke_method(),
- * gimp_context_set_foreground(), gimp_context_set_brush() and all
- * brush property settings, gimp_context_set_gradient() and all
- * gradient property settings, gimp_context_set_line_width() and all
- * line property settings, gimp_context_set_antialias().
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_drawable_edit_stroke_selection (gint32 drawable_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-edit-stroke-selection",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-edit-stroke-selection",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_drawable_edit_stroke_item:
* @drawable: The drawable to stroke to.
@@ -657,57 +372,3 @@ gimp_drawable_edit_stroke_item (GimpDrawable *drawable,
return success;
}
-
-/**
- * _gimp_drawable_edit_stroke_item: (skip)
- * @drawable_ID: The drawable to stroke to.
- * @item_ID: The item to stroke.
- *
- * Stroke the specified item
- *
- * This procedure strokes the specified item, painting along its
- * outline (e.g. along a path, or along a channel's boundary), with the
- * active paint method and brush, or using a plain line with
- * configurable properties.
- *
- * This procedure is affected by the following context setters:
- * gimp_context_set_opacity(), gimp_context_set_paint_mode(),
- * gimp_context_set_paint_method(), gimp_context_set_stroke_method(),
- * gimp_context_set_foreground(), gimp_context_set_brush() and all
- * brush property settings, gimp_context_set_gradient() and all
- * gradient property settings, gimp_context_set_line_width() and all
- * line property settings, gimp_context_set_antialias().
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-_gimp_drawable_edit_stroke_item (gint32 drawable_ID,
- gint32 item_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-drawable-edit-stroke-item",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-drawable-edit-stroke-item",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
diff --git a/libgimp/gimpdrawableedit_pdb.h b/libgimp/gimpdrawableedit_pdb.h
index 8eec9ef43d..4ee15bb99a 100644
--- a/libgimp/gimpdrawableedit_pdb.h
+++ b/libgimp/gimpdrawableedit_pdb.h
@@ -32,10 +32,6 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
gboolean gimp_drawable_edit_clear (GimpDrawable *drawable);
gboolean gimp_drawable_edit_fill (GimpDrawable *drawable,
GimpFillType fill_type);
@@ -58,44 +54,6 @@ gboolean gimp_drawable_edit_stroke_selection (GimpDrawable *drawable);
gboolean gimp_drawable_edit_stroke_item (GimpDrawable *drawable,
GimpItem *item);
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_drawable_edit_clear _gimp_drawable_edit_clear
-#define gimp_drawable_edit_fill _gimp_drawable_edit_fill
-#define gimp_drawable_edit_bucket_fill _gimp_drawable_edit_bucket_fill
-#define gimp_drawable_edit_gradient_fill _gimp_drawable_edit_gradient_fill
-#define gimp_drawable_edit_stroke_selection _gimp_drawable_edit_stroke_selection
-#define gimp_drawable_edit_stroke_item _gimp_drawable_edit_stroke_item
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-gboolean _gimp_drawable_edit_clear (gint32 drawable_ID);
-gboolean _gimp_drawable_edit_fill (gint32 drawable_ID,
- GimpFillType fill_type);
-gboolean _gimp_drawable_edit_bucket_fill (gint32 drawable_ID,
- GimpFillType fill_type,
- gdouble x,
- gdouble y);
-gboolean _gimp_drawable_edit_gradient_fill (gint32 drawable_ID,
- GimpGradientType gradient_type,
- gdouble offset,
- gboolean supersample,
- gint supersample_max_depth,
- gdouble supersample_threshold,
- gboolean dither,
- gdouble x1,
- gdouble y1,
- gdouble x2,
- gdouble y2);
-gboolean _gimp_drawable_edit_stroke_selection (gint32 drawable_ID);
-gboolean _gimp_drawable_edit_stroke_item (gint32 drawable_ID,
- gint32 item_ID);
-
G_END_DECLS
diff --git a/libgimp/gimpdynamics_pdb.h b/libgimp/gimpdynamics_pdb.h
index 7983ccbcfa..6623ffc01d 100644
--- a/libgimp/gimpdynamics_pdb.h
+++ b/libgimp/gimpdynamics_pdb.h
@@ -36,22 +36,6 @@ gboolean gimp_dynamics_refresh (void);
gchar** gimp_dynamics_get_list (const gchar *filter,
gint *num_dynamics);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimpedit_pdb.c b/libgimp/gimpedit_pdb.c
index 5521eb493e..53c6535e36 100644
--- a/libgimp/gimpedit_pdb.c
+++ b/libgimp/gimpedit_pdb.c
@@ -80,52 +80,6 @@ gimp_edit_cut (GimpDrawable *drawable)
return non_empty;
}
-/**
- * _gimp_edit_cut: (skip)
- * @drawable_ID: The drawable to cut from.
- *
- * Cut from the specified drawable.
- *
- * If there is a selection in the image, then the area specified by the
- * selection is cut from the specified drawable and placed in an
- * internal GIMP edit buffer. It can subsequently be retrieved using
- * the gimp_edit_paste() command. If there is no selection, then the
- * specified drawable will be removed and its contents stored in the
- * internal GIMP edit buffer. This procedure will fail if the selected
- * area lies completely outside the bounds of the current drawable and
- * there is nothing to copy from.
- *
- * Returns: TRUE if the cut was successful, FALSE if there was nothing to copy from.
- **/
-gboolean
-_gimp_edit_cut (gint32 drawable_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean non_empty = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-edit-cut",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-edit-cut",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- non_empty = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return non_empty;
-}
-
/**
* gimp_edit_copy:
* @drawable: The drawable to copy from.
@@ -172,52 +126,6 @@ gimp_edit_copy (GimpDrawable *drawable)
return non_empty;
}
-/**
- * _gimp_edit_copy: (skip)
- * @drawable_ID: The drawable to copy from.
- *
- * Copy from the specified drawable.
- *
- * If there is a selection in the image, then the area specified by the
- * selection is copied from the specified drawable and placed in an
- * internal GIMP edit buffer. It can subsequently be retrieved using
- * the gimp_edit_paste() command. If there is no selection, then the
- * specified drawable's contents will be stored in the internal GIMP
- * edit buffer. This procedure will fail if the selected area lies
- * completely outside the bounds of the current drawable and there is
- * nothing to copy from.
- *
- * Returns: TRUE if the cut was successful, FALSE if there was nothing to copy from.
- **/
-gboolean
-_gimp_edit_copy (gint32 drawable_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean non_empty = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-edit-copy",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-edit-copy",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- non_empty = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return non_empty;
-}
-
/**
* gimp_edit_copy_visible:
* @image: The image to copy from.
@@ -264,52 +172,6 @@ gimp_edit_copy_visible (GimpImage *image)
return non_empty;
}
-/**
- * _gimp_edit_copy_visible: (skip)
- * @image_ID: The image to copy from.
- *
- * Copy from the projection.
- *
- * If there is a selection in the image, then the area specified by the
- * selection is copied from the projection and placed in an internal
- * GIMP edit buffer. It can subsequently be retrieved using the
- * gimp_edit_paste() command. If there is no selection, then the
- * projection's contents will be stored in the internal GIMP edit
- * buffer.
- *
- * Returns: TRUE if the copy was successful.
- *
- * Since: 2.2
- **/
-gboolean
-_gimp_edit_copy_visible (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean non_empty = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-edit-copy-visible",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-edit-copy-visible",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- non_empty = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return non_empty;
-}
-
/**
* gimp_edit_paste:
* @drawable: The drawable to paste to.
@@ -366,62 +228,6 @@ gimp_edit_paste (GimpDrawable *drawable,
return floating_sel;
}
-/**
- * _gimp_edit_paste: (skip)
- * @drawable_ID: The drawable to paste to.
- * @paste_into: Clear selection, or paste behind it?
- *
- * Paste buffer to the specified drawable.
- *
- * This procedure pastes a copy of the internal GIMP edit buffer to the
- * specified drawable. The GIMP edit buffer will be empty unless a call
- * was previously made to either gimp_edit_cut() or gimp_edit_copy().
- * The \"paste_into\" option specifies whether to clear the current
- * image selection, or to paste the buffer \"behind\" the selection.
- * This allows the selection to act as a mask for the pasted buffer.
- * Anywhere that the selection mask is non-zero, the pasted buffer will
- * show through. The pasted buffer will be a new layer in the image
- * which is designated as the image floating selection. If the image
- * has a floating selection at the time of pasting, the old floating
- * selection will be anchored to its drawable before the new floating
- * selection is added. This procedure returns the new floating layer.
- * The resulting floating selection will already be attached to the
- * specified drawable, and a subsequent call to floating_sel_attach is
- * not needed.
- *
- * Returns: The new floating selection.
- **/
-gint32
-_gimp_edit_paste (gint32 drawable_ID,
- gboolean paste_into)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 floating_sel_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_BOOLEAN, paste_into,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-edit-paste",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-edit-paste",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- floating_sel_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return floating_sel_ID;
-}
-
/**
* gimp_edit_paste_as_new_image:
*
@@ -464,48 +270,6 @@ gimp_edit_paste_as_new_image (void)
return image;
}
-/**
- * _gimp_edit_paste_as_new_image: (skip)
- *
- * Paste buffer to a new image.
- *
- * This procedure pastes a copy of the internal GIMP edit buffer to a
- * new image. The GIMP edit buffer will be empty unless a call was
- * previously made to either gimp_edit_cut() or gimp_edit_copy(). This
- * procedure returns the new image or -1 if the edit buffer was empty.
- *
- * Returns: The new image.
- *
- * Since: 2.10
- **/
-gint32
-_gimp_edit_paste_as_new_image (void)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 image_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-edit-paste-as-new-image",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-edit-paste-as-new-image",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- image_ID = gimp_image_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return image_ID;
-}
-
/**
* gimp_edit_named_cut:
* @drawable: The drawable to cut from.
@@ -555,54 +319,6 @@ gimp_edit_named_cut (GimpDrawable *drawable,
return real_name;
}
-/**
- * _gimp_edit_named_cut: (skip)
- * @drawable_ID: The drawable to cut from.
- * @buffer_name: The name of the buffer to create.
- *
- * Cut into a named buffer.
- *
- * This procedure works like gimp_edit_cut(), but additionally stores
- * the cut buffer into a named buffer that will stay available for
- * later pasting, regardless of any intermediate copy or cut
- * operations.
- *
- * Returns: The real name given to the buffer, or NULL if the cut failed.
- * The returned value must be freed with g_free().
- *
- * Since: 2.4
- **/
-gchar *
-_gimp_edit_named_cut (gint32 drawable_ID,
- const gchar *buffer_name)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gchar *real_name = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_STRING, buffer_name,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-edit-named-cut",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-edit-named-cut",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- real_name = g_value_dup_string (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return real_name;
-}
-
/**
* gimp_edit_named_copy:
* @drawable: The drawable to copy from.
@@ -652,54 +368,6 @@ gimp_edit_named_copy (GimpDrawable *drawable,
return real_name;
}
-/**
- * _gimp_edit_named_copy: (skip)
- * @drawable_ID: The drawable to copy from.
- * @buffer_name: The name of the buffer to create.
- *
- * Copy into a named buffer.
- *
- * This procedure works like gimp_edit_copy(), but additionally stores
- * the copied buffer into a named buffer that will stay available for
- * later pasting, regardless of any intermediate copy or cut
- * operations.
- *
- * Returns: The real name given to the buffer, or NULL if the copy failed.
- * The returned value must be freed with g_free().
- *
- * Since: 2.4
- **/
-gchar *
-_gimp_edit_named_copy (gint32 drawable_ID,
- const gchar *buffer_name)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gchar *real_name = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_STRING, buffer_name,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-edit-named-copy",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-edit-named-copy",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- real_name = g_value_dup_string (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return real_name;
-}
-
/**
* gimp_edit_named_copy_visible:
* @image: The image to copy from.
@@ -749,54 +417,6 @@ gimp_edit_named_copy_visible (GimpImage *image,
return real_name;
}
-/**
- * _gimp_edit_named_copy_visible: (skip)
- * @image_ID: The image to copy from.
- * @buffer_name: The name of the buffer to create.
- *
- * Copy from the projection into a named buffer.
- *
- * This procedure works like gimp_edit_copy_visible(), but additionally
- * stores the copied buffer into a named buffer that will stay
- * available for later pasting, regardless of any intermediate copy or
- * cut operations.
- *
- * Returns: The real name given to the buffer, or NULL if the copy failed.
- * The returned value must be freed with g_free().
- *
- * Since: 2.4
- **/
-gchar *
-_gimp_edit_named_copy_visible (gint32 image_ID,
- const gchar *buffer_name)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gchar *real_name = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_STRING, buffer_name,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-edit-named-copy-visible",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-edit-named-copy-visible",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- real_name = g_value_dup_string (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return real_name;
-}
-
/**
* gimp_edit_named_paste:
* @drawable: The drawable to paste to.
@@ -845,54 +465,6 @@ gimp_edit_named_paste (GimpDrawable *drawable,
return floating_sel;
}
-/**
- * _gimp_edit_named_paste: (skip)
- * @drawable_ID: The drawable to paste to.
- * @buffer_name: The name of the buffer to paste.
- * @paste_into: Clear selection, or paste behind it?
- *
- * Paste named buffer to the specified drawable.
- *
- * This procedure works like gimp_edit_paste() but pastes a named
- * buffer instead of the global buffer.
- *
- * Returns: The new floating selection.
- *
- * Since: 2.4
- **/
-gint32
-_gimp_edit_named_paste (gint32 drawable_ID,
- const gchar *buffer_name,
- gboolean paste_into)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 floating_sel_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_STRING, buffer_name,
- G_TYPE_BOOLEAN, paste_into,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-edit-named-paste",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-edit-named-paste",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- floating_sel_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return floating_sel_ID;
-}
-
/**
* gimp_edit_named_paste_as_new_image:
* @buffer_name: The name of the buffer to paste.
@@ -934,45 +506,3 @@ gimp_edit_named_paste_as_new_image (const gchar *buffer_name)
return image;
}
-
-/**
- * _gimp_edit_named_paste_as_new_image: (skip)
- * @buffer_name: The name of the buffer to paste.
- *
- * Paste named buffer to a new image.
- *
- * This procedure works like gimp_edit_paste_as_new_image() but pastes
- * a named buffer instead of the global buffer.
- *
- * Returns: The new image.
- *
- * Since: 2.10
- **/
-gint32
-_gimp_edit_named_paste_as_new_image (const gchar *buffer_name)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 image_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- G_TYPE_STRING, buffer_name,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-edit-named-paste-as-new-image",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-edit-named-paste-as-new-image",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- image_ID = gimp_image_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return image_ID;
-}
diff --git a/libgimp/gimpedit_pdb.h b/libgimp/gimpedit_pdb.h
index 2326b01136..32ee45fa6d 100644
--- a/libgimp/gimpedit_pdb.h
+++ b/libgimp/gimpedit_pdb.h
@@ -32,10 +32,6 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
gboolean gimp_edit_cut (GimpDrawable *drawable);
gboolean gimp_edit_copy (GimpDrawable *drawable);
gboolean gimp_edit_copy_visible (GimpImage *image);
@@ -53,43 +49,6 @@ GimpLayer* gimp_edit_named_paste (GimpDrawable *drawable,
gboolean paste_into);
GimpImage* gimp_edit_named_paste_as_new_image (const gchar *buffer_name);
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_edit_cut _gimp_edit_cut
-#define gimp_edit_copy _gimp_edit_copy
-#define gimp_edit_copy_visible _gimp_edit_copy_visible
-#define gimp_edit_paste _gimp_edit_paste
-#define gimp_edit_paste_as_new_image _gimp_edit_paste_as_new_image
-#define gimp_edit_named_cut _gimp_edit_named_cut
-#define gimp_edit_named_copy _gimp_edit_named_copy
-#define gimp_edit_named_copy_visible _gimp_edit_named_copy_visible
-#define gimp_edit_named_paste _gimp_edit_named_paste
-#define gimp_edit_named_paste_as_new_image _gimp_edit_named_paste_as_new_image
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-gboolean _gimp_edit_cut (gint32 drawable_ID);
-gboolean _gimp_edit_copy (gint32 drawable_ID);
-gboolean _gimp_edit_copy_visible (gint32 image_ID);
-gint32 _gimp_edit_paste (gint32 drawable_ID,
- gboolean paste_into);
-gint32 _gimp_edit_paste_as_new_image (void);
-gchar* _gimp_edit_named_cut (gint32 drawable_ID,
- const gchar *buffer_name);
-gchar* _gimp_edit_named_copy (gint32 drawable_ID,
- const gchar *buffer_name);
-gchar* _gimp_edit_named_copy_visible (gint32 image_ID,
- const gchar *buffer_name);
-gint32 _gimp_edit_named_paste (gint32 drawable_ID,
- const gchar *buffer_name,
- gboolean paste_into);
-gint32 _gimp_edit_named_paste_as_new_image (const gchar *buffer_name);
-
G_END_DECLS
diff --git a/libgimp/gimpfileops_pdb.c b/libgimp/gimpfileops_pdb.c
index 284e0d59ca..50c1354f3a 100644
--- a/libgimp/gimpfileops_pdb.c
+++ b/libgimp/gimpfileops_pdb.c
@@ -85,57 +85,6 @@ gimp_file_load (GimpRunMode run_mode,
return image;
}
-/**
- * _gimp_file_load: (skip)
- * @run_mode: The run mode.
- * @filename: The name of the file to load.
- * @raw_filename: The name as entered by the user.
- *
- * Loads an image file by invoking the right load handler.
- *
- * This procedure invokes the correct file load handler using magic if
- * possible, and falling back on the file's extension and/or prefix if
- * not. The name of the file to load is typically a full pathname, and
- * the name entered is what the user actually typed before prepending a
- * directory path. The reason for this is that if the user types
- * https://www.gimp.org/foo.png he wants to fetch a URL, and the full
- * pathname will not look like a URL.
- *
- * Returns: The output image.
- **/
-gint32
-_gimp_file_load (GimpRunMode run_mode,
- const gchar *filename,
- const gchar *raw_filename)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 image_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_RUN_MODE, run_mode,
- G_TYPE_STRING, filename,
- G_TYPE_STRING, raw_filename,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-file-load",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-file-load",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- image_ID = gimp_image_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return image_ID;
-}
-
/**
* gimp_file_load_layer:
* @run_mode: The run mode.
@@ -186,56 +135,6 @@ gimp_file_load_layer (GimpRunMode run_mode,
return layer;
}
-/**
- * _gimp_file_load_layer: (skip)
- * @run_mode: The run mode.
- * @image_ID: Destination image.
- * @filename: The name of the file to load.
- *
- * Loads an image file as a layer for an existing image.
- *
- * This procedure behaves like the file-load procedure but opens the
- * specified image as a layer for an existing image. The returned layer
- * needs to be added to the existing image with
- * gimp_image_insert_layer().
- *
- * Returns: The layer created when loading the image file.
- *
- * Since: 2.4
- **/
-gint32
-_gimp_file_load_layer (GimpRunMode run_mode,
- gint32 image_ID,
- const gchar *filename)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 layer_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_RUN_MODE, run_mode,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_STRING, filename,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-file-load-layer",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-file-load-layer",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- layer_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return layer_ID;
-}
-
/**
* gimp_file_load_layers:
* @run_mode: The run mode.
@@ -295,64 +194,6 @@ gimp_file_load_layers (GimpRunMode run_mode,
return layer_ids;
}
-/**
- * _gimp_file_load_layers: (skip)
- * @run_mode: The run mode.
- * @image_ID: Destination image.
- * @filename: The name of the file to load.
- * @num_layers: (out): The number of loaded layers.
- *
- * Loads an image file as layers for an existing image.
- *
- * This procedure behaves like the file-load procedure but opens the
- * specified image as layers for an existing image. The returned layers
- * needs to be added to the existing image with
- * gimp_image_insert_layer().
- *
- * Returns: (array length=num_layers): The list of loaded layers.
- * The returned value must be freed with g_free().
- *
- * Since: 2.4
- **/
-gint *
-_gimp_file_load_layers (GimpRunMode run_mode,
- gint32 image_ID,
- const gchar *filename,
- gint *num_layers)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint *layer_ids = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_RUN_MODE, run_mode,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_STRING, filename,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-file-load-layers",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-file-load-layers",
- args);
- gimp_value_array_unref (args);
-
- *num_layers = 0;
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- {
- *num_layers = g_value_get_int (gimp_value_array_index (return_vals, 1));
- layer_ids = gimp_value_dup_int32_array (gimp_value_array_index (return_vals, 2));
- }
-
- gimp_value_array_unref (return_vals);
-
- return layer_ids;
-}
-
/**
* gimp_file_save:
* @run_mode: The run mode.
@@ -409,62 +250,6 @@ gimp_file_save (GimpRunMode run_mode,
return success;
}
-/**
- * _gimp_file_save: (skip)
- * @run_mode: The run mode.
- * @image_ID: Input image.
- * @drawable_ID: Drawable to save.
- * @filename: The name of the file to save the image in.
- * @raw_filename: The name as entered by the user.
- *
- * Saves a file by extension.
- *
- * This procedure invokes the correct file save handler according to
- * the file's extension and/or prefix. The name of the file to save is
- * typically a full pathname, and the name entered is what the user
- * actually typed before prepending a directory path. The reason for
- * this is that if the user types https://www.gimp.org/foo.png she
- * wants to fetch a URL, and the full pathname will not look like a
- * URL.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_file_save (GimpRunMode run_mode,
- gint32 image_ID,
- gint32 drawable_ID,
- const gchar *filename,
- const gchar *raw_filename)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_RUN_MODE, run_mode,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_STRING, filename,
- G_TYPE_STRING, raw_filename,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-file-save",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-file-save",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_file_save_thumbnail:
* @image: The image.
@@ -511,52 +296,6 @@ gimp_file_save_thumbnail (GimpImage *image,
return success;
}
-/**
- * _gimp_file_save_thumbnail: (skip)
- * @image_ID: The image.
- * @filename: The name of the file the thumbnail belongs to.
- *
- * Saves a thumbnail for the given image
- *
- * This procedure saves a thumbnail for the given image according to
- * the Free Desktop Thumbnail Managing Standard. The thumbnail is saved
- * so that it belongs to the file with the given filename. This means
- * you have to save the image under this name first, otherwise this
- * procedure will fail. This procedure may become useful if you want to
- * explicitly save a thumbnail with a file.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_file_save_thumbnail (gint32 image_ID,
- const gchar *filename)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_STRING, filename,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-file-save-thumbnail",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-file-save-thumbnail",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* _gimp_register_magic_load_handler:
* @procedure_name: The name of the procedure to be used for loading.
diff --git a/libgimp/gimpfileops_pdb.h b/libgimp/gimpfileops_pdb.h
index 4574c7cb66..b5d32531ce 100644
--- a/libgimp/gimpfileops_pdb.h
+++ b/libgimp/gimpfileops_pdb.h
@@ -32,77 +32,41 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-G_GNUC_INTERNAL gboolean _gimp_register_magic_load_handler (const gchar *procedure_name,
- const gchar *extensions,
- const gchar *prefixes,
- const gchar *magics);
-G_GNUC_INTERNAL gboolean _gimp_register_load_handler (const gchar *procedure_name,
- const gchar *extensions,
- const gchar *prefixes);
-G_GNUC_INTERNAL gboolean _gimp_register_save_handler (const gchar *procedure_name,
- const gchar *extensions,
- const gchar *prefixes);
-G_GNUC_INTERNAL gboolean _gimp_register_file_handler_priority (const gchar *procedure_name,
- gint priority);
-G_GNUC_INTERNAL gboolean _gimp_register_file_handler_mime (const gchar *procedure_name,
- const gchar *mime_types);
-G_GNUC_INTERNAL gboolean _gimp_register_file_handler_remote (const gchar *procedure_name);
-G_GNUC_INTERNAL gboolean _gimp_register_file_handler_raw (const gchar *procedure_name);
-G_GNUC_INTERNAL gboolean _gimp_register_thumbnail_loader (const gchar *load_proc,
- const gchar *thumb_proc);
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-GimpImage* gimp_file_load (GimpRunMode run_mode,
- const gchar *filename,
- const gchar *raw_filename);
-GimpLayer* gimp_file_load_layer (GimpRunMode run_mode,
- GimpImage *image,
- const gchar *filename);
-gint* gimp_file_load_layers (GimpRunMode run_mode,
- GimpImage *image,
- const gchar *filename,
- gint *num_layers);
-gboolean gimp_file_save (GimpRunMode run_mode,
- GimpImage *image,
- GimpDrawable *drawable,
- const gchar *filename,
- const gchar *raw_filename);
-gboolean gimp_file_save_thumbnail (GimpImage *image,
- const gchar *filename);
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_file_load _gimp_file_load
-#define gimp_file_load_layer _gimp_file_load_layer
-#define gimp_file_load_layers _gimp_file_load_layers
-#define gimp_file_save _gimp_file_save
-#define gimp_file_save_thumbnail _gimp_file_save_thumbnail
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-gint32 _gimp_file_load (GimpRunMode run_mode,
- const gchar *filename,
- const gchar *raw_filename);
-gint32 _gimp_file_load_layer (GimpRunMode run_mode,
- gint32 image_ID,
- const gchar *filename);
-gint* _gimp_file_load_layers (GimpRunMode run_mode,
- gint32 image_ID,
- const gchar *filename,
- gint *num_layers);
-gboolean _gimp_file_save (GimpRunMode run_mode,
- gint32 image_ID,
- gint32 drawable_ID,
- const gchar *filename,
- const gchar *raw_filename);
-gboolean _gimp_file_save_thumbnail (gint32 image_ID,
- const gchar *filename);
+GimpImage* gimp_file_load (GimpRunMode run_mode,
+ const gchar *filename,
+ const gchar *raw_filename);
+GimpLayer* gimp_file_load_layer (GimpRunMode run_mode,
+ GimpImage *image,
+ const gchar *filename);
+gint* gimp_file_load_layers (GimpRunMode run_mode,
+ GimpImage *image,
+ const gchar *filename,
+ gint *num_layers);
+gboolean gimp_file_save (GimpRunMode run_mode,
+ GimpImage *image,
+ GimpDrawable *drawable,
+ const gchar *filename,
+ const gchar *raw_filename);
+gboolean gimp_file_save_thumbnail (GimpImage *image,
+ const gchar *filename);
+G_GNUC_INTERNAL gboolean _gimp_register_magic_load_handler (const gchar *procedure_name,
+ const gchar *extensions,
+ const gchar *prefixes,
+ const gchar *magics);
+G_GNUC_INTERNAL gboolean _gimp_register_load_handler (const gchar *procedure_name,
+ const gchar *extensions,
+ const gchar *prefixes);
+G_GNUC_INTERNAL gboolean _gimp_register_save_handler (const gchar *procedure_name,
+ const gchar *extensions,
+ const gchar *prefixes);
+G_GNUC_INTERNAL gboolean _gimp_register_file_handler_priority (const gchar *procedure_name,
+ gint priority);
+G_GNUC_INTERNAL gboolean _gimp_register_file_handler_mime (const gchar *procedure_name,
+ const gchar *mime_types);
+G_GNUC_INTERNAL gboolean _gimp_register_file_handler_remote (const gchar *procedure_name);
+G_GNUC_INTERNAL gboolean _gimp_register_file_handler_raw (const gchar *procedure_name);
+G_GNUC_INTERNAL gboolean _gimp_register_thumbnail_loader (const gchar *load_proc,
+ const gchar *thumb_proc);
G_END_DECLS
diff --git a/libgimp/gimpfloatingsel_pdb.c b/libgimp/gimpfloatingsel_pdb.c
index 47b45841e8..663060623e 100644
--- a/libgimp/gimpfloatingsel_pdb.c
+++ b/libgimp/gimpfloatingsel_pdb.c
@@ -74,46 +74,6 @@ gimp_floating_sel_remove (GimpLayer *floating_sel)
return success;
}
-/**
- * _gimp_floating_sel_remove: (skip)
- * @floating_sel_ID: The floating selection.
- *
- * Remove the specified floating selection from its associated
- * drawable.
- *
- * This procedure removes the floating selection completely, without
- * any side effects. The associated drawable is then set to active.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_floating_sel_remove (gint32 floating_sel_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (floating_sel_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-floating-sel-remove",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-floating-sel-remove",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_floating_sel_anchor:
* @floating_sel: The floating selection.
@@ -155,47 +115,6 @@ gimp_floating_sel_anchor (GimpLayer *floating_sel)
return success;
}
-/**
- * _gimp_floating_sel_anchor: (skip)
- * @floating_sel_ID: The floating selection.
- *
- * Anchor the specified floating selection to its associated drawable.
- *
- * This procedure anchors the floating selection to its associated
- * drawable. This is similar to merging with a merge type of
- * ClipToBottomLayer. The floating selection layer is no longer valid
- * after this operation.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_floating_sel_anchor (gint32 floating_sel_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (floating_sel_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-floating-sel-anchor",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-floating-sel-anchor",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_floating_sel_to_layer:
* @floating_sel: The floating selection.
@@ -241,51 +160,6 @@ gimp_floating_sel_to_layer (GimpLayer *floating_sel)
return success;
}
-/**
- * _gimp_floating_sel_to_layer: (skip)
- * @floating_sel_ID: The floating selection.
- *
- * Transforms the specified floating selection into a layer.
- *
- * This procedure transforms the specified floating selection into a
- * layer with the same offsets and extents. The composited image will
- * look precisely the same, but the floating selection layer will no
- * longer be clipped to the extents of the drawable it was attached to.
- * The floating selection will become the active layer. This procedure
- * will not work if the floating selection has a different base type
- * from the underlying image. This might be the case if the floating
- * selection is above an auxiliary channel or a layer mask.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_floating_sel_to_layer (gint32 floating_sel_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (floating_sel_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-floating-sel-to-layer",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-floating-sel-to-layer",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_floating_sel_attach:
* @layer: The layer (is attached as floating selection).
@@ -327,45 +201,3 @@ gimp_floating_sel_attach (GimpLayer *layer,
return success;
}
-
-/**
- * _gimp_floating_sel_attach: (skip)
- * @layer_ID: The layer (is attached as floating selection).
- * @drawable_ID: The drawable (where to attach the floating selection).
- *
- * Attach the specified layer as floating to the specified drawable.
- *
- * This procedure attaches the layer as floating selection to the
- * drawable.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_floating_sel_attach (gint32 layer_ID,
- gint32 drawable_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-floating-sel-attach",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-floating-sel-attach",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
diff --git a/libgimp/gimpfloatingsel_pdb.h b/libgimp/gimpfloatingsel_pdb.h
index 38d557a34b..598e9df3d4 100644
--- a/libgimp/gimpfloatingsel_pdb.h
+++ b/libgimp/gimpfloatingsel_pdb.h
@@ -32,36 +32,12 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
gboolean gimp_floating_sel_remove (GimpLayer *floating_sel);
gboolean gimp_floating_sel_anchor (GimpLayer *floating_sel);
gboolean gimp_floating_sel_to_layer (GimpLayer *floating_sel);
gboolean gimp_floating_sel_attach (GimpLayer *layer,
GimpDrawable *drawable);
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_floating_sel_remove _gimp_floating_sel_remove
-#define gimp_floating_sel_anchor _gimp_floating_sel_anchor
-#define gimp_floating_sel_to_layer _gimp_floating_sel_to_layer
-#define gimp_floating_sel_attach _gimp_floating_sel_attach
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-gboolean _gimp_floating_sel_remove (gint32 floating_sel_ID);
-gboolean _gimp_floating_sel_anchor (gint32 floating_sel_ID);
-gboolean _gimp_floating_sel_to_layer (gint32 floating_sel_ID);
-gboolean _gimp_floating_sel_attach (gint32 layer_ID,
- gint32 drawable_ID);
-
G_END_DECLS
diff --git a/libgimp/gimpfonts_pdb.h b/libgimp/gimpfonts_pdb.h
index 57ccbc8f34..8ef2a7b0ac 100644
--- a/libgimp/gimpfonts_pdb.h
+++ b/libgimp/gimpfonts_pdb.h
@@ -36,22 +36,6 @@ gboolean gimp_fonts_refresh (void);
gchar** gimp_fonts_get_list (const gchar *filter,
gint *num_fonts);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimpfontselect_pdb.h b/libgimp/gimpfontselect_pdb.h
index d053dcc0f5..1685e351a3 100644
--- a/libgimp/gimpfontselect_pdb.h
+++ b/libgimp/gimpfontselect_pdb.h
@@ -39,22 +39,6 @@ gboolean gimp_fonts_close_popup (const gchar *font_callback);
gboolean gimp_fonts_set_popup (const gchar *font_callback,
const gchar *font_name);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimpgimprc_pdb.h b/libgimp/gimpgimprc_pdb.h
index 403cf9f41b..42d500a995 100644
--- a/libgimp/gimpgimprc_pdb.h
+++ b/libgimp/gimpgimprc_pdb.h
@@ -42,22 +42,6 @@ gboolean gimp_get_monitor_resolution (gdouble *xres,
G_GNUC_INTERNAL gchar* _gimp_get_color_configuration (void);
gchar* gimp_get_module_load_inhibit (void);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimpgradient_pdb.h b/libgimp/gimpgradient_pdb.h
index 08a9d598f9..e0ea6b3fe8 100644
--- a/libgimp/gimpgradient_pdb.h
+++ b/libgimp/gimpgradient_pdb.h
@@ -133,22 +133,6 @@ gdouble gimp_gradient_segment_range_move (const gchar
gdouble delta,
gboolean control_compress);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimpgradients_pdb.h b/libgimp/gimpgradients_pdb.h
index a2950f156f..218a7e11b6 100644
--- a/libgimp/gimpgradients_pdb.h
+++ b/libgimp/gimpgradients_pdb.h
@@ -36,22 +36,6 @@ gboolean gimp_gradients_refresh (void);
gchar** gimp_gradients_get_list (const gchar *filter,
gint *num_gradients);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimpgradientselect_pdb.h b/libgimp/gimpgradientselect_pdb.h
index 595f0892e1..e3b85937d6 100644
--- a/libgimp/gimpgradientselect_pdb.h
+++ b/libgimp/gimpgradientselect_pdb.h
@@ -40,22 +40,6 @@ gboolean gimp_gradients_close_popup (const gchar *gradient_callback);
gboolean gimp_gradients_set_popup (const gchar *gradient_callback,
const gchar *gradient_name);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimphelp_pdb.h b/libgimp/gimphelp_pdb.h
index d3aba8945a..850bab4706 100644
--- a/libgimp/gimphelp_pdb.h
+++ b/libgimp/gimphelp_pdb.h
@@ -35,22 +35,6 @@ G_BEGIN_DECLS
gboolean gimp_help (const gchar *help_domain,
const gchar *help_id);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimpimage_pdb.c b/libgimp/gimpimage_pdb.c
index f55c64d755..1e8650343c 100644
--- a/libgimp/gimpimage_pdb.c
+++ b/libgimp/gimpimage_pdb.c
@@ -176,60 +176,6 @@ gimp_image_new (gint width,
return image;
}
-/**
- * _gimp_image_new: (skip)
- * @width: The width of the image.
- * @height: The height of the image.
- * @type: The type of image.
- *
- * Creates a new image with the specified width, height, and type.
- *
- * Creates a new image, undisplayed, with the specified extents and
- * type. A layer should be created and added before this image is
- * displayed, or subsequent calls to gimp_display_new() with this image
- * as an argument will fail. Layers can be created using the
- * gimp_layer_new() commands. They can be added to an image using the
- * gimp_image_insert_layer() command.
- *
- * If your image's type if INDEXED, a colormap must also be added with
- * gimp_image_set_colormap(). An indexed image without a colormap will
- * output unexpected colors.
- *
- * Returns: The newly created image.
- **/
-gint32
-_gimp_image_new (gint width,
- gint height,
- GimpImageBaseType type)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 image_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- G_TYPE_INT, width,
- G_TYPE_INT, height,
- GIMP_TYPE_IMAGE_BASE_TYPE, type,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-new",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-new",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- image_ID = gimp_image_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return image_ID;
-}
-
/**
* gimp_image_new_with_precision:
* @width: The width of the image.
@@ -284,60 +230,6 @@ gimp_image_new_with_precision (gint width,
return image;
}
-/**
- * _gimp_image_new_with_precision: (skip)
- * @width: The width of the image.
- * @height: The height of the image.
- * @type: The type of image.
- * @precision: The precision.
- *
- * Creates a new image with the specified width, height, type and
- * precision.
- *
- * Creates a new image, undisplayed with the specified extents, type
- * and precision. Indexed images can only be created at
- * GIMP_PRECISION_U8_NON_LINEAR precision. See gimp_image_new() for
- * further details.
- *
- * Returns: The newly created image.
- *
- * Since: 2.10
- **/
-gint32
-_gimp_image_new_with_precision (gint width,
- gint height,
- GimpImageBaseType type,
- GimpPrecision precision)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 image_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- G_TYPE_INT, width,
- G_TYPE_INT, height,
- GIMP_TYPE_IMAGE_BASE_TYPE, type,
- GIMP_TYPE_PRECISION, precision,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-new-with-precision",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-new-with-precision",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- image_ID = gimp_image_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return image_ID;
-}
-
/**
* gimp_image_duplicate:
* @image: The image.
@@ -378,46 +270,6 @@ gimp_image_duplicate (GimpImage *image)
return new_image;
}
-/**
- * _gimp_image_duplicate: (skip)
- * @image_ID: The image.
- *
- * Duplicate the specified image
- *
- * This procedure duplicates the specified image, copying all layers,
- * channels, and image information.
- *
- * Returns: The new, duplicated image.
- **/
-gint32
-_gimp_image_duplicate (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 new_image_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-duplicate",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-duplicate",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- new_image_ID = gimp_image_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return new_image_ID;
-}
-
/**
* gimp_image_delete:
* @image: The image.
@@ -461,49 +313,6 @@ gimp_image_delete (GimpImage *image)
return success;
}
-/**
- * _gimp_image_delete: (skip)
- * @image_ID: The image.
- *
- * Delete the specified image.
- *
- * If there are no displays associated with this image it will be
- * deleted. This means that you can not delete an image through the PDB
- * that was created by the user. If the associated display was however
- * created through the PDB and you know the display ID, you may delete
- * the display. Removal of the last associated display will then delete
- * the image.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_delete (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-delete",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-delete",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_base_type:
* @image: The image.
@@ -545,64 +354,65 @@ gimp_image_base_type (GimpImage *image)
}
/**
- * _gimp_image_base_type: (skip)
- * @image_ID: The image.
+ * gimp_image_get_precision:
+ * @image: The image.
*
- * Get the base type of the image.
+ * Get the precision of the image.
*
- * This procedure returns the image's base type. Layers in the image
- * must be of this subtype, but can have an optional alpha channel.
+ * This procedure returns the image's precision.
*
- * Returns: The image's base type.
+ * Returns: The image's precision.
+ *
+ * Since: 2.10
**/
-GimpImageBaseType
-_gimp_image_base_type (gint32 image_ID)
+GimpPrecision
+gimp_image_get_precision (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- GimpImageBaseType base_type = 0;
+ GimpPrecision precision = 0;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
+ GIMP_TYPE_IMAGE, image,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-base-type",
+ "gimp-image-get-precision",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-base-type",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-precision",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- base_type = g_value_get_enum (gimp_value_array_index (return_vals, 1));
+ precision = g_value_get_enum (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return base_type;
+ return precision;
}
/**
- * gimp_image_get_precision:
+ * gimp_image_get_default_new_layer_mode:
* @image: The image.
*
- * Get the precision of the image.
+ * Get the default mode for newly created layers of this image.
*
- * This procedure returns the image's precision.
+ * Returns the default mode for newly created layers of this image.
*
- * Returns: The image's precision.
+ * Returns: The layer mode.
*
* Since: 2.10
**/
-GimpPrecision
-gimp_image_get_precision (GimpImage *image)
+GimpLayerMode
+gimp_image_get_default_new_layer_mode (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- GimpPrecision precision = 0;
+ GimpLayerMode mode = 0;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
@@ -610,81 +420,79 @@ gimp_image_get_precision (GimpImage *image)
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-precision",
+ "gimp-image-get-default-new-layer-mode",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-get-precision",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-default-new-layer-mode",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- precision = g_value_get_enum (gimp_value_array_index (return_vals, 1));
+ mode = g_value_get_enum (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return precision;
+ return mode;
}
/**
- * _gimp_image_get_precision: (skip)
- * @image_ID: The image.
- *
- * Get the precision of the image.
+ * gimp_image_width:
+ * @image: The image.
*
- * This procedure returns the image's precision.
+ * Return the width of the image
*
- * Returns: The image's precision.
+ * This procedure returns the image's width. This value is independent
+ * of any of the layers in this image. This is the \"canvas\" width.
*
- * Since: 2.10
+ * Returns: The image's width.
**/
-GimpPrecision
-_gimp_image_get_precision (gint32 image_ID)
+gint
+gimp_image_width (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- GimpPrecision precision = 0;
+ gint width = 0;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
+ GIMP_TYPE_IMAGE, image,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-precision",
+ "gimp-image-width",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-get-precision",
+ return_vals = gimp_run_procedure_array ("gimp-image-width",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- precision = g_value_get_enum (gimp_value_array_index (return_vals, 1));
+ width = g_value_get_int (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return precision;
+ return width;
}
/**
- * gimp_image_get_default_new_layer_mode:
+ * gimp_image_height:
* @image: The image.
*
- * Get the default mode for newly created layers of this image.
- *
- * Returns the default mode for newly created layers of this image.
+ * Return the height of the image
*
- * Returns: The layer mode.
+ * This procedure returns the image's height. This value is independent
+ * of any of the layers in this image. This is the \"canvas\" height.
*
- * Since: 2.10
+ * Returns: The image's height.
**/
-GimpLayerMode
-gimp_image_get_default_new_layer_mode (GimpImage *image)
+gint
+gimp_image_height (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- GimpLayerMode mode = 0;
+ gint height = 0;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
@@ -692,220 +500,19 @@ gimp_image_get_default_new_layer_mode (GimpImage *image)
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-default-new-layer-mode",
+ "gimp-image-height",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-get-default-new-layer-mode",
+ return_vals = gimp_run_procedure_array ("gimp-image-height",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- mode = g_value_get_enum (gimp_value_array_index (return_vals, 1));
+ height = g_value_get_int (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return mode;
-}
-
-/**
- * _gimp_image_get_default_new_layer_mode: (skip)
- * @image_ID: The image.
- *
- * Get the default mode for newly created layers of this image.
- *
- * Returns the default mode for newly created layers of this image.
- *
- * Returns: The layer mode.
- *
- * Since: 2.10
- **/
-GimpLayerMode
-_gimp_image_get_default_new_layer_mode (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- GimpLayerMode mode = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-default-new-layer-mode",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-default-new-layer-mode",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- mode = g_value_get_enum (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return mode;
-}
-
-/**
- * gimp_image_width:
- * @image: The image.
- *
- * Return the width of the image
- *
- * This procedure returns the image's width. This value is independent
- * of any of the layers in this image. This is the \"canvas\" width.
- *
- * Returns: The image's width.
- **/
-gint
-gimp_image_width (GimpImage *image)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint width = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-width",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-width",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- width = g_value_get_int (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return width;
-}
-
-/**
- * _gimp_image_width: (skip)
- * @image_ID: The image.
- *
- * Return the width of the image
- *
- * This procedure returns the image's width. This value is independent
- * of any of the layers in this image. This is the \"canvas\" width.
- *
- * Returns: The image's width.
- **/
-gint
-_gimp_image_width (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint width = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-width",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-width",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- width = g_value_get_int (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return width;
-}
-
-/**
- * gimp_image_height:
- * @image: The image.
- *
- * Return the height of the image
- *
- * This procedure returns the image's height. This value is independent
- * of any of the layers in this image. This is the \"canvas\" height.
- *
- * Returns: The image's height.
- **/
-gint
-gimp_image_height (GimpImage *image)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint height = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-height",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-height",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- height = g_value_get_int (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return height;
-}
-
-/**
- * _gimp_image_height: (skip)
- * @image_ID: The image.
- *
- * Return the height of the image
- *
- * This procedure returns the image's height. This value is independent
- * of any of the layers in this image. This is the \"canvas\" height.
- *
- * Returns: The image's height.
- **/
-gint
-_gimp_image_height (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint height = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-height",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-height",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- height = g_value_get_int (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return height;
+ return height;
}
/**
@@ -1104,50 +711,6 @@ gimp_image_get_active_drawable (GimpImage *image)
return drawable;
}
-/**
- * _gimp_image_get_active_drawable: (skip)
- * @image_ID: The image.
- *
- * Get the image's active drawable
- *
- * This procedure returns the ID of the image's active drawable. This
- * can be either a layer, a channel, or a layer mask. The active
- * drawable is specified by the active image channel. If that is -1,
- * then by the active image layer. If the active image layer has a
- * layer mask and the layer mask is in edit mode, then the layer mask
- * is the active drawable.
- *
- * Returns: The active drawable.
- **/
-gint32
-_gimp_image_get_active_drawable (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 drawable_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-active-drawable",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-active-drawable",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- drawable_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return drawable_ID;
-}
-
/**
* gimp_image_unset_active_channel:
* @image: The image.
@@ -1190,131 +753,50 @@ gimp_image_unset_active_channel (GimpImage *image)
}
/**
- * _gimp_image_unset_active_channel: (skip)
- * @image_ID: The image.
+ * gimp_image_get_floating_sel:
+ * @image: The image.
*
- * Unsets the active channel in the specified image.
+ * Return the floating selection of the image.
*
- * If an active channel exists, it is unset. There then exists no
- * active channel, and if desired, one can be set through a call to
- * 'Set Active Channel'. No error is returned in the case of no
- * existing active channel.
+ * This procedure returns the image's floating selection, if it exists.
+ * If it doesn't exist, -1 is returned as the layer ID.
*
- * Returns: TRUE on success.
+ * Returns: (transfer none): The image's floating selection.
**/
-gboolean
-_gimp_image_unset_active_channel (gint32 image_ID)
+GimpLayer *
+gimp_image_get_floating_sel (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ GimpLayer *floating_sel = NULL;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
+ GIMP_TYPE_IMAGE, image,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-unset-active-channel",
+ "gimp-image-get-floating-sel",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-unset-active-channel",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-floating-sel",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ floating_sel = g_value_get_object (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return floating_sel;
}
/**
- * gimp_image_get_floating_sel:
+ * gimp_image_floating_sel_attached_to:
* @image: The image.
*
- * Return the floating selection of the image.
- *
- * This procedure returns the image's floating selection, if it exists.
- * If it doesn't exist, -1 is returned as the layer ID.
- *
- * Returns: (transfer none): The image's floating selection.
- **/
-GimpLayer *
-gimp_image_get_floating_sel (GimpImage *image)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- GimpLayer *floating_sel = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-floating-sel",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-floating-sel",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- floating_sel = g_value_get_object (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return floating_sel;
-}
-
-/**
- * _gimp_image_get_floating_sel: (skip)
- * @image_ID: The image.
- *
- * Return the floating selection of the image.
- *
- * This procedure returns the image's floating selection, if it exists.
- * If it doesn't exist, -1 is returned as the layer ID.
- *
- * Returns: The image's floating selection.
- **/
-gint32
-_gimp_image_get_floating_sel (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 floating_sel_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-floating-sel",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-floating-sel",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- floating_sel_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return floating_sel_ID;
-}
-
-/**
- * gimp_image_floating_sel_attached_to:
- * @image: The image.
- *
- * Return the drawable the floating selection is attached to.
+ * Return the drawable the floating selection is attached to.
*
* This procedure returns the drawable the image's floating selection
* is attached to, if it exists. If it doesn't exist, -1 is returned as
@@ -1352,47 +834,6 @@ gimp_image_floating_sel_attached_to (GimpImage *image)
return drawable;
}
-/**
- * _gimp_image_floating_sel_attached_to: (skip)
- * @image_ID: The image.
- *
- * Return the drawable the floating selection is attached to.
- *
- * This procedure returns the drawable the image's floating selection
- * is attached to, if it exists. If it doesn't exist, -1 is returned as
- * the drawable ID.
- *
- * Returns: The drawable the floating selection is attached to.
- **/
-gint32
-_gimp_image_floating_sel_attached_to (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 drawable_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-floating-sel-attached-to",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-floating-sel-attached-to",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- drawable_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return drawable_ID;
-}
-
/**
* gimp_image_pick_color:
* @image: The image.
@@ -1464,77 +905,6 @@ gimp_image_pick_color (GimpImage *image,
return success;
}
-/**
- * _gimp_image_pick_color: (skip)
- * @image_ID: The image.
- * @drawable_ID: (nullable): The drawable to pick from.
- * @x: x coordinate of upper-left corner of rectangle.
- * @y: y coordinate of upper-left corner of rectangle.
- * @sample_merged: Use the composite image, not the drawable.
- * @sample_average: Average the color of all the pixels in a specified radius.
- * @average_radius: The radius of pixels to average.
- * @color: (out caller-allocates): The return color.
- *
- * Determine the color at the given drawable coordinates
- *
- * This tool determines the color at the specified coordinates. The
- * returned color is an RGB triplet even for grayscale and indexed
- * drawables. If the coordinates lie outside of the extents of the
- * specified drawable, then an error is returned. If the drawable has
- * an alpha channel, the algorithm examines the alpha value of the
- * drawable at the coordinates. If the alpha value is completely
- * transparent (0), then an error is returned. If the sample_merged
- * parameter is TRUE, the data of the composite image will be used
- * instead of that for the specified drawable. This is equivalent to
- * sampling for colors after merging all visible layers. In the case of
- * a merged sampling, the supplied drawable is ignored.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_pick_color (gint32 image_ID,
- gint32 drawable_ID,
- gdouble x,
- gdouble y,
- gboolean sample_merged,
- gboolean sample_average,
- gdouble average_radius,
- GimpRGB *color)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_DOUBLE, x,
- G_TYPE_DOUBLE, y,
- G_TYPE_BOOLEAN, sample_merged,
- G_TYPE_BOOLEAN, sample_average,
- G_TYPE_DOUBLE, average_radius,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-pick-color",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-pick-color",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- if (success)
- gimp_value_get_rgb (gimp_value_array_index (return_vals, 1), &*color);
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_pick_correlate_layer:
* @image: The image.
@@ -1584,55 +954,6 @@ gimp_image_pick_correlate_layer (GimpImage *image,
return layer;
}
-/**
- * _gimp_image_pick_correlate_layer: (skip)
- * @image_ID: The image.
- * @x: The x coordinate for the pick.
- * @y: The y coordinate for the pick.
- *
- * Find the layer visible at the specified coordinates.
- *
- * This procedure finds the layer which is visible at the specified
- * coordinates. Layers which do not qualify are those whose extents do
- * not pass within the specified coordinates, or which are transparent
- * at the specified coordinates. This procedure will return -1 if no
- * layer is found.
- *
- * Returns: The layer found at the specified coordinates.
- **/
-gint32
-_gimp_image_pick_correlate_layer (gint32 image_ID,
- gint x,
- gint y)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 layer_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_INT, x,
- G_TYPE_INT, y,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-pick-correlate-layer",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-pick-correlate-layer",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- layer_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return layer_ID;
-}
-
/**
* gimp_image_insert_layer:
* @image: The image.
@@ -1691,33 +1012,23 @@ gimp_image_insert_layer (GimpImage *image,
}
/**
- * _gimp_image_insert_layer: (skip)
- * @image_ID: The image.
- * @layer_ID: The layer.
- * @parent_ID: (nullable): The parent layer.
- * @position: The layer position.
+ * gimp_image_remove_layer:
+ * @image: The image.
+ * @layer: The layer.
*
- * Add the specified layer to the image.
+ * Remove the specified layer from the image.
*
- * This procedure adds the specified layer to the image at the given
- * position. If the specified parent is a valid layer group (See
- * gimp_item_is_group() and gimp_layer_group_new()) then the layer is
- * added inside the group. If the parent is 0, the layer is added
- * inside the main stack, outside of any group. The position argument
- * specifies the location of the layer inside the stack (or the group,
- * if a valid parent was supplied), starting from the top (0) and
- * increasing. If the position is specified as -1 and the parent is
- * specified as 0, then the layer is inserted above the active layer,
- * or inside the group if the active layer is a layer group. The layer
- * type must be compatible with the image base type.
+ * This procedure removes the specified layer from the image. If the
+ * layer doesn't exist, an error is returned. If there are no layers
+ * left in the image, this call will fail. If this layer is the last
+ * layer remaining, the image will become empty and have no active
+ * layer.
*
* Returns: TRUE on success.
**/
gboolean
-_gimp_image_insert_layer (gint32 image_ID,
- gint32 layer_ID,
- gint32 parent_ID,
- gint position)
+gimp_image_remove_layer (GimpImage *image,
+ GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -1725,18 +1036,16 @@ _gimp_image_insert_layer (gint32 image_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- GIMP_TYPE_LAYER, gimp_item_get_by_id (parent_ID),
- G_TYPE_INT, position,
+ GIMP_TYPE_IMAGE, image,
+ GIMP_TYPE_LAYER, layer,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-insert-layer",
+ "gimp-image-remove-layer",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-insert-layer",
+ return_vals = gimp_run_procedure_array ("gimp-image-remove-layer",
args);
gimp_value_array_unref (args);
@@ -1748,23 +1057,25 @@ _gimp_image_insert_layer (gint32 image_ID,
}
/**
- * gimp_image_remove_layer:
+ * gimp_image_freeze_layers:
* @image: The image.
- * @layer: The layer.
*
- * Remove the specified layer from the image.
+ * Freeze the image's layer list.
*
- * This procedure removes the specified layer from the image. If the
- * layer doesn't exist, an error is returned. If there are no layers
- * left in the image, this call will fail. If this layer is the last
- * layer remaining, the image will become empty and have no active
- * layer.
+ * This procedure freezes the layer list of the image, suppressing any
+ * updates to the Layers dialog in response to changes to the image's
+ * layers. This can significantly improve performance while applying
+ * changes affecting the layer list.
+ *
+ * Each call to gimp_image_freeze_layers() should be matched by a
+ * corresponding call to gimp_image_thaw_layers(), undoing its effects.
*
* Returns: TRUE on success.
+ *
+ * Since: 2.10.2
**/
gboolean
-gimp_image_remove_layer (GimpImage *image,
- GimpLayer *layer)
+gimp_image_freeze_layers (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -1773,15 +1084,14 @@ gimp_image_remove_layer (GimpImage *image,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
- GIMP_TYPE_LAYER, layer,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-remove-layer",
+ "gimp-image-freeze-layers",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-remove-layer",
+ return_vals = gimp_run_procedure_array ("gimp-image-freeze-layers",
args);
gimp_value_array_unref (args);
@@ -1793,23 +1103,23 @@ gimp_image_remove_layer (GimpImage *image,
}
/**
- * _gimp_image_remove_layer: (skip)
- * @image_ID: The image.
- * @layer_ID: The layer.
+ * gimp_image_thaw_layers:
+ * @image: The image.
*
- * Remove the specified layer from the image.
+ * Thaw the image's layer list.
*
- * This procedure removes the specified layer from the image. If the
- * layer doesn't exist, an error is returned. If there are no layers
- * left in the image, this call will fail. If this layer is the last
- * layer remaining, the image will become empty and have no active
- * layer.
+ * This procedure thaws the layer list of the image, re-enabling
+ * updates to the Layers dialog.
+ *
+ * This procedure should match a corresponding call to
+ * gimp_image_freeze_layers().
*
* Returns: TRUE on success.
+ *
+ * Since: 2.10.2
**/
gboolean
-_gimp_image_remove_layer (gint32 image_ID,
- gint32 layer_ID)
+gimp_image_thaw_layers (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -1817,16 +1127,15 @@ _gimp_image_remove_layer (gint32 image_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
+ GIMP_TYPE_IMAGE, image,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-remove-layer",
+ "gimp-image-thaw-layers",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-remove-layer",
+ return_vals = gimp_run_procedure_array ("gimp-image-thaw-layers",
args);
gimp_value_array_unref (args);
@@ -1838,25 +1147,28 @@ _gimp_image_remove_layer (gint32 image_ID,
}
/**
- * gimp_image_freeze_layers:
+ * gimp_image_insert_channel:
* @image: The image.
+ * @channel: The channel.
+ * @parent: (nullable): The parent channel.
+ * @position: The channel position.
*
- * Freeze the image's layer list.
- *
- * This procedure freezes the layer list of the image, suppressing any
- * updates to the Layers dialog in response to changes to the image's
- * layers. This can significantly improve performance while applying
- * changes affecting the layer list.
+ * Add the specified channel to the image.
*
- * Each call to gimp_image_freeze_layers() should be matched by a
- * corresponding call to gimp_image_thaw_layers(), undoing its effects.
+ * This procedure adds the specified channel to the image at the given
+ * position. Since channel groups are not currently supported, the
+ * parent argument must always be 0. The position argument specifies
+ * the location of the channel inside the stack, starting from the top
+ * (0) and increasing. If the position is specified as -1, then the
+ * channel is inserted above the active channel.
*
* Returns: TRUE on success.
- *
- * Since: 2.10.2
**/
gboolean
-gimp_image_freeze_layers (GimpImage *image)
+gimp_image_insert_channel (GimpImage *image,
+ GimpChannel *channel,
+ GimpChannel *parent,
+ gint position)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -1865,14 +1177,17 @@ gimp_image_freeze_layers (GimpImage *image)
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
+ GIMP_TYPE_CHANNEL, channel,
+ GIMP_TYPE_CHANNEL, parent,
+ G_TYPE_INT, position,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-freeze-layers",
+ "gimp-image-insert-channel",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-freeze-layers",
+ return_vals = gimp_run_procedure_array ("gimp-image-insert-channel",
args);
gimp_value_array_unref (args);
@@ -1884,25 +1199,20 @@ gimp_image_freeze_layers (GimpImage *image)
}
/**
- * _gimp_image_freeze_layers: (skip)
- * @image_ID: The image.
- *
- * Freeze the image's layer list.
+ * gimp_image_remove_channel:
+ * @image: The image.
+ * @channel: The channel.
*
- * This procedure freezes the layer list of the image, suppressing any
- * updates to the Layers dialog in response to changes to the image's
- * layers. This can significantly improve performance while applying
- * changes affecting the layer list.
+ * Remove the specified channel from the image.
*
- * Each call to gimp_image_freeze_layers() should be matched by a
- * corresponding call to gimp_image_thaw_layers(), undoing its effects.
+ * This procedure removes the specified channel from the image. If the
+ * channel doesn't exist, an error is returned.
*
* Returns: TRUE on success.
- *
- * Since: 2.10.2
**/
gboolean
-_gimp_image_freeze_layers (gint32 image_ID)
+gimp_image_remove_channel (GimpImage *image,
+ GimpChannel *channel)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -1910,15 +1220,16 @@ _gimp_image_freeze_layers (gint32 image_ID)
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
+ GIMP_TYPE_IMAGE, image,
+ GIMP_TYPE_CHANNEL, channel,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-freeze-layers",
+ "gimp-image-remove-channel",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-freeze-layers",
+ return_vals = gimp_run_procedure_array ("gimp-image-remove-channel",
args);
gimp_value_array_unref (args);
@@ -1930,23 +1241,26 @@ _gimp_image_freeze_layers (gint32 image_ID)
}
/**
- * gimp_image_thaw_layers:
+ * gimp_image_freeze_channels:
* @image: The image.
*
- * Thaw the image's layer list.
+ * Freeze the image's channel list.
*
- * This procedure thaws the layer list of the image, re-enabling
- * updates to the Layers dialog.
+ * This procedure freezes the channel list of the image, suppressing
+ * any updates to the Channels dialog in response to changes to the
+ * image's channels. This can significantly improve performance while
+ * applying changes affecting the channel list.
*
- * This procedure should match a corresponding call to
- * gimp_image_freeze_layers().
+ * Each call to gimp_image_freeze_channels() should be matched by a
+ * corresponding call to gimp_image_thaw_channels(), undoing its
+ * effects.
*
* Returns: TRUE on success.
*
* Since: 2.10.2
**/
gboolean
-gimp_image_thaw_layers (GimpImage *image)
+gimp_image_freeze_channels (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -1959,10 +1273,10 @@ gimp_image_thaw_layers (GimpImage *image)
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-thaw-layers",
+ "gimp-image-freeze-channels",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-thaw-layers",
+ return_vals = gimp_run_procedure_array ("gimp-image-freeze-channels",
args);
gimp_value_array_unref (args);
@@ -1974,23 +1288,23 @@ gimp_image_thaw_layers (GimpImage *image)
}
/**
- * _gimp_image_thaw_layers: (skip)
- * @image_ID: The image.
+ * gimp_image_thaw_channels:
+ * @image: The image.
*
- * Thaw the image's layer list.
+ * Thaw the image's channel list.
*
- * This procedure thaws the layer list of the image, re-enabling
- * updates to the Layers dialog.
+ * This procedure thaws the channel list of the image, re-enabling
+ * updates to the Channels dialog.
*
* This procedure should match a corresponding call to
- * gimp_image_freeze_layers().
+ * gimp_image_freeze_channels().
*
* Returns: TRUE on success.
*
* Since: 2.10.2
**/
gboolean
-_gimp_image_thaw_layers (gint32 image_ID)
+gimp_image_thaw_channels (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -1998,15 +1312,15 @@ _gimp_image_thaw_layers (gint32 image_ID)
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
+ GIMP_TYPE_IMAGE, image,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-thaw-layers",
+ "gimp-image-thaw-channels",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-thaw-layers",
+ return_vals = gimp_run_procedure_array ("gimp-image-thaw-channels",
args);
gimp_value_array_unref (args);
@@ -2018,27 +1332,27 @@ _gimp_image_thaw_layers (gint32 image_ID)
}
/**
- * gimp_image_insert_channel:
+ * gimp_image_insert_vectors:
* @image: The image.
- * @channel: The channel.
- * @parent: (nullable): The parent channel.
- * @position: The channel position.
+ * @vectors: The vectors.
+ * @parent: (nullable): The parent vectors.
+ * @position: The vectors position.
*
- * Add the specified channel to the image.
+ * Add the specified vectors to the image.
*
- * This procedure adds the specified channel to the image at the given
- * position. Since channel groups are not currently supported, the
+ * This procedure adds the specified vectors to the image at the given
+ * position. Since vectors groups are not currently supported, the
* parent argument must always be 0. The position argument specifies
- * the location of the channel inside the stack, starting from the top
+ * the location of the vectors inside the stack, starting from the top
* (0) and increasing. If the position is specified as -1, then the
- * channel is inserted above the active channel.
+ * vectors is inserted above the active vectors.
*
* Returns: TRUE on success.
**/
gboolean
-gimp_image_insert_channel (GimpImage *image,
- GimpChannel *channel,
- GimpChannel *parent,
+gimp_image_insert_vectors (GimpImage *image,
+ GimpVectors *vectors,
+ GimpVectors *parent,
gint position)
{
GimpPDB *pdb = gimp_get_pdb ();
@@ -2048,17 +1362,17 @@ gimp_image_insert_channel (GimpImage *image,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
- GIMP_TYPE_CHANNEL, channel,
- GIMP_TYPE_CHANNEL, parent,
+ GIMP_TYPE_VECTORS, vectors,
+ GIMP_TYPE_VECTORS, parent,
G_TYPE_INT, position,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-insert-channel",
+ "gimp-image-insert-vectors",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-insert-channel",
+ return_vals = gimp_run_procedure_array ("gimp-image-insert-vectors",
args);
gimp_value_array_unref (args);
@@ -2070,28 +1384,22 @@ gimp_image_insert_channel (GimpImage *image,
}
/**
- * _gimp_image_insert_channel: (skip)
- * @image_ID: The image.
- * @channel_ID: The channel.
- * @parent_ID: (nullable): The parent channel.
- * @position: The channel position.
+ * gimp_image_remove_vectors:
+ * @image: The image.
+ * @vectors: The vectors object.
*
- * Add the specified channel to the image.
+ * Remove the specified path from the image.
*
- * This procedure adds the specified channel to the image at the given
- * position. Since channel groups are not currently supported, the
- * parent argument must always be 0. The position argument specifies
- * the location of the channel inside the stack, starting from the top
- * (0) and increasing. If the position is specified as -1, then the
- * channel is inserted above the active channel.
+ * This procedure removes the specified path from the image. If the
+ * path doesn't exist, an error is returned.
*
* Returns: TRUE on success.
+ *
+ * Since: 2.4
**/
gboolean
-_gimp_image_insert_channel (gint32 image_ID,
- gint32 channel_ID,
- gint32 parent_ID,
- gint position)
+gimp_image_remove_vectors (GimpImage *image,
+ GimpVectors *vectors)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -2099,18 +1407,16 @@ _gimp_image_insert_channel (gint32 image_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_CHANNEL, gimp_item_get_by_id (channel_ID),
- GIMP_TYPE_CHANNEL, gimp_item_get_by_id (parent_ID),
- G_TYPE_INT, position,
+ GIMP_TYPE_IMAGE, image,
+ GIMP_TYPE_VECTORS, vectors,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-insert-channel",
+ "gimp-image-remove-vectors",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-insert-channel",
+ return_vals = gimp_run_procedure_array ("gimp-image-remove-vectors",
args);
gimp_value_array_unref (args);
@@ -2122,20 +1428,26 @@ _gimp_image_insert_channel (gint32 image_ID,
}
/**
- * gimp_image_remove_channel:
+ * gimp_image_freeze_vectors:
* @image: The image.
- * @channel: The channel.
*
- * Remove the specified channel from the image.
+ * Freeze the image's vectors list.
*
- * This procedure removes the specified channel from the image. If the
- * channel doesn't exist, an error is returned.
+ * This procedure freezes the vectors list of the image, suppressing
+ * any updates to the Paths dialog in response to changes to the
+ * image's vectors. This can significantly improve performance while
+ * applying changes affecting the vectors list.
+ *
+ * Each call to gimp_image_freeze_vectors() should be matched by a
+ * corresponding call to gimp_image_thaw_vectors(), undoing its
+ * effects.
*
* Returns: TRUE on success.
+ *
+ * Since: 2.10.2
**/
gboolean
-gimp_image_remove_channel (GimpImage *image,
- GimpChannel *channel)
+gimp_image_freeze_vectors (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -2144,15 +1456,14 @@ gimp_image_remove_channel (GimpImage *image,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
- GIMP_TYPE_CHANNEL, channel,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-remove-channel",
+ "gimp-image-freeze-vectors",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-remove-channel",
+ return_vals = gimp_run_procedure_array ("gimp-image-freeze-vectors",
args);
gimp_value_array_unref (args);
@@ -2164,20 +1475,23 @@ gimp_image_remove_channel (GimpImage *image,
}
/**
- * _gimp_image_remove_channel: (skip)
- * @image_ID: The image.
- * @channel_ID: The channel.
+ * gimp_image_thaw_vectors:
+ * @image: The image.
*
- * Remove the specified channel from the image.
+ * Thaw the image's vectors list.
*
- * This procedure removes the specified channel from the image. If the
- * channel doesn't exist, an error is returned.
+ * This procedure thaws the vectors list of the image, re-enabling
+ * updates to the Paths dialog.
+ *
+ * This procedure should match a corresponding call to
+ * gimp_image_freeze_vectors().
*
* Returns: TRUE on success.
+ *
+ * Since: 2.10.2
**/
gboolean
-_gimp_image_remove_channel (gint32 image_ID,
- gint32 channel_ID)
+gimp_image_thaw_vectors (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -2185,16 +1499,15 @@ _gimp_image_remove_channel (gint32 image_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_CHANNEL, gimp_item_get_by_id (channel_ID),
+ GIMP_TYPE_IMAGE, image,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-remove-channel",
+ "gimp-image-thaw-vectors",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-remove-channel",
+ return_vals = gimp_run_procedure_array ("gimp-image-thaw-vectors",
args);
gimp_value_array_unref (args);
@@ -2206,73 +1519,69 @@ _gimp_image_remove_channel (gint32 image_ID,
}
/**
- * gimp_image_freeze_channels:
+ * gimp_image_get_item_position:
* @image: The image.
+ * @item: The item.
*
- * Freeze the image's channel list.
- *
- * This procedure freezes the channel list of the image, suppressing
- * any updates to the Channels dialog in response to changes to the
- * image's channels. This can significantly improve performance while
- * applying changes affecting the channel list.
+ * Returns the position of the item in its level of its item tree.
*
- * Each call to gimp_image_freeze_channels() should be matched by a
- * corresponding call to gimp_image_thaw_channels(), undoing its
- * effects.
+ * This procedure determines the position of the specified item in its
+ * level in its item tree in the image. If the item doesn't exist in
+ * the image, or the item is not part of an item tree, an error is
+ * returned.
*
- * Returns: TRUE on success.
+ * Returns: The position of the item in its level in the item tree.
*
- * Since: 2.10.2
+ * Since: 2.8
**/
-gboolean
-gimp_image_freeze_channels (GimpImage *image)
+gint
+gimp_image_get_item_position (GimpImage *image,
+ GimpItem *item)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ gint position = 0;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
+ GIMP_TYPE_ITEM, item,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-freeze-channels",
+ "gimp-image-get-item-position",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-freeze-channels",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-item-position",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ position = g_value_get_int (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return position;
}
/**
- * _gimp_image_freeze_channels: (skip)
- * @image_ID: The image.
- *
- * Freeze the image's channel list.
+ * gimp_image_raise_item:
+ * @image: The image.
+ * @item: The item to raise.
*
- * This procedure freezes the channel list of the image, suppressing
- * any updates to the Channels dialog in response to changes to the
- * image's channels. This can significantly improve performance while
- * applying changes affecting the channel list.
+ * Raise the specified item in its level in its item tree
*
- * Each call to gimp_image_freeze_channels() should be matched by a
- * corresponding call to gimp_image_thaw_channels(), undoing its
- * effects.
+ * This procedure raises the specified item one step in the item tree.
+ * The procedure call will fail if there is no item above it.
*
* Returns: TRUE on success.
*
- * Since: 2.10.2
+ * Since: 2.8
**/
gboolean
-_gimp_image_freeze_channels (gint32 image_ID)
+gimp_image_raise_item (GimpImage *image,
+ GimpItem *item)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -2280,15 +1589,16 @@ _gimp_image_freeze_channels (gint32 image_ID)
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
+ GIMP_TYPE_IMAGE, image,
+ GIMP_TYPE_ITEM, item,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-freeze-channels",
+ "gimp-image-raise-item",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-freeze-channels",
+ return_vals = gimp_run_procedure_array ("gimp-image-raise-item",
args);
gimp_value_array_unref (args);
@@ -2300,23 +1610,22 @@ _gimp_image_freeze_channels (gint32 image_ID)
}
/**
- * gimp_image_thaw_channels:
+ * gimp_image_lower_item:
* @image: The image.
+ * @item: The item to lower.
*
- * Thaw the image's channel list.
- *
- * This procedure thaws the channel list of the image, re-enabling
- * updates to the Channels dialog.
+ * Lower the specified item in its level in its item tree
*
- * This procedure should match a corresponding call to
- * gimp_image_freeze_channels().
+ * This procedure lowers the specified item one step in the item tree.
+ * The procedure call will fail if there is no item below it.
*
* Returns: TRUE on success.
*
- * Since: 2.10.2
+ * Since: 2.8
**/
gboolean
-gimp_image_thaw_channels (GimpImage *image)
+gimp_image_lower_item (GimpImage *image,
+ GimpItem *item)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -2325,14 +1634,15 @@ gimp_image_thaw_channels (GimpImage *image)
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
+ GIMP_TYPE_ITEM, item,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-thaw-channels",
+ "gimp-image-lower-item",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-thaw-channels",
+ return_vals = gimp_run_procedure_array ("gimp-image-lower-item",
args);
gimp_value_array_unref (args);
@@ -2344,23 +1654,22 @@ gimp_image_thaw_channels (GimpImage *image)
}
/**
- * _gimp_image_thaw_channels: (skip)
- * @image_ID: The image.
- *
- * Thaw the image's channel list.
+ * gimp_image_raise_item_to_top:
+ * @image: The image.
+ * @item: The item to raise to top.
*
- * This procedure thaws the channel list of the image, re-enabling
- * updates to the Channels dialog.
+ * Raise the specified item to the top of its level in its item tree
*
- * This procedure should match a corresponding call to
- * gimp_image_freeze_channels().
+ * This procedure raises the specified item to top of its level in the
+ * item tree. It will not move the item if there is no item above it.
*
* Returns: TRUE on success.
*
- * Since: 2.10.2
+ * Since: 2.8
**/
gboolean
-_gimp_image_thaw_channels (gint32 image_ID)
+gimp_image_raise_item_to_top (GimpImage *image,
+ GimpItem *item)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -2368,15 +1677,16 @@ _gimp_image_thaw_channels (gint32 image_ID)
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
+ GIMP_TYPE_IMAGE, image,
+ GIMP_TYPE_ITEM, item,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-thaw-channels",
+ "gimp-image-raise-item-to-top",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-thaw-channels",
+ return_vals = gimp_run_procedure_array ("gimp-image-raise-item-to-top",
args);
gimp_value_array_unref (args);
@@ -2388,28 +1698,23 @@ _gimp_image_thaw_channels (gint32 image_ID)
}
/**
- * gimp_image_insert_vectors:
+ * gimp_image_lower_item_to_bottom:
* @image: The image.
- * @vectors: The vectors.
- * @parent: (nullable): The parent vectors.
- * @position: The vectors position.
+ * @item: The item to lower to bottom.
*
- * Add the specified vectors to the image.
+ * Lower the specified item to the bottom of its level in its item tree
*
- * This procedure adds the specified vectors to the image at the given
- * position. Since vectors groups are not currently supported, the
- * parent argument must always be 0. The position argument specifies
- * the location of the vectors inside the stack, starting from the top
- * (0) and increasing. If the position is specified as -1, then the
- * vectors is inserted above the active vectors.
+ * This procedure lowers the specified item to bottom of its level in
+ * the item tree. It will not move the layer if there is no layer below
+ * it.
*
* Returns: TRUE on success.
+ *
+ * Since: 2.8
**/
gboolean
-gimp_image_insert_vectors (GimpImage *image,
- GimpVectors *vectors,
- GimpVectors *parent,
- gint position)
+gimp_image_lower_item_to_bottom (GimpImage *image,
+ GimpItem *item)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -2418,17 +1723,15 @@ gimp_image_insert_vectors (GimpImage *image,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
- GIMP_TYPE_VECTORS, vectors,
- GIMP_TYPE_VECTORS, parent,
- G_TYPE_INT, position,
+ GIMP_TYPE_ITEM, item,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-insert-vectors",
+ "gimp-image-lower-item-to-bottom",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-insert-vectors",
+ return_vals = gimp_run_procedure_array ("gimp-image-lower-item-to-bottom",
args);
gimp_value_array_unref (args);
@@ -2440,28 +1743,25 @@ gimp_image_insert_vectors (GimpImage *image,
}
/**
- * _gimp_image_insert_vectors: (skip)
- * @image_ID: The image.
- * @vectors_ID: The vectors.
- * @parent_ID: (nullable): The parent vectors.
- * @position: The vectors position.
+ * gimp_image_reorder_item:
+ * @image: The image.
+ * @item: The item to reorder.
+ * @parent: (nullable): The new parent item.
+ * @position: The new position of the item.
*
- * Add the specified vectors to the image.
+ * Reorder the specified item within its item tree
*
- * This procedure adds the specified vectors to the image at the given
- * position. Since vectors groups are not currently supported, the
- * parent argument must always be 0. The position argument specifies
- * the location of the vectors inside the stack, starting from the top
- * (0) and increasing. If the position is specified as -1, then the
- * vectors is inserted above the active vectors.
+ * This procedure reorders the specified item within its item tree.
*
* Returns: TRUE on success.
+ *
+ * Since: 2.8
**/
gboolean
-_gimp_image_insert_vectors (gint32 image_ID,
- gint32 vectors_ID,
- gint32 parent_ID,
- gint position)
+gimp_image_reorder_item (GimpImage *image,
+ GimpItem *item,
+ GimpItem *parent,
+ gint position)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -2469,18 +1769,18 @@ _gimp_image_insert_vectors (gint32 image_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_VECTORS, gimp_item_get_by_id (vectors_ID),
- GIMP_TYPE_VECTORS, gimp_item_get_by_id (parent_ID),
+ GIMP_TYPE_IMAGE, image,
+ GIMP_TYPE_ITEM, item,
+ GIMP_TYPE_ITEM, parent,
G_TYPE_INT, position,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-insert-vectors",
+ "gimp-image-reorder-item",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-insert-vectors",
+ return_vals = gimp_run_procedure_array ("gimp-image-reorder-item",
args);
gimp_value_array_unref (args);
@@ -2492,205 +1792,217 @@ _gimp_image_insert_vectors (gint32 image_ID,
}
/**
- * gimp_image_remove_vectors:
+ * gimp_image_flatten:
* @image: The image.
- * @vectors: The vectors object.
- *
- * Remove the specified path from the image.
*
- * This procedure removes the specified path from the image. If the
- * path doesn't exist, an error is returned.
+ * Flatten all visible layers into a single layer. Discard all
+ * invisible layers.
*
- * Returns: TRUE on success.
+ * This procedure combines the visible layers in a manner analogous to
+ * merging with the CLIP_TO_IMAGE merge type. Non-visible layers are
+ * discarded, and the resulting image is stripped of its alpha channel.
*
- * Since: 2.4
+ * Returns: (transfer none): The resulting layer.
**/
-gboolean
-gimp_image_remove_vectors (GimpImage *image,
- GimpVectors *vectors)
+GimpLayer *
+gimp_image_flatten (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ GimpLayer *layer = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
- GIMP_TYPE_VECTORS, vectors,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-remove-vectors",
+ "gimp-image-flatten",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-remove-vectors",
+ return_vals = gimp_run_procedure_array ("gimp-image-flatten",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ layer = g_value_get_object (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return layer;
}
/**
- * _gimp_image_remove_vectors: (skip)
- * @image_ID: The image.
- * @vectors_ID: The vectors object.
- *
- * Remove the specified path from the image.
+ * gimp_image_merge_visible_layers:
+ * @image: The image.
+ * @merge_type: The type of merge.
*
- * This procedure removes the specified path from the image. If the
- * path doesn't exist, an error is returned.
+ * Merge the visible image layers into one.
*
- * Returns: TRUE on success.
+ * This procedure combines the visible layers into a single layer using
+ * the specified merge type. A merge type of EXPAND_AS_NECESSARY
+ * expands the final layer to encompass the areas of the visible
+ * layers. A merge type of CLIP_TO_IMAGE clips the final layer to the
+ * extents of the image. A merge type of CLIP_TO_BOTTOM_LAYER clips the
+ * final layer to the size of the bottommost layer.
*
- * Since: 2.4
+ * Returns: (transfer none): The resulting layer.
**/
-gboolean
-_gimp_image_remove_vectors (gint32 image_ID,
- gint32 vectors_ID)
+GimpLayer *
+gimp_image_merge_visible_layers (GimpImage *image,
+ GimpMergeType merge_type)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ GimpLayer *layer = NULL;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_VECTORS, gimp_item_get_by_id (vectors_ID),
+ GIMP_TYPE_IMAGE, image,
+ GIMP_TYPE_MERGE_TYPE, merge_type,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-remove-vectors",
+ "gimp-image-merge-visible-layers",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-remove-vectors",
+ return_vals = gimp_run_procedure_array ("gimp-image-merge-visible-layers",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ layer = g_value_get_object (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return layer;
}
/**
- * gimp_image_freeze_vectors:
+ * gimp_image_merge_down:
* @image: The image.
+ * @merge_layer: The layer to merge down from.
+ * @merge_type: The type of merge.
*
- * Freeze the image's vectors list.
- *
- * This procedure freezes the vectors list of the image, suppressing
- * any updates to the Paths dialog in response to changes to the
- * image's vectors. This can significantly improve performance while
- * applying changes affecting the vectors list.
- *
- * Each call to gimp_image_freeze_vectors() should be matched by a
- * corresponding call to gimp_image_thaw_vectors(), undoing its
- * effects.
+ * Merge the layer passed and the first visible layer below.
*
- * Returns: TRUE on success.
+ * This procedure combines the passed layer and the first visible layer
+ * below it using the specified merge type. A merge type of
+ * EXPAND_AS_NECESSARY expands the final layer to encompass the areas
+ * of the visible layers. A merge type of CLIP_TO_IMAGE clips the final
+ * layer to the extents of the image. A merge type of
+ * CLIP_TO_BOTTOM_LAYER clips the final layer to the size of the
+ * bottommost layer.
*
- * Since: 2.10.2
+ * Returns: (transfer none): The resulting layer.
**/
-gboolean
-gimp_image_freeze_vectors (GimpImage *image)
+GimpLayer *
+gimp_image_merge_down (GimpImage *image,
+ GimpLayer *merge_layer,
+ GimpMergeType merge_type)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ GimpLayer *layer = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
+ GIMP_TYPE_LAYER, merge_layer,
+ GIMP_TYPE_MERGE_TYPE, merge_type,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-freeze-vectors",
+ "gimp-image-merge-down",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-freeze-vectors",
+ return_vals = gimp_run_procedure_array ("gimp-image-merge-down",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ layer = g_value_get_object (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return layer;
}
/**
- * _gimp_image_freeze_vectors: (skip)
- * @image_ID: The image.
+ * _gimp_image_get_colormap:
+ * @image: The image.
+ * @num_bytes: (out): Number of bytes in the colormap array.
*
- * Freeze the image's vectors list.
+ * Returns the image's colormap
*
- * This procedure freezes the vectors list of the image, suppressing
- * any updates to the Paths dialog in response to changes to the
- * image's vectors. This can significantly improve performance while
- * applying changes affecting the vectors list.
+ * This procedure returns an actual pointer to the image's colormap, as
+ * well as the number of bytes contained in the colormap. The actual
+ * number of colors in the transmitted colormap will be 'num-bytes' /
+ * 3. If the image is not in Indexed color mode, no colormap is
+ * returned.
*
- * Each call to gimp_image_freeze_vectors() should be matched by a
- * corresponding call to gimp_image_thaw_vectors(), undoing its
- * effects.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10.2
+ * Returns: (array length=num_bytes) (element-type guint8) (transfer full):
+ * The image's colormap.
+ * The returned value must be freed with g_free().
**/
-gboolean
-_gimp_image_freeze_vectors (gint32 image_ID)
+guint8 *
+_gimp_image_get_colormap (GimpImage *image,
+ gint *num_bytes)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ guint8 *colormap = NULL;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
+ GIMP_TYPE_IMAGE, image,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-freeze-vectors",
+ "gimp-image-get-colormap",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-freeze-vectors",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-colormap",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ *num_bytes = 0;
+
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ {
+ *num_bytes = g_value_get_int (gimp_value_array_index (return_vals, 1));
+ colormap = gimp_value_dup_uint8_array (gimp_value_array_index (return_vals, 2));
+ }
gimp_value_array_unref (return_vals);
- return success;
+ return colormap;
}
/**
- * gimp_image_thaw_vectors:
+ * _gimp_image_set_colormap:
* @image: The image.
+ * @num_bytes: Number of bytes in the colormap array.
+ * @colormap: (array length=num_bytes) (element-type guint8): The new colormap values.
*
- * Thaw the image's vectors list.
- *
- * This procedure thaws the vectors list of the image, re-enabling
- * updates to the Paths dialog.
+ * Sets the entries in the image's colormap.
*
- * This procedure should match a corresponding call to
- * gimp_image_freeze_vectors().
+ * This procedure sets the entries in the specified image's colormap.
+ * The number of entries is specified by the 'num-bytes' parameter and
+ * corresponds to the number of INT8 triples that must be contained in
+ * the 'colormap' array. The actual number of colors in the transmitted
+ * colormap is 'num-bytes' / 3.
*
* Returns: TRUE on success.
- *
- * Since: 2.10.2
**/
gboolean
-gimp_image_thaw_vectors (GimpImage *image)
+_gimp_image_set_colormap (GimpImage *image,
+ gint num_bytes,
+ const guint8 *colormap)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -2699,14 +2011,17 @@ gimp_image_thaw_vectors (GimpImage *image)
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
+ G_TYPE_INT, num_bytes,
+ GIMP_TYPE_UINT8_ARRAY, NULL,
G_TYPE_NONE);
+ gimp_value_set_uint8_array (gimp_value_array_index (args, 2), colormap, num_bytes);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-thaw-vectors",
+ "gimp-image-set-colormap",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-thaw-vectors",
+ return_vals = gimp_run_procedure_array ("gimp-image-set-colormap",
args);
gimp_value_array_unref (args);
@@ -2718,204 +2033,200 @@ gimp_image_thaw_vectors (GimpImage *image)
}
/**
- * _gimp_image_thaw_vectors: (skip)
- * @image_ID: The image.
- *
- * Thaw the image's vectors list.
- *
- * This procedure thaws the vectors list of the image, re-enabling
- * updates to the Paths dialog.
+ * _gimp_image_get_metadata:
+ * @image: The image.
*
- * This procedure should match a corresponding call to
- * gimp_image_freeze_vectors().
+ * Returns the image's metadata.
*
- * Returns: TRUE on success.
+ * Returns exif/iptc/xmp metadata from the image.
*
- * Since: 2.10.2
+ * Returns: (transfer full): The exif/ptc/xmp metadata as a string.
+ * The returned value must be freed with g_free().
**/
-gboolean
-_gimp_image_thaw_vectors (gint32 image_ID)
+gchar *
+_gimp_image_get_metadata (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ gchar *metadata_string = NULL;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
+ GIMP_TYPE_IMAGE, image,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-thaw-vectors",
+ "gimp-image-get-metadata",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-thaw-vectors",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-metadata",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ metadata_string = g_value_dup_string (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return metadata_string;
}
/**
- * gimp_image_get_item_position:
+ * _gimp_image_set_metadata:
* @image: The image.
- * @item: The item.
- *
- * Returns the position of the item in its level of its item tree.
+ * @metadata_string: The exif/ptc/xmp metadata as a string.
*
- * This procedure determines the position of the specified item in its
- * level in its item tree in the image. If the item doesn't exist in
- * the image, or the item is not part of an item tree, an error is
- * returned.
+ * Set the image's metadata.
*
- * Returns: The position of the item in its level in the item tree.
+ * Sets exif/iptc/xmp metadata on the image.
*
- * Since: 2.8
+ * Returns: TRUE on success.
**/
-gint
-gimp_image_get_item_position (GimpImage *image,
- GimpItem *item)
+gboolean
+_gimp_image_set_metadata (GimpImage *image,
+ const gchar *metadata_string)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gint position = 0;
+ gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
- GIMP_TYPE_ITEM, item,
+ G_TYPE_STRING, metadata_string,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-item-position",
+ "gimp-image-set-metadata",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-get-item-position",
+ return_vals = gimp_run_procedure_array ("gimp-image-set-metadata",
args);
gimp_value_array_unref (args);
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- position = g_value_get_int (gimp_value_array_index (return_vals, 1));
+ success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
- return position;
+ return success;
}
/**
- * _gimp_image_get_item_position: (skip)
- * @image_ID: The image.
- * @item_ID: The item.
- *
- * Returns the position of the item in its level of its item tree.
+ * gimp_image_clean_all:
+ * @image: The image.
*
- * This procedure determines the position of the specified item in its
- * level in its item tree in the image. If the item doesn't exist in
- * the image, or the item is not part of an item tree, an error is
- * returned.
+ * Set the image dirty count to 0.
*
- * Returns: The position of the item in its level in the item tree.
+ * This procedure sets the specified image's dirty count to 0, allowing
+ * operations to occur without having a 'dirtied' image. This is
+ * especially useful for creating and loading images which should not
+ * initially be considered dirty, even though layers must be created,
+ * filled, and installed in the image. Note that save plug-ins must NOT
+ * call this function themselves after saving the image.
*
- * Since: 2.8
+ * Returns: TRUE on success.
**/
-gint
-_gimp_image_get_item_position (gint32 image_ID,
- gint32 item_ID)
+gboolean
+gimp_image_clean_all (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gint position = 0;
+ gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
+ GIMP_TYPE_IMAGE, image,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-item-position",
+ "gimp-image-clean-all",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-get-item-position",
+ return_vals = gimp_run_procedure_array ("gimp-image-clean-all",
args);
gimp_value_array_unref (args);
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- position = g_value_get_int (gimp_value_array_index (return_vals, 1));
+ success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
- return position;
+ return success;
}
/**
- * gimp_image_raise_item:
+ * gimp_image_is_dirty:
* @image: The image.
- * @item: The item to raise.
- *
- * Raise the specified item in its level in its item tree
*
- * This procedure raises the specified item one step in the item tree.
- * The procedure call will fail if there is no item above it.
+ * Checks if the image has unsaved changes.
*
- * Returns: TRUE on success.
+ * This procedure checks the specified image's dirty count to see if it
+ * needs to be saved. Note that saving the image does not automatically
+ * set the dirty count to 0, you need to call gimp_image_clean_all()
+ * after calling a save procedure to make the image clean.
*
- * Since: 2.8
+ * Returns: TRUE if the image has unsaved changes.
**/
gboolean
-gimp_image_raise_item (GimpImage *image,
- GimpItem *item)
+gimp_image_is_dirty (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ gboolean dirty = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
- GIMP_TYPE_ITEM, item,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-raise-item",
+ "gimp-image-is-dirty",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-raise-item",
+ return_vals = gimp_run_procedure_array ("gimp-image-is-dirty",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ dirty = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return dirty;
}
/**
- * _gimp_image_raise_item: (skip)
- * @image_ID: The image.
- * @item_ID: The item to raise.
+ * _gimp_image_thumbnail:
+ * @image: The image.
+ * @width: The requested thumbnail width.
+ * @height: The requested thumbnail height.
+ * @actual_width: (out): The previews width.
+ * @actual_height: (out): The previews height.
+ * @bpp: (out): The previews bpp.
+ * @thumbnail_data_count: (out): The number of bytes in thumbnail data.
+ * @thumbnail_data: (out) (array length=thumbnail_data_count) (element-type guint8) (transfer full): The
thumbnail data.
*
- * Raise the specified item in its level in its item tree
+ * Get a thumbnail of an image.
*
- * This procedure raises the specified item one step in the item tree.
- * The procedure call will fail if there is no item above it.
+ * This function gets data from which a thumbnail of an image preview
+ * can be created. Maximum x or y dimension is 1024 pixels. The pixels
+ * are returned in RGB[A] or GRAY[A] format. The bpp return value gives
+ * the number of bits per pixel in the image.
*
* Returns: TRUE on success.
- *
- * Since: 2.8
**/
gboolean
-_gimp_image_raise_item (gint32 image_ID,
- gint32 item_ID)
+_gimp_image_thumbnail (GimpImage *image,
+ gint width,
+ gint height,
+ gint *actual_width,
+ gint *actual_height,
+ gint *bpp,
+ gint *thumbnail_data_count,
+ guint8 **thumbnail_data)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -2923,87 +2234,100 @@ _gimp_image_raise_item (gint32 image_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
+ GIMP_TYPE_IMAGE, image,
+ G_TYPE_INT, width,
+ G_TYPE_INT, height,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-raise-item",
+ "gimp-image-thumbnail",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-raise-item",
+ return_vals = gimp_run_procedure_array ("gimp-image-thumbnail",
args);
gimp_value_array_unref (args);
+ *actual_width = 0;
+ *actual_height = 0;
+ *bpp = 0;
+ *thumbnail_data_count = 0;
+ *thumbnail_data = NULL;
+
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (success)
+ {
+ *actual_width = g_value_get_int (gimp_value_array_index (return_vals, 1));
+ *actual_height = g_value_get_int (gimp_value_array_index (return_vals, 2));
+ *bpp = g_value_get_int (gimp_value_array_index (return_vals, 3));
+ *thumbnail_data_count = g_value_get_int (gimp_value_array_index (return_vals, 4));
+ *thumbnail_data = gimp_value_dup_uint8_array (gimp_value_array_index (return_vals, 5));
+ }
+
gimp_value_array_unref (return_vals);
return success;
}
/**
- * gimp_image_lower_item:
+ * gimp_image_get_active_layer:
* @image: The image.
- * @item: The item to lower.
- *
- * Lower the specified item in its level in its item tree
*
- * This procedure lowers the specified item one step in the item tree.
- * The procedure call will fail if there is no item below it.
+ * Returns the specified image's active layer.
*
- * Returns: TRUE on success.
+ * If there is an active layer, its ID will be returned, otherwise, -1.
+ * If a channel is currently active, then no layer will be. If a layer
+ * mask is active, then this will return the associated layer.
*
- * Since: 2.8
+ * Returns: (transfer none): The active layer.
**/
-gboolean
-gimp_image_lower_item (GimpImage *image,
- GimpItem *item)
+GimpLayer *
+gimp_image_get_active_layer (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ GimpLayer *active_layer = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
- GIMP_TYPE_ITEM, item,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-lower-item",
+ "gimp-image-get-active-layer",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-lower-item",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-active-layer",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ active_layer = g_value_get_object (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return active_layer;
}
/**
- * _gimp_image_lower_item: (skip)
- * @image_ID: The image.
- * @item_ID: The item to lower.
+ * gimp_image_set_active_layer:
+ * @image: The image.
+ * @active_layer: The new image active layer.
*
- * Lower the specified item in its level in its item tree
+ * Sets the specified image's active layer.
*
- * This procedure lowers the specified item one step in the item tree.
- * The procedure call will fail if there is no item below it.
+ * If the layer exists, it is set as the active layer in the image. Any
+ * previous active layer or channel is set to inactive. An exception is
+ * a previously existing floating selection, in which case this
+ * procedure will return an execution error.
*
* Returns: TRUE on success.
- *
- * Since: 2.8
**/
gboolean
-_gimp_image_lower_item (gint32 image_ID,
- gint32 item_ID)
+gimp_image_set_active_layer (GimpImage *image,
+ GimpLayer *active_layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -3011,16 +2335,16 @@ _gimp_image_lower_item (gint32 image_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
+ GIMP_TYPE_IMAGE, image,
+ GIMP_TYPE_LAYER, active_layer,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-lower-item",
+ "gimp-image-set-active-layer",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-lower-item",
+ return_vals = gimp_run_procedure_array ("gimp-image-set-active-layer",
args);
gimp_value_array_unref (args);
@@ -3032,66 +2356,62 @@ _gimp_image_lower_item (gint32 image_ID,
}
/**
- * gimp_image_raise_item_to_top:
+ * gimp_image_get_active_channel:
* @image: The image.
- * @item: The item to raise to top.
- *
- * Raise the specified item to the top of its level in its item tree
*
- * This procedure raises the specified item to top of its level in the
- * item tree. It will not move the item if there is no item above it.
+ * Returns the specified image's active channel.
*
- * Returns: TRUE on success.
+ * If there is an active channel, this will return the channel ID,
+ * otherwise, -1.
*
- * Since: 2.8
+ * Returns: (transfer none): The active channel.
**/
-gboolean
-gimp_image_raise_item_to_top (GimpImage *image,
- GimpItem *item)
+GimpChannel *
+gimp_image_get_active_channel (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ GimpChannel *active_channel = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
- GIMP_TYPE_ITEM, item,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-raise-item-to-top",
+ "gimp-image-get-active-channel",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-raise-item-to-top",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-active-channel",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ active_channel = g_value_get_object (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return active_channel;
}
/**
- * _gimp_image_raise_item_to_top: (skip)
- * @image_ID: The image.
- * @item_ID: The item to raise to top.
+ * gimp_image_set_active_channel:
+ * @image: The image.
+ * @active_channel: The new image active channel.
*
- * Raise the specified item to the top of its level in its item tree
+ * Sets the specified image's active channel.
*
- * This procedure raises the specified item to top of its level in the
- * item tree. It will not move the item if there is no item above it.
+ * If the channel exists, it is set as the active channel in the image.
+ * Any previous active channel or layer is set to inactive. An
+ * exception is a previously existing floating selection, in which case
+ * this procedure will return an execution error.
*
* Returns: TRUE on success.
- *
- * Since: 2.8
**/
gboolean
-_gimp_image_raise_item_to_top (gint32 image_ID,
- gint32 item_ID)
+gimp_image_set_active_channel (GimpImage *image,
+ GimpChannel *active_channel)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -3099,16 +2419,16 @@ _gimp_image_raise_item_to_top (gint32 image_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
+ GIMP_TYPE_IMAGE, image,
+ GIMP_TYPE_CHANNEL, active_channel,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-raise-item-to-top",
+ "gimp-image-set-active-channel",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-raise-item-to-top",
+ return_vals = gimp_run_procedure_array ("gimp-image-set-active-channel",
args);
gimp_value_array_unref (args);
@@ -3120,68 +2440,58 @@ _gimp_image_raise_item_to_top (gint32 image_ID,
}
/**
- * gimp_image_lower_item_to_bottom:
+ * gimp_image_get_active_vectors:
* @image: The image.
- * @item: The item to lower to bottom.
*
- * Lower the specified item to the bottom of its level in its item tree
- *
- * This procedure lowers the specified item to bottom of its level in
- * the item tree. It will not move the layer if there is no layer below
- * it.
+ * Returns the specified image's active vectors.
*
- * Returns: TRUE on success.
+ * If there is an active path, its ID will be returned, otherwise, -1.
*
- * Since: 2.8
+ * Returns: (transfer none): The active vectors.
**/
-gboolean
-gimp_image_lower_item_to_bottom (GimpImage *image,
- GimpItem *item)
+GimpVectors *
+gimp_image_get_active_vectors (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ GimpVectors *active_vectors = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
- GIMP_TYPE_ITEM, item,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-lower-item-to-bottom",
+ "gimp-image-get-active-vectors",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-lower-item-to-bottom",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-active-vectors",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ active_vectors = g_value_get_object (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return active_vectors;
}
/**
- * _gimp_image_lower_item_to_bottom: (skip)
- * @image_ID: The image.
- * @item_ID: The item to lower to bottom.
+ * gimp_image_set_active_vectors:
+ * @image: The image.
+ * @active_vectors: The new image active vectors.
*
- * Lower the specified item to the bottom of its level in its item tree
+ * Sets the specified image's active vectors.
*
- * This procedure lowers the specified item to bottom of its level in
- * the item tree. It will not move the layer if there is no layer below
- * it.
+ * If the path exists, it is set as the active path in the image.
*
* Returns: TRUE on success.
- *
- * Since: 2.8
**/
gboolean
-_gimp_image_lower_item_to_bottom (gint32 image_ID,
- gint32 item_ID)
+gimp_image_set_active_vectors (GimpImage *image,
+ GimpVectors *active_vectors)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -3189,16 +2499,16 @@ _gimp_image_lower_item_to_bottom (gint32 image_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
+ GIMP_TYPE_IMAGE, image,
+ GIMP_TYPE_VECTORS, active_vectors,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-lower-item-to-bottom",
+ "gimp-image-set-active-vectors",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-lower-item-to-bottom",
+ return_vals = gimp_run_procedure_array ("gimp-image-set-active-vectors",
args);
gimp_value_array_unref (args);
@@ -3210,408 +2520,385 @@ _gimp_image_lower_item_to_bottom (gint32 image_ID,
}
/**
- * gimp_image_reorder_item:
+ * gimp_image_get_selection:
* @image: The image.
- * @item: The item to reorder.
- * @parent: (nullable): The new parent item.
- * @position: The new position of the item.
- *
- * Reorder the specified item within its item tree
*
- * This procedure reorders the specified item within its item tree.
+ * Returns the specified image's selection.
*
- * Returns: TRUE on success.
+ * This will always return a valid ID for a selection -- which is
+ * represented as a channel internally.
*
- * Since: 2.8
+ * Returns: (transfer none): The selection channel.
**/
-gboolean
-gimp_image_reorder_item (GimpImage *image,
- GimpItem *item,
- GimpItem *parent,
- gint position)
+GimpSelection *
+gimp_image_get_selection (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ GimpSelection *selection = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
- GIMP_TYPE_ITEM, item,
- GIMP_TYPE_ITEM, parent,
- G_TYPE_INT, position,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-reorder-item",
+ "gimp-image-get-selection",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-reorder-item",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-selection",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ selection = g_value_get_object (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return selection;
}
/**
- * _gimp_image_reorder_item: (skip)
- * @image_ID: The image.
- * @item_ID: The item to reorder.
- * @parent_ID: (nullable): The new parent item.
- * @position: The new position of the item.
- *
- * Reorder the specified item within its item tree
+ * gimp_image_get_component_active:
+ * @image: The image.
+ * @component: The image component.
*
- * This procedure reorders the specified item within its item tree.
+ * Returns if the specified image's image component is active.
*
- * Returns: TRUE on success.
+ * This procedure returns if the specified image's image component
+ * (i.e. Red, Green, Blue intensity channels in an RGB image) is active
+ * or inactive -- whether or not it can be modified. If the specified
+ * component is not valid for the image type, an error is returned.
*
- * Since: 2.8
+ * Returns: Component is active.
**/
gboolean
-_gimp_image_reorder_item (gint32 image_ID,
- gint32 item_ID,
- gint32 parent_ID,
- gint position)
+gimp_image_get_component_active (GimpImage *image,
+ GimpChannelType component)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ gboolean active = FALSE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- GIMP_TYPE_ITEM, gimp_item_get_by_id (parent_ID),
- G_TYPE_INT, position,
+ GIMP_TYPE_IMAGE, image,
+ GIMP_TYPE_CHANNEL_TYPE, component,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-reorder-item",
+ "gimp-image-get-component-active",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-reorder-item",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-component-active",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ active = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return active;
}
/**
- * gimp_image_flatten:
+ * gimp_image_set_component_active:
* @image: The image.
+ * @component: The image component.
+ * @active: Component is active.
*
- * Flatten all visible layers into a single layer. Discard all
- * invisible layers.
+ * Sets if the specified image's image component is active.
*
- * This procedure combines the visible layers in a manner analogous to
- * merging with the CLIP_TO_IMAGE merge type. Non-visible layers are
- * discarded, and the resulting image is stripped of its alpha channel.
+ * This procedure sets if the specified image's image component (i.e.
+ * Red, Green, Blue intensity channels in an RGB image) is active or
+ * inactive -- whether or not it can be modified. If the specified
+ * component is not valid for the image type, an error is returned.
*
- * Returns: (transfer none): The resulting layer.
+ * Returns: TRUE on success.
**/
-GimpLayer *
-gimp_image_flatten (GimpImage *image)
+gboolean
+gimp_image_set_component_active (GimpImage *image,
+ GimpChannelType component,
+ gboolean active)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- GimpLayer *layer = NULL;
+ gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
+ GIMP_TYPE_CHANNEL_TYPE, component,
+ G_TYPE_BOOLEAN, active,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-flatten",
+ "gimp-image-set-component-active",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-flatten",
+ return_vals = gimp_run_procedure_array ("gimp-image-set-component-active",
args);
gimp_value_array_unref (args);
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- layer = g_value_get_object (gimp_value_array_index (return_vals, 1));
+ success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
- return layer;
+ return success;
}
/**
- * _gimp_image_flatten: (skip)
- * @image_ID: The image.
+ * gimp_image_get_component_visible:
+ * @image: The image.
+ * @component: The image component.
*
- * Flatten all visible layers into a single layer. Discard all
- * invisible layers.
+ * Returns if the specified image's image component is visible.
*
- * This procedure combines the visible layers in a manner analogous to
- * merging with the CLIP_TO_IMAGE merge type. Non-visible layers are
- * discarded, and the resulting image is stripped of its alpha channel.
+ * This procedure returns if the specified image's image component
+ * (i.e. Red, Green, Blue intensity channels in an RGB image) is
+ * visible or invisible -- whether or not it can be seen. If the
+ * specified component is not valid for the image type, an error is
+ * returned.
*
- * Returns: The resulting layer.
+ * Returns: Component is visible.
**/
-gint32
-_gimp_image_flatten (gint32 image_ID)
+gboolean
+gimp_image_get_component_visible (GimpImage *image,
+ GimpChannelType component)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gint32 layer_ID = -1;
+ gboolean visible = FALSE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
+ GIMP_TYPE_IMAGE, image,
+ GIMP_TYPE_CHANNEL_TYPE, component,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-flatten",
+ "gimp-image-get-component-visible",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-flatten",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-component-visible",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- layer_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
+ visible = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return layer_ID;
+ return visible;
}
/**
- * gimp_image_merge_visible_layers:
+ * gimp_image_set_component_visible:
* @image: The image.
- * @merge_type: The type of merge.
+ * @component: The image component.
+ * @visible: Component is visible.
*
- * Merge the visible image layers into one.
+ * Sets if the specified image's image component is visible.
*
- * This procedure combines the visible layers into a single layer using
- * the specified merge type. A merge type of EXPAND_AS_NECESSARY
- * expands the final layer to encompass the areas of the visible
- * layers. A merge type of CLIP_TO_IMAGE clips the final layer to the
- * extents of the image. A merge type of CLIP_TO_BOTTOM_LAYER clips the
- * final layer to the size of the bottommost layer.
+ * This procedure sets if the specified image's image component (i.e.
+ * Red, Green, Blue intensity channels in an RGB image) is visible or
+ * invisible -- whether or not it can be seen. If the specified
+ * component is not valid for the image type, an error is returned.
*
- * Returns: (transfer none): The resulting layer.
+ * Returns: TRUE on success.
**/
-GimpLayer *
-gimp_image_merge_visible_layers (GimpImage *image,
- GimpMergeType merge_type)
+gboolean
+gimp_image_set_component_visible (GimpImage *image,
+ GimpChannelType component,
+ gboolean visible)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- GimpLayer *layer = NULL;
+ gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
- GIMP_TYPE_MERGE_TYPE, merge_type,
+ GIMP_TYPE_CHANNEL_TYPE, component,
+ G_TYPE_BOOLEAN, visible,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-merge-visible-layers",
+ "gimp-image-set-component-visible",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-merge-visible-layers",
+ return_vals = gimp_run_procedure_array ("gimp-image-set-component-visible",
args);
gimp_value_array_unref (args);
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- layer = g_value_get_object (gimp_value_array_index (return_vals, 1));
+ success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
- return layer;
+ return success;
}
/**
- * _gimp_image_merge_visible_layers: (skip)
- * @image_ID: The image.
- * @merge_type: The type of merge.
+ * gimp_image_get_filename:
+ * @image: The image.
*
- * Merge the visible image layers into one.
+ * Returns the specified image's filename.
*
- * This procedure combines the visible layers into a single layer using
- * the specified merge type. A merge type of EXPAND_AS_NECESSARY
- * expands the final layer to encompass the areas of the visible
- * layers. A merge type of CLIP_TO_IMAGE clips the final layer to the
- * extents of the image. A merge type of CLIP_TO_BOTTOM_LAYER clips the
- * final layer to the size of the bottommost layer.
+ * This procedure returns the specified image's filename in the
+ * filesystem encoding. The image has a filename only if it was loaded
+ * or imported from a file or has since been saved or exported.
+ * Otherwise, this function returns %NULL. See also
+ * gimp_image_get_uri().
*
- * Returns: The resulting layer.
+ * Returns: (transfer full): The filename.
+ * The returned value must be freed with g_free().
**/
-gint32
-_gimp_image_merge_visible_layers (gint32 image_ID,
- GimpMergeType merge_type)
+gchar *
+gimp_image_get_filename (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gint32 layer_ID = -1;
+ gchar *filename = NULL;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_MERGE_TYPE, merge_type,
+ GIMP_TYPE_IMAGE, image,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-merge-visible-layers",
+ "gimp-image-get-filename",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-merge-visible-layers",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-filename",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- layer_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
+ filename = g_value_dup_string (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return layer_ID;
+ return filename;
}
/**
- * gimp_image_merge_down:
+ * gimp_image_set_filename:
* @image: The image.
- * @merge_layer: The layer to merge down from.
- * @merge_type: The type of merge.
+ * @filename: The new image filename.
*
- * Merge the layer passed and the first visible layer below.
+ * Sets the specified image's filename.
*
- * This procedure combines the passed layer and the first visible layer
- * below it using the specified merge type. A merge type of
- * EXPAND_AS_NECESSARY expands the final layer to encompass the areas
- * of the visible layers. A merge type of CLIP_TO_IMAGE clips the final
- * layer to the extents of the image. A merge type of
- * CLIP_TO_BOTTOM_LAYER clips the final layer to the size of the
- * bottommost layer.
+ * This procedure sets the specified image's filename. The filename
+ * should be in the filesystem encoding.
*
- * Returns: (transfer none): The resulting layer.
+ * Returns: TRUE on success.
**/
-GimpLayer *
-gimp_image_merge_down (GimpImage *image,
- GimpLayer *merge_layer,
- GimpMergeType merge_type)
+gboolean
+gimp_image_set_filename (GimpImage *image,
+ const gchar *filename)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- GimpLayer *layer = NULL;
+ gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
- GIMP_TYPE_LAYER, merge_layer,
- GIMP_TYPE_MERGE_TYPE, merge_type,
+ G_TYPE_STRING, filename,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-merge-down",
+ "gimp-image-set-filename",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-merge-down",
+ return_vals = gimp_run_procedure_array ("gimp-image-set-filename",
args);
gimp_value_array_unref (args);
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- layer = g_value_get_object (gimp_value_array_index (return_vals, 1));
+ success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
- return layer;
+ return success;
}
/**
- * _gimp_image_merge_down: (skip)
- * @image_ID: The image.
- * @merge_layer_ID: The layer to merge down from.
- * @merge_type: The type of merge.
+ * gimp_image_get_uri:
+ * @image: The image.
*
- * Merge the layer passed and the first visible layer below.
+ * Returns the URI for the specified image.
*
- * This procedure combines the passed layer and the first visible layer
- * below it using the specified merge type. A merge type of
- * EXPAND_AS_NECESSARY expands the final layer to encompass the areas
- * of the visible layers. A merge type of CLIP_TO_IMAGE clips the final
- * layer to the extents of the image. A merge type of
- * CLIP_TO_BOTTOM_LAYER clips the final layer to the size of the
- * bottommost layer.
+ * This procedure returns the URI associated with the specified image.
+ * The image has an URI only if it was loaded or imported from a file
+ * or has since been saved or exported. Otherwise, this function
+ * returns %NULL. See also gimp-image-get-imported-uri to get the URI
+ * of the current file if it was imported from a non-GIMP file format
+ * and not yet saved, or gimp-image-get-exported-uri if the image has
+ * been exported to a non-GIMP file format.
+ *
+ * Returns: (transfer full): The URI.
+ * The returned value must be freed with g_free().
*
- * Returns: The resulting layer.
+ * Since: 2.8
**/
-gint32
-_gimp_image_merge_down (gint32 image_ID,
- gint32 merge_layer_ID,
- GimpMergeType merge_type)
+gchar *
+gimp_image_get_uri (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gint32 layer_ID = -1;
+ gchar *uri = NULL;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_LAYER, gimp_item_get_by_id (merge_layer_ID),
- GIMP_TYPE_MERGE_TYPE, merge_type,
+ GIMP_TYPE_IMAGE, image,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-merge-down",
+ "gimp-image-get-uri",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-merge-down",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-uri",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- layer_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
+ uri = g_value_dup_string (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return layer_ID;
+ return uri;
}
/**
- * _gimp_image_get_colormap:
+ * gimp_image_get_xcf_uri:
* @image: The image.
- * @num_bytes: (out): Number of bytes in the colormap array.
*
- * Returns the image's colormap
+ * Returns the XCF URI for the specified image.
*
- * This procedure returns an actual pointer to the image's colormap, as
- * well as the number of bytes contained in the colormap. The actual
- * number of colors in the transmitted colormap will be 'num-bytes' /
- * 3. If the image is not in Indexed color mode, no colormap is
- * returned.
+ * This procedure returns the XCF URI associated with the image. If
+ * there is no such URI, this procedure returns %NULL.
*
- * Returns: (array length=num_bytes) (element-type guint8) (transfer full):
- * The image's colormap.
+ * Returns: (transfer full): The imported URI.
* The returned value must be freed with g_free().
+ *
+ * Since: 2.8
**/
-guint8 *
-_gimp_image_get_colormap (GimpImage *image,
- gint *num_bytes)
+gchar *
+gimp_image_get_xcf_uri (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- guint8 *colormap = NULL;
+ gchar *uri = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
@@ -3619,93 +2906,88 @@ _gimp_image_get_colormap (GimpImage *image,
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-colormap",
+ "gimp-image-get-xcf-uri",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-get-colormap",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-xcf-uri",
args);
gimp_value_array_unref (args);
- *num_bytes = 0;
-
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- {
- *num_bytes = g_value_get_int (gimp_value_array_index (return_vals, 1));
- colormap = gimp_value_dup_uint8_array (gimp_value_array_index (return_vals, 2));
- }
+ uri = g_value_dup_string (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return colormap;
+ return uri;
}
/**
- * _gimp_image_set_colormap:
+ * gimp_image_get_imported_uri:
* @image: The image.
- * @num_bytes: Number of bytes in the colormap array.
- * @colormap: (array length=num_bytes) (element-type guint8): The new colormap values.
*
- * Sets the entries in the image's colormap.
+ * Returns the imported URI for the specified image.
*
- * This procedure sets the entries in the specified image's colormap.
- * The number of entries is specified by the 'num-bytes' parameter and
- * corresponds to the number of INT8 triples that must be contained in
- * the 'colormap' array. The actual number of colors in the transmitted
- * colormap is 'num-bytes' / 3.
+ * This procedure returns the URI associated with the specified image
+ * if the image was imported from a non-native Gimp format. If the
+ * image was not imported, or has since been saved in the native Gimp
+ * format, this procedure returns %NULL.
*
- * Returns: TRUE on success.
+ * Returns: (transfer full): The imported URI.
+ * The returned value must be freed with g_free().
+ *
+ * Since: 2.8
**/
-gboolean
-_gimp_image_set_colormap (GimpImage *image,
- gint num_bytes,
- const guint8 *colormap)
+gchar *
+gimp_image_get_imported_uri (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ gchar *uri = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
- G_TYPE_INT, num_bytes,
- GIMP_TYPE_UINT8_ARRAY, NULL,
G_TYPE_NONE);
- gimp_value_set_uint8_array (gimp_value_array_index (args, 2), colormap, num_bytes);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-set-colormap",
+ "gimp-image-get-imported-uri",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-set-colormap",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-imported-uri",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ uri = g_value_dup_string (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return uri;
}
/**
- * _gimp_image_get_metadata:
+ * gimp_image_get_exported_uri:
* @image: The image.
*
- * Returns the image's metadata.
+ * Returns the exported URI for the specified image.
*
- * Returns exif/iptc/xmp metadata from the image.
+ * This procedure returns the URI associated with the specified image
+ * if the image was exported a non-native GIMP format. If the image was
+ * not exported, this procedure returns %NULL.
*
- * Returns: (transfer full): The exif/ptc/xmp metadata as a string.
+ * Returns: (transfer full): The exported URI.
* The returned value must be freed with g_free().
+ *
+ * Since: 2.8
**/
gchar *
-_gimp_image_get_metadata (GimpImage *image)
+gimp_image_get_exported_uri (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gchar *metadata_string = NULL;
+ gchar *uri = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
@@ -3713,2801 +2995,403 @@ _gimp_image_get_metadata (GimpImage *image)
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-metadata",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-metadata",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- metadata_string = g_value_dup_string (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return metadata_string;
-}
-
-/**
- * _gimp_image_set_metadata:
- * @image: The image.
- * @metadata_string: The exif/ptc/xmp metadata as a string.
- *
- * Set the image's metadata.
- *
- * Sets exif/iptc/xmp metadata on the image.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_set_metadata (GimpImage *image,
- const gchar *metadata_string)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_STRING, metadata_string,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-set-metadata",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-set-metadata",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_image_clean_all:
- * @image: The image.
- *
- * Set the image dirty count to 0.
- *
- * This procedure sets the specified image's dirty count to 0, allowing
- * operations to occur without having a 'dirtied' image. This is
- * especially useful for creating and loading images which should not
- * initially be considered dirty, even though layers must be created,
- * filled, and installed in the image. Note that save plug-ins must NOT
- * call this function themselves after saving the image.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_image_clean_all (GimpImage *image)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-clean-all",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-clean-all",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_image_clean_all: (skip)
- * @image_ID: The image.
- *
- * Set the image dirty count to 0.
- *
- * This procedure sets the specified image's dirty count to 0, allowing
- * operations to occur without having a 'dirtied' image. This is
- * especially useful for creating and loading images which should not
- * initially be considered dirty, even though layers must be created,
- * filled, and installed in the image. Note that save plug-ins must NOT
- * call this function themselves after saving the image.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_clean_all (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-clean-all",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-clean-all",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_image_is_dirty:
- * @image: The image.
- *
- * Checks if the image has unsaved changes.
- *
- * This procedure checks the specified image's dirty count to see if it
- * needs to be saved. Note that saving the image does not automatically
- * set the dirty count to 0, you need to call gimp_image_clean_all()
- * after calling a save procedure to make the image clean.
- *
- * Returns: TRUE if the image has unsaved changes.
- **/
-gboolean
-gimp_image_is_dirty (GimpImage *image)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean dirty = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-is-dirty",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-is-dirty",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- dirty = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return dirty;
-}
-
-/**
- * _gimp_image_is_dirty: (skip)
- * @image_ID: The image.
- *
- * Checks if the image has unsaved changes.
- *
- * This procedure checks the specified image's dirty count to see if it
- * needs to be saved. Note that saving the image does not automatically
- * set the dirty count to 0, you need to call gimp_image_clean_all()
- * after calling a save procedure to make the image clean.
- *
- * Returns: TRUE if the image has unsaved changes.
- **/
-gboolean
-_gimp_image_is_dirty (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean dirty = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-is-dirty",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-is-dirty",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- dirty = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return dirty;
-}
-
-/**
- * _gimp_image_thumbnail:
- * @image: The image.
- * @width: The requested thumbnail width.
- * @height: The requested thumbnail height.
- * @actual_width: (out): The previews width.
- * @actual_height: (out): The previews height.
- * @bpp: (out): The previews bpp.
- * @thumbnail_data_count: (out): The number of bytes in thumbnail data.
- * @thumbnail_data: (out) (array length=thumbnail_data_count) (element-type guint8) (transfer full): The
thumbnail data.
- *
- * Get a thumbnail of an image.
- *
- * This function gets data from which a thumbnail of an image preview
- * can be created. Maximum x or y dimension is 1024 pixels. The pixels
- * are returned in RGB[A] or GRAY[A] format. The bpp return value gives
- * the number of bits per pixel in the image.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_thumbnail (GimpImage *image,
- gint width,
- gint height,
- gint *actual_width,
- gint *actual_height,
- gint *bpp,
- gint *thumbnail_data_count,
- guint8 **thumbnail_data)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_INT, width,
- G_TYPE_INT, height,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-thumbnail",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-thumbnail",
- args);
- gimp_value_array_unref (args);
-
- *actual_width = 0;
- *actual_height = 0;
- *bpp = 0;
- *thumbnail_data_count = 0;
- *thumbnail_data = NULL;
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- if (success)
- {
- *actual_width = g_value_get_int (gimp_value_array_index (return_vals, 1));
- *actual_height = g_value_get_int (gimp_value_array_index (return_vals, 2));
- *bpp = g_value_get_int (gimp_value_array_index (return_vals, 3));
- *thumbnail_data_count = g_value_get_int (gimp_value_array_index (return_vals, 4));
- *thumbnail_data = gimp_value_dup_uint8_array (gimp_value_array_index (return_vals, 5));
- }
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_image_get_active_layer:
- * @image: The image.
- *
- * Returns the specified image's active layer.
- *
- * If there is an active layer, its ID will be returned, otherwise, -1.
- * If a channel is currently active, then no layer will be. If a layer
- * mask is active, then this will return the associated layer.
- *
- * Returns: (transfer none): The active layer.
- **/
-GimpLayer *
-gimp_image_get_active_layer (GimpImage *image)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- GimpLayer *active_layer = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-active-layer",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-active-layer",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- active_layer = g_value_get_object (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return active_layer;
-}
-
-/**
- * _gimp_image_get_active_layer: (skip)
- * @image_ID: The image.
- *
- * Returns the specified image's active layer.
- *
- * If there is an active layer, its ID will be returned, otherwise, -1.
- * If a channel is currently active, then no layer will be. If a layer
- * mask is active, then this will return the associated layer.
- *
- * Returns: The active layer.
- **/
-gint32
-_gimp_image_get_active_layer (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 active_layer_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-active-layer",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-active-layer",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- active_layer_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return active_layer_ID;
-}
-
-/**
- * gimp_image_set_active_layer:
- * @image: The image.
- * @active_layer: The new image active layer.
- *
- * Sets the specified image's active layer.
- *
- * If the layer exists, it is set as the active layer in the image. Any
- * previous active layer or channel is set to inactive. An exception is
- * a previously existing floating selection, in which case this
- * procedure will return an execution error.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_image_set_active_layer (GimpImage *image,
- GimpLayer *active_layer)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- GIMP_TYPE_LAYER, active_layer,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-set-active-layer",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-set-active-layer",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_image_set_active_layer: (skip)
- * @image_ID: The image.
- * @active_layer_ID: The new image active layer.
- *
- * Sets the specified image's active layer.
- *
- * If the layer exists, it is set as the active layer in the image. Any
- * previous active layer or channel is set to inactive. An exception is
- * a previously existing floating selection, in which case this
- * procedure will return an execution error.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_set_active_layer (gint32 image_ID,
- gint32 active_layer_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_LAYER, gimp_item_get_by_id (active_layer_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-set-active-layer",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-set-active-layer",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_image_get_active_channel:
- * @image: The image.
- *
- * Returns the specified image's active channel.
- *
- * If there is an active channel, this will return the channel ID,
- * otherwise, -1.
- *
- * Returns: (transfer none): The active channel.
- **/
-GimpChannel *
-gimp_image_get_active_channel (GimpImage *image)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- GimpChannel *active_channel = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-active-channel",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-active-channel",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- active_channel = g_value_get_object (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return active_channel;
-}
-
-/**
- * _gimp_image_get_active_channel: (skip)
- * @image_ID: The image.
- *
- * Returns the specified image's active channel.
- *
- * If there is an active channel, this will return the channel ID,
- * otherwise, -1.
- *
- * Returns: The active channel.
- **/
-gint32
-_gimp_image_get_active_channel (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 active_channel_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-active-channel",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-active-channel",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- active_channel_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return active_channel_ID;
-}
-
-/**
- * gimp_image_set_active_channel:
- * @image: The image.
- * @active_channel: The new image active channel.
- *
- * Sets the specified image's active channel.
- *
- * If the channel exists, it is set as the active channel in the image.
- * Any previous active channel or layer is set to inactive. An
- * exception is a previously existing floating selection, in which case
- * this procedure will return an execution error.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_image_set_active_channel (GimpImage *image,
- GimpChannel *active_channel)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- GIMP_TYPE_CHANNEL, active_channel,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-set-active-channel",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-set-active-channel",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_image_set_active_channel: (skip)
- * @image_ID: The image.
- * @active_channel_ID: The new image active channel.
- *
- * Sets the specified image's active channel.
- *
- * If the channel exists, it is set as the active channel in the image.
- * Any previous active channel or layer is set to inactive. An
- * exception is a previously existing floating selection, in which case
- * this procedure will return an execution error.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_set_active_channel (gint32 image_ID,
- gint32 active_channel_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_CHANNEL, gimp_item_get_by_id (active_channel_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-set-active-channel",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-set-active-channel",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_image_get_active_vectors:
- * @image: The image.
- *
- * Returns the specified image's active vectors.
- *
- * If there is an active path, its ID will be returned, otherwise, -1.
- *
- * Returns: (transfer none): The active vectors.
- **/
-GimpVectors *
-gimp_image_get_active_vectors (GimpImage *image)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- GimpVectors *active_vectors = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-active-vectors",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-active-vectors",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- active_vectors = g_value_get_object (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return active_vectors;
-}
-
-/**
- * _gimp_image_get_active_vectors: (skip)
- * @image_ID: The image.
- *
- * Returns the specified image's active vectors.
- *
- * If there is an active path, its ID will be returned, otherwise, -1.
- *
- * Returns: The active vectors.
- **/
-gint32
-_gimp_image_get_active_vectors (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 active_vectors_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-active-vectors",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-active-vectors",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- active_vectors_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return active_vectors_ID;
-}
-
-/**
- * gimp_image_set_active_vectors:
- * @image: The image.
- * @active_vectors: The new image active vectors.
- *
- * Sets the specified image's active vectors.
- *
- * If the path exists, it is set as the active path in the image.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_image_set_active_vectors (GimpImage *image,
- GimpVectors *active_vectors)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- GIMP_TYPE_VECTORS, active_vectors,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-set-active-vectors",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-set-active-vectors",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_image_set_active_vectors: (skip)
- * @image_ID: The image.
- * @active_vectors_ID: The new image active vectors.
- *
- * Sets the specified image's active vectors.
- *
- * If the path exists, it is set as the active path in the image.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_set_active_vectors (gint32 image_ID,
- gint32 active_vectors_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_VECTORS, gimp_item_get_by_id (active_vectors_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-set-active-vectors",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-set-active-vectors",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_image_get_selection:
- * @image: The image.
- *
- * Returns the specified image's selection.
- *
- * This will always return a valid ID for a selection -- which is
- * represented as a channel internally.
- *
- * Returns: (transfer none): The selection channel.
- **/
-GimpSelection *
-gimp_image_get_selection (GimpImage *image)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- GimpSelection *selection = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-selection",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-selection",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- selection = g_value_get_object (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return selection;
-}
-
-/**
- * _gimp_image_get_selection: (skip)
- * @image_ID: The image.
- *
- * Returns the specified image's selection.
- *
- * This will always return a valid ID for a selection -- which is
- * represented as a channel internally.
- *
- * Returns: The selection channel.
- **/
-gint32
-_gimp_image_get_selection (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 selection_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-selection",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-selection",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- selection_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return selection_ID;
-}
-
-/**
- * gimp_image_get_component_active:
- * @image: The image.
- * @component: The image component.
- *
- * Returns if the specified image's image component is active.
- *
- * This procedure returns if the specified image's image component
- * (i.e. Red, Green, Blue intensity channels in an RGB image) is active
- * or inactive -- whether or not it can be modified. If the specified
- * component is not valid for the image type, an error is returned.
- *
- * Returns: Component is active.
- **/
-gboolean
-gimp_image_get_component_active (GimpImage *image,
- GimpChannelType component)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean active = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- GIMP_TYPE_CHANNEL_TYPE, component,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-component-active",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-component-active",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- active = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return active;
-}
-
-/**
- * _gimp_image_get_component_active: (skip)
- * @image_ID: The image.
- * @component: The image component.
- *
- * Returns if the specified image's image component is active.
- *
- * This procedure returns if the specified image's image component
- * (i.e. Red, Green, Blue intensity channels in an RGB image) is active
- * or inactive -- whether or not it can be modified. If the specified
- * component is not valid for the image type, an error is returned.
- *
- * Returns: Component is active.
- **/
-gboolean
-_gimp_image_get_component_active (gint32 image_ID,
- GimpChannelType component)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean active = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_CHANNEL_TYPE, component,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-component-active",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-component-active",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- active = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return active;
-}
-
-/**
- * gimp_image_set_component_active:
- * @image: The image.
- * @component: The image component.
- * @active: Component is active.
- *
- * Sets if the specified image's image component is active.
- *
- * This procedure sets if the specified image's image component (i.e.
- * Red, Green, Blue intensity channels in an RGB image) is active or
- * inactive -- whether or not it can be modified. If the specified
- * component is not valid for the image type, an error is returned.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_image_set_component_active (GimpImage *image,
- GimpChannelType component,
- gboolean active)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- GIMP_TYPE_CHANNEL_TYPE, component,
- G_TYPE_BOOLEAN, active,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-set-component-active",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-set-component-active",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_image_set_component_active: (skip)
- * @image_ID: The image.
- * @component: The image component.
- * @active: Component is active.
- *
- * Sets if the specified image's image component is active.
- *
- * This procedure sets if the specified image's image component (i.e.
- * Red, Green, Blue intensity channels in an RGB image) is active or
- * inactive -- whether or not it can be modified. If the specified
- * component is not valid for the image type, an error is returned.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_set_component_active (gint32 image_ID,
- GimpChannelType component,
- gboolean active)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_CHANNEL_TYPE, component,
- G_TYPE_BOOLEAN, active,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-set-component-active",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-set-component-active",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_image_get_component_visible:
- * @image: The image.
- * @component: The image component.
- *
- * Returns if the specified image's image component is visible.
- *
- * This procedure returns if the specified image's image component
- * (i.e. Red, Green, Blue intensity channels in an RGB image) is
- * visible or invisible -- whether or not it can be seen. If the
- * specified component is not valid for the image type, an error is
- * returned.
- *
- * Returns: Component is visible.
- **/
-gboolean
-gimp_image_get_component_visible (GimpImage *image,
- GimpChannelType component)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean visible = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- GIMP_TYPE_CHANNEL_TYPE, component,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-component-visible",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-component-visible",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- visible = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return visible;
-}
-
-/**
- * _gimp_image_get_component_visible: (skip)
- * @image_ID: The image.
- * @component: The image component.
- *
- * Returns if the specified image's image component is visible.
- *
- * This procedure returns if the specified image's image component
- * (i.e. Red, Green, Blue intensity channels in an RGB image) is
- * visible or invisible -- whether or not it can be seen. If the
- * specified component is not valid for the image type, an error is
- * returned.
- *
- * Returns: Component is visible.
- **/
-gboolean
-_gimp_image_get_component_visible (gint32 image_ID,
- GimpChannelType component)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean visible = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_CHANNEL_TYPE, component,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-component-visible",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-component-visible",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- visible = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return visible;
-}
-
-/**
- * gimp_image_set_component_visible:
- * @image: The image.
- * @component: The image component.
- * @visible: Component is visible.
- *
- * Sets if the specified image's image component is visible.
- *
- * This procedure sets if the specified image's image component (i.e.
- * Red, Green, Blue intensity channels in an RGB image) is visible or
- * invisible -- whether or not it can be seen. If the specified
- * component is not valid for the image type, an error is returned.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_image_set_component_visible (GimpImage *image,
- GimpChannelType component,
- gboolean visible)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- GIMP_TYPE_CHANNEL_TYPE, component,
- G_TYPE_BOOLEAN, visible,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-set-component-visible",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-set-component-visible",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_image_set_component_visible: (skip)
- * @image_ID: The image.
- * @component: The image component.
- * @visible: Component is visible.
- *
- * Sets if the specified image's image component is visible.
- *
- * This procedure sets if the specified image's image component (i.e.
- * Red, Green, Blue intensity channels in an RGB image) is visible or
- * invisible -- whether or not it can be seen. If the specified
- * component is not valid for the image type, an error is returned.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_set_component_visible (gint32 image_ID,
- GimpChannelType component,
- gboolean visible)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_CHANNEL_TYPE, component,
- G_TYPE_BOOLEAN, visible,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-set-component-visible",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-set-component-visible",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_image_get_filename:
- * @image: The image.
- *
- * Returns the specified image's filename.
- *
- * This procedure returns the specified image's filename in the
- * filesystem encoding. The image has a filename only if it was loaded
- * or imported from a file or has since been saved or exported.
- * Otherwise, this function returns %NULL. See also
- * gimp_image_get_uri().
- *
- * Returns: (transfer full): The filename.
- * The returned value must be freed with g_free().
- **/
-gchar *
-gimp_image_get_filename (GimpImage *image)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gchar *filename = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-filename",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-filename",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- filename = g_value_dup_string (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return filename;
-}
-
-/**
- * _gimp_image_get_filename: (skip)
- * @image_ID: The image.
- *
- * Returns the specified image's filename.
- *
- * This procedure returns the specified image's filename in the
- * filesystem encoding. The image has a filename only if it was loaded
- * or imported from a file or has since been saved or exported.
- * Otherwise, this function returns %NULL. See also
- * gimp_image_get_uri().
- *
- * Returns: The filename.
- * The returned value must be freed with g_free().
- **/
-gchar *
-_gimp_image_get_filename (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gchar *filename = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-filename",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-filename",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- filename = g_value_dup_string (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return filename;
-}
-
-/**
- * gimp_image_set_filename:
- * @image: The image.
- * @filename: The new image filename.
- *
- * Sets the specified image's filename.
- *
- * This procedure sets the specified image's filename. The filename
- * should be in the filesystem encoding.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_image_set_filename (GimpImage *image,
- const gchar *filename)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_STRING, filename,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-set-filename",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-set-filename",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_image_set_filename: (skip)
- * @image_ID: The image.
- * @filename: The new image filename.
- *
- * Sets the specified image's filename.
- *
- * This procedure sets the specified image's filename. The filename
- * should be in the filesystem encoding.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_set_filename (gint32 image_ID,
- const gchar *filename)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_STRING, filename,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-set-filename",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-set-filename",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_image_get_uri:
- * @image: The image.
- *
- * Returns the URI for the specified image.
- *
- * This procedure returns the URI associated with the specified image.
- * The image has an URI only if it was loaded or imported from a file
- * or has since been saved or exported. Otherwise, this function
- * returns %NULL. See also gimp-image-get-imported-uri to get the URI
- * of the current file if it was imported from a non-GIMP file format
- * and not yet saved, or gimp-image-get-exported-uri if the image has
- * been exported to a non-GIMP file format.
- *
- * Returns: (transfer full): The URI.
- * The returned value must be freed with g_free().
- *
- * Since: 2.8
- **/
-gchar *
-gimp_image_get_uri (GimpImage *image)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gchar *uri = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-uri",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-uri",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- uri = g_value_dup_string (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return uri;
-}
-
-/**
- * _gimp_image_get_uri: (skip)
- * @image_ID: The image.
- *
- * Returns the URI for the specified image.
- *
- * This procedure returns the URI associated with the specified image.
- * The image has an URI only if it was loaded or imported from a file
- * or has since been saved or exported. Otherwise, this function
- * returns %NULL. See also gimp-image-get-imported-uri to get the URI
- * of the current file if it was imported from a non-GIMP file format
- * and not yet saved, or gimp-image-get-exported-uri if the image has
- * been exported to a non-GIMP file format.
- *
- * Returns: The URI.
- * The returned value must be freed with g_free().
- *
- * Since: 2.8
- **/
-gchar *
-_gimp_image_get_uri (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gchar *uri = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-uri",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-uri",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- uri = g_value_dup_string (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return uri;
-}
-
-/**
- * gimp_image_get_xcf_uri:
- * @image: The image.
- *
- * Returns the XCF URI for the specified image.
- *
- * This procedure returns the XCF URI associated with the image. If
- * there is no such URI, this procedure returns %NULL.
- *
- * Returns: (transfer full): The imported URI.
- * The returned value must be freed with g_free().
- *
- * Since: 2.8
- **/
-gchar *
-gimp_image_get_xcf_uri (GimpImage *image)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gchar *uri = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-xcf-uri",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-xcf-uri",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- uri = g_value_dup_string (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return uri;
-}
-
-/**
- * _gimp_image_get_xcf_uri: (skip)
- * @image_ID: The image.
- *
- * Returns the XCF URI for the specified image.
- *
- * This procedure returns the XCF URI associated with the image. If
- * there is no such URI, this procedure returns %NULL.
- *
- * Returns: The imported URI.
- * The returned value must be freed with g_free().
- *
- * Since: 2.8
- **/
-gchar *
-_gimp_image_get_xcf_uri (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gchar *uri = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-xcf-uri",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-xcf-uri",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- uri = g_value_dup_string (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return uri;
-}
-
-/**
- * gimp_image_get_imported_uri:
- * @image: The image.
- *
- * Returns the imported URI for the specified image.
- *
- * This procedure returns the URI associated with the specified image
- * if the image was imported from a non-native Gimp format. If the
- * image was not imported, or has since been saved in the native Gimp
- * format, this procedure returns %NULL.
- *
- * Returns: (transfer full): The imported URI.
- * The returned value must be freed with g_free().
- *
- * Since: 2.8
- **/
-gchar *
-gimp_image_get_imported_uri (GimpImage *image)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gchar *uri = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-imported-uri",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-imported-uri",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- uri = g_value_dup_string (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return uri;
-}
-
-/**
- * _gimp_image_get_imported_uri: (skip)
- * @image_ID: The image.
- *
- * Returns the imported URI for the specified image.
- *
- * This procedure returns the URI associated with the specified image
- * if the image was imported from a non-native Gimp format. If the
- * image was not imported, or has since been saved in the native Gimp
- * format, this procedure returns %NULL.
- *
- * Returns: The imported URI.
- * The returned value must be freed with g_free().
- *
- * Since: 2.8
- **/
-gchar *
-_gimp_image_get_imported_uri (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gchar *uri = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-imported-uri",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-imported-uri",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- uri = g_value_dup_string (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return uri;
-}
-
-/**
- * gimp_image_get_exported_uri:
- * @image: The image.
- *
- * Returns the exported URI for the specified image.
- *
- * This procedure returns the URI associated with the specified image
- * if the image was exported a non-native GIMP format. If the image was
- * not exported, this procedure returns %NULL.
- *
- * Returns: (transfer full): The exported URI.
- * The returned value must be freed with g_free().
- *
- * Since: 2.8
- **/
-gchar *
-gimp_image_get_exported_uri (GimpImage *image)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gchar *uri = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-exported-uri",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-exported-uri",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- uri = g_value_dup_string (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return uri;
-}
-
-/**
- * _gimp_image_get_exported_uri: (skip)
- * @image_ID: The image.
- *
- * Returns the exported URI for the specified image.
- *
- * This procedure returns the URI associated with the specified image
- * if the image was exported a non-native GIMP format. If the image was
- * not exported, this procedure returns %NULL.
- *
- * Returns: The exported URI.
- * The returned value must be freed with g_free().
- *
- * Since: 2.8
- **/
-gchar *
-_gimp_image_get_exported_uri (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gchar *uri = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-exported-uri",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-exported-uri",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- uri = g_value_dup_string (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return uri;
-}
-
-/**
- * gimp_image_get_name:
- * @image: The image.
- *
- * Returns the specified image's name.
- *
- * This procedure returns the image's name. If the image has a filename
- * or an URI, then the returned name contains the filename's or URI's
- * base name (the last component of the path). Otherwise it is the
- * translated string \"Untitled\". The returned name is formatted like
- * the image name in the image window title, it may contain '[]',
- * '(imported)' etc. and should only be used to label user interface
- * elements. Never use it to construct filenames.
- *
- * Returns: (transfer full): The name.
- * The returned value must be freed with g_free().
- **/
-gchar *
-gimp_image_get_name (GimpImage *image)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gchar *name = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-name",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-name",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- name = g_value_dup_string (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return name;
-}
-
-/**
- * _gimp_image_get_name: (skip)
- * @image_ID: The image.
- *
- * Returns the specified image's name.
- *
- * This procedure returns the image's name. If the image has a filename
- * or an URI, then the returned name contains the filename's or URI's
- * base name (the last component of the path). Otherwise it is the
- * translated string \"Untitled\". The returned name is formatted like
- * the image name in the image window title, it may contain '[]',
- * '(imported)' etc. and should only be used to label user interface
- * elements. Never use it to construct filenames.
- *
- * Returns: The name.
- * The returned value must be freed with g_free().
- **/
-gchar *
-_gimp_image_get_name (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gchar *name = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-name",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-name",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- name = g_value_dup_string (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return name;
-}
-
-/**
- * gimp_image_get_resolution:
- * @image: The image.
- * @xresolution: (out): The resolution in the x-axis, in dots per inch.
- * @yresolution: (out): The resolution in the y-axis, in dots per inch.
- *
- * Returns the specified image's resolution.
- *
- * This procedure returns the specified image's resolution in dots per
- * inch. This value is independent of any of the layers in this image.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_image_get_resolution (GimpImage *image,
- gdouble *xresolution,
- gdouble *yresolution)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-resolution",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-resolution",
- args);
- gimp_value_array_unref (args);
-
- *xresolution = 0.0;
- *yresolution = 0.0;
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- if (success)
- {
- *xresolution = g_value_get_double (gimp_value_array_index (return_vals, 1));
- *yresolution = g_value_get_double (gimp_value_array_index (return_vals, 2));
- }
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_image_get_resolution: (skip)
- * @image_ID: The image.
- * @xresolution: (out): The resolution in the x-axis, in dots per inch.
- * @yresolution: (out): The resolution in the y-axis, in dots per inch.
- *
- * Returns the specified image's resolution.
- *
- * This procedure returns the specified image's resolution in dots per
- * inch. This value is independent of any of the layers in this image.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_get_resolution (gint32 image_ID,
- gdouble *xresolution,
- gdouble *yresolution)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-resolution",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-resolution",
- args);
- gimp_value_array_unref (args);
-
- *xresolution = 0.0;
- *yresolution = 0.0;
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- if (success)
- {
- *xresolution = g_value_get_double (gimp_value_array_index (return_vals, 1));
- *yresolution = g_value_get_double (gimp_value_array_index (return_vals, 2));
- }
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_image_set_resolution:
- * @image: The image.
- * @xresolution: The new image resolution in the x-axis, in dots per inch.
- * @yresolution: The new image resolution in the y-axis, in dots per inch.
- *
- * Sets the specified image's resolution.
- *
- * This procedure sets the specified image's resolution in dots per
- * inch. This value is independent of any of the layers in this image.
- * No scaling or resizing is performed.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_image_set_resolution (GimpImage *image,
- gdouble xresolution,
- gdouble yresolution)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_DOUBLE, xresolution,
- G_TYPE_DOUBLE, yresolution,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-set-resolution",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-set-resolution",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_image_set_resolution: (skip)
- * @image_ID: The image.
- * @xresolution: The new image resolution in the x-axis, in dots per inch.
- * @yresolution: The new image resolution in the y-axis, in dots per inch.
- *
- * Sets the specified image's resolution.
- *
- * This procedure sets the specified image's resolution in dots per
- * inch. This value is independent of any of the layers in this image.
- * No scaling or resizing is performed.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_set_resolution (gint32 image_ID,
- gdouble xresolution,
- gdouble yresolution)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_DOUBLE, xresolution,
- G_TYPE_DOUBLE, yresolution,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-set-resolution",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-set-resolution",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_image_get_unit:
- * @image: The image.
- *
- * Returns the specified image's unit.
- *
- * This procedure returns the specified image's unit. This value is
- * independent of any of the layers in this image. See the
- * gimp_unit_*() procedure definitions for the valid range of unit IDs
- * and a description of the unit system.
- *
- * Returns: (transfer none): The unit.
- **/
-GimpUnit
-gimp_image_get_unit (GimpImage *image)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- GimpUnit unit = GIMP_UNIT_PIXEL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-unit",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-unit",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- unit = g_value_get_int (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return unit;
-}
-
-/**
- * _gimp_image_get_unit: (skip)
- * @image_ID: The image.
- *
- * Returns the specified image's unit.
- *
- * This procedure returns the specified image's unit. This value is
- * independent of any of the layers in this image. See the
- * gimp_unit_*() procedure definitions for the valid range of unit IDs
- * and a description of the unit system.
- *
- * Returns: The unit.
- **/
-GimpUnit
-_gimp_image_get_unit (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- GimpUnit unit = GIMP_UNIT_PIXEL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-unit",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-unit",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- unit = g_value_get_int (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return unit;
-}
-
-/**
- * gimp_image_set_unit:
- * @image: The image.
- * @unit: The new image unit.
- *
- * Sets the specified image's unit.
- *
- * This procedure sets the specified image's unit. No scaling or
- * resizing is performed. This value is independent of any of the
- * layers in this image. See the gimp_unit_*() procedure definitions
- * for the valid range of unit IDs and a description of the unit
- * system.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_image_set_unit (GimpImage *image,
- GimpUnit unit)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- GIMP_TYPE_UNIT, unit,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-set-unit",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-set-unit",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_image_set_unit: (skip)
- * @image_ID: The image.
- * @unit: The new image unit.
- *
- * Sets the specified image's unit.
- *
- * This procedure sets the specified image's unit. No scaling or
- * resizing is performed. This value is independent of any of the
- * layers in this image. See the gimp_unit_*() procedure definitions
- * for the valid range of unit IDs and a description of the unit
- * system.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_set_unit (gint32 image_ID,
- GimpUnit unit)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_UNIT, unit,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-set-unit",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-set-unit",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_image_get_tattoo_state:
- * @image: The image.
- *
- * Returns the tattoo state associated with the image.
- *
- * This procedure returns the tattoo state of the image. Use only by
- * save/load plug-ins that wish to preserve an images tattoo state.
- * Using this function at other times will produce unexpected results.
- *
- * Returns: The tattoo state.
- **/
-guint
-gimp_image_get_tattoo_state (GimpImage *image)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- guint tattoo_state = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-tattoo-state",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-tattoo-state",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- tattoo_state = g_value_get_uint (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return tattoo_state;
-}
-
-/**
- * _gimp_image_get_tattoo_state: (skip)
- * @image_ID: The image.
- *
- * Returns the tattoo state associated with the image.
- *
- * This procedure returns the tattoo state of the image. Use only by
- * save/load plug-ins that wish to preserve an images tattoo state.
- * Using this function at other times will produce unexpected results.
- *
- * Returns: The tattoo state.
- **/
-guint
-_gimp_image_get_tattoo_state (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- guint tattoo_state = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-tattoo-state",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-tattoo-state",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- tattoo_state = g_value_get_uint (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return tattoo_state;
-}
-
-/**
- * gimp_image_set_tattoo_state:
- * @image: The image.
- * @tattoo_state: The new image tattoo state.
- *
- * Set the tattoo state associated with the image.
- *
- * This procedure sets the tattoo state of the image. Use only by
- * save/load plug-ins that wish to preserve an images tattoo state.
- * Using this function at other times will produce unexpected results.
- * A full check of uniqueness of states in layers, channels and paths
- * will be performed by this procedure and a execution failure will be
- * returned if this fails. A failure will also be returned if the new
- * tattoo state value is less than the maximum tattoo value from all of
- * the tattoos from the paths, layers and channels. After the image
- * data has been loaded and all the tattoos have been set then this is
- * the last procedure that should be called. If effectively does a
- * status check on the tattoo values that have been set to make sure
- * that all is OK.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_image_set_tattoo_state (GimpImage *image,
- guint tattoo_state)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_UINT, tattoo_state,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-set-tattoo-state",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-set-tattoo-state",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_image_set_tattoo_state: (skip)
- * @image_ID: The image.
- * @tattoo_state: The new image tattoo state.
- *
- * Set the tattoo state associated with the image.
- *
- * This procedure sets the tattoo state of the image. Use only by
- * save/load plug-ins that wish to preserve an images tattoo state.
- * Using this function at other times will produce unexpected results.
- * A full check of uniqueness of states in layers, channels and paths
- * will be performed by this procedure and a execution failure will be
- * returned if this fails. A failure will also be returned if the new
- * tattoo state value is less than the maximum tattoo value from all of
- * the tattoos from the paths, layers and channels. After the image
- * data has been loaded and all the tattoos have been set then this is
- * the last procedure that should be called. If effectively does a
- * status check on the tattoo values that have been set to make sure
- * that all is OK.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_set_tattoo_state (gint32 image_ID,
- guint tattoo_state)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_UINT, tattoo_state,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-set-tattoo-state",
+ "gimp-image-get-exported-uri",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-set-tattoo-state",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-exported-uri",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ uri = g_value_dup_string (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return uri;
}
/**
- * gimp_image_get_layer_by_tattoo:
+ * gimp_image_get_name:
* @image: The image.
- * @tattoo: The tattoo of the layer to find.
*
- * Find a layer with a given tattoo in an image.
+ * Returns the specified image's name.
*
- * This procedure returns the layer with the given tattoo in the
- * specified image.
+ * This procedure returns the image's name. If the image has a filename
+ * or an URI, then the returned name contains the filename's or URI's
+ * base name (the last component of the path). Otherwise it is the
+ * translated string \"Untitled\". The returned name is formatted like
+ * the image name in the image window title, it may contain '[]',
+ * '(imported)' etc. and should only be used to label user interface
+ * elements. Never use it to construct filenames.
*
- * Returns: (transfer none): The layer with the specified tattoo.
+ * Returns: (transfer full): The name.
+ * The returned value must be freed with g_free().
**/
-GimpLayer *
-gimp_image_get_layer_by_tattoo (GimpImage *image,
- guint tattoo)
+gchar *
+gimp_image_get_name (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- GimpLayer *layer = NULL;
+ gchar *name = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
- G_TYPE_UINT, tattoo,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-layer-by-tattoo",
+ "gimp-image-get-name",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-get-layer-by-tattoo",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-name",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- layer = g_value_get_object (gimp_value_array_index (return_vals, 1));
+ name = g_value_dup_string (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return layer;
+ return name;
}
/**
- * _gimp_image_get_layer_by_tattoo: (skip)
- * @image_ID: The image.
- * @tattoo: The tattoo of the layer to find.
+ * gimp_image_get_resolution:
+ * @image: The image.
+ * @xresolution: (out): The resolution in the x-axis, in dots per inch.
+ * @yresolution: (out): The resolution in the y-axis, in dots per inch.
*
- * Find a layer with a given tattoo in an image.
+ * Returns the specified image's resolution.
*
- * This procedure returns the layer with the given tattoo in the
- * specified image.
+ * This procedure returns the specified image's resolution in dots per
+ * inch. This value is independent of any of the layers in this image.
*
- * Returns: The layer with the specified tattoo.
+ * Returns: TRUE on success.
**/
-gint32
-_gimp_image_get_layer_by_tattoo (gint32 image_ID,
- guint tattoo)
+gboolean
+gimp_image_get_resolution (GimpImage *image,
+ gdouble *xresolution,
+ gdouble *yresolution)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gint32 layer_ID = -1;
+ gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_UINT, tattoo,
+ GIMP_TYPE_IMAGE, image,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-layer-by-tattoo",
+ "gimp-image-get-resolution",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-get-layer-by-tattoo",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-resolution",
args);
gimp_value_array_unref (args);
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- layer_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
+ *xresolution = 0.0;
+ *yresolution = 0.0;
+
+ success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+
+ if (success)
+ {
+ *xresolution = g_value_get_double (gimp_value_array_index (return_vals, 1));
+ *yresolution = g_value_get_double (gimp_value_array_index (return_vals, 2));
+ }
gimp_value_array_unref (return_vals);
- return layer_ID;
+ return success;
}
/**
- * gimp_image_get_channel_by_tattoo:
+ * gimp_image_set_resolution:
* @image: The image.
- * @tattoo: The tattoo of the channel to find.
+ * @xresolution: The new image resolution in the x-axis, in dots per inch.
+ * @yresolution: The new image resolution in the y-axis, in dots per inch.
*
- * Find a channel with a given tattoo in an image.
+ * Sets the specified image's resolution.
*
- * This procedure returns the channel with the given tattoo in the
- * specified image.
+ * This procedure sets the specified image's resolution in dots per
+ * inch. This value is independent of any of the layers in this image.
+ * No scaling or resizing is performed.
*
- * Returns: (transfer none): The channel with the specified tattoo.
+ * Returns: TRUE on success.
**/
-GimpChannel *
-gimp_image_get_channel_by_tattoo (GimpImage *image,
- guint tattoo)
+gboolean
+gimp_image_set_resolution (GimpImage *image,
+ gdouble xresolution,
+ gdouble yresolution)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- GimpChannel *channel = NULL;
+ gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
- G_TYPE_UINT, tattoo,
+ G_TYPE_DOUBLE, xresolution,
+ G_TYPE_DOUBLE, yresolution,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-channel-by-tattoo",
+ "gimp-image-set-resolution",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-get-channel-by-tattoo",
+ return_vals = gimp_run_procedure_array ("gimp-image-set-resolution",
args);
gimp_value_array_unref (args);
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- channel = g_value_get_object (gimp_value_array_index (return_vals, 1));
+ success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
- return channel;
+ return success;
}
/**
- * _gimp_image_get_channel_by_tattoo: (skip)
- * @image_ID: The image.
- * @tattoo: The tattoo of the channel to find.
+ * gimp_image_get_unit:
+ * @image: The image.
*
- * Find a channel with a given tattoo in an image.
+ * Returns the specified image's unit.
*
- * This procedure returns the channel with the given tattoo in the
- * specified image.
+ * This procedure returns the specified image's unit. This value is
+ * independent of any of the layers in this image. See the
+ * gimp_unit_*() procedure definitions for the valid range of unit IDs
+ * and a description of the unit system.
*
- * Returns: The channel with the specified tattoo.
+ * Returns: (transfer none): The unit.
**/
-gint32
-_gimp_image_get_channel_by_tattoo (gint32 image_ID,
- guint tattoo)
+GimpUnit
+gimp_image_get_unit (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gint32 channel_ID = -1;
+ GimpUnit unit = GIMP_UNIT_PIXEL;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_UINT, tattoo,
+ GIMP_TYPE_IMAGE, image,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-channel-by-tattoo",
+ "gimp-image-get-unit",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-get-channel-by-tattoo",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-unit",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- channel_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
+ unit = g_value_get_int (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return channel_ID;
+ return unit;
}
/**
- * gimp_image_get_vectors_by_tattoo:
+ * gimp_image_set_unit:
* @image: The image.
- * @tattoo: The tattoo of the vectors to find.
- *
- * Find a vectors with a given tattoo in an image.
+ * @unit: The new image unit.
*
- * This procedure returns the vectors with the given tattoo in the
- * specified image.
+ * Sets the specified image's unit.
*
- * Returns: (transfer none): The vectors with the specified tattoo.
+ * This procedure sets the specified image's unit. No scaling or
+ * resizing is performed. This value is independent of any of the
+ * layers in this image. See the gimp_unit_*() procedure definitions
+ * for the valid range of unit IDs and a description of the unit
+ * system.
*
- * Since: 2.6
+ * Returns: TRUE on success.
**/
-GimpVectors *
-gimp_image_get_vectors_by_tattoo (GimpImage *image,
- guint tattoo)
+gboolean
+gimp_image_set_unit (GimpImage *image,
+ GimpUnit unit)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- GimpVectors *vectors = NULL;
+ gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
- G_TYPE_UINT, tattoo,
+ GIMP_TYPE_UNIT, unit,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-vectors-by-tattoo",
+ "gimp-image-set-unit",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-get-vectors-by-tattoo",
+ return_vals = gimp_run_procedure_array ("gimp-image-set-unit",
args);
gimp_value_array_unref (args);
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- vectors = g_value_get_object (gimp_value_array_index (return_vals, 1));
+ success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
- return vectors;
+ return success;
}
/**
- * _gimp_image_get_vectors_by_tattoo: (skip)
- * @image_ID: The image.
- * @tattoo: The tattoo of the vectors to find.
- *
- * Find a vectors with a given tattoo in an image.
+ * gimp_image_get_tattoo_state:
+ * @image: The image.
*
- * This procedure returns the vectors with the given tattoo in the
- * specified image.
+ * Returns the tattoo state associated with the image.
*
- * Returns: The vectors with the specified tattoo.
+ * This procedure returns the tattoo state of the image. Use only by
+ * save/load plug-ins that wish to preserve an images tattoo state.
+ * Using this function at other times will produce unexpected results.
*
- * Since: 2.6
+ * Returns: The tattoo state.
**/
-gint32
-_gimp_image_get_vectors_by_tattoo (gint32 image_ID,
- guint tattoo)
+guint
+gimp_image_get_tattoo_state (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gint32 vectors_ID = -1;
+ guint tattoo_state = 0;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_UINT, tattoo,
+ GIMP_TYPE_IMAGE, image,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-vectors-by-tattoo",
+ "gimp-image-get-tattoo-state",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-get-vectors-by-tattoo",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-tattoo-state",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- vectors_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
+ tattoo_state = g_value_get_uint (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return vectors_ID;
+ return tattoo_state;
}
/**
- * gimp_image_get_layer_by_name:
+ * gimp_image_set_tattoo_state:
* @image: The image.
- * @name: The name of the layer to find.
- *
- * Find a layer with a given name in an image.
+ * @tattoo_state: The new image tattoo state.
*
- * This procedure returns the layer with the given name in the
- * specified image.
+ * Set the tattoo state associated with the image.
*
- * Returns: (transfer none): The layer with the specified name.
+ * This procedure sets the tattoo state of the image. Use only by
+ * save/load plug-ins that wish to preserve an images tattoo state.
+ * Using this function at other times will produce unexpected results.
+ * A full check of uniqueness of states in layers, channels and paths
+ * will be performed by this procedure and a execution failure will be
+ * returned if this fails. A failure will also be returned if the new
+ * tattoo state value is less than the maximum tattoo value from all of
+ * the tattoos from the paths, layers and channels. After the image
+ * data has been loaded and all the tattoos have been set then this is
+ * the last procedure that should be called. If effectively does a
+ * status check on the tattoo values that have been set to make sure
+ * that all is OK.
*
- * Since: 2.8
+ * Returns: TRUE on success.
**/
-GimpLayer *
-gimp_image_get_layer_by_name (GimpImage *image,
- const gchar *name)
+gboolean
+gimp_image_set_tattoo_state (GimpImage *image,
+ guint tattoo_state)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- GimpLayer *layer = NULL;
+ gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
- G_TYPE_STRING, name,
+ G_TYPE_UINT, tattoo_state,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-layer-by-name",
+ "gimp-image-set-tattoo-state",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-get-layer-by-name",
+ return_vals = gimp_run_procedure_array ("gimp-image-set-tattoo-state",
args);
gimp_value_array_unref (args);
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- layer = g_value_get_object (gimp_value_array_index (return_vals, 1));
+ success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
- return layer;
+ return success;
}
/**
- * _gimp_image_get_layer_by_name: (skip)
- * @image_ID: The image.
- * @name: The name of the layer to find.
+ * gimp_image_get_layer_by_tattoo:
+ * @image: The image.
+ * @tattoo: The tattoo of the layer to find.
*
- * Find a layer with a given name in an image.
+ * Find a layer with a given tattoo in an image.
*
- * This procedure returns the layer with the given name in the
+ * This procedure returns the layer with the given tattoo in the
* specified image.
*
- * Returns: The layer with the specified name.
- *
- * Since: 2.8
+ * Returns: (transfer none): The layer with the specified tattoo.
**/
-gint32
-_gimp_image_get_layer_by_name (gint32 image_ID,
- const gchar *name)
+GimpLayer *
+gimp_image_get_layer_by_tattoo (GimpImage *image,
+ guint tattoo)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gint32 layer_ID = -1;
+ GimpLayer *layer = NULL;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_STRING, name,
+ GIMP_TYPE_IMAGE, image,
+ G_TYPE_UINT, tattoo,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-layer-by-name",
+ "gimp-image-get-layer-by-tattoo",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-get-layer-by-name",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-layer-by-tattoo",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- layer_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
+ layer = g_value_get_object (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return layer_ID;
+ return layer;
}
/**
- * gimp_image_get_channel_by_name:
+ * gimp_image_get_channel_by_tattoo:
* @image: The image.
- * @name: The name of the channel to find.
+ * @tattoo: The tattoo of the channel to find.
*
- * Find a channel with a given name in an image.
+ * Find a channel with a given tattoo in an image.
*
- * This procedure returns the channel with the given name in the
+ * This procedure returns the channel with the given tattoo in the
* specified image.
*
- * Returns: (transfer none): The channel with the specified name.
- *
- * Since: 2.8
+ * Returns: (transfer none): The channel with the specified tattoo.
**/
GimpChannel *
-gimp_image_get_channel_by_name (GimpImage *image,
- const gchar *name)
+gimp_image_get_channel_by_tattoo (GimpImage *image,
+ guint tattoo)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -6516,15 +3400,15 @@ gimp_image_get_channel_by_name (GimpImage *image,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
- G_TYPE_STRING, name,
+ G_TYPE_UINT, tattoo,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-channel-by-name",
+ "gimp-image-get-channel-by-tattoo",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-get-channel-by-name",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-channel-by-tattoo",
args);
gimp_value_array_unref (args);
@@ -6537,72 +3421,72 @@ gimp_image_get_channel_by_name (GimpImage *image,
}
/**
- * _gimp_image_get_channel_by_name: (skip)
- * @image_ID: The image.
- * @name: The name of the channel to find.
+ * gimp_image_get_vectors_by_tattoo:
+ * @image: The image.
+ * @tattoo: The tattoo of the vectors to find.
*
- * Find a channel with a given name in an image.
+ * Find a vectors with a given tattoo in an image.
*
- * This procedure returns the channel with the given name in the
+ * This procedure returns the vectors with the given tattoo in the
* specified image.
*
- * Returns: The channel with the specified name.
+ * Returns: (transfer none): The vectors with the specified tattoo.
*
- * Since: 2.8
+ * Since: 2.6
**/
-gint32
-_gimp_image_get_channel_by_name (gint32 image_ID,
- const gchar *name)
+GimpVectors *
+gimp_image_get_vectors_by_tattoo (GimpImage *image,
+ guint tattoo)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gint32 channel_ID = -1;
+ GimpVectors *vectors = NULL;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_STRING, name,
+ GIMP_TYPE_IMAGE, image,
+ G_TYPE_UINT, tattoo,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-channel-by-name",
+ "gimp-image-get-vectors-by-tattoo",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-get-channel-by-name",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-vectors-by-tattoo",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- channel_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
+ vectors = g_value_get_object (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return channel_ID;
+ return vectors;
}
/**
- * gimp_image_get_vectors_by_name:
+ * gimp_image_get_layer_by_name:
* @image: The image.
- * @name: The name of the vectors to find.
+ * @name: The name of the layer to find.
*
- * Find a vectors with a given name in an image.
+ * Find a layer with a given name in an image.
*
- * This procedure returns the vectors with the given name in the
+ * This procedure returns the layer with the given name in the
* specified image.
*
- * Returns: (transfer none): The vectors with the specified name.
+ * Returns: (transfer none): The layer with the specified name.
*
* Since: 2.8
**/
-GimpVectors *
-gimp_image_get_vectors_by_name (GimpImage *image,
- const gchar *name)
+GimpLayer *
+gimp_image_get_layer_by_name (GimpImage *image,
+ const gchar *name)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- GimpVectors *vectors = NULL;
+ GimpLayer *layer = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
@@ -6611,113 +3495,114 @@ gimp_image_get_vectors_by_name (GimpImage *image,
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-vectors-by-name",
+ "gimp-image-get-layer-by-name",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-get-vectors-by-name",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-layer-by-name",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- vectors = g_value_get_object (gimp_value_array_index (return_vals, 1));
+ layer = g_value_get_object (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return vectors;
+ return layer;
}
/**
- * _gimp_image_get_vectors_by_name: (skip)
- * @image_ID: The image.
- * @name: The name of the vectors to find.
+ * gimp_image_get_channel_by_name:
+ * @image: The image.
+ * @name: The name of the channel to find.
*
- * Find a vectors with a given name in an image.
+ * Find a channel with a given name in an image.
*
- * This procedure returns the vectors with the given name in the
+ * This procedure returns the channel with the given name in the
* specified image.
*
- * Returns: The vectors with the specified name.
+ * Returns: (transfer none): The channel with the specified name.
*
* Since: 2.8
**/
-gint32
-_gimp_image_get_vectors_by_name (gint32 image_ID,
- const gchar *name)
+GimpChannel *
+gimp_image_get_channel_by_name (GimpImage *image,
+ const gchar *name)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gint32 vectors_ID = -1;
+ GimpChannel *channel = NULL;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
+ GIMP_TYPE_IMAGE, image,
G_TYPE_STRING, name,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-vectors-by-name",
+ "gimp-image-get-channel-by-name",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-get-vectors-by-name",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-channel-by-name",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- vectors_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
+ channel = g_value_get_object (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return vectors_ID;
+ return channel;
}
/**
- * gimp_image_attach_parasite:
+ * gimp_image_get_vectors_by_name:
* @image: The image.
- * @parasite: The parasite to attach to an image.
+ * @name: The name of the vectors to find.
*
- * Add a parasite to an image.
+ * Find a vectors with a given name in an image.
*
- * This procedure attaches a parasite to an image. It has no return
- * values.
+ * This procedure returns the vectors with the given name in the
+ * specified image.
*
- * Returns: TRUE on success.
+ * Returns: (transfer none): The vectors with the specified name.
*
* Since: 2.8
**/
-gboolean
-gimp_image_attach_parasite (GimpImage *image,
- const GimpParasite *parasite)
+GimpVectors *
+gimp_image_get_vectors_by_name (GimpImage *image,
+ const gchar *name)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ GimpVectors *vectors = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
- GIMP_TYPE_PARASITE, parasite,
+ G_TYPE_STRING, name,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-attach-parasite",
+ "gimp-image-get-vectors-by-name",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-image-attach-parasite",
+ return_vals = gimp_run_procedure_array ("gimp-image-get-vectors-by-name",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ vectors = g_value_get_object (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return vectors;
}
/**
- * _gimp_image_attach_parasite: (skip)
- * @image_ID: The image.
+ * gimp_image_attach_parasite:
+ * @image: The image.
* @parasite: The parasite to attach to an image.
*
* Add a parasite to an image.
@@ -6730,8 +3615,8 @@ gimp_image_attach_parasite (GimpImage *image,
* Since: 2.8
**/
gboolean
-_gimp_image_attach_parasite (gint32 image_ID,
- const GimpParasite *parasite)
+gimp_image_attach_parasite (GimpImage *image,
+ const GimpParasite *parasite)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -6739,7 +3624,7 @@ _gimp_image_attach_parasite (gint32 image_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
+ GIMP_TYPE_IMAGE, image,
GIMP_TYPE_PARASITE, parasite,
G_TYPE_NONE);
@@ -6803,50 +3688,6 @@ gimp_image_detach_parasite (GimpImage *image,
return success;
}
-/**
- * _gimp_image_detach_parasite: (skip)
- * @image_ID: The image.
- * @name: The name of the parasite to detach from an image.
- *
- * Removes a parasite from an image.
- *
- * This procedure detaches a parasite from an image. It has no return
- * values.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.8
- **/
-gboolean
-_gimp_image_detach_parasite (gint32 image_ID,
- const gchar *name)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_STRING, name,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-detach-parasite",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-detach-parasite",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_get_parasite:
* @image: The image.
@@ -6892,51 +3733,6 @@ gimp_image_get_parasite (GimpImage *image,
return parasite;
}
-/**
- * _gimp_image_get_parasite: (skip)
- * @image_ID: The image.
- * @name: The name of the parasite to find.
- *
- * Look up a parasite in an image
- *
- * Finds and returns the parasite that was previously attached to an
- * image.
- *
- * Returns: The found parasite.
- *
- * Since: 2.8
- **/
-GimpParasite *
-_gimp_image_get_parasite (gint32 image_ID,
- const gchar *name)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- GimpParasite *parasite = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_STRING, name,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-parasite",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-parasite",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- parasite = g_value_dup_boxed (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return parasite;
-}
-
/**
* gimp_image_get_parasite_list:
* @image: The image.
@@ -6986,53 +3782,3 @@ gimp_image_get_parasite_list (GimpImage *image,
return parasites;
}
-
-/**
- * _gimp_image_get_parasite_list: (skip)
- * @image_ID: The image.
- * @num_parasites: (out): The number of attached parasites.
- *
- * List all parasites.
- *
- * Returns a list of all currently attached parasites.
- *
- * Returns: (array length=num_parasites):
- * The names of currently attached parasites.
- * The returned value must be freed with g_strfreev().
- *
- * Since: 2.8
- **/
-gchar **
-_gimp_image_get_parasite_list (gint32 image_ID,
- gint *num_parasites)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gchar **parasites = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-parasite-list",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-parasite-list",
- args);
- gimp_value_array_unref (args);
-
- *num_parasites = 0;
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- {
- *num_parasites = g_value_get_int (gimp_value_array_index (return_vals, 1));
- parasites = gimp_value_dup_string_array (gimp_value_array_index (return_vals, 2));
- }
-
- gimp_value_array_unref (return_vals);
-
- return parasites;
-}
diff --git a/libgimp/gimpimage_pdb.h b/libgimp/gimpimage_pdb.h
index bba1c4928c..13c09d0fc6 100644
--- a/libgimp/gimpimage_pdb.h
+++ b/libgimp/gimpimage_pdb.h
@@ -32,11 +32,8 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-gboolean gimp_image_id_is_valid (gint image_id);
-G_GNUC_INTERNAL gint* _gimp_image_list (gint *num_images);
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
+gboolean gimp_image_id_is_valid (gint image_id);
+G_GNUC_INTERNAL gint* _gimp_image_list (gint *num_images);
GimpImage* gimp_image_new (gint width,
gint height,
GimpImageBaseType type);
@@ -195,224 +192,6 @@ GimpParasite* gimp_image_get_parasite (GimpImage
gchar** gimp_image_get_parasite_list (GimpImage *image,
gint *num_parasites);
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_image_new _gimp_image_new
-#define gimp_image_new_with_precision _gimp_image_new_with_precision
-#define gimp_image_duplicate _gimp_image_duplicate
-#define gimp_image_delete _gimp_image_delete
-#define gimp_image_base_type _gimp_image_base_type
-#define gimp_image_get_precision _gimp_image_get_precision
-#define gimp_image_get_default_new_layer_mode _gimp_image_get_default_new_layer_mode
-#define gimp_image_width _gimp_image_width
-#define gimp_image_height _gimp_image_height
-#define gimp_image_get_active_drawable _gimp_image_get_active_drawable
-#define gimp_image_unset_active_channel _gimp_image_unset_active_channel
-#define gimp_image_get_floating_sel _gimp_image_get_floating_sel
-#define gimp_image_floating_sel_attached_to _gimp_image_floating_sel_attached_to
-#define gimp_image_pick_color _gimp_image_pick_color
-#define gimp_image_pick_correlate_layer _gimp_image_pick_correlate_layer
-#define gimp_image_insert_layer _gimp_image_insert_layer
-#define gimp_image_remove_layer _gimp_image_remove_layer
-#define gimp_image_freeze_layers _gimp_image_freeze_layers
-#define gimp_image_thaw_layers _gimp_image_thaw_layers
-#define gimp_image_insert_channel _gimp_image_insert_channel
-#define gimp_image_remove_channel _gimp_image_remove_channel
-#define gimp_image_freeze_channels _gimp_image_freeze_channels
-#define gimp_image_thaw_channels _gimp_image_thaw_channels
-#define gimp_image_insert_vectors _gimp_image_insert_vectors
-#define gimp_image_remove_vectors _gimp_image_remove_vectors
-#define gimp_image_freeze_vectors _gimp_image_freeze_vectors
-#define gimp_image_thaw_vectors _gimp_image_thaw_vectors
-#define gimp_image_get_item_position _gimp_image_get_item_position
-#define gimp_image_raise_item _gimp_image_raise_item
-#define gimp_image_lower_item _gimp_image_lower_item
-#define gimp_image_raise_item_to_top _gimp_image_raise_item_to_top
-#define gimp_image_lower_item_to_bottom _gimp_image_lower_item_to_bottom
-#define gimp_image_reorder_item _gimp_image_reorder_item
-#define gimp_image_flatten _gimp_image_flatten
-#define gimp_image_merge_visible_layers _gimp_image_merge_visible_layers
-#define gimp_image_merge_down _gimp_image_merge_down
-#define gimp_image_clean_all _gimp_image_clean_all
-#define gimp_image_is_dirty _gimp_image_is_dirty
-#define gimp_image_get_active_layer _gimp_image_get_active_layer
-#define gimp_image_set_active_layer _gimp_image_set_active_layer
-#define gimp_image_get_active_channel _gimp_image_get_active_channel
-#define gimp_image_set_active_channel _gimp_image_set_active_channel
-#define gimp_image_get_active_vectors _gimp_image_get_active_vectors
-#define gimp_image_set_active_vectors _gimp_image_set_active_vectors
-#define gimp_image_get_selection _gimp_image_get_selection
-#define gimp_image_get_component_active _gimp_image_get_component_active
-#define gimp_image_set_component_active _gimp_image_set_component_active
-#define gimp_image_get_component_visible _gimp_image_get_component_visible
-#define gimp_image_set_component_visible _gimp_image_set_component_visible
-#define gimp_image_get_filename _gimp_image_get_filename
-#define gimp_image_set_filename _gimp_image_set_filename
-#define gimp_image_get_uri _gimp_image_get_uri
-#define gimp_image_get_xcf_uri _gimp_image_get_xcf_uri
-#define gimp_image_get_imported_uri _gimp_image_get_imported_uri
-#define gimp_image_get_exported_uri _gimp_image_get_exported_uri
-#define gimp_image_get_name _gimp_image_get_name
-#define gimp_image_get_resolution _gimp_image_get_resolution
-#define gimp_image_set_resolution _gimp_image_set_resolution
-#define gimp_image_get_unit _gimp_image_get_unit
-#define gimp_image_set_unit _gimp_image_set_unit
-#define gimp_image_get_tattoo_state _gimp_image_get_tattoo_state
-#define gimp_image_set_tattoo_state _gimp_image_set_tattoo_state
-#define gimp_image_get_layer_by_tattoo _gimp_image_get_layer_by_tattoo
-#define gimp_image_get_channel_by_tattoo _gimp_image_get_channel_by_tattoo
-#define gimp_image_get_vectors_by_tattoo _gimp_image_get_vectors_by_tattoo
-#define gimp_image_get_layer_by_name _gimp_image_get_layer_by_name
-#define gimp_image_get_channel_by_name _gimp_image_get_channel_by_name
-#define gimp_image_get_vectors_by_name _gimp_image_get_vectors_by_name
-#define gimp_image_attach_parasite _gimp_image_attach_parasite
-#define gimp_image_detach_parasite _gimp_image_detach_parasite
-#define gimp_image_get_parasite _gimp_image_get_parasite
-#define gimp_image_get_parasite_list _gimp_image_get_parasite_list
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-gint32 _gimp_image_new (gint width,
- gint height,
- GimpImageBaseType type);
-gint32 _gimp_image_new_with_precision (gint width,
- gint height,
- GimpImageBaseType type,
- GimpPrecision precision);
-gint32 _gimp_image_duplicate (gint32 image_ID);
-gboolean _gimp_image_delete (gint32 image_ID);
-GimpImageBaseType _gimp_image_base_type (gint32 image_ID);
-GimpPrecision _gimp_image_get_precision (gint32 image_ID);
-GimpLayerMode _gimp_image_get_default_new_layer_mode (gint32 image_ID);
-gint _gimp_image_width (gint32 image_ID);
-gint _gimp_image_height (gint32 image_ID);
-gint32 _gimp_image_get_active_drawable (gint32 image_ID);
-gboolean _gimp_image_unset_active_channel (gint32 image_ID);
-gint32 _gimp_image_get_floating_sel (gint32 image_ID);
-gint32 _gimp_image_floating_sel_attached_to (gint32 image_ID);
-gboolean _gimp_image_pick_color (gint32 image_ID,
- gint32 drawable_ID,
- gdouble x,
- gdouble y,
- gboolean sample_merged,
- gboolean sample_average,
- gdouble average_radius,
- GimpRGB *color);
-gint32 _gimp_image_pick_correlate_layer (gint32 image_ID,
- gint x,
- gint y);
-gboolean _gimp_image_insert_layer (gint32 image_ID,
- gint32 layer_ID,
- gint32 parent_ID,
- gint position);
-gboolean _gimp_image_remove_layer (gint32 image_ID,
- gint32 layer_ID);
-gboolean _gimp_image_freeze_layers (gint32 image_ID);
-gboolean _gimp_image_thaw_layers (gint32 image_ID);
-gboolean _gimp_image_insert_channel (gint32 image_ID,
- gint32 channel_ID,
- gint32 parent_ID,
- gint position);
-gboolean _gimp_image_remove_channel (gint32 image_ID,
- gint32 channel_ID);
-gboolean _gimp_image_freeze_channels (gint32 image_ID);
-gboolean _gimp_image_thaw_channels (gint32 image_ID);
-gboolean _gimp_image_insert_vectors (gint32 image_ID,
- gint32 vectors_ID,
- gint32 parent_ID,
- gint position);
-gboolean _gimp_image_remove_vectors (gint32 image_ID,
- gint32 vectors_ID);
-gboolean _gimp_image_freeze_vectors (gint32 image_ID);
-gboolean _gimp_image_thaw_vectors (gint32 image_ID);
-gint _gimp_image_get_item_position (gint32 image_ID,
- gint32 item_ID);
-gboolean _gimp_image_raise_item (gint32 image_ID,
- gint32 item_ID);
-gboolean _gimp_image_lower_item (gint32 image_ID,
- gint32 item_ID);
-gboolean _gimp_image_raise_item_to_top (gint32 image_ID,
- gint32 item_ID);
-gboolean _gimp_image_lower_item_to_bottom (gint32 image_ID,
- gint32 item_ID);
-gboolean _gimp_image_reorder_item (gint32 image_ID,
- gint32 item_ID,
- gint32 parent_ID,
- gint position);
-gint32 _gimp_image_flatten (gint32 image_ID);
-gint32 _gimp_image_merge_visible_layers (gint32 image_ID,
- GimpMergeType merge_type);
-gint32 _gimp_image_merge_down (gint32 image_ID,
- gint32 merge_layer_ID,
- GimpMergeType merge_type);
-gboolean _gimp_image_clean_all (gint32 image_ID);
-gboolean _gimp_image_is_dirty (gint32 image_ID);
-gint32 _gimp_image_get_active_layer (gint32 image_ID);
-gboolean _gimp_image_set_active_layer (gint32 image_ID,
- gint32 active_layer_ID);
-gint32 _gimp_image_get_active_channel (gint32 image_ID);
-gboolean _gimp_image_set_active_channel (gint32 image_ID,
- gint32 active_channel_ID);
-gint32 _gimp_image_get_active_vectors (gint32 image_ID);
-gboolean _gimp_image_set_active_vectors (gint32 image_ID,
- gint32 active_vectors_ID);
-gint32 _gimp_image_get_selection (gint32 image_ID);
-gboolean _gimp_image_get_component_active (gint32 image_ID,
- GimpChannelType component);
-gboolean _gimp_image_set_component_active (gint32 image_ID,
- GimpChannelType component,
- gboolean active);
-gboolean _gimp_image_get_component_visible (gint32 image_ID,
- GimpChannelType component);
-gboolean _gimp_image_set_component_visible (gint32 image_ID,
- GimpChannelType component,
- gboolean visible);
-gchar* _gimp_image_get_filename (gint32 image_ID);
-gboolean _gimp_image_set_filename (gint32 image_ID,
- const gchar *filename);
-gchar* _gimp_image_get_uri (gint32 image_ID);
-gchar* _gimp_image_get_xcf_uri (gint32 image_ID);
-gchar* _gimp_image_get_imported_uri (gint32 image_ID);
-gchar* _gimp_image_get_exported_uri (gint32 image_ID);
-gchar* _gimp_image_get_name (gint32 image_ID);
-gboolean _gimp_image_get_resolution (gint32 image_ID,
- gdouble *xresolution,
- gdouble *yresolution);
-gboolean _gimp_image_set_resolution (gint32 image_ID,
- gdouble xresolution,
- gdouble yresolution);
-GimpUnit _gimp_image_get_unit (gint32 image_ID);
-gboolean _gimp_image_set_unit (gint32 image_ID,
- GimpUnit unit);
-guint _gimp_image_get_tattoo_state (gint32 image_ID);
-gboolean _gimp_image_set_tattoo_state (gint32 image_ID,
- guint tattoo_state);
-gint32 _gimp_image_get_layer_by_tattoo (gint32 image_ID,
- guint tattoo);
-gint32 _gimp_image_get_channel_by_tattoo (gint32 image_ID,
- guint tattoo);
-gint32 _gimp_image_get_vectors_by_tattoo (gint32 image_ID,
- guint tattoo);
-gint32 _gimp_image_get_layer_by_name (gint32 image_ID,
- const gchar *name);
-gint32 _gimp_image_get_channel_by_name (gint32 image_ID,
- const gchar *name);
-gint32 _gimp_image_get_vectors_by_name (gint32 image_ID,
- const gchar *name);
-gboolean _gimp_image_attach_parasite (gint32 image_ID,
- const GimpParasite *parasite);
-gboolean _gimp_image_detach_parasite (gint32 image_ID,
- const gchar *name);
-GimpParasite* _gimp_image_get_parasite (gint32 image_ID,
- const gchar *name);
-gchar** _gimp_image_get_parasite_list (gint32 image_ID,
- gint *num_parasites);
-
G_END_DECLS
diff --git a/libgimp/gimpimagecolorprofile_pdb.c b/libgimp/gimpimagecolorprofile_pdb.c
index cd29891f16..0b97758416 100644
--- a/libgimp/gimpimagecolorprofile_pdb.c
+++ b/libgimp/gimpimagecolorprofile_pdb.c
@@ -238,54 +238,6 @@ gimp_image_set_color_profile_from_file (GimpImage *image,
return success;
}
-/**
- * _gimp_image_set_color_profile_from_file: (skip)
- * @image_ID: The image.
- * @uri: The URI of the file containing the new color profile.
- *
- * Sets the image's color profile from an ICC file
- *
- * This procedure sets the image's color profile from a file containing
- * an ICC profile, or unsets it if NULL is passed as 'uri'. This
- * procedure does no color conversion. However, it will change the
- * pixel format of all layers to contain the babl space matching the
- * profile. You must call this procedure before adding layers to the
- * image.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-_gimp_image_set_color_profile_from_file (gint32 image_ID,
- const gchar *uri)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_STRING, uri,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-set-color-profile-from-file",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-set-color-profile-from-file",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* _gimp_image_convert_color_profile:
* @image: The image.
@@ -393,55 +345,3 @@ gimp_image_convert_color_profile_from_file (GimpImage *image,
return success;
}
-
-/**
- * _gimp_image_convert_color_profile_from_file: (skip)
- * @image_ID: The image.
- * @uri: The URI of the file containing the new color profile.
- * @intent: Rendering intent.
- * @bpc: Black point compensation.
- *
- * Convert the image's layers to a color profile
- *
- * This procedure converts from the image's color profile (or the
- * default RGB or grayscale profile if none is set) to an ICC profile
- * specified by 'uri'. Only RGB and grayscale color profiles are
- * accepted, according to the image's type.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-_gimp_image_convert_color_profile_from_file (gint32 image_ID,
- const gchar *uri,
- GimpColorRenderingIntent intent,
- gboolean bpc)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_STRING, uri,
- GIMP_TYPE_COLOR_RENDERING_INTENT, intent,
- G_TYPE_BOOLEAN, bpc,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-convert-color-profile-from-file",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-convert-color-profile-from-file",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
diff --git a/libgimp/gimpimagecolorprofile_pdb.h b/libgimp/gimpimagecolorprofile_pdb.h
index ce9b08e86d..454a837bfe 100644
--- a/libgimp/gimpimagecolorprofile_pdb.h
+++ b/libgimp/gimpimagecolorprofile_pdb.h
@@ -32,10 +32,6 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
G_GNUC_INTERNAL guint8* _gimp_image_get_color_profile (GimpImage *image,
gint *num_bytes);
G_GNUC_INTERNAL guint8* _gimp_image_get_effective_color_profile (GimpImage *image,
@@ -55,25 +51,6 @@ gboolean gimp_image_convert_color_profile_from_file (GimpImage
GimpColorRenderingIntent intent,
gboolean bpc);
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_image_set_color_profile_from_file _gimp_image_set_color_profile_from_file
-#define gimp_image_convert_color_profile_from_file _gimp_image_convert_color_profile_from_file
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-gboolean _gimp_image_set_color_profile_from_file (gint32 image_ID,
- const gchar *uri);
-gboolean _gimp_image_convert_color_profile_from_file (gint32 image_ID,
- const gchar *uri,
- GimpColorRenderingIntent intent,
- gboolean bpc);
-
G_END_DECLS
diff --git a/libgimp/gimpimageconvert_pdb.c b/libgimp/gimpimageconvert_pdb.c
index fe2cb4d935..512ac3ed36 100644
--- a/libgimp/gimpimageconvert_pdb.c
+++ b/libgimp/gimpimageconvert_pdb.c
@@ -75,47 +75,6 @@ gimp_image_convert_rgb (GimpImage *image)
return success;
}
-/**
- * _gimp_image_convert_rgb: (skip)
- * @image_ID: The image.
- *
- * Convert specified image to RGB color
- *
- * This procedure converts the specified image to RGB color. This
- * process requires an image in Grayscale or Indexed color mode. No
- * image content is lost in this process aside from the colormap for an
- * indexed image.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_convert_rgb (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-convert-rgb",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-convert-rgb",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_convert_grayscale:
* @image: The image.
@@ -155,45 +114,6 @@ gimp_image_convert_grayscale (GimpImage *image)
return success;
}
-/**
- * _gimp_image_convert_grayscale: (skip)
- * @image_ID: The image.
- *
- * Convert specified image to grayscale
- *
- * This procedure converts the specified image to grayscale. This
- * process requires an image in RGB or Indexed color mode.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_convert_grayscale (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-convert-grayscale",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-convert-grayscale",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_convert_indexed:
* @image: The image.
@@ -262,74 +182,6 @@ gimp_image_convert_indexed (GimpImage *image,
return success;
}
-/**
- * _gimp_image_convert_indexed: (skip)
- * @image_ID: The image.
- * @dither_type: The dither type to use.
- * @palette_type: The type of palette to use.
- * @num_cols: The number of colors to quantize to, ignored unless (palette_type ==
GIMP_CONVERT_PALETTE_GENERATE).
- * @alpha_dither: Dither transparency to fake partial opacity.
- * @remove_unused: Remove unused or duplicate color entries from final palette, ignored if (palette_type ==
GIMP_CONVERT_PALETTE_GENERATE).
- * @palette: The name of the custom palette to use, ignored unless (palette_type ==
GIMP_CONVERT_PALETTE_CUSTOM).
- *
- * Convert specified image to and Indexed image
- *
- * This procedure converts the specified image to 'indexed' color. This
- * process requires an image in RGB or Grayscale mode. The
- * 'palette_type' specifies what kind of palette to use, A type of '0'
- * means to use an optimal palette of 'num_cols' generated from the
- * colors in the image. A type of '1' means to re-use the previous
- * palette (not currently implemented). A type of '2' means to use the
- * so-called WWW-optimized palette. Type '3' means to use only black
- * and white colors. A type of '4' means to use a palette from the gimp
- * palettes directories. The 'dither type' specifies what kind of
- * dithering to use. '0' means no dithering, '1' means standard
- * Floyd-Steinberg error diffusion, '2' means Floyd-Steinberg error
- * diffusion with reduced bleeding, '3' means dithering based on pixel
- * location ('Fixed' dithering).
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_convert_indexed (gint32 image_ID,
- GimpConvertDitherType dither_type,
- GimpConvertPaletteType palette_type,
- gint num_cols,
- gboolean alpha_dither,
- gboolean remove_unused,
- const gchar *palette)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_CONVERT_DITHER_TYPE, dither_type,
- GIMP_TYPE_CONVERT_PALETTE_TYPE, palette_type,
- G_TYPE_INT, num_cols,
- G_TYPE_BOOLEAN, alpha_dither,
- G_TYPE_BOOLEAN, remove_unused,
- G_TYPE_STRING, palette,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-convert-indexed",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-convert-indexed",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_convert_set_dither_matrix:
* @width: Width of the matrix (0 to reset to default matrix).
@@ -425,48 +277,3 @@ gimp_image_convert_precision (GimpImage *image,
return success;
}
-
-/**
- * _gimp_image_convert_precision: (skip)
- * @image_ID: The image.
- * @precision: The new precision.
- *
- * Convert the image to the specified precision
- *
- * This procedure converts the image to the specified precision. Note
- * that indexed images cannot be converted and are always in
- * GIMP_PRECISION_U8.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-_gimp_image_convert_precision (gint32 image_ID,
- GimpPrecision precision)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_PRECISION, precision,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-convert-precision",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-convert-precision",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
diff --git a/libgimp/gimpimageconvert_pdb.h b/libgimp/gimpimageconvert_pdb.h
index ec91cc6b36..fe4cfaf973 100644
--- a/libgimp/gimpimageconvert_pdb.h
+++ b/libgimp/gimpimageconvert_pdb.h
@@ -32,50 +32,21 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-gboolean gimp_image_convert_set_dither_matrix (gint width,
- gint height,
- gint matrix_length,
- const guint8 *matrix);
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-gboolean gimp_image_convert_rgb (GimpImage *image);
-gboolean gimp_image_convert_grayscale (GimpImage *image);
-gboolean gimp_image_convert_indexed (GimpImage *image,
- GimpConvertDitherType dither_type,
- GimpConvertPaletteType palette_type,
- gint num_cols,
- gboolean alpha_dither,
- gboolean remove_unused,
- const gchar *palette);
-gboolean gimp_image_convert_precision (GimpImage *image,
- GimpPrecision precision);
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_image_convert_rgb _gimp_image_convert_rgb
-#define gimp_image_convert_grayscale _gimp_image_convert_grayscale
-#define gimp_image_convert_indexed _gimp_image_convert_indexed
-#define gimp_image_convert_precision _gimp_image_convert_precision
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-gboolean _gimp_image_convert_rgb (gint32 image_ID);
-gboolean _gimp_image_convert_grayscale (gint32 image_ID);
-gboolean _gimp_image_convert_indexed (gint32 image_ID,
- GimpConvertDitherType dither_type,
- GimpConvertPaletteType palette_type,
- gint num_cols,
- gboolean alpha_dither,
- gboolean remove_unused,
- const gchar *palette);
-gboolean _gimp_image_convert_precision (gint32 image_ID,
- GimpPrecision precision);
+gboolean gimp_image_convert_rgb (GimpImage *image);
+gboolean gimp_image_convert_grayscale (GimpImage *image);
+gboolean gimp_image_convert_indexed (GimpImage *image,
+ GimpConvertDitherType dither_type,
+ GimpConvertPaletteType palette_type,
+ gint num_cols,
+ gboolean alpha_dither,
+ gboolean remove_unused,
+ const gchar *palette);
+gboolean gimp_image_convert_set_dither_matrix (gint width,
+ gint height,
+ gint matrix_length,
+ const guint8 *matrix);
+gboolean gimp_image_convert_precision (GimpImage *image,
+ GimpPrecision precision);
G_END_DECLS
diff --git a/libgimp/gimpimagegrid_pdb.c b/libgimp/gimpimagegrid_pdb.c
index ae05ca8e9b..219955b835 100644
--- a/libgimp/gimpimagegrid_pdb.c
+++ b/libgimp/gimpimagegrid_pdb.c
@@ -88,60 +88,6 @@ gimp_image_grid_get_spacing (GimpImage *image,
return success;
}
-/**
- * _gimp_image_grid_get_spacing: (skip)
- * @image_ID: The image.
- * @xspacing: (out): The image's grid horizontal spacing.
- * @yspacing: (out): The image's grid vertical spacing.
- *
- * Gets the spacing of an image's grid.
- *
- * This procedure retrieves the horizontal and vertical spacing of an
- * image's grid. It takes the image as parameter.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.4
- **/
-gboolean
-_gimp_image_grid_get_spacing (gint32 image_ID,
- gdouble *xspacing,
- gdouble *yspacing)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-grid-get-spacing",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-grid-get-spacing",
- args);
- gimp_value_array_unref (args);
-
- *xspacing = 0.0;
- *yspacing = 0.0;
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- if (success)
- {
- *xspacing = g_value_get_double (gimp_value_array_index (return_vals, 1));
- *yspacing = g_value_get_double (gimp_value_array_index (return_vals, 2));
- }
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_grid_set_spacing:
* @image: The image.
@@ -189,53 +135,6 @@ gimp_image_grid_set_spacing (GimpImage *image,
return success;
}
-/**
- * _gimp_image_grid_set_spacing: (skip)
- * @image_ID: The image.
- * @xspacing: The image's grid horizontal spacing.
- * @yspacing: The image's grid vertical spacing.
- *
- * Sets the spacing of an image's grid.
- *
- * This procedure sets the horizontal and vertical spacing of an
- * image's grid.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.4
- **/
-gboolean
-_gimp_image_grid_set_spacing (gint32 image_ID,
- gdouble xspacing,
- gdouble yspacing)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_DOUBLE, xspacing,
- G_TYPE_DOUBLE, yspacing,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-grid-set-spacing",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-grid-set-spacing",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_grid_get_offset:
* @image: The image.
@@ -290,60 +189,6 @@ gimp_image_grid_get_offset (GimpImage *image,
return success;
}
-/**
- * _gimp_image_grid_get_offset: (skip)
- * @image_ID: The image.
- * @xoffset: (out): The image's grid horizontal offset.
- * @yoffset: (out): The image's grid vertical offset.
- *
- * Gets the offset of an image's grid.
- *
- * This procedure retrieves the horizontal and vertical offset of an
- * image's grid. It takes the image as parameter.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.4
- **/
-gboolean
-_gimp_image_grid_get_offset (gint32 image_ID,
- gdouble *xoffset,
- gdouble *yoffset)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-grid-get-offset",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-grid-get-offset",
- args);
- gimp_value_array_unref (args);
-
- *xoffset = 0.0;
- *yoffset = 0.0;
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- if (success)
- {
- *xoffset = g_value_get_double (gimp_value_array_index (return_vals, 1));
- *yoffset = g_value_get_double (gimp_value_array_index (return_vals, 2));
- }
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_grid_set_offset:
* @image: The image.
@@ -391,53 +236,6 @@ gimp_image_grid_set_offset (GimpImage *image,
return success;
}
-/**
- * _gimp_image_grid_set_offset: (skip)
- * @image_ID: The image.
- * @xoffset: The image's grid horizontal offset.
- * @yoffset: The image's grid vertical offset.
- *
- * Sets the offset of an image's grid.
- *
- * This procedure sets the horizontal and vertical offset of an image's
- * grid.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.4
- **/
-gboolean
-_gimp_image_grid_set_offset (gint32 image_ID,
- gdouble xoffset,
- gdouble yoffset)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_DOUBLE, xoffset,
- G_TYPE_DOUBLE, yoffset,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-grid-set-offset",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-grid-set-offset",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_grid_get_foreground_color:
* @image: The image.
@@ -483,51 +281,6 @@ gimp_image_grid_get_foreground_color (GimpImage *image,
return success;
}
-/**
- * _gimp_image_grid_get_foreground_color: (skip)
- * @image_ID: The image.
- * @fgcolor: (out caller-allocates): The image's grid foreground color.
- *
- * Sets the foreground color of an image's grid.
- *
- * This procedure gets the foreground color of an image's grid.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.4
- **/
-gboolean
-_gimp_image_grid_get_foreground_color (gint32 image_ID,
- GimpRGB *fgcolor)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-grid-get-foreground-color",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-grid-get-foreground-color",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- if (success)
- gimp_value_get_rgb (gimp_value_array_index (return_vals, 1), &*fgcolor);
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_grid_set_foreground_color:
* @image: The image.
@@ -571,49 +324,6 @@ gimp_image_grid_set_foreground_color (GimpImage *image,
return success;
}
-/**
- * _gimp_image_grid_set_foreground_color: (skip)
- * @image_ID: The image.
- * @fgcolor: The new foreground color.
- *
- * Gets the foreground color of an image's grid.
- *
- * This procedure sets the foreground color of an image's grid.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.4
- **/
-gboolean
-_gimp_image_grid_set_foreground_color (gint32 image_ID,
- const GimpRGB *fgcolor)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_RGB, fgcolor,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-grid-set-foreground-color",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-grid-set-foreground-color",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_grid_get_background_color:
* @image: The image.
@@ -659,51 +369,6 @@ gimp_image_grid_get_background_color (GimpImage *image,
return success;
}
-/**
- * _gimp_image_grid_get_background_color: (skip)
- * @image_ID: The image.
- * @bgcolor: (out caller-allocates): The image's grid background color.
- *
- * Sets the background color of an image's grid.
- *
- * This procedure gets the background color of an image's grid.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.4
- **/
-gboolean
-_gimp_image_grid_get_background_color (gint32 image_ID,
- GimpRGB *bgcolor)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-grid-get-background-color",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-grid-get-background-color",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- if (success)
- gimp_value_get_rgb (gimp_value_array_index (return_vals, 1), &*bgcolor);
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_grid_set_background_color:
* @image: The image.
@@ -747,49 +412,6 @@ gimp_image_grid_set_background_color (GimpImage *image,
return success;
}
-/**
- * _gimp_image_grid_set_background_color: (skip)
- * @image_ID: The image.
- * @bgcolor: The new background color.
- *
- * Gets the background color of an image's grid.
- *
- * This procedure sets the background color of an image's grid.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.4
- **/
-gboolean
-_gimp_image_grid_set_background_color (gint32 image_ID,
- const GimpRGB *bgcolor)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_RGB, bgcolor,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-grid-set-background-color",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-grid-set-background-color",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_grid_get_style:
* @image: The image.
@@ -831,47 +453,6 @@ gimp_image_grid_get_style (GimpImage *image)
return style;
}
-/**
- * _gimp_image_grid_get_style: (skip)
- * @image_ID: The image.
- *
- * Gets the style of an image's grid.
- *
- * This procedure retrieves the style of an image's grid.
- *
- * Returns: The image's grid style.
- *
- * Since: 2.4
- **/
-GimpGridStyle
-_gimp_image_grid_get_style (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- GimpGridStyle style = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-grid-get-style",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-grid-get-style",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- style = g_value_get_enum (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return style;
-}
-
/**
* gimp_image_grid_set_style:
* @image: The image.
@@ -915,47 +496,3 @@ gimp_image_grid_set_style (GimpImage *image,
return success;
}
-
-/**
- * _gimp_image_grid_set_style: (skip)
- * @image_ID: The image.
- * @style: The image's grid style.
- *
- * Sets the style unit of an image's grid.
- *
- * This procedure sets the style of an image's grid. It takes the image
- * and the new style as parameters.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.4
- **/
-gboolean
-_gimp_image_grid_set_style (gint32 image_ID,
- GimpGridStyle style)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_GRID_STYLE, style,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-grid-set-style",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-grid-set-style",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
diff --git a/libgimp/gimpimagegrid_pdb.h b/libgimp/gimpimagegrid_pdb.h
index 79374c9c6b..e256944329 100644
--- a/libgimp/gimpimagegrid_pdb.h
+++ b/libgimp/gimpimagegrid_pdb.h
@@ -32,10 +32,6 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
gboolean gimp_image_grid_get_spacing (GimpImage *image,
gdouble *xspacing,
gdouble *yspacing);
@@ -60,50 +56,6 @@ GimpGridStyle gimp_image_grid_get_style (GimpImage *image);
gboolean gimp_image_grid_set_style (GimpImage *image,
GimpGridStyle style);
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_image_grid_get_spacing _gimp_image_grid_get_spacing
-#define gimp_image_grid_set_spacing _gimp_image_grid_set_spacing
-#define gimp_image_grid_get_offset _gimp_image_grid_get_offset
-#define gimp_image_grid_set_offset _gimp_image_grid_set_offset
-#define gimp_image_grid_get_foreground_color _gimp_image_grid_get_foreground_color
-#define gimp_image_grid_set_foreground_color _gimp_image_grid_set_foreground_color
-#define gimp_image_grid_get_background_color _gimp_image_grid_get_background_color
-#define gimp_image_grid_set_background_color _gimp_image_grid_set_background_color
-#define gimp_image_grid_get_style _gimp_image_grid_get_style
-#define gimp_image_grid_set_style _gimp_image_grid_set_style
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-gboolean _gimp_image_grid_get_spacing (gint32 image_ID,
- gdouble *xspacing,
- gdouble *yspacing);
-gboolean _gimp_image_grid_set_spacing (gint32 image_ID,
- gdouble xspacing,
- gdouble yspacing);
-gboolean _gimp_image_grid_get_offset (gint32 image_ID,
- gdouble *xoffset,
- gdouble *yoffset);
-gboolean _gimp_image_grid_set_offset (gint32 image_ID,
- gdouble xoffset,
- gdouble yoffset);
-gboolean _gimp_image_grid_get_foreground_color (gint32 image_ID,
- GimpRGB *fgcolor);
-gboolean _gimp_image_grid_set_foreground_color (gint32 image_ID,
- const GimpRGB *fgcolor);
-gboolean _gimp_image_grid_get_background_color (gint32 image_ID,
- GimpRGB *bgcolor);
-gboolean _gimp_image_grid_set_background_color (gint32 image_ID,
- const GimpRGB *bgcolor);
-GimpGridStyle _gimp_image_grid_get_style (gint32 image_ID);
-gboolean _gimp_image_grid_set_style (gint32 image_ID,
- GimpGridStyle style);
-
G_END_DECLS
diff --git a/libgimp/gimpimageguides_pdb.c b/libgimp/gimpimageguides_pdb.c
index 48e3c53dce..42814fb0ce 100644
--- a/libgimp/gimpimageguides_pdb.c
+++ b/libgimp/gimpimageguides_pdb.c
@@ -78,50 +78,6 @@ gimp_image_add_hguide (GimpImage *image,
return guide;
}
-/**
- * _gimp_image_add_hguide: (skip)
- * @image_ID: The image.
- * @yposition: The guide's y-offset from top of image.
- *
- * Add a horizontal guide to an image.
- *
- * This procedure adds a horizontal guide to an image. It takes the
- * input image and the y-position of the new guide as parameters. It
- * returns the guide ID of the new guide.
- *
- * Returns: The new guide.
- **/
-gint32
-_gimp_image_add_hguide (gint32 image_ID,
- gint yposition)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 guide_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_INT, yposition,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-add-hguide",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-add-hguide",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- guide_ID = g_value_get_uint (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return guide_ID;
-}
-
/**
* gimp_image_add_vguide:
* @image: The image.
@@ -166,50 +122,6 @@ gimp_image_add_vguide (GimpImage *image,
return guide;
}
-/**
- * _gimp_image_add_vguide: (skip)
- * @image_ID: The image.
- * @xposition: The guide's x-offset from left of image.
- *
- * Add a vertical guide to an image.
- *
- * This procedure adds a vertical guide to an image. It takes the input
- * image and the x-position of the new guide as parameters. It returns
- * the guide ID of the new guide.
- *
- * Returns: The new guide.
- **/
-gint32
-_gimp_image_add_vguide (gint32 image_ID,
- gint xposition)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 guide_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_INT, xposition,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-add-vguide",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-add-vguide",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- guide_ID = g_value_get_uint (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return guide_ID;
-}
-
/**
* gimp_image_delete_guide:
* @image: The image.
@@ -252,48 +164,6 @@ gimp_image_delete_guide (GimpImage *image,
return success;
}
-/**
- * _gimp_image_delete_guide: (skip)
- * @image_ID: The image.
- * @guide_ID: The ID of the guide to be removed.
- *
- * Deletes a guide from an image.
- *
- * This procedure takes an image and a guide ID as input and removes
- * the specified guide from the specified image.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_delete_guide (gint32 image_ID,
- gint32 guide_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_UINT, guide_ID,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-delete-guide",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-delete-guide",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_find_next_guide:
* @image: The image.
@@ -340,52 +210,6 @@ gimp_image_find_next_guide (GimpImage *image,
return next_guide;
}
-/**
- * _gimp_image_find_next_guide: (skip)
- * @image_ID: The image.
- * @guide_ID: The ID of the current guide (0 if first invocation).
- *
- * Find next guide on an image.
- *
- * This procedure takes an image and a guide ID as input and finds the
- * guide ID of the successor of the given guide ID in the image's guide
- * list. If the supplied guide ID is 0, the procedure will return the
- * first Guide. The procedure will return 0 if given the final guide ID
- * as an argument or the image has no guides.
- *
- * Returns: The next guide's ID.
- **/
-gint32
-_gimp_image_find_next_guide (gint32 image_ID,
- gint32 guide_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 next_guide_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_UINT, guide_ID,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-find-next-guide",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-find-next-guide",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- next_guide_ID = g_value_get_uint (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return next_guide_ID;
-}
-
/**
* gimp_image_get_guide_orientation:
* @image: The image.
@@ -429,49 +253,6 @@ gimp_image_get_guide_orientation (GimpImage *image,
return orientation;
}
-/**
- * _gimp_image_get_guide_orientation: (skip)
- * @image_ID: The image.
- * @guide_ID: The guide.
- *
- * Get orientation of a guide on an image.
- *
- * This procedure takes an image and a guide ID as input and returns
- * the orientations of the guide.
- *
- * Returns: The guide's orientation.
- **/
-GimpOrientationType
-_gimp_image_get_guide_orientation (gint32 image_ID,
- gint32 guide_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- GimpOrientationType orientation = GIMP_ORIENTATION_UNKNOWN;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_UINT, guide_ID,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-guide-orientation",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-guide-orientation",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- orientation = g_value_get_enum (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return orientation;
-}
-
/**
* gimp_image_get_guide_position:
* @image: The image.
@@ -514,46 +295,3 @@ gimp_image_get_guide_position (GimpImage *image,
return position;
}
-
-/**
- * _gimp_image_get_guide_position: (skip)
- * @image_ID: The image.
- * @guide_ID: The guide.
- *
- * Get position of a guide on an image.
- *
- * This procedure takes an image and a guide ID as input and returns
- * the position of the guide relative to the top or left of the image.
- *
- * Returns: The guide's position relative to top or left of image.
- **/
-gint
-_gimp_image_get_guide_position (gint32 image_ID,
- gint32 guide_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint position = G_MININT /* GIMP_GUIDE_POSITION_UNDEFINED */;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_UINT, guide_ID,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-guide-position",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-guide-position",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- position = g_value_get_int (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return position;
-}
diff --git a/libgimp/gimpimageguides_pdb.h b/libgimp/gimpimageguides_pdb.h
index 91ab5e94e0..78b1359949 100644
--- a/libgimp/gimpimageguides_pdb.h
+++ b/libgimp/gimpimageguides_pdb.h
@@ -32,10 +32,6 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
guint gimp_image_add_hguide (GimpImage *image,
gint yposition);
guint gimp_image_add_vguide (GimpImage *image,
@@ -49,35 +45,6 @@ GimpOrientationType gimp_image_get_guide_orientation (GimpImage *image,
gint gimp_image_get_guide_position (GimpImage *image,
guint guide);
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_image_add_hguide _gimp_image_add_hguide
-#define gimp_image_add_vguide _gimp_image_add_vguide
-#define gimp_image_delete_guide _gimp_image_delete_guide
-#define gimp_image_find_next_guide _gimp_image_find_next_guide
-#define gimp_image_get_guide_orientation _gimp_image_get_guide_orientation
-#define gimp_image_get_guide_position _gimp_image_get_guide_position
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-gint32 _gimp_image_add_hguide (gint32 image_ID,
- gint yposition);
-gint32 _gimp_image_add_vguide (gint32 image_ID,
- gint xposition);
-gboolean _gimp_image_delete_guide (gint32 image_ID,
- gint32 guide_ID);
-gint32 _gimp_image_find_next_guide (gint32 image_ID,
- gint32 guide_ID);
-GimpOrientationType _gimp_image_get_guide_orientation (gint32 image_ID,
- gint32 guide_ID);
-gint _gimp_image_get_guide_position (gint32 image_ID,
- gint32 guide_ID);
-
G_END_DECLS
diff --git a/libgimp/gimpimagesamplepoints_pdb.c b/libgimp/gimpimagesamplepoints_pdb.c
index 85941e2daf..8384382c1b 100644
--- a/libgimp/gimpimagesamplepoints_pdb.c
+++ b/libgimp/gimpimagesamplepoints_pdb.c
@@ -83,55 +83,6 @@ gimp_image_add_sample_point (GimpImage *image,
return sample_point;
}
-/**
- * _gimp_image_add_sample_point: (skip)
- * @image_ID: The image.
- * @position_x: The guide'sample points x-offset from left of image.
- * @position_y: The guide'sample points y-offset from top of image.
- *
- * Add a sample point to an image.
- *
- * This procedure adds a sample point to an image. It takes the input
- * image and the position of the new sample points as parameters. It
- * returns the sample point ID of the new sample point.
- *
- * Returns: The new sample point.
- *
- * Since: 2.10
- **/
-gint32
-_gimp_image_add_sample_point (gint32 image_ID,
- gint position_x,
- gint position_y)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 sample_point_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_INT, position_x,
- G_TYPE_INT, position_y,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-add-sample-point",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-add-sample-point",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- sample_point_ID = g_value_get_uint (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return sample_point_ID;
-}
-
/**
* gimp_image_delete_sample_point:
* @image: The image.
@@ -176,50 +127,6 @@ gimp_image_delete_sample_point (GimpImage *image,
return success;
}
-/**
- * _gimp_image_delete_sample_point: (skip)
- * @image_ID: The image.
- * @sample_point_ID: The ID of the sample point to be removed.
- *
- * Deletes a sample point from an image.
- *
- * This procedure takes an image and a sample point ID as input and
- * removes the specified sample point from the specified image.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-_gimp_image_delete_sample_point (gint32 image_ID,
- gint32 sample_point_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_UINT, sample_point_ID,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-delete-sample-point",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-delete-sample-point",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_find_next_sample_point:
* @image: The image.
@@ -269,55 +176,6 @@ gimp_image_find_next_sample_point (GimpImage *image,
return next_sample_point;
}
-/**
- * _gimp_image_find_next_sample_point: (skip)
- * @image_ID: The image.
- * @sample_point_ID: The ID of the current sample point (0 if first invocation).
- *
- * Find next sample point on an image.
- *
- * This procedure takes an image and a sample point ID as input and
- * finds the sample point ID of the successor of the given sample point
- * ID in the image's sample point list. If the supplied sample point ID
- * is 0, the procedure will return the first sample point. The
- * procedure will return 0 if given the final sample point ID as an
- * argument or the image has no sample points.
- *
- * Returns: The next sample point's ID.
- *
- * Since: 2.10
- **/
-gint32
-_gimp_image_find_next_sample_point (gint32 image_ID,
- gint32 sample_point_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 next_sample_point_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_UINT, sample_point_ID,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-find-next-sample-point",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-find-next-sample-point",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- next_sample_point_ID = g_value_get_uint (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return next_sample_point_ID;
-}
-
/**
* gimp_image_get_sample_point_position:
* @image: The image.
@@ -368,54 +226,3 @@ gimp_image_get_sample_point_position (GimpImage *image,
return position_x;
}
-
-/**
- * _gimp_image_get_sample_point_position: (skip)
- * @image_ID: The image.
- * @sample_point_ID: The guide.
- * @position_y: (out): The sample points's position relative to top of image.
- *
- * Get position of a sample point on an image.
- *
- * This procedure takes an image and a sample point ID as input and
- * returns the position of the sample point relative to the top and
- * left of the image.
- *
- * Returns: The sample points's position relative to top of image.
- *
- * Since: 2.10
- **/
-gint
-_gimp_image_get_sample_point_position (gint32 image_ID,
- gint32 sample_point_ID,
- gint *position_y)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint position_x = G_MININT;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_UINT, sample_point_ID,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-get-sample-point-position",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-get-sample-point-position",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- {
- position_x = g_value_get_int (gimp_value_array_index (return_vals, 1));
- *position_y = g_value_get_int (gimp_value_array_index (return_vals, 2));
- }
-
- gimp_value_array_unref (return_vals);
-
- return position_x;
-}
diff --git a/libgimp/gimpimagesamplepoints_pdb.h b/libgimp/gimpimagesamplepoints_pdb.h
index 5700c08872..7c12a4fde6 100644
--- a/libgimp/gimpimagesamplepoints_pdb.h
+++ b/libgimp/gimpimagesamplepoints_pdb.h
@@ -32,10 +32,6 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
guint gimp_image_add_sample_point (GimpImage *image,
gint position_x,
gint position_y);
@@ -47,31 +43,6 @@ gint gimp_image_get_sample_point_position (GimpImage *image,
guint sample_point,
gint *position_y);
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_image_add_sample_point _gimp_image_add_sample_point
-#define gimp_image_delete_sample_point _gimp_image_delete_sample_point
-#define gimp_image_find_next_sample_point _gimp_image_find_next_sample_point
-#define gimp_image_get_sample_point_position _gimp_image_get_sample_point_position
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-gint32 _gimp_image_add_sample_point (gint32 image_ID,
- gint position_x,
- gint position_y);
-gboolean _gimp_image_delete_sample_point (gint32 image_ID,
- gint32 sample_point_ID);
-gint32 _gimp_image_find_next_sample_point (gint32 image_ID,
- gint32 sample_point_ID);
-gint _gimp_image_get_sample_point_position (gint32 image_ID,
- gint32 sample_point_ID,
- gint *position_y);
-
G_END_DECLS
diff --git a/libgimp/gimpimageselect_pdb.c b/libgimp/gimpimageselect_pdb.c
index 4702c2599c..1f1cf2e9f6 100644
--- a/libgimp/gimpimageselect_pdb.c
+++ b/libgimp/gimpimageselect_pdb.c
@@ -99,71 +99,6 @@ gimp_image_select_color (GimpImage *image,
return success;
}
-/**
- * _gimp_image_select_color: (skip)
- * @image_ID: The affected image.
- * @operation: The selection operation.
- * @drawable_ID: The affected drawable.
- * @color: The color to select.
- *
- * Create a selection by selecting all pixels (in the specified
- * drawable) with the same (or similar) color to that specified.
- *
- * This tool creates a selection over the specified image. A by-color
- * selection is determined by the supplied color under the constraints
- * of the current context settings. Essentially, all pixels (in the
- * drawable) that have color sufficiently close to the specified color
- * (as determined by the threshold and criterion context values) are
- * included in the selection. To select transparent regions, the color
- * specified must also have minimum alpha.
- *
- * This procedure is affected by the following context setters:
- * gimp_context_set_antialias(), gimp_context_set_feather(),
- * gimp_context_set_feather_radius(), gimp_context_set_sample_merged(),
- * gimp_context_set_sample_criterion(),
- * gimp_context_set_sample_threshold(),
- * gimp_context_set_sample_transparent().
- *
- * In the case of a merged sampling, the supplied drawable is ignored.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.8
- **/
-gboolean
-_gimp_image_select_color (gint32 image_ID,
- GimpChannelOps operation,
- gint32 drawable_ID,
- const GimpRGB *color)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_CHANNEL_OPS, operation,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- GIMP_TYPE_RGB, color,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-select-color",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-select-color",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_select_contiguous_color:
* @image: The affected image.
@@ -241,83 +176,6 @@ gimp_image_select_contiguous_color (GimpImage *image,
return success;
}
-/**
- * _gimp_image_select_contiguous_color: (skip)
- * @image_ID: The affected image.
- * @operation: The selection operation.
- * @drawable_ID: The affected drawable.
- * @x: x coordinate of initial seed fill point: (image coordinates).
- * @y: y coordinate of initial seed fill point: (image coordinates).
- *
- * Create a selection by selecting all pixels around specified
- * coordinates with the same (or similar) color to that at the
- * coordinates.
- *
- * This tool creates a contiguous selection over the specified image. A
- * contiguous color selection is determined by a seed fill under the
- * constraints of the current context settings. Essentially, the color
- * at the specified coordinates (in the drawable) is measured and the
- * selection expands outwards from that point to any adjacent pixels
- * which are not significantly different (as determined by the
- * threshold and criterion context settings). This process continues
- * until no more expansion is possible. If antialiasing is turned on,
- * the final selection mask will contain intermediate values based on
- * close misses to the threshold bar at pixels along the seed fill
- * boundary.
- *
- * This procedure is affected by the following context setters:
- * gimp_context_set_antialias(), gimp_context_set_feather(),
- * gimp_context_set_feather_radius(), gimp_context_set_sample_merged(),
- * gimp_context_set_sample_criterion(),
- * gimp_context_set_sample_threshold(),
- * gimp_context_set_sample_transparent(),
- * gimp_context_set_diagonal_neighbors().
- *
- * In the case of a merged sampling, the supplied drawable is ignored.
- * If the sample is merged, the specified coordinates are relative to
- * the image origin; otherwise, they are relative to the drawable's
- * origin.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.8
- **/
-gboolean
-_gimp_image_select_contiguous_color (gint32 image_ID,
- GimpChannelOps operation,
- gint32 drawable_ID,
- gdouble x,
- gdouble y)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_CHANNEL_OPS, operation,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_DOUBLE, x,
- G_TYPE_DOUBLE, y,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-select-contiguous-color",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-select-contiguous-color",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_select_rectangle:
* @image: The image.
@@ -378,66 +236,6 @@ gimp_image_select_rectangle (GimpImage *image,
return success;
}
-/**
- * _gimp_image_select_rectangle: (skip)
- * @image_ID: The image.
- * @operation: The selection operation.
- * @x: x coordinate of upper-left corner of rectangle.
- * @y: y coordinate of upper-left corner of rectangle.
- * @width: The width of the rectangle.
- * @height: The height of the rectangle.
- *
- * Create a rectangular selection over the specified image;
- *
- * This tool creates a rectangular selection over the specified image.
- * The rectangular region can be either added to, subtracted from, or
- * replace the contents of the previous selection mask.
- *
- * This procedure is affected by the following context setters:
- * gimp_context_set_feather(), gimp_context_set_feather_radius().
- *
- * Returns: TRUE on success.
- *
- * Since: 2.8
- **/
-gboolean
-_gimp_image_select_rectangle (gint32 image_ID,
- GimpChannelOps operation,
- gdouble x,
- gdouble y,
- gdouble width,
- gdouble height)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_CHANNEL_OPS, operation,
- G_TYPE_DOUBLE, x,
- G_TYPE_DOUBLE, y,
- G_TYPE_DOUBLE, width,
- G_TYPE_DOUBLE, height,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-select-rectangle",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-select-rectangle",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_select_round_rectangle:
* @image: The image.
@@ -507,75 +305,6 @@ gimp_image_select_round_rectangle (GimpImage *image,
return success;
}
-/**
- * _gimp_image_select_round_rectangle: (skip)
- * @image_ID: The image.
- * @operation: The selection operation.
- * @x: x coordinate of upper-left corner of rectangle.
- * @y: y coordinate of upper-left corner of rectangle.
- * @width: The width of the rectangle.
- * @height: The height of the rectangle.
- * @corner_radius_x: The corner radius in X direction.
- * @corner_radius_y: The corner radius in Y direction.
- *
- * Create a rectangular selection with round corners over the specified
- * image;
- *
- * This tool creates a rectangular selection with round corners over
- * the specified image. The rectangular region can be either added to,
- * subtracted from, or replace the contents of the previous selection
- * mask.
- *
- * This procedure is affected by the following context setters:
- * gimp_context_set_antialias(), gimp_context_set_feather(),
- * gimp_context_set_feather_radius().
- *
- * Returns: TRUE on success.
- *
- * Since: 2.8
- **/
-gboolean
-_gimp_image_select_round_rectangle (gint32 image_ID,
- GimpChannelOps operation,
- gdouble x,
- gdouble y,
- gdouble width,
- gdouble height,
- gdouble corner_radius_x,
- gdouble corner_radius_y)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_CHANNEL_OPS, operation,
- G_TYPE_DOUBLE, x,
- G_TYPE_DOUBLE, y,
- G_TYPE_DOUBLE, width,
- G_TYPE_DOUBLE, height,
- G_TYPE_DOUBLE, corner_radius_x,
- G_TYPE_DOUBLE, corner_radius_y,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-select-round-rectangle",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-select-round-rectangle",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_select_ellipse:
* @image: The image.
@@ -637,67 +366,6 @@ gimp_image_select_ellipse (GimpImage *image,
return success;
}
-/**
- * _gimp_image_select_ellipse: (skip)
- * @image_ID: The image.
- * @operation: The selection operation.
- * @x: x coordinate of upper-left corner of ellipse bounding box.
- * @y: y coordinate of upper-left corner of ellipse bounding box.
- * @width: The width of the ellipse.
- * @height: The height of the ellipse.
- *
- * Create an elliptical selection over the specified image.
- *
- * This tool creates an elliptical selection over the specified image.
- * The elliptical region can be either added to, subtracted from, or
- * replace the contents of the previous selection mask.
- *
- * This procedure is affected by the following context setters:
- * gimp_context_set_antialias(), gimp_context_set_feather(),
- * gimp_context_set_feather_radius().
- *
- * Returns: TRUE on success.
- *
- * Since: 2.8
- **/
-gboolean
-_gimp_image_select_ellipse (gint32 image_ID,
- GimpChannelOps operation,
- gdouble x,
- gdouble y,
- gdouble width,
- gdouble height)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_CHANNEL_OPS, operation,
- G_TYPE_DOUBLE, x,
- G_TYPE_DOUBLE, y,
- G_TYPE_DOUBLE, width,
- G_TYPE_DOUBLE, height,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-select-ellipse",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-select-ellipse",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_select_polygon:
* @image: The image.
@@ -759,67 +427,6 @@ gimp_image_select_polygon (GimpImage *image,
return success;
}
-/**
- * _gimp_image_select_polygon: (skip)
- * @image_ID: The image.
- * @operation: The selection operation.
- * @num_segs: Number of points (count 1 coordinate as two points).
- * @segs: (array length=num_segs) (element-type gdouble): Array of points: { p1.x, p1.y, p2.x, p2.y, ...,
pn.x, pn.y}.
- *
- * Create a polygonal selection over the specified image.
- *
- * This tool creates a polygonal selection over the specified image.
- * The polygonal region can be either added to, subtracted from, or
- * replace the contents of the previous selection mask. The polygon is
- * specified through an array of floating point numbers and its length.
- * The length of array must be 2n, where n is the number of points.
- * Each point is defined by 2 floating point values which correspond to
- * the x and y coordinates. If the final point does not connect to the
- * starting point, a connecting segment is automatically added.
- *
- * This procedure is affected by the following context setters:
- * gimp_context_set_antialias(), gimp_context_set_feather(),
- * gimp_context_set_feather_radius().
- *
- * Returns: TRUE on success.
- *
- * Since: 2.8
- **/
-gboolean
-_gimp_image_select_polygon (gint32 image_ID,
- GimpChannelOps operation,
- gint num_segs,
- const gdouble *segs)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_CHANNEL_OPS, operation,
- G_TYPE_INT, num_segs,
- GIMP_TYPE_FLOAT_ARRAY, NULL,
- G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 3), segs, num_segs);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-select-polygon",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-select-polygon",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_select_item:
* @image: The image.
@@ -872,56 +479,3 @@ gimp_image_select_item (GimpImage *image,
return success;
}
-
-/**
- * _gimp_image_select_item: (skip)
- * @image_ID: The image.
- * @operation: The desired operation with current selection.
- * @item_ID: The item to render to the selection.
- *
- * Transforms the specified item into a selection
- *
- * This procedure renders the item's outline into the current selection
- * of the image the item belongs to. What exactly the item's outline is
- * depends on the item type: for layers, it's the layer's alpha
- * channel, for vectors the vector's shape.
- *
- * This procedure is affected by the following context setters:
- * gimp_context_set_antialias(), gimp_context_set_feather(),
- * gimp_context_set_feather_radius().
- *
- * Returns: TRUE on success.
- *
- * Since: 2.8
- **/
-gboolean
-_gimp_image_select_item (gint32 image_ID,
- GimpChannelOps operation,
- gint32 item_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_CHANNEL_OPS, operation,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-select-item",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-select-item",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
diff --git a/libgimp/gimpimageselect_pdb.h b/libgimp/gimpimageselect_pdb.h
index 1bea2480b5..706a87c4b4 100644
--- a/libgimp/gimpimageselect_pdb.h
+++ b/libgimp/gimpimageselect_pdb.h
@@ -32,10 +32,6 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
gboolean gimp_image_select_color (GimpImage *image,
GimpChannelOps operation,
GimpDrawable *drawable,
@@ -73,60 +69,6 @@ gboolean gimp_image_select_item (GimpImage *image,
GimpChannelOps operation,
GimpItem *item);
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_image_select_color _gimp_image_select_color
-#define gimp_image_select_contiguous_color _gimp_image_select_contiguous_color
-#define gimp_image_select_rectangle _gimp_image_select_rectangle
-#define gimp_image_select_round_rectangle _gimp_image_select_round_rectangle
-#define gimp_image_select_ellipse _gimp_image_select_ellipse
-#define gimp_image_select_polygon _gimp_image_select_polygon
-#define gimp_image_select_item _gimp_image_select_item
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-gboolean _gimp_image_select_color (gint32 image_ID,
- GimpChannelOps operation,
- gint32 drawable_ID,
- const GimpRGB *color);
-gboolean _gimp_image_select_contiguous_color (gint32 image_ID,
- GimpChannelOps operation,
- gint32 drawable_ID,
- gdouble x,
- gdouble y);
-gboolean _gimp_image_select_rectangle (gint32 image_ID,
- GimpChannelOps operation,
- gdouble x,
- gdouble y,
- gdouble width,
- gdouble height);
-gboolean _gimp_image_select_round_rectangle (gint32 image_ID,
- GimpChannelOps operation,
- gdouble x,
- gdouble y,
- gdouble width,
- gdouble height,
- gdouble corner_radius_x,
- gdouble corner_radius_y);
-gboolean _gimp_image_select_ellipse (gint32 image_ID,
- GimpChannelOps operation,
- gdouble x,
- gdouble y,
- gdouble width,
- gdouble height);
-gboolean _gimp_image_select_polygon (gint32 image_ID,
- GimpChannelOps operation,
- gint num_segs,
- const gdouble *segs);
-gboolean _gimp_image_select_item (gint32 image_ID,
- GimpChannelOps operation,
- gint32 item_ID);
-
G_END_DECLS
diff --git a/libgimp/gimpimagetransform_pdb.c b/libgimp/gimpimagetransform_pdb.c
index 93a334ca06..079a267977 100644
--- a/libgimp/gimpimagetransform_pdb.c
+++ b/libgimp/gimpimagetransform_pdb.c
@@ -90,62 +90,6 @@ gimp_image_resize (GimpImage *image,
return success;
}
-/**
- * _gimp_image_resize: (skip)
- * @image_ID: The image.
- * @new_width: New image width.
- * @new_height: New image height.
- * @offx: x offset between upper left corner of old and new images: (new - old).
- * @offy: y offset between upper left corner of old and new images: (new - old).
- *
- * Resize the image to the specified extents.
- *
- * This procedure resizes the image so that it's new width and height
- * are equal to the supplied parameters. Offsets are also provided
- * which describe the position of the previous image's content. All
- * channels within the image are resized according to the specified
- * parameters; this includes the image selection mask. All layers
- * within the image are repositioned according to the specified
- * offsets.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_resize (gint32 image_ID,
- gint new_width,
- gint new_height,
- gint offx,
- gint offy)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_INT, new_width,
- G_TYPE_INT, new_height,
- G_TYPE_INT, offx,
- G_TYPE_INT, offy,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-resize",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-resize",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_resize_to_layers:
* @image: The image.
@@ -189,49 +133,6 @@ gimp_image_resize_to_layers (GimpImage *image)
return success;
}
-/**
- * _gimp_image_resize_to_layers: (skip)
- * @image_ID: The image.
- *
- * Resize the image to fit all layers.
- *
- * This procedure resizes the image to the bounding box of all layers
- * of the image. All channels within the image are resized to the new
- * size; this includes the image selection mask. All layers within the
- * image are repositioned to the new image area.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.2
- **/
-gboolean
-_gimp_image_resize_to_layers (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-resize-to-layers",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-resize-to-layers",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_scale:
* @image: The image.
@@ -280,54 +181,6 @@ gimp_image_scale (GimpImage *image,
return success;
}
-/**
- * _gimp_image_scale: (skip)
- * @image_ID: The image.
- * @new_width: New image width.
- * @new_height: New image height.
- *
- * Scale the image using the default interpolation method.
- *
- * This procedure scales the image so that its new width and height are
- * equal to the supplied parameters. All layers and channels within the
- * image are scaled according to the specified parameters; this
- * includes the image selection mask. The interpolation method used can
- * be set with gimp_context_set_interpolation().
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_scale (gint32 image_ID,
- gint new_width,
- gint new_height)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_INT, new_width,
- G_TYPE_INT, new_height,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-scale",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-scale",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_crop:
* @image: The image.
@@ -383,61 +236,6 @@ gimp_image_crop (GimpImage *image,
return success;
}
-/**
- * _gimp_image_crop: (skip)
- * @image_ID: The image.
- * @new_width: New image width: (0 < new_width <= width).
- * @new_height: New image height: (0 < new_height <= height).
- * @offx: X offset: (0 <= offx <= (width - new_width)).
- * @offy: Y offset: (0 <= offy <= (height - new_height)).
- *
- * Crop the image to the specified extents.
- *
- * This procedure crops the image so that it's new width and height are
- * equal to the supplied parameters. Offsets are also provided which
- * describe the position of the previous image's content. All channels
- * and layers within the image are cropped to the new image extents;
- * this includes the image selection mask. If any parameters are out of
- * range, an error is returned.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_crop (gint32 image_ID,
- gint new_width,
- gint new_height,
- gint offx,
- gint offy)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_INT, new_width,
- G_TYPE_INT, new_height,
- G_TYPE_INT, offx,
- G_TYPE_INT, offy,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-crop",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-crop",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_flip:
* @image: The image.
@@ -479,47 +277,6 @@ gimp_image_flip (GimpImage *image,
return success;
}
-/**
- * _gimp_image_flip: (skip)
- * @image_ID: The image.
- * @flip_type: Type of flip.
- *
- * Flips the image horizontally or vertically.
- *
- * This procedure flips (mirrors) the image.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_flip (gint32 image_ID,
- GimpOrientationType flip_type)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_ORIENTATION_TYPE, flip_type,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-flip",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-flip",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_rotate:
* @image: The image.
@@ -560,44 +317,3 @@ gimp_image_rotate (GimpImage *image,
return success;
}
-
-/**
- * _gimp_image_rotate: (skip)
- * @image_ID: The image.
- * @rotate_type: Angle of rotation.
- *
- * Rotates the image by the specified degrees.
- *
- * This procedure rotates the image.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_rotate (gint32 image_ID,
- GimpRotationType rotate_type)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_ROTATION_TYPE, rotate_type,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-rotate",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-rotate",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
diff --git a/libgimp/gimpimagetransform_pdb.h b/libgimp/gimpimagetransform_pdb.h
index 34caacb0c9..f82c018682 100644
--- a/libgimp/gimpimagetransform_pdb.h
+++ b/libgimp/gimpimagetransform_pdb.h
@@ -32,10 +32,6 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
gboolean gimp_image_resize (GimpImage *image,
gint new_width,
gint new_height,
@@ -55,41 +51,6 @@ gboolean gimp_image_flip (GimpImage *image,
gboolean gimp_image_rotate (GimpImage *image,
GimpRotationType rotate_type);
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_image_resize _gimp_image_resize
-#define gimp_image_resize_to_layers _gimp_image_resize_to_layers
-#define gimp_image_scale _gimp_image_scale
-#define gimp_image_crop _gimp_image_crop
-#define gimp_image_flip _gimp_image_flip
-#define gimp_image_rotate _gimp_image_rotate
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-gboolean _gimp_image_resize (gint32 image_ID,
- gint new_width,
- gint new_height,
- gint offx,
- gint offy);
-gboolean _gimp_image_resize_to_layers (gint32 image_ID);
-gboolean _gimp_image_scale (gint32 image_ID,
- gint new_width,
- gint new_height);
-gboolean _gimp_image_crop (gint32 image_ID,
- gint new_width,
- gint new_height,
- gint offx,
- gint offy);
-gboolean _gimp_image_flip (gint32 image_ID,
- GimpOrientationType flip_type);
-gboolean _gimp_image_rotate (gint32 image_ID,
- GimpRotationType rotate_type);
-
G_END_DECLS
diff --git a/libgimp/gimpimageundo_pdb.c b/libgimp/gimpimageundo_pdb.c
index b93ec92107..f21ec62d8b 100644
--- a/libgimp/gimpimageundo_pdb.c
+++ b/libgimp/gimpimageundo_pdb.c
@@ -75,47 +75,6 @@ gimp_image_undo_group_start (GimpImage *image)
return success;
}
-/**
- * _gimp_image_undo_group_start: (skip)
- * @image_ID: The ID of the image in which to open an undo group.
- *
- * Starts a group undo.
- *
- * This function is used to start a group undo--necessary for logically
- * combining two or more undo operations into a single operation. This
- * call must be used in conjunction with a gimp_image_undo_group_end()
- * call.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_undo_group_start (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-undo-group-start",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-undo-group-start",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_undo_group_end:
* @image: The ID of the image in which to close an undo group.
@@ -155,45 +114,6 @@ gimp_image_undo_group_end (GimpImage *image)
return success;
}
-/**
- * _gimp_image_undo_group_end: (skip)
- * @image_ID: The ID of the image in which to close an undo group.
- *
- * Finish a group undo.
- *
- * This function must be called once for each
- * gimp_image_undo_group_start() call that is made.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_image_undo_group_end (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-undo-group-end",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-undo-group-end",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_image_undo_is_enabled:
* @image: The image.
@@ -236,48 +156,6 @@ gimp_image_undo_is_enabled (GimpImage *image)
return enabled;
}
-/**
- * _gimp_image_undo_is_enabled: (skip)
- * @image_ID: The image.
- *
- * Check if the image's undo stack is enabled.
- *
- * This procedure checks if the image's undo stack is currently enabled
- * or disabled. This is useful when several plug-ins or scripts call
- * each other and want to check if their caller has already used
- * gimp_image_undo_disable() or gimp_image_undo_freeze().
- *
- * Returns: TRUE if undo is enabled for this image.
- **/
-gboolean
-_gimp_image_undo_is_enabled (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean enabled = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-undo-is-enabled",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-undo-is-enabled",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- enabled = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return enabled;
-}
-
/**
* gimp_image_undo_disable:
* @image: The image.
@@ -321,49 +199,6 @@ gimp_image_undo_disable (GimpImage *image)
return disabled;
}
-/**
- * _gimp_image_undo_disable: (skip)
- * @image_ID: The image.
- *
- * Disable the image's undo stack.
- *
- * This procedure disables the image's undo stack, allowing subsequent
- * operations to ignore their undo steps. This is generally called in
- * conjunction with gimp_image_undo_enable() to temporarily disable an
- * image undo stack. This is advantageous because saving undo steps can
- * be time and memory intensive.
- *
- * Returns: TRUE if the image undo has been disabled.
- **/
-gboolean
-_gimp_image_undo_disable (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean disabled = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-undo-disable",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-undo-disable",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- disabled = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return disabled;
-}
-
/**
* gimp_image_undo_enable:
* @image: The image.
@@ -406,48 +241,6 @@ gimp_image_undo_enable (GimpImage *image)
return enabled;
}
-/**
- * _gimp_image_undo_enable: (skip)
- * @image_ID: The image.
- *
- * Enable the image's undo stack.
- *
- * This procedure enables the image's undo stack, allowing subsequent
- * operations to store their undo steps. This is generally called in
- * conjunction with gimp_image_undo_disable() to temporarily disable an
- * image undo stack.
- *
- * Returns: TRUE if the image undo has been enabled.
- **/
-gboolean
-_gimp_image_undo_enable (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean enabled = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-undo-enable",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-undo-enable",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- enabled = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return enabled;
-}
-
/**
* gimp_image_undo_freeze:
* @image: The image.
@@ -497,55 +290,6 @@ gimp_image_undo_freeze (GimpImage *image)
return frozen;
}
-/**
- * _gimp_image_undo_freeze: (skip)
- * @image_ID: The image.
- *
- * Freeze the image's undo stack.
- *
- * This procedure freezes the image's undo stack, allowing subsequent
- * operations to ignore their undo steps. This is generally called in
- * conjunction with gimp_image_undo_thaw() to temporarily disable an
- * image undo stack. This is advantageous because saving undo steps can
- * be time and memory intensive. gimp_image_undo_freeze() /
- * gimp_image_undo_thaw() and gimp_image_undo_disable() /
- * gimp_image_undo_enable() differ in that the former does not free up
- * all undo steps when undo is thawed, so is more suited to interactive
- * in-situ previews. It is important in this case that the image is
- * back to the same state it was frozen in before thawing, else 'undo'
- * behaviour is undefined.
- *
- * Returns: TRUE if the image undo has been frozen.
- **/
-gboolean
-_gimp_image_undo_freeze (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean frozen = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-undo-freeze",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-undo-freeze",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- frozen = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return frozen;
-}
-
/**
* gimp_image_undo_thaw:
* @image: The image.
@@ -593,51 +337,3 @@ gimp_image_undo_thaw (GimpImage *image)
return thawed;
}
-
-/**
- * _gimp_image_undo_thaw: (skip)
- * @image_ID: The image.
- *
- * Thaw the image's undo stack.
- *
- * This procedure thaws the image's undo stack, allowing subsequent
- * operations to store their undo steps. This is generally called in
- * conjunction with gimp_image_undo_freeze() to temporarily freeze an
- * image undo stack. gimp_image_undo_thaw() does NOT free the undo
- * stack as gimp_image_undo_enable() does, so is suited for situations
- * where one wishes to leave the undo stack in the same state in which
- * one found it despite non-destructively playing with the image in the
- * meantime. An example would be in-situ plug-in previews. Balancing
- * freezes and thaws and ensuring image consistency is the
- * responsibility of the caller.
- *
- * Returns: TRUE if the image undo has been thawed.
- **/
-gboolean
-_gimp_image_undo_thaw (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean thawed = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-image-undo-thaw",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-image-undo-thaw",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- thawed = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return thawed;
-}
diff --git a/libgimp/gimpimageundo_pdb.h b/libgimp/gimpimageundo_pdb.h
index 9a59b7622f..3caa0f2227 100644
--- a/libgimp/gimpimageundo_pdb.h
+++ b/libgimp/gimpimageundo_pdb.h
@@ -32,10 +32,6 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
gboolean gimp_image_undo_group_start (GimpImage *image);
gboolean gimp_image_undo_group_end (GimpImage *image);
gboolean gimp_image_undo_is_enabled (GimpImage *image);
@@ -44,31 +40,6 @@ gboolean gimp_image_undo_enable (GimpImage *image);
gboolean gimp_image_undo_freeze (GimpImage *image);
gboolean gimp_image_undo_thaw (GimpImage *image);
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_image_undo_group_start _gimp_image_undo_group_start
-#define gimp_image_undo_group_end _gimp_image_undo_group_end
-#define gimp_image_undo_is_enabled _gimp_image_undo_is_enabled
-#define gimp_image_undo_disable _gimp_image_undo_disable
-#define gimp_image_undo_enable _gimp_image_undo_enable
-#define gimp_image_undo_freeze _gimp_image_undo_freeze
-#define gimp_image_undo_thaw _gimp_image_undo_thaw
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-gboolean _gimp_image_undo_group_start (gint32 image_ID);
-gboolean _gimp_image_undo_group_end (gint32 image_ID);
-gboolean _gimp_image_undo_is_enabled (gint32 image_ID);
-gboolean _gimp_image_undo_disable (gint32 image_ID);
-gboolean _gimp_image_undo_enable (gint32 image_ID);
-gboolean _gimp_image_undo_freeze (gint32 image_ID);
-gboolean _gimp_image_undo_thaw (gint32 image_ID);
-
G_END_DECLS
diff --git a/libgimp/gimpitem_pdb.c b/libgimp/gimpitem_pdb.c
index 84533e68f9..f098698a91 100644
--- a/libgimp/gimpitem_pdb.c
+++ b/libgimp/gimpitem_pdb.c
@@ -406,47 +406,6 @@ gimp_item_get_image (GimpItem *item)
return image;
}
-/**
- * _gimp_item_get_image: (skip)
- * @item_ID: The item.
- *
- * Returns the item's image.
- *
- * This procedure returns the item's image.
- *
- * Returns: The item's image.
- *
- * Since: 2.8
- **/
-gint32
-_gimp_item_get_image (gint32 item_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 image_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-get-image",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-get-image",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- image_ID = gimp_image_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return image_ID;
-}
-
/**
* gimp_item_delete:
* @item: The item to delete.
@@ -491,50 +450,6 @@ gimp_item_delete (GimpItem *item)
return success;
}
-/**
- * _gimp_item_delete: (skip)
- * @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: 2.8
- **/
-gboolean
-_gimp_item_delete (gint32 item_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-delete",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-delete",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_item_is_group:
* @item: The item.
@@ -577,48 +492,6 @@ gimp_item_is_group (GimpItem *item)
return group;
}
-/**
- * _gimp_item_is_group: (skip)
- * @item_ID: The item.
- *
- * Returns whether the item is a group item.
- *
- * This procedure returns TRUE if the specified item is a group item
- * which can have children.
- *
- * Returns: TRUE if the item is a group, FALSE otherwise.
- *
- * Since: 2.8
- **/
-gboolean
-_gimp_item_is_group (gint32 item_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean group = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-is-group",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-is-group",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- group = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return group;
-}
-
/**
* gimp_item_get_parent:
* @item: The item.
@@ -660,47 +533,6 @@ gimp_item_get_parent (GimpItem *item)
return parent;
}
-/**
- * _gimp_item_get_parent: (skip)
- * @item_ID: The item.
- *
- * Returns the item's parent item.
- *
- * This procedure returns the item's parent item, if any.
- *
- * Returns: The item's parent item.
- *
- * Since: 2.8
- **/
-gint32
-_gimp_item_get_parent (gint32 item_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 parent_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-get-parent",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-get-parent",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- parent_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return parent_ID;
-}
-
/**
* _gimp_item_get_children:
* @item: The item.
@@ -794,105 +626,106 @@ gimp_item_get_expanded (GimpItem *item)
}
/**
- * _gimp_item_get_expanded: (skip)
- * @item_ID: The item.
+ * gimp_item_set_expanded:
+ * @item: The item.
+ * @expanded: TRUE to expand the item, FALSE to collapse the item.
*
- * Returns whether the item is expanded.
+ * Sets the expanded state of the item.
*
- * This procedure returns TRUE if the specified item is expanded.
+ * This procedure expands or collapses the item.
*
- * Returns: TRUE if the item is expanded, FALSE otherwise.
+ * Returns: TRUE on success.
*
* Since: 2.10
**/
gboolean
-_gimp_item_get_expanded (gint32 item_ID)
+gimp_item_set_expanded (GimpItem *item,
+ gboolean expanded)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean expanded = FALSE;
+ gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
+ GIMP_TYPE_ITEM, item,
+ G_TYPE_BOOLEAN, expanded,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-get-expanded",
+ "gimp-item-set-expanded",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-item-get-expanded",
+ return_vals = gimp_run_procedure_array ("gimp-item-set-expanded",
args);
gimp_value_array_unref (args);
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- expanded = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
+ success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
- return expanded;
+ return success;
}
/**
- * gimp_item_set_expanded:
+ * gimp_item_get_name:
* @item: The item.
- * @expanded: TRUE to expand the item, FALSE to collapse the item.
*
- * Sets the expanded state of the item.
+ * Get the name of the specified item.
*
- * This procedure expands or collapses the item.
+ * This procedure returns the specified item's name.
*
- * Returns: TRUE on success.
+ * Returns: (transfer full): The item name.
+ * The returned value must be freed with g_free().
*
- * Since: 2.10
+ * Since: 2.8
**/
-gboolean
-gimp_item_set_expanded (GimpItem *item,
- gboolean expanded)
+gchar *
+gimp_item_get_name (GimpItem *item)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ gchar *name = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_ITEM, item,
- G_TYPE_BOOLEAN, expanded,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-set-expanded",
+ "gimp-item-get-name",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-item-set-expanded",
+ return_vals = gimp_run_procedure_array ("gimp-item-get-name",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ name = g_value_dup_string (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return name;
}
/**
- * _gimp_item_set_expanded: (skip)
- * @item_ID: The item.
- * @expanded: TRUE to expand the item, FALSE to collapse the item.
+ * gimp_item_set_name:
+ * @item: The item.
+ * @name: The new item name.
*
- * Sets the expanded state of the item.
+ * Set the name of the specified item.
*
- * This procedure expands or collapses the item.
+ * This procedure sets the specified item's name.
*
* Returns: TRUE on success.
*
- * Since: 2.10
+ * Since: 2.8
**/
gboolean
-_gimp_item_set_expanded (gint32 item_ID,
- gboolean expanded)
+gimp_item_set_name (GimpItem *item,
+ const gchar *name)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -900,16 +733,16 @@ _gimp_item_set_expanded (gint32 item_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_BOOLEAN, expanded,
+ GIMP_TYPE_ITEM, item,
+ G_TYPE_STRING, name,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-set-expanded",
+ "gimp-item-set-name",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-item-set-expanded",
+ return_vals = gimp_run_procedure_array ("gimp-item-set-name",
args);
gimp_value_array_unref (args);
@@ -921,25 +754,24 @@ _gimp_item_set_expanded (gint32 item_ID,
}
/**
- * gimp_item_get_name:
+ * gimp_item_get_visible:
* @item: The item.
*
- * Get the name of the specified item.
+ * Get the visibility of the specified item.
*
- * This procedure returns the specified item's name.
+ * This procedure returns the specified item's visibility.
*
- * Returns: (transfer full): The item name.
- * The returned value must be freed with g_free().
+ * Returns: The item visibility.
*
* Since: 2.8
**/
-gchar *
-gimp_item_get_name (GimpItem *item)
+gboolean
+gimp_item_get_visible (GimpItem *item)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gchar *name = NULL;
+ gboolean visible = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_ITEM, item,
@@ -947,122 +779,121 @@ gimp_item_get_name (GimpItem *item)
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-get-name",
+ "gimp-item-get-visible",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-item-get-name",
+ return_vals = gimp_run_procedure_array ("gimp-item-get-visible",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- name = g_value_dup_string (gimp_value_array_index (return_vals, 1));
+ visible = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return name;
+ return visible;
}
/**
- * _gimp_item_get_name: (skip)
- * @item_ID: The item.
+ * gimp_item_set_visible:
+ * @item: The item.
+ * @visible: The new item visibility.
*
- * Get the name of the specified item.
+ * Set the visibility of the specified item.
*
- * This procedure returns the specified item's name.
+ * This procedure sets the specified item's visibility.
*
- * Returns: The item name.
- * The returned value must be freed with g_free().
+ * Returns: TRUE on success.
*
* Since: 2.8
**/
-gchar *
-_gimp_item_get_name (gint32 item_ID)
+gboolean
+gimp_item_set_visible (GimpItem *item,
+ gboolean visible)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gchar *name = NULL;
+ gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
+ GIMP_TYPE_ITEM, item,
+ G_TYPE_BOOLEAN, visible,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-get-name",
+ "gimp-item-set-visible",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-item-get-name",
+ return_vals = gimp_run_procedure_array ("gimp-item-set-visible",
args);
gimp_value_array_unref (args);
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- name = g_value_dup_string (gimp_value_array_index (return_vals, 1));
+ success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
- return name;
+ return success;
}
/**
- * gimp_item_set_name:
+ * gimp_item_get_linked:
* @item: The item.
- * @name: The new item name.
*
- * Set the name of the specified item.
+ * Get the linked state of the specified item.
*
- * This procedure sets the specified item's name.
+ * This procedure returns the specified item's linked state.
*
- * Returns: TRUE on success.
+ * Returns: The item linked state (for moves).
*
* Since: 2.8
**/
gboolean
-gimp_item_set_name (GimpItem *item,
- const gchar *name)
+gimp_item_get_linked (GimpItem *item)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ gboolean linked = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_ITEM, item,
- G_TYPE_STRING, name,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-set-name",
+ "gimp-item-get-linked",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-item-set-name",
+ return_vals = gimp_run_procedure_array ("gimp-item-get-linked",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ linked = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return linked;
}
/**
- * _gimp_item_set_name: (skip)
- * @item_ID: The item.
- * @name: The new item name.
+ * gimp_item_set_linked:
+ * @item: The item.
+ * @linked: The new item linked state.
*
- * Set the name of the specified item.
+ * Set the linked state of the specified item.
*
- * This procedure sets the specified item's name.
+ * This procedure sets the specified item's linked state.
*
* Returns: TRUE on success.
*
* Since: 2.8
**/
gboolean
-_gimp_item_set_name (gint32 item_ID,
- const gchar *name)
+gimp_item_set_linked (GimpItem *item,
+ gboolean linked)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -1070,16 +901,16 @@ _gimp_item_set_name (gint32 item_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_STRING, name,
+ GIMP_TYPE_ITEM, item,
+ G_TYPE_BOOLEAN, linked,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-set-name",
+ "gimp-item-set-linked",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-item-set-name",
+ return_vals = gimp_run_procedure_array ("gimp-item-set-linked",
args);
gimp_value_array_unref (args);
@@ -1091,24 +922,24 @@ _gimp_item_set_name (gint32 item_ID,
}
/**
- * gimp_item_get_visible:
+ * gimp_item_get_lock_content:
* @item: The item.
*
- * Get the visibility of the specified item.
+ * Get the 'lock content' state of the specified item.
*
- * This procedure returns the specified item's visibility.
+ * This procedure returns the specified item's lock content state.
*
- * Returns: The item visibility.
+ * Returns: Whether the item's contents are locked.
*
* Since: 2.8
**/
gboolean
-gimp_item_get_visible (GimpItem *item)
+gimp_item_get_lock_content (GimpItem *item)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean visible = FALSE;
+ gboolean lock_content = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_ITEM, item,
@@ -1116,121 +947,121 @@ gimp_item_get_visible (GimpItem *item)
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-get-visible",
+ "gimp-item-get-lock-content",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-item-get-visible",
+ return_vals = gimp_run_procedure_array ("gimp-item-get-lock-content",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- visible = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
+ lock_content = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return visible;
+ return lock_content;
}
/**
- * _gimp_item_get_visible: (skip)
- * @item_ID: The item.
+ * gimp_item_set_lock_content:
+ * @item: The item.
+ * @lock_content: The new item 'lock content' state.
*
- * Get the visibility of the specified item.
+ * Set the 'lock content' state of the specified item.
*
- * This procedure returns the specified item's visibility.
+ * This procedure sets the specified item's lock content state.
*
- * Returns: The item visibility.
+ * Returns: TRUE on success.
*
* Since: 2.8
**/
gboolean
-_gimp_item_get_visible (gint32 item_ID)
+gimp_item_set_lock_content (GimpItem *item,
+ gboolean lock_content)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean visible = FALSE;
+ gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
+ GIMP_TYPE_ITEM, item,
+ G_TYPE_BOOLEAN, lock_content,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-get-visible",
+ "gimp-item-set-lock-content",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-item-get-visible",
+ return_vals = gimp_run_procedure_array ("gimp-item-set-lock-content",
args);
gimp_value_array_unref (args);
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- visible = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
+ success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
- return visible;
+ return success;
}
/**
- * gimp_item_set_visible:
+ * gimp_item_get_lock_position:
* @item: The item.
- * @visible: The new item visibility.
*
- * Set the visibility of the specified item.
+ * Get the 'lock position' state of the specified item.
*
- * This procedure sets the specified item's visibility.
+ * This procedure returns the specified item's lock position state.
*
- * Returns: TRUE on success.
+ * Returns: Whether the item's position is locked.
*
- * Since: 2.8
+ * Since: 2.10
**/
gboolean
-gimp_item_set_visible (GimpItem *item,
- gboolean visible)
+gimp_item_get_lock_position (GimpItem *item)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ gboolean lock_position = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_ITEM, item,
- G_TYPE_BOOLEAN, visible,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-set-visible",
+ "gimp-item-get-lock-position",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-item-set-visible",
+ return_vals = gimp_run_procedure_array ("gimp-item-get-lock-position",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ lock_position = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return lock_position;
}
/**
- * _gimp_item_set_visible: (skip)
- * @item_ID: The item.
- * @visible: The new item visibility.
+ * gimp_item_set_lock_position:
+ * @item: The item.
+ * @lock_position: The new item 'lock position' state.
*
- * Set the visibility of the specified item.
+ * Set the 'lock position' state of the specified item.
*
- * This procedure sets the specified item's visibility.
+ * This procedure sets the specified item's lock position state.
*
* Returns: TRUE on success.
*
- * Since: 2.8
+ * Since: 2.10
**/
gboolean
-_gimp_item_set_visible (gint32 item_ID,
- gboolean visible)
+gimp_item_set_lock_position (GimpItem *item,
+ gboolean lock_position)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -1238,16 +1069,16 @@ _gimp_item_set_visible (gint32 item_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_BOOLEAN, visible,
+ GIMP_TYPE_ITEM, item,
+ G_TYPE_BOOLEAN, lock_position,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-set-visible",
+ "gimp-item-set-lock-position",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-item-set-visible",
+ return_vals = gimp_run_procedure_array ("gimp-item-set-lock-position",
args);
gimp_value_array_unref (args);
@@ -1259,24 +1090,24 @@ _gimp_item_set_visible (gint32 item_ID,
}
/**
- * gimp_item_get_linked:
+ * gimp_item_get_color_tag:
* @item: The item.
*
- * Get the linked state of the specified item.
+ * Get the color tag of the specified item.
*
- * This procedure returns the specified item's linked state.
+ * This procedure returns the specified item's color tag.
*
- * Returns: The item linked state (for moves).
+ * Returns: The item's color tag.
*
- * Since: 2.8
+ * Since: 2.10
**/
-gboolean
-gimp_item_get_linked (GimpItem *item)
+GimpColorTag
+gimp_item_get_color_tag (GimpItem *item)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean linked = FALSE;
+ GimpColorTag color_tag = 0;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_ITEM, item,
@@ -1284,121 +1115,125 @@ gimp_item_get_linked (GimpItem *item)
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-get-linked",
+ "gimp-item-get-color-tag",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-item-get-linked",
+ return_vals = gimp_run_procedure_array ("gimp-item-get-color-tag",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- linked = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
+ color_tag = g_value_get_enum (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return linked;
+ return color_tag;
}
/**
- * _gimp_item_get_linked: (skip)
- * @item_ID: The item.
+ * gimp_item_set_color_tag:
+ * @item: The item.
+ * @color_tag: The new item color tag.
*
- * Get the linked state of the specified item.
+ * Set the color tag of the specified item.
*
- * This procedure returns the specified item's linked state.
+ * This procedure sets the specified item's color tag.
*
- * Returns: The item linked state (for moves).
+ * Returns: TRUE on success.
*
- * Since: 2.8
+ * Since: 2.10
**/
gboolean
-_gimp_item_get_linked (gint32 item_ID)
+gimp_item_set_color_tag (GimpItem *item,
+ GimpColorTag color_tag)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean linked = FALSE;
+ gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
+ GIMP_TYPE_ITEM, item,
+ GIMP_TYPE_COLOR_TAG, color_tag,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-get-linked",
+ "gimp-item-set-color-tag",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-item-get-linked",
+ return_vals = gimp_run_procedure_array ("gimp-item-set-color-tag",
args);
gimp_value_array_unref (args);
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- linked = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
+ success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
- return linked;
+ return success;
}
/**
- * gimp_item_set_linked:
+ * gimp_item_get_tattoo:
* @item: The item.
- * @linked: The new item linked state.
*
- * Set the linked state of the specified item.
+ * Get the tattoo of the specified item.
*
- * This procedure sets the specified item's linked state.
+ * 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: TRUE on success.
+ * Returns: The item tattoo.
*
* Since: 2.8
**/
-gboolean
-gimp_item_set_linked (GimpItem *item,
- gboolean linked)
+guint
+gimp_item_get_tattoo (GimpItem *item)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ guint tattoo = 0;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_ITEM, item,
- G_TYPE_BOOLEAN, linked,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-set-linked",
+ "gimp-item-get-tattoo",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-item-set-linked",
+ return_vals = gimp_run_procedure_array ("gimp-item-get-tattoo",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ tattoo = g_value_get_uint (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return tattoo;
}
/**
- * _gimp_item_set_linked: (skip)
- * @item_ID: The item.
- * @linked: The new item linked state.
+ * gimp_item_set_tattoo:
+ * @item: The item.
+ * @tattoo: The new item tattoo.
*
- * Set the linked state of the specified item.
+ * Set the tattoo of the specified item.
*
- * This procedure sets the specified item's linked state.
+ * 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: 2.8
**/
gboolean
-_gimp_item_set_linked (gint32 item_ID,
- gboolean linked)
+gimp_item_set_tattoo (GimpItem *item,
+ guint tattoo)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -1406,16 +1241,16 @@ _gimp_item_set_linked (gint32 item_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_BOOLEAN, linked,
+ GIMP_TYPE_ITEM, item,
+ G_TYPE_UINT, tattoo,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-set-linked",
+ "gimp-item-set-tattoo",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-item-set-linked",
+ return_vals = gimp_run_procedure_array ("gimp-item-set-tattoo",
args);
gimp_value_array_unref (args);
@@ -1427,763 +1262,39 @@ _gimp_item_set_linked (gint32 item_ID,
}
/**
- * gimp_item_get_lock_content:
+ * gimp_item_attach_parasite:
* @item: The item.
+ * @parasite: The parasite to attach to the item.
*
- * Get the 'lock content' state of the specified item.
+ * Add a parasite to an item.
*
- * This procedure returns the specified item's lock content state.
+ * This procedure attaches a parasite to an item. It has no return
+ * values.
*
- * Returns: Whether the item's contents are locked.
+ * Returns: TRUE on success.
*
* Since: 2.8
**/
gboolean
-gimp_item_get_lock_content (GimpItem *item)
+gimp_item_attach_parasite (GimpItem *item,
+ const GimpParasite *parasite)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean lock_content = FALSE;
+ gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_ITEM, item,
+ GIMP_TYPE_PARASITE, parasite,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-get-lock-content",
+ "gimp-item-attach-parasite",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-item-get-lock-content",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- lock_content = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return lock_content;
-}
-
-/**
- * _gimp_item_get_lock_content: (skip)
- * @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 contents are locked.
- *
- * Since: 2.8
- **/
-gboolean
-_gimp_item_get_lock_content (gint32 item_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean lock_content = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-get-lock-content",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-get-lock-content",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- lock_content = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return lock_content;
-}
-
-/**
- * gimp_item_set_lock_content:
- * @item: 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: 2.8
- **/
-gboolean
-gimp_item_set_lock_content (GimpItem *item,
- gboolean lock_content)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, item,
- G_TYPE_BOOLEAN, lock_content,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-set-lock-content",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-set-lock-content",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_item_set_lock_content: (skip)
- * @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: 2.8
- **/
-gboolean
-_gimp_item_set_lock_content (gint32 item_ID,
- gboolean lock_content)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_BOOLEAN, lock_content,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-set-lock-content",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-set-lock-content",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_item_get_lock_position:
- * @item: The item.
- *
- * Get the 'lock position' state of the specified item.
- *
- * This procedure returns the specified item's lock position state.
- *
- * Returns: Whether the item's position is locked.
- *
- * Since: 2.10
- **/
-gboolean
-gimp_item_get_lock_position (GimpItem *item)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean lock_position = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, item,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-get-lock-position",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-get-lock-position",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- lock_position = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return lock_position;
-}
-
-/**
- * _gimp_item_get_lock_position: (skip)
- * @item_ID: The item.
- *
- * Get the 'lock position' state of the specified item.
- *
- * This procedure returns the specified item's lock position state.
- *
- * Returns: Whether the item's position is locked.
- *
- * Since: 2.10
- **/
-gboolean
-_gimp_item_get_lock_position (gint32 item_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean lock_position = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-get-lock-position",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-get-lock-position",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- lock_position = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return lock_position;
-}
-
-/**
- * gimp_item_set_lock_position:
- * @item: The item.
- * @lock_position: The new item 'lock position' state.
- *
- * Set the 'lock position' state of the specified item.
- *
- * This procedure sets the specified item's lock position state.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-gimp_item_set_lock_position (GimpItem *item,
- gboolean lock_position)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, item,
- G_TYPE_BOOLEAN, lock_position,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-set-lock-position",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-set-lock-position",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_item_set_lock_position: (skip)
- * @item_ID: The item.
- * @lock_position: The new item 'lock position' state.
- *
- * Set the 'lock position' state of the specified item.
- *
- * This procedure sets the specified item's lock position state.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-_gimp_item_set_lock_position (gint32 item_ID,
- gboolean lock_position)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_BOOLEAN, lock_position,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-set-lock-position",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-set-lock-position",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_item_get_color_tag:
- * @item: The item.
- *
- * Get the color tag of the specified item.
- *
- * This procedure returns the specified item's color tag.
- *
- * Returns: The item's color tag.
- *
- * Since: 2.10
- **/
-GimpColorTag
-gimp_item_get_color_tag (GimpItem *item)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- GimpColorTag color_tag = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, item,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-get-color-tag",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-get-color-tag",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- color_tag = g_value_get_enum (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return color_tag;
-}
-
-/**
- * _gimp_item_get_color_tag: (skip)
- * @item_ID: The item.
- *
- * Get the color tag of the specified item.
- *
- * This procedure returns the specified item's color tag.
- *
- * Returns: The item's color tag.
- *
- * Since: 2.10
- **/
-GimpColorTag
-_gimp_item_get_color_tag (gint32 item_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- GimpColorTag color_tag = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-get-color-tag",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-get-color-tag",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- color_tag = g_value_get_enum (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return color_tag;
-}
-
-/**
- * gimp_item_set_color_tag:
- * @item: The item.
- * @color_tag: The new item color tag.
- *
- * Set the color tag of the specified item.
- *
- * This procedure sets the specified item's color tag.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-gimp_item_set_color_tag (GimpItem *item,
- GimpColorTag color_tag)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, item,
- GIMP_TYPE_COLOR_TAG, color_tag,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-set-color-tag",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-set-color-tag",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_item_set_color_tag: (skip)
- * @item_ID: The item.
- * @color_tag: The new item color tag.
- *
- * Set the color tag of the specified item.
- *
- * This procedure sets the specified item's color tag.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-_gimp_item_set_color_tag (gint32 item_ID,
- GimpColorTag color_tag)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- GIMP_TYPE_COLOR_TAG, color_tag,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-set-color-tag",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-set-color-tag",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_item_get_tattoo:
- * @item: 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: 2.8
- **/
-guint
-gimp_item_get_tattoo (GimpItem *item)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- guint tattoo = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, item,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-get-tattoo",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-get-tattoo",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- tattoo = g_value_get_uint (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return tattoo;
-}
-
-/**
- * _gimp_item_get_tattoo: (skip)
- * @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: 2.8
- **/
-guint
-_gimp_item_get_tattoo (gint32 item_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- guint tattoo = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-get-tattoo",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-get-tattoo",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- tattoo = g_value_get_uint (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return tattoo;
-}
-
-/**
- * gimp_item_set_tattoo:
- * @item: 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: 2.8
- **/
-gboolean
-gimp_item_set_tattoo (GimpItem *item,
- guint tattoo)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, item,
- G_TYPE_UINT, tattoo,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-set-tattoo",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-set-tattoo",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_item_set_tattoo: (skip)
- * @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: 2.8
- **/
-gboolean
-_gimp_item_set_tattoo (gint32 item_ID,
- guint tattoo)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_UINT, tattoo,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-set-tattoo",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-set-tattoo",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_item_attach_parasite:
- * @item: The item.
- * @parasite: The parasite to attach to the item.
- *
- * Add a parasite to an item.
- *
- * This procedure attaches a parasite to an item. It has no return
- * values.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.8
- **/
-gboolean
-gimp_item_attach_parasite (GimpItem *item,
- const GimpParasite *parasite)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, item,
- GIMP_TYPE_PARASITE, parasite,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-attach-parasite",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-attach-parasite",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_item_attach_parasite: (skip)
- * @item_ID: The item.
- * @parasite: The parasite to attach to the item.
- *
- * Add a parasite to an item.
- *
- * This procedure attaches a parasite to an item. It has no return
- * values.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.8
- **/
-gboolean
-_gimp_item_attach_parasite (gint32 item_ID,
- const GimpParasite *parasite)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- GIMP_TYPE_PARASITE, parasite,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-attach-parasite",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-attach-parasite",
+ return_vals = gimp_run_procedure_array ("gimp-item-attach-parasite",
args);
gimp_value_array_unref (args);
@@ -2238,50 +1349,6 @@ gimp_item_detach_parasite (GimpItem *item,
return success;
}
-/**
- * _gimp_item_detach_parasite: (skip)
- * @item_ID: The item.
- * @name: The name of the parasite to detach from the item.
- *
- * Removes a parasite from an item.
- *
- * This procedure detaches a parasite from an item. It has no return
- * values.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.8
- **/
-gboolean
-_gimp_item_detach_parasite (gint32 item_ID,
- const gchar *name)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_STRING, name,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-detach-parasite",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-detach-parasite",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_item_get_parasite:
* @item: The item.
@@ -2326,50 +1393,6 @@ gimp_item_get_parasite (GimpItem *item,
return parasite;
}
-/**
- * _gimp_item_get_parasite: (skip)
- * @item_ID: The item.
- * @name: The name of the parasite to find.
- *
- * Look up a parasite in an item
- *
- * Finds and returns the parasite that is attached to an item.
- *
- * Returns: The found parasite.
- *
- * Since: 2.8
- **/
-GimpParasite *
-_gimp_item_get_parasite (gint32 item_ID,
- const gchar *name)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- GimpParasite *parasite = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_STRING, name,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-get-parasite",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-get-parasite",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- parasite = g_value_dup_boxed (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return parasite;
-}
-
/**
* gimp_item_get_parasite_list:
* @item: The item.
@@ -2419,53 +1442,3 @@ gimp_item_get_parasite_list (GimpItem *item,
return parasites;
}
-
-/**
- * _gimp_item_get_parasite_list: (skip)
- * @item_ID: The item.
- * @num_parasites: (out): The number of attached parasites.
- *
- * List all parasites.
- *
- * Returns a list of all parasites currently attached the an item.
- *
- * Returns: (array length=num_parasites):
- * The names of currently attached parasites.
- * The returned value must be freed with g_strfreev().
- *
- * Since: 2.8
- **/
-gchar **
-_gimp_item_get_parasite_list (gint32 item_ID,
- gint *num_parasites)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gchar **parasites = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-get-parasite-list",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-get-parasite-list",
- args);
- gimp_value_array_unref (args);
-
- *num_parasites = 0;
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- {
- *num_parasites = g_value_get_int (gimp_value_array_index (return_vals, 1));
- parasites = gimp_value_dup_string_array (gimp_value_array_index (return_vals, 2));
- }
-
- gimp_value_array_unref (return_vals);
-
- return parasites;
-}
diff --git a/libgimp/gimpitem_pdb.h b/libgimp/gimpitem_pdb.h
index 68b6d9d89a..9d24bb36bb 100644
--- a/libgimp/gimpitem_pdb.h
+++ b/libgimp/gimpitem_pdb.h
@@ -32,17 +32,14 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-gboolean gimp_item_id_is_valid (gint item_id);
-gboolean gimp_item_id_is_drawable (gint item_id);
-gboolean gimp_item_id_is_layer (gint item_id);
-gboolean gimp_item_id_is_text_layer (gint item_id);
-gboolean gimp_item_id_is_channel (gint item_id);
-gboolean gimp_item_id_is_layer_mask (gint item_id);
-gboolean gimp_item_id_is_selection (gint item_id);
-gboolean gimp_item_id_is_vectors (gint item_id);
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
+gboolean gimp_item_id_is_valid (gint item_id);
+gboolean gimp_item_id_is_drawable (gint item_id);
+gboolean gimp_item_id_is_layer (gint item_id);
+gboolean gimp_item_id_is_text_layer (gint item_id);
+gboolean gimp_item_id_is_channel (gint item_id);
+gboolean gimp_item_id_is_layer_mask (gint item_id);
+gboolean gimp_item_id_is_selection (gint item_id);
+gboolean gimp_item_id_is_vectors (gint item_id);
GimpImage* gimp_item_get_image (GimpItem *item);
gboolean gimp_item_delete (GimpItem *item);
gboolean gimp_item_is_group (GimpItem *item);
@@ -82,77 +79,6 @@ GimpParasite* gimp_item_get_parasite (GimpItem *item,
gchar** gimp_item_get_parasite_list (GimpItem *item,
gint *num_parasites);
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_item_get_image _gimp_item_get_image
-#define gimp_item_delete _gimp_item_delete
-#define gimp_item_is_group _gimp_item_is_group
-#define gimp_item_get_parent _gimp_item_get_parent
-#define gimp_item_get_expanded _gimp_item_get_expanded
-#define gimp_item_set_expanded _gimp_item_set_expanded
-#define gimp_item_get_name _gimp_item_get_name
-#define gimp_item_set_name _gimp_item_set_name
-#define gimp_item_get_visible _gimp_item_get_visible
-#define gimp_item_set_visible _gimp_item_set_visible
-#define gimp_item_get_linked _gimp_item_get_linked
-#define gimp_item_set_linked _gimp_item_set_linked
-#define gimp_item_get_lock_content _gimp_item_get_lock_content
-#define gimp_item_set_lock_content _gimp_item_set_lock_content
-#define gimp_item_get_lock_position _gimp_item_get_lock_position
-#define gimp_item_set_lock_position _gimp_item_set_lock_position
-#define gimp_item_get_color_tag _gimp_item_get_color_tag
-#define gimp_item_set_color_tag _gimp_item_set_color_tag
-#define gimp_item_get_tattoo _gimp_item_get_tattoo
-#define gimp_item_set_tattoo _gimp_item_set_tattoo
-#define gimp_item_attach_parasite _gimp_item_attach_parasite
-#define gimp_item_detach_parasite _gimp_item_detach_parasite
-#define gimp_item_get_parasite _gimp_item_get_parasite
-#define gimp_item_get_parasite_list _gimp_item_get_parasite_list
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-gint32 _gimp_item_get_image (gint32 item_ID);
-gboolean _gimp_item_delete (gint32 item_ID);
-gboolean _gimp_item_is_group (gint32 item_ID);
-gint32 _gimp_item_get_parent (gint32 item_ID);
-gboolean _gimp_item_get_expanded (gint32 item_ID);
-gboolean _gimp_item_set_expanded (gint32 item_ID,
- gboolean expanded);
-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);
-gboolean _gimp_item_get_lock_position (gint32 item_ID);
-gboolean _gimp_item_set_lock_position (gint32 item_ID,
- gboolean lock_position);
-GimpColorTag _gimp_item_get_color_tag (gint32 item_ID);
-gboolean _gimp_item_set_color_tag (gint32 item_ID,
- GimpColorTag color_tag);
-guint _gimp_item_get_tattoo (gint32 item_ID);
-gboolean _gimp_item_set_tattoo (gint32 item_ID,
- guint tattoo);
-gboolean _gimp_item_attach_parasite (gint32 item_ID,
- const GimpParasite *parasite);
-gboolean _gimp_item_detach_parasite (gint32 item_ID,
- const gchar *name);
-GimpParasite* _gimp_item_get_parasite (gint32 item_ID,
- const gchar *name);
-gchar** _gimp_item_get_parasite_list (gint32 item_ID,
- gint *num_parasites);
-
G_END_DECLS
diff --git a/libgimp/gimpitemtransform_pdb.c b/libgimp/gimpitemtransform_pdb.c
index 6b934c43cf..93430894d0 100644
--- a/libgimp/gimpitemtransform_pdb.c
+++ b/libgimp/gimpitemtransform_pdb.c
@@ -89,61 +89,6 @@ gimp_item_transform_translate (GimpItem *item,
return ret_item;
}
-/**
- * _gimp_item_transform_translate: (skip)
- * @item_ID: The item.
- * @off_x: Offset in x direction.
- * @off_y: Offset in y direction.
- *
- * Translate the item by the specified offsets.
- *
- * This procedure translates the item by the amounts specified in the
- * off_x and off_y arguments. These can be negative, and are considered
- * offsets from the current position. The offsets will be rounded to
- * the nearest pixel unless the item is a path.
- *
- * If the item is attached to an image and has its linked flag set to
- * TRUE, all additional items contained in the image which have the
- * linked flag set to TRUE will also be translated by the specified
- * offsets.
- *
- * Returns: The translated item.
- *
- * Since: 2.10
- **/
-gint32
-_gimp_item_transform_translate (gint32 item_ID,
- gdouble off_x,
- gdouble off_y)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 ret_item_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_DOUBLE, off_x,
- G_TYPE_DOUBLE, off_y,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-transform-translate",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-transform-translate",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- ret_item_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return ret_item_ID;
-}
-
/**
* gimp_item_transform_flip_simple:
* @item: The affected item.
@@ -212,74 +157,6 @@ gimp_item_transform_flip_simple (GimpItem *item,
return ret_item;
}
-/**
- * _gimp_item_transform_flip_simple: (skip)
- * @item_ID: The affected item.
- * @flip_type: Type of flip.
- * @auto_center: Whether to automatically position the axis in the selection center.
- * @axis: coord. of flip axis.
- *
- * Flip the specified item either vertically or horizontally.
- *
- * This procedure flips the specified item.
- *
- * If a selection exists and the item is a drawable, the portion of the
- * drawable which lies under the selection is cut from the drawable and
- * made into a floating selection which is then flipped. If auto_center
- * is set to TRUE, the flip is around the selection's center.
- * Otherwise, the coordinate of the axis needs to be specified. The
- * return value is the ID of the flipped floating selection.
- *
- * If there is no selection or the item is not a drawable, the entire
- * item will be flipped around its center if auto_center is set to
- * TRUE, otherwise the coordinate of the axis needs to be specified.
- * Additionally, if the item has its linked flag set to TRUE, all
- * additional items contained in the image which have the linked flag
- * set to TRUE will also be flipped around the same axis. The return
- * value will be equal to the item ID supplied as input.
- *
- * This procedure is affected by the following context setters:
- * gimp_context_set_transform_resize().
- *
- * Returns: The flipped item.
- *
- * Since: 2.2
- **/
-gint32
-_gimp_item_transform_flip_simple (gint32 item_ID,
- GimpOrientationType flip_type,
- gboolean auto_center,
- gdouble axis)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 ret_item_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- GIMP_TYPE_ORIENTATION_TYPE, flip_type,
- G_TYPE_BOOLEAN, auto_center,
- G_TYPE_DOUBLE, axis,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-transform-flip-simple",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-transform-flip-simple",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- ret_item_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return ret_item_ID;
-}
-
/**
* gimp_item_transform_flip:
* @item: The affected item.
@@ -351,77 +228,6 @@ gimp_item_transform_flip (GimpItem *item,
return ret_item;
}
-/**
- * _gimp_item_transform_flip: (skip)
- * @item_ID: The affected item.
- * @x0: horz. coord. of one end of axis.
- * @y0: vert. coord. of one end of axis.
- * @x1: horz. coord. of other end of axis.
- * @y1: vert. coord. of other end of axis.
- *
- * Flip the specified item around a given line.
- *
- * This procedure flips the specified item.
- *
- * If a selection exists and the item is a drawable, the portion of the
- * drawable which lies under the selection is cut from the drawable and
- * made into a floating selection which is then flipped. The axis to
- * flip around is specified by specifying two points from that line.
- * The return value is the ID of the flipped floating selection.
- *
- * If there is no selection or the item is not a drawable, the entire
- * item will be flipped around the specified axis. Additionally, if the
- * item has its linked flag set to TRUE, all additional items contained
- * in the image which have the linked flag set to TRUE will also be
- * flipped around the same axis. The return value will be equal to the
- * item ID supplied as input.
- *
- * This procedure is affected by the following context setters:
- * gimp_context_set_interpolation(),
- * gimp_context_set_transform_direction(),
- * gimp_context_set_transform_resize().
- *
- * Returns: The flipped item.
- *
- * Since: 2.8
- **/
-gint32
-_gimp_item_transform_flip (gint32 item_ID,
- gdouble x0,
- gdouble y0,
- gdouble x1,
- gdouble y1)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 ret_item_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_DOUBLE, x0,
- G_TYPE_DOUBLE, y0,
- G_TYPE_DOUBLE, x1,
- G_TYPE_DOUBLE, y1,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-transform-flip",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-transform-flip",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- ret_item_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return ret_item_ID;
-}
-
/**
* gimp_item_transform_perspective:
* @item: The affected item.
@@ -514,98 +320,6 @@ gimp_item_transform_perspective (GimpItem *item,
return ret_item;
}
-/**
- * _gimp_item_transform_perspective: (skip)
- * @item_ID: The affected item.
- * @x0: The new x coordinate of upper-left corner of original bounding box.
- * @y0: The new y coordinate of upper-left corner of original bounding box.
- * @x1: The new x coordinate of upper-right corner of original bounding box.
- * @y1: The new y coordinate of upper-right corner of original bounding box.
- * @x2: The new x coordinate of lower-left corner of original bounding box.
- * @y2: The new y coordinate of lower-left corner of original bounding box.
- * @x3: The new x coordinate of lower-right corner of original bounding box.
- * @y3: The new y coordinate of lower-right corner of original bounding box.
- *
- * Perform a possibly non-affine transformation on the specified item.
- *
- * This procedure performs a possibly non-affine transformation on the
- * specified item by allowing the corners of the original bounding box
- * to be arbitrarily remapped to any values.
- *
- * The 4 coordinates specify the new locations of each corner of the
- * original bounding box. By specifying these values, any affine
- * transformation (rotation, scaling, translation) can be affected.
- * Additionally, these values can be specified such that the resulting
- * transformed item will appear to have been projected via a
- * perspective transform.
- *
- * If a selection exists and the item is a drawable, the portion of the
- * drawable which lies under the selection is cut from the drawable and
- * made into a floating selection which is then transformed as
- * specified. The return value is the ID of the transformed floating
- * selection.
- *
- * If there is no selection or the item is not a drawable, the entire
- * item will be transformed according to the specified mapping.
- * Additionally, if the item has its linked flag set to TRUE, all
- * additional items contained in the image which have the linked flag
- * set to TRUE will also be transformed the same way. The return value
- * will be equal to the item ID supplied as input.
- *
- * This procedure is affected by the following context setters:
- * gimp_context_set_interpolation(),
- * gimp_context_set_transform_direction(),
- * gimp_context_set_transform_resize().
- *
- * Returns: The transformed item.
- *
- * Since: 2.8
- **/
-gint32
-_gimp_item_transform_perspective (gint32 item_ID,
- gdouble x0,
- gdouble y0,
- gdouble x1,
- gdouble y1,
- gdouble x2,
- gdouble y2,
- gdouble x3,
- gdouble y3)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 ret_item_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_DOUBLE, x0,
- G_TYPE_DOUBLE, y0,
- G_TYPE_DOUBLE, x1,
- G_TYPE_DOUBLE, y1,
- G_TYPE_DOUBLE, x2,
- G_TYPE_DOUBLE, y2,
- G_TYPE_DOUBLE, x3,
- G_TYPE_DOUBLE, y3,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-transform-perspective",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-transform-perspective",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- ret_item_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return ret_item_ID;
-}
-
/**
* gimp_item_transform_rotate_simple:
* @item: The affected item.
@@ -681,9 +395,9 @@ gimp_item_transform_rotate_simple (GimpItem *item,
}
/**
- * _gimp_item_transform_rotate_simple: (skip)
- * @item_ID: The affected item.
- * @rotate_type: Type of rotation.
+ * gimp_item_transform_rotate:
+ * @item: The affected item.
+ * @angle: The angle of rotation (radians).
* @auto_center: Whether to automatically rotate around the selection center.
* @center_x: The hor. coordinate of the center of rotation.
* @center_y: The vert. coordinate of the center of rotation.
@@ -711,27 +425,29 @@ gimp_item_transform_rotate_simple (GimpItem *item,
* input.
*
* This procedure is affected by the following context setters:
+ * gimp_context_set_interpolation(),
+ * gimp_context_set_transform_direction(),
* gimp_context_set_transform_resize().
*
- * Returns: The rotated item.
+ * Returns: (transfer none): The rotated item.
*
* Since: 2.8
**/
-gint32
-_gimp_item_transform_rotate_simple (gint32 item_ID,
- GimpRotationType rotate_type,
- gboolean auto_center,
- gdouble center_x,
- gdouble center_y)
+GimpItem *
+gimp_item_transform_rotate (GimpItem *item,
+ gdouble angle,
+ gboolean auto_center,
+ gdouble center_x,
+ gdouble center_y)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gint32 ret_item_ID = -1;
+ GimpItem *ret_item = NULL;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- GIMP_TYPE_ROTATION_TYPE, rotate_type,
+ GIMP_TYPE_ITEM, item,
+ G_TYPE_DOUBLE, angle,
G_TYPE_BOOLEAN, auto_center,
G_TYPE_DOUBLE, center_x,
G_TYPE_DOUBLE, center_y,
@@ -739,171 +455,19 @@ _gimp_item_transform_rotate_simple (gint32 item_ID,
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-transform-rotate-simple",
+ "gimp-item-transform-rotate",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-item-transform-rotate-simple",
+ return_vals = gimp_run_procedure_array ("gimp-item-transform-rotate",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- ret_item_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
+ ret_item = g_value_get_object (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return ret_item_ID;
-}
-
-/**
- * gimp_item_transform_rotate:
- * @item: The affected item.
- * @angle: The angle of rotation (radians).
- * @auto_center: Whether to automatically rotate around the selection center.
- * @center_x: The hor. coordinate of the center of rotation.
- * @center_y: The vert. coordinate of the center of rotation.
- *
- * Rotate the specified item about given coordinates through the
- * specified angle.
- *
- * This function rotates the specified item.
- *
- * If a selection exists and the item is a drawable, the portion of the
- * drawable which lies under the selection is cut from the drawable and
- * made into a floating selection which is then rotated by the
- * specified amount. If auto_center is set to TRUE, the rotation is
- * around the selection's center. Otherwise, the coordinate of the
- * center point needs to be specified. The return value is the ID of
- * the rotated floating selection.
- *
- * If there is no selection or the item is not a drawable, the entire
- * item will be rotated around its center if auto_center is set to
- * TRUE, otherwise the coordinate of the center point needs to be
- * specified. Additionally, if the item has its linked flag set to
- * TRUE, all additional items contained in the image which have the
- * linked flag set to TRUE will also be rotated around the same center
- * point. The return value will be equal to the item ID supplied as
- * input.
- *
- * This procedure is affected by the following context setters:
- * gimp_context_set_interpolation(),
- * gimp_context_set_transform_direction(),
- * gimp_context_set_transform_resize().
- *
- * Returns: (transfer none): The rotated item.
- *
- * Since: 2.8
- **/
-GimpItem *
-gimp_item_transform_rotate (GimpItem *item,
- gdouble angle,
- gboolean auto_center,
- gdouble center_x,
- gdouble center_y)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- GimpItem *ret_item = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, item,
- G_TYPE_DOUBLE, angle,
- G_TYPE_BOOLEAN, auto_center,
- G_TYPE_DOUBLE, center_x,
- G_TYPE_DOUBLE, center_y,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-transform-rotate",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-transform-rotate",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- ret_item = g_value_get_object (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return ret_item;
-}
-
-/**
- * _gimp_item_transform_rotate: (skip)
- * @item_ID: The affected item.
- * @angle: The angle of rotation (radians).
- * @auto_center: Whether to automatically rotate around the selection center.
- * @center_x: The hor. coordinate of the center of rotation.
- * @center_y: The vert. coordinate of the center of rotation.
- *
- * Rotate the specified item about given coordinates through the
- * specified angle.
- *
- * This function rotates the specified item.
- *
- * If a selection exists and the item is a drawable, the portion of the
- * drawable which lies under the selection is cut from the drawable and
- * made into a floating selection which is then rotated by the
- * specified amount. If auto_center is set to TRUE, the rotation is
- * around the selection's center. Otherwise, the coordinate of the
- * center point needs to be specified. The return value is the ID of
- * the rotated floating selection.
- *
- * If there is no selection or the item is not a drawable, the entire
- * item will be rotated around its center if auto_center is set to
- * TRUE, otherwise the coordinate of the center point needs to be
- * specified. Additionally, if the item has its linked flag set to
- * TRUE, all additional items contained in the image which have the
- * linked flag set to TRUE will also be rotated around the same center
- * point. The return value will be equal to the item ID supplied as
- * input.
- *
- * This procedure is affected by the following context setters:
- * gimp_context_set_interpolation(),
- * gimp_context_set_transform_direction(),
- * gimp_context_set_transform_resize().
- *
- * Returns: The rotated item.
- *
- * Since: 2.8
- **/
-gint32
-_gimp_item_transform_rotate (gint32 item_ID,
- gdouble angle,
- gboolean auto_center,
- gdouble center_x,
- gdouble center_y)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 ret_item_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_DOUBLE, angle,
- G_TYPE_BOOLEAN, auto_center,
- G_TYPE_DOUBLE, center_x,
- G_TYPE_DOUBLE, center_y,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-transform-rotate",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-transform-rotate",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- ret_item_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return ret_item_ID;
+ return ret_item;
}
/**
@@ -979,79 +543,6 @@ gimp_item_transform_scale (GimpItem *item,
return ret_item;
}
-/**
- * _gimp_item_transform_scale: (skip)
- * @item_ID: The affected item.
- * @x0: The new x coordinate of the upper-left corner of the scaled region.
- * @y0: The new y coordinate of the upper-left corner of the scaled region.
- * @x1: The new x coordinate of the lower-right corner of the scaled region.
- * @y1: The new y coordinate of the lower-right corner of the scaled region.
- *
- * Scale the specified item.
- *
- * This procedure scales the specified item.
- *
- * The 2 coordinates specify the new locations of the top-left and
- * bottom-roght corners of the original bounding box.
- *
- * If a selection exists and the item is a drawable, the portion of the
- * drawable which lies under the selection is cut from the drawable and
- * made into a floating selection which is then scaled as specified.
- * The return value is the ID of the scaled floating selection.
- *
- * If there is no selection or the item is not a drawable, the entire
- * item will be scaled according to the specified coordinates.
- * Additionally, if the item has its linked flag set to TRUE, all
- * additional items contained in the image which have the linked flag
- * set to TRUE will also be scaled the same way. The return value will
- * be equal to the item ID supplied as input.
- *
- * This procedure is affected by the following context setters:
- * gimp_context_set_interpolation(),
- * gimp_context_set_transform_direction(),
- * gimp_context_set_transform_resize().
- *
- * Returns: The scaled item.
- *
- * Since: 2.8
- **/
-gint32
-_gimp_item_transform_scale (gint32 item_ID,
- gdouble x0,
- gdouble y0,
- gdouble x1,
- gdouble y1)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 ret_item_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_DOUBLE, x0,
- G_TYPE_DOUBLE, y0,
- G_TYPE_DOUBLE, x1,
- G_TYPE_DOUBLE, y1,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-transform-scale",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-transform-scale",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- ret_item_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return ret_item_ID;
-}
-
/**
* gimp_item_transform_shear:
* @item: The affected item.
@@ -1121,75 +612,6 @@ gimp_item_transform_shear (GimpItem *item,
return ret_item;
}
-/**
- * _gimp_item_transform_shear: (skip)
- * @item_ID: The affected item.
- * @shear_type: Type of shear.
- * @magnitude: The magnitude of the shear.
- *
- * Shear the specified item about its center by the specified
- * magnitude.
- *
- * This procedure shears the specified item.
- *
- * The shear type parameter indicates whether the shear will be applied
- * horizontally or vertically. The magnitude can be either positive or
- * negative and indicates the extent (in pixels) to shear by.
- *
- * If a selection exists and the item is a drawable, the portion of the
- * drawable which lies under the selection is cut from the drawable and
- * made into a floating selection which is then sheared as specified.
- * The return value is the ID of the sheared floating selection.
- *
- * If there is no selection or the item is not a drawable, the entire
- * item will be sheared according to the specified parameters.
- * Additionally, if the item has its linked flag set to TRUE, all
- * additional items contained in the image which have the linked flag
- * set to TRUE will also be sheared the same way. The return value will
- * be equal to the item ID supplied as input.
- *
- * This procedure is affected by the following context setters:
- * gimp_context_set_interpolation(),
- * gimp_context_set_transform_direction(),
- * gimp_context_set_transform_resize().
- *
- * Returns: The sheared item.
- *
- * Since: 2.8
- **/
-gint32
-_gimp_item_transform_shear (gint32 item_ID,
- GimpOrientationType shear_type,
- gdouble magnitude)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 ret_item_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- GIMP_TYPE_ORIENTATION_TYPE, shear_type,
- G_TYPE_DOUBLE, magnitude,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-transform-shear",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-transform-shear",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- ret_item_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return ret_item_ID;
-}
-
/**
* gimp_item_transform_2d:
* @item: The affected item.
@@ -1275,91 +697,6 @@ gimp_item_transform_2d (GimpItem *item,
return ret_item;
}
-/**
- * _gimp_item_transform_2d: (skip)
- * @item_ID: The affected item.
- * @source_x: X coordinate of the transformation center.
- * @source_y: Y coordinate of the transformation center.
- * @scale_x: Amount to scale in x direction.
- * @scale_y: Amount to scale in y direction.
- * @angle: The angle of rotation (radians).
- * @dest_x: X coordinate of where the center goes.
- * @dest_y: Y coordinate of where the center goes.
- *
- * Transform the specified item in 2d.
- *
- * This procedure transforms the specified item.
- *
- * The transformation is done by scaling by the x and y scale factors
- * about the point (source_x, source_y), then rotating around the same
- * point, then translating that point to the new position (dest_x,
- * dest_y).
- *
- * If a selection exists and the item is a drawable, the portion of the
- * drawable which lies under the selection is cut from the drawable and
- * made into a floating selection which is then transformed as
- * specified. The return value is the ID of the transformed floating
- * selection.
- *
- * If there is no selection or the item is not a drawable, the entire
- * item will be transformed according to the specified parameters.
- * Additionally, if the item has its linked flag set to TRUE, all
- * additional items contained in the image which have the linked flag
- * set to TRUE will also be transformed the same way. The return value
- * will be equal to the item ID supplied as input.
- *
- * This procedure is affected by the following context setters:
- * gimp_context_set_interpolation(),
- * gimp_context_set_transform_direction(),
- * gimp_context_set_transform_resize().
- *
- * Returns: The transformed item.
- *
- * Since: 2.8
- **/
-gint32
-_gimp_item_transform_2d (gint32 item_ID,
- gdouble source_x,
- gdouble source_y,
- gdouble scale_x,
- gdouble scale_y,
- gdouble angle,
- gdouble dest_x,
- gdouble dest_y)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 ret_item_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_DOUBLE, source_x,
- G_TYPE_DOUBLE, source_y,
- G_TYPE_DOUBLE, scale_x,
- G_TYPE_DOUBLE, scale_y,
- G_TYPE_DOUBLE, angle,
- G_TYPE_DOUBLE, dest_x,
- G_TYPE_DOUBLE, dest_y,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-transform-2d",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-transform-2d",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- ret_item_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return ret_item_ID;
-}
-
/**
* gimp_item_transform_matrix:
* @item: The affected item.
@@ -1448,92 +785,3 @@ gimp_item_transform_matrix (GimpItem *item,
return ret_item;
}
-
-/**
- * _gimp_item_transform_matrix: (skip)
- * @item_ID: The affected item.
- * @coeff_0_0: coefficient (0,0) of the transformation matrix.
- * @coeff_0_1: coefficient (0,1) of the transformation matrix.
- * @coeff_0_2: coefficient (0,2) of the transformation matrix.
- * @coeff_1_0: coefficient (1,0) of the transformation matrix.
- * @coeff_1_1: coefficient (1,1) of the transformation matrix.
- * @coeff_1_2: coefficient (1,2) of the transformation matrix.
- * @coeff_2_0: coefficient (2,0) of the transformation matrix.
- * @coeff_2_1: coefficient (2,1) of the transformation matrix.
- * @coeff_2_2: coefficient (2,2) of the transformation matrix.
- *
- * Transform the specified item in 2d.
- *
- * This procedure transforms the specified item.
- *
- * The transformation is done by assembling a 3x3 matrix from the
- * coefficients passed.
- *
- * If a selection exists and the item is a drawable, the portion of the
- * drawable which lies under the selection is cut from the drawable and
- * made into a floating selection which is then transformed as
- * specified. The return value is the ID of the transformed floating
- * selection.
- *
- * If there is no selection or the item is not a drawable, the entire
- * item will be transformed according to the specified matrix.
- * Additionally, if the item has its linked flag set to TRUE, all
- * additional items contained in the image which have the linked flag
- * set to TRUE will also be transformed the same way. The return value
- * will be equal to the item ID supplied as input.
- *
- * This procedure is affected by the following context setters:
- * gimp_context_set_interpolation(),
- * gimp_context_set_transform_direction(),
- * gimp_context_set_transform_resize().
- *
- * Returns: The transformed item.
- *
- * Since: 2.8
- **/
-gint32
-_gimp_item_transform_matrix (gint32 item_ID,
- gdouble coeff_0_0,
- gdouble coeff_0_1,
- gdouble coeff_0_2,
- gdouble coeff_1_0,
- gdouble coeff_1_1,
- gdouble coeff_1_2,
- gdouble coeff_2_0,
- gdouble coeff_2_1,
- gdouble coeff_2_2)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 ret_item_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_ITEM, gimp_item_get_by_id (item_ID),
- G_TYPE_DOUBLE, coeff_0_0,
- G_TYPE_DOUBLE, coeff_0_1,
- G_TYPE_DOUBLE, coeff_0_2,
- G_TYPE_DOUBLE, coeff_1_0,
- G_TYPE_DOUBLE, coeff_1_1,
- G_TYPE_DOUBLE, coeff_1_2,
- G_TYPE_DOUBLE, coeff_2_0,
- G_TYPE_DOUBLE, coeff_2_1,
- G_TYPE_DOUBLE, coeff_2_2,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-item-transform-matrix",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-item-transform-matrix",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- ret_item_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return ret_item_ID;
-}
diff --git a/libgimp/gimpitemtransform_pdb.h b/libgimp/gimpitemtransform_pdb.h
index b379c69a94..02890ea773 100644
--- a/libgimp/gimpitemtransform_pdb.h
+++ b/libgimp/gimpitemtransform_pdb.h
@@ -32,10 +32,6 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
GimpItem* gimp_item_transform_translate (GimpItem *item,
gdouble off_x,
gdouble off_y);
@@ -94,84 +90,6 @@ GimpItem* gimp_item_transform_matrix (GimpItem *item,
gdouble coeff_2_1,
gdouble coeff_2_2);
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_item_transform_translate _gimp_item_transform_translate
-#define gimp_item_transform_flip_simple _gimp_item_transform_flip_simple
-#define gimp_item_transform_flip _gimp_item_transform_flip
-#define gimp_item_transform_perspective _gimp_item_transform_perspective
-#define gimp_item_transform_rotate_simple _gimp_item_transform_rotate_simple
-#define gimp_item_transform_rotate _gimp_item_transform_rotate
-#define gimp_item_transform_scale _gimp_item_transform_scale
-#define gimp_item_transform_shear _gimp_item_transform_shear
-#define gimp_item_transform_2d _gimp_item_transform_2d
-#define gimp_item_transform_matrix _gimp_item_transform_matrix
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-gint32 _gimp_item_transform_translate (gint32 item_ID,
- gdouble off_x,
- gdouble off_y);
-gint32 _gimp_item_transform_flip_simple (gint32 item_ID,
- GimpOrientationType flip_type,
- gboolean auto_center,
- gdouble axis);
-gint32 _gimp_item_transform_flip (gint32 item_ID,
- gdouble x0,
- gdouble y0,
- gdouble x1,
- gdouble y1);
-gint32 _gimp_item_transform_perspective (gint32 item_ID,
- gdouble x0,
- gdouble y0,
- gdouble x1,
- gdouble y1,
- gdouble x2,
- gdouble y2,
- gdouble x3,
- gdouble y3);
-gint32 _gimp_item_transform_rotate_simple (gint32 item_ID,
- GimpRotationType rotate_type,
- gboolean auto_center,
- gdouble center_x,
- gdouble center_y);
-gint32 _gimp_item_transform_rotate (gint32 item_ID,
- gdouble angle,
- gboolean auto_center,
- gdouble center_x,
- gdouble center_y);
-gint32 _gimp_item_transform_scale (gint32 item_ID,
- gdouble x0,
- gdouble y0,
- gdouble x1,
- gdouble y1);
-gint32 _gimp_item_transform_shear (gint32 item_ID,
- GimpOrientationType shear_type,
- gdouble magnitude);
-gint32 _gimp_item_transform_2d (gint32 item_ID,
- gdouble source_x,
- gdouble source_y,
- gdouble scale_x,
- gdouble scale_y,
- gdouble angle,
- gdouble dest_x,
- gdouble dest_y);
-gint32 _gimp_item_transform_matrix (gint32 item_ID,
- gdouble coeff_0_0,
- gdouble coeff_0_1,
- gdouble coeff_0_2,
- gdouble coeff_1_0,
- gdouble coeff_1_1,
- gdouble coeff_1_2,
- gdouble coeff_2_0,
- gdouble coeff_2_1,
- gdouble coeff_2_2);
-
G_END_DECLS
diff --git a/libgimp/gimplayer_pdb.c b/libgimp/gimplayer_pdb.c
index bad56d997a..546eb00a45 100644
--- a/libgimp/gimplayer_pdb.c
+++ b/libgimp/gimplayer_pdb.c
@@ -147,57 +147,6 @@ gimp_layer_new_from_visible (GimpImage *image,
return layer;
}
-/**
- * _gimp_layer_new_from_visible: (skip)
- * @image_ID: The source image from where the content is copied.
- * @dest_image_ID: The destination image to which to add the layer.
- * @name: The layer name.
- *
- * Create a new layer from what is visible in an image.
- *
- * This procedure creates a new layer from what is visible in the given
- * image. The new layer still needs to be added to the destination
- * image, as this is not automatic. Add the new layer with the
- * gimp_image_insert_layer() command. Other attributes such as layer
- * mask modes, and offsets should be set with explicit procedure calls.
- *
- * Returns: The newly created layer.
- *
- * Since: 2.6
- **/
-gint32
-_gimp_layer_new_from_visible (gint32 image_ID,
- gint32 dest_image_ID,
- const gchar *name)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 layer_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (dest_image_ID),
- G_TYPE_STRING, name,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-new-from-visible",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-new-from-visible",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- layer_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return layer_ID;
-}
-
/**
* gimp_layer_new_from_drawable:
* @drawable: The source drawable from where the new layer is copied.
@@ -244,52 +193,6 @@ gimp_layer_new_from_drawable (GimpDrawable *drawable,
return layer_copy;
}
-/**
- * _gimp_layer_new_from_drawable: (skip)
- * @drawable_ID: The source drawable from where the new layer is copied.
- * @dest_image_ID: The destination image to which to add the layer.
- *
- * Create a new layer by copying an existing drawable.
- *
- * This procedure creates a new layer as a copy of the specified
- * drawable. The new layer still needs to be added to the image, as
- * this is not automatic. Add the new layer with the
- * gimp_image_insert_layer() command. Other attributes such as layer
- * mask modes, and offsets should be set with explicit procedure calls.
- *
- * Returns: The newly copied layer.
- **/
-gint32
-_gimp_layer_new_from_drawable (gint32 drawable_ID,
- gint32 dest_image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 layer_copy_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (dest_image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-new-from-drawable",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-new-from-drawable",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- layer_copy_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return layer_copy_ID;
-}
-
/**
* gimp_layer_group_new:
* @image: The image to which to add the layer group.
@@ -337,53 +240,6 @@ gimp_layer_group_new (GimpImage *image)
return layer_group;
}
-/**
- * _gimp_layer_group_new: (skip)
- * @image_ID: The image to which to add the layer group.
- *
- * Create a new layer group.
- *
- * This procedure creates a new layer group. Attributes such as layer
- * mode and opacity should be set with explicit procedure calls. Add
- * the new layer group (which is a kind of layer) with the
- * gimp_image_insert_layer() command.
- * Other procedures useful with layer groups:
- * gimp_image_reorder_item(), gimp_item_get_parent(),
- * gimp_item_get_children(), gimp_item_is_group().
- *
- * Returns: The newly created layer group.
- *
- * Since: 2.8
- **/
-gint32
-_gimp_layer_group_new (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 layer_group_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-group-new",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-group-new",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- layer_group_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return layer_group_ID;
-}
-
/**
* _gimp_layer_copy:
* @layer: The layer to copy.
@@ -473,48 +329,6 @@ gimp_layer_add_alpha (GimpLayer *layer)
return success;
}
-/**
- * _gimp_layer_add_alpha: (skip)
- * @layer_ID: The layer.
- *
- * Add an alpha channel to the layer if it doesn't already have one.
- *
- * This procedure adds an additional component to the specified layer
- * if it does not already possess an alpha channel. An alpha channel
- * makes it possible to clear and erase to transparency, instead of the
- * background color. This transforms layers of type RGB to RGBA, GRAY
- * to GRAYA, and INDEXED to INDEXEDA.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_layer_add_alpha (gint32 layer_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-add-alpha",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-add-alpha",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_layer_flatten:
* @layer: The layer.
@@ -558,49 +372,6 @@ gimp_layer_flatten (GimpLayer *layer)
return success;
}
-/**
- * _gimp_layer_flatten: (skip)
- * @layer_ID: The layer.
- *
- * Remove the alpha channel from the layer if it has one.
- *
- * This procedure removes the alpha channel from a layer, blending all
- * (partially) transparent pixels in the layer against the background
- * color. This transforms layers of type RGBA to RGB, GRAYA to GRAY,
- * and INDEXEDA to INDEXED.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.4
- **/
-gboolean
-_gimp_layer_flatten (gint32 layer_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-flatten",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-flatten",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_layer_scale:
* @layer: The layer.
@@ -653,58 +424,6 @@ gimp_layer_scale (GimpLayer *layer,
return success;
}
-/**
- * _gimp_layer_scale: (skip)
- * @layer_ID: The layer.
- * @new_width: New layer width.
- * @new_height: New layer height.
- * @local_origin: Use a local origin (as opposed to the image origin).
- *
- * Scale the layer using the default interpolation method.
- *
- * This procedure scales the layer so that its new width and height are
- * equal to the supplied parameters. The 'local-origin' parameter
- * specifies whether to scale from the center of the layer, or from the
- * image origin. This operation only works if the layer has been added
- * to an image. The interpolation method used can be set with
- * gimp_context_set_interpolation().
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_layer_scale (gint32 layer_ID,
- gint new_width,
- gint new_height,
- gboolean local_origin)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_INT, new_width,
- G_TYPE_INT, new_height,
- G_TYPE_BOOLEAN, local_origin,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-scale",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-scale",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_layer_resize:
* @layer: The layer.
@@ -759,28 +478,18 @@ gimp_layer_resize (GimpLayer *layer,
}
/**
- * _gimp_layer_resize: (skip)
- * @layer_ID: The layer.
- * @new_width: New layer width.
- * @new_height: New layer height.
- * @offx: x offset between upper left corner of old and new layers: (old - new).
- * @offy: y offset between upper left corner of old and new layers: (old - new).
+ * gimp_layer_resize_to_image_size:
+ * @layer: The layer to resize.
*
- * Resize the layer to the specified extents.
+ * Resize a layer to the image size.
*
- * This procedure resizes the layer so that its new width and height
- * are equal to the supplied parameters. Offsets are also provided
- * which describe the position of the previous layer's content. This
- * operation only works if the layer has been added to an image.
+ * This procedure resizes the layer so that it's new width and height
+ * are equal to the width and height of its image container.
*
* Returns: TRUE on success.
**/
gboolean
-_gimp_layer_resize (gint32 layer_ID,
- gint new_width,
- gint new_height,
- gint offx,
- gint offy)
+gimp_layer_resize_to_image_size (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -788,97 +497,15 @@ _gimp_layer_resize (gint32 layer_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_INT, new_width,
- G_TYPE_INT, new_height,
- G_TYPE_INT, offx,
- G_TYPE_INT, offy,
+ GIMP_TYPE_LAYER, layer,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-resize",
+ "gimp-layer-resize-to-image-size",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-layer-resize",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_layer_resize_to_image_size:
- * @layer: The layer to resize.
- *
- * Resize a layer to the image size.
- *
- * This procedure resizes the layer so that it's new width and height
- * are equal to the width and height of its image container.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_layer_resize_to_image_size (GimpLayer *layer)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, layer,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-resize-to-image-size",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-resize-to-image-size",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_layer_resize_to_image_size: (skip)
- * @layer_ID: The layer to resize.
- *
- * Resize a layer to the image size.
- *
- * This procedure resizes the layer so that it's new width and height
- * are equal to the width and height of its image container.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_layer_resize_to_image_size (gint32 layer_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-resize-to-image-size",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-resize-to-image-size",
+ return_vals = gimp_run_procedure_array ("gimp-layer-resize-to-image-size",
args);
gimp_value_array_unref (args);
@@ -935,52 +562,6 @@ gimp_layer_set_offsets (GimpLayer *layer,
return success;
}
-/**
- * _gimp_layer_set_offsets: (skip)
- * @layer_ID: The layer.
- * @offx: Offset in x direction.
- * @offy: Offset in y direction.
- *
- * Set the layer offsets.
- *
- * This procedure sets the offsets for the specified layer. The offsets
- * are relative to the image origin and can be any values. This
- * operation is valid only on layers which have been added to an image.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_layer_set_offsets (gint32 layer_ID,
- gint offx,
- gint offy)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_INT, offx,
- G_TYPE_INT, offy,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-set-offsets",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-set-offsets",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_layer_create_mask:
* @layer: The layer to which to add the mask.
@@ -1042,67 +623,6 @@ gimp_layer_create_mask (GimpLayer *layer,
return mask;
}
-/**
- * _gimp_layer_create_mask: (skip)
- * @layer_ID: The layer to which to add the mask.
- * @mask_type: The type of mask.
- *
- * Create a layer mask for the specified layer.
- *
- * This procedure creates a layer mask for the specified layer.
- * Layer masks serve as an additional alpha channel for a layer.
- * Different types of masks are allowed for initialisation:
- * - white mask (leaves the layer fully visible);
- * - black mask (gives the layer complete transparency);
- * - the layer's alpha channel (either a copy, or a transfer, which
- * leaves the layer fully visible, but which may be more useful than a
- * white mask);
- * - the current selection;
- * - a grayscale copy of the layer;
- * - or a copy of the active channel.
- *
- * The layer mask still needs to be added to the layer. This can be
- * done with a call to gimp_layer_add_mask().
- *
- * gimp_layer_create_mask() will fail if there are no active channels
- * on the image, when called with 'ADD-CHANNEL-MASK'. It will return a
- * black mask when called with 'ADD-ALPHA-MASK' or
- * 'ADD-ALPHA-TRANSFER-MASK' on a layer with no alpha channels, or with
- * 'ADD-SELECTION-MASK' when there is no selection on the image.
- *
- * Returns: The newly created mask.
- **/
-gint32
-_gimp_layer_create_mask (gint32 layer_ID,
- GimpAddMaskType mask_type)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 mask_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- GIMP_TYPE_ADD_MASK_TYPE, mask_type,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-create-mask",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-create-mask",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- mask_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return mask_ID;
-}
-
/**
* gimp_layer_get_mask:
* @layer: The layer.
@@ -1143,46 +663,6 @@ gimp_layer_get_mask (GimpLayer *layer)
return mask;
}
-/**
- * _gimp_layer_get_mask: (skip)
- * @layer_ID: The layer.
- *
- * Get the specified layer's mask if it exists.
- *
- * This procedure returns the specified layer's mask, or -1 if none
- * exists.
- *
- * Returns: The layer mask.
- **/
-gint32
-_gimp_layer_get_mask (gint32 layer_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 mask_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-get-mask",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-get-mask",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- mask_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return mask_ID;
-}
-
/**
* gimp_layer_from_mask:
* @mask: Mask for which to return the layer.
@@ -1225,48 +705,6 @@ gimp_layer_from_mask (GimpLayerMask *mask)
return layer;
}
-/**
- * _gimp_layer_from_mask: (skip)
- * @mask_ID: Mask for which to return the layer.
- *
- * Get the specified mask's layer.
- *
- * This procedure returns the specified mask's layer , or -1 if none
- * exists.
- *
- * Returns: The mask's layer.
- *
- * Since: 2.2
- **/
-gint32
-_gimp_layer_from_mask (gint32 mask_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 layer_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER_MASK, gimp_item_get_by_id (mask_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-from-mask",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-from-mask",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- layer_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return layer_ID;
-}
-
/**
* gimp_layer_add_mask:
* @layer: The layer to receive the mask.
@@ -1291,847 +729,44 @@ gimp_layer_add_mask (GimpLayer *layer,
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, layer,
- GIMP_TYPE_LAYER_MASK, mask,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-add-mask",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-add-mask",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_layer_add_mask: (skip)
- * @layer_ID: The layer to receive the mask.
- * @mask_ID: The mask to add to the layer.
- *
- * Add a layer mask to the specified layer.
- *
- * This procedure adds a layer mask to the specified layer. Layer masks
- * serve as an additional alpha channel for a layer. This procedure
- * will fail if a number of prerequisites aren't met. The layer cannot
- * already have a layer mask. The specified mask must exist and have
- * the same dimensions as the layer. The layer must have been created
- * for use with the specified image and the mask must have been created
- * with the procedure 'gimp-layer-create-mask'.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_layer_add_mask (gint32 layer_ID,
- gint32 mask_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- GIMP_TYPE_LAYER_MASK, gimp_item_get_by_id (mask_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-add-mask",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-add-mask",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_layer_remove_mask:
- * @layer: The layer from which to remove mask.
- * @mode: Removal mode.
- *
- * Remove the specified layer mask from the layer.
- *
- * This procedure removes the specified layer mask from the layer. If
- * the mask doesn't exist, an error is returned.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_layer_remove_mask (GimpLayer *layer,
- GimpMaskApplyMode mode)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, layer,
- GIMP_TYPE_MASK_APPLY_MODE, mode,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-remove-mask",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-remove-mask",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_layer_remove_mask: (skip)
- * @layer_ID: The layer from which to remove mask.
- * @mode: Removal mode.
- *
- * Remove the specified layer mask from the layer.
- *
- * This procedure removes the specified layer mask from the layer. If
- * the mask doesn't exist, an error is returned.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_layer_remove_mask (gint32 layer_ID,
- GimpMaskApplyMode mode)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- GIMP_TYPE_MASK_APPLY_MODE, mode,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-remove-mask",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-remove-mask",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_layer_is_floating_sel:
- * @layer: The layer.
- *
- * Is the specified layer a floating selection?
- *
- * This procedure returns whether the layer is a floating selection.
- * Floating selections are special cases of layers which are attached
- * to a specific drawable.
- *
- * Returns: TRUE if the layer is a floating selection.
- **/
-gboolean
-gimp_layer_is_floating_sel (GimpLayer *layer)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean is_floating_sel = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, layer,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-is-floating-sel",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-is-floating-sel",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- is_floating_sel = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return is_floating_sel;
-}
-
-/**
- * _gimp_layer_is_floating_sel: (skip)
- * @layer_ID: The layer.
- *
- * Is the specified layer a floating selection?
- *
- * This procedure returns whether the layer is a floating selection.
- * Floating selections are special cases of layers which are attached
- * to a specific drawable.
- *
- * Returns: TRUE if the layer is a floating selection.
- **/
-gboolean
-_gimp_layer_is_floating_sel (gint32 layer_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean is_floating_sel = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-is-floating-sel",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-is-floating-sel",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- is_floating_sel = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return is_floating_sel;
-}
-
-/**
- * gimp_layer_get_lock_alpha:
- * @layer: The layer.
- *
- * Get the lock alpha channel setting of the specified layer.
- *
- * This procedure returns the specified layer's lock alpha channel
- * setting.
- *
- * Returns: The layer's lock alpha channel setting.
- **/
-gboolean
-gimp_layer_get_lock_alpha (GimpLayer *layer)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean lock_alpha = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, layer,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-get-lock-alpha",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-get-lock-alpha",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- lock_alpha = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return lock_alpha;
-}
-
-/**
- * _gimp_layer_get_lock_alpha: (skip)
- * @layer_ID: The layer.
- *
- * Get the lock alpha channel setting of the specified layer.
- *
- * This procedure returns the specified layer's lock alpha channel
- * setting.
- *
- * Returns: The layer's lock alpha channel setting.
- **/
-gboolean
-_gimp_layer_get_lock_alpha (gint32 layer_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean lock_alpha = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-get-lock-alpha",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-get-lock-alpha",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- lock_alpha = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return lock_alpha;
-}
-
-/**
- * gimp_layer_set_lock_alpha:
- * @layer: The layer.
- * @lock_alpha: The new layer's lock alpha channel setting.
- *
- * Set the lock alpha channel setting of the specified layer.
- *
- * This procedure sets the specified layer's lock alpha channel
- * setting.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_layer_set_lock_alpha (GimpLayer *layer,
- gboolean lock_alpha)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, layer,
- G_TYPE_BOOLEAN, lock_alpha,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-set-lock-alpha",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-set-lock-alpha",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_layer_set_lock_alpha: (skip)
- * @layer_ID: The layer.
- * @lock_alpha: The new layer's lock alpha channel setting.
- *
- * Set the lock alpha channel setting of the specified layer.
- *
- * This procedure sets the specified layer's lock alpha channel
- * setting.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_layer_set_lock_alpha (gint32 layer_ID,
- gboolean lock_alpha)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_BOOLEAN, lock_alpha,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-set-lock-alpha",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-set-lock-alpha",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_layer_get_apply_mask:
- * @layer: The layer.
- *
- * Get the apply mask setting of the specified layer.
- *
- * This procedure returns the specified layer's apply mask setting. If
- * the value is TRUE, then the layer mask for this layer is currently
- * being composited with the layer's alpha channel.
- *
- * Returns: The layer's apply mask setting.
- **/
-gboolean
-gimp_layer_get_apply_mask (GimpLayer *layer)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean apply_mask = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, layer,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-get-apply-mask",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-get-apply-mask",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- apply_mask = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return apply_mask;
-}
-
-/**
- * _gimp_layer_get_apply_mask: (skip)
- * @layer_ID: The layer.
- *
- * Get the apply mask setting of the specified layer.
- *
- * This procedure returns the specified layer's apply mask setting. If
- * the value is TRUE, then the layer mask for this layer is currently
- * being composited with the layer's alpha channel.
- *
- * Returns: The layer's apply mask setting.
- **/
-gboolean
-_gimp_layer_get_apply_mask (gint32 layer_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean apply_mask = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-get-apply-mask",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-get-apply-mask",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- apply_mask = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return apply_mask;
-}
-
-/**
- * gimp_layer_set_apply_mask:
- * @layer: The layer.
- * @apply_mask: The new layer's apply mask setting.
- *
- * Set the apply mask setting of the specified layer.
- *
- * This procedure sets the specified layer's apply mask setting. This
- * controls whether the layer's mask is currently affecting the alpha
- * channel. If there is no layer mask, this function will return an
- * error.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_layer_set_apply_mask (GimpLayer *layer,
- gboolean apply_mask)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, layer,
- G_TYPE_BOOLEAN, apply_mask,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-set-apply-mask",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-set-apply-mask",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_layer_set_apply_mask: (skip)
- * @layer_ID: The layer.
- * @apply_mask: The new layer's apply mask setting.
- *
- * Set the apply mask setting of the specified layer.
- *
- * This procedure sets the specified layer's apply mask setting. This
- * controls whether the layer's mask is currently affecting the alpha
- * channel. If there is no layer mask, this function will return an
- * error.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_layer_set_apply_mask (gint32 layer_ID,
- gboolean apply_mask)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_BOOLEAN, apply_mask,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-set-apply-mask",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-set-apply-mask",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_layer_get_show_mask:
- * @layer: The layer.
- *
- * Get the show mask setting of the specified layer.
- *
- * This procedure returns the specified layer's show mask setting. This
- * controls whether the layer or its mask is visible. TRUE indicates
- * that the mask should be visible. If the layer has no mask, then this
- * function returns an error.
- *
- * Returns: The layer's show mask setting.
- **/
-gboolean
-gimp_layer_get_show_mask (GimpLayer *layer)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean show_mask = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, layer,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-get-show-mask",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-get-show-mask",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- show_mask = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return show_mask;
-}
-
-/**
- * _gimp_layer_get_show_mask: (skip)
- * @layer_ID: The layer.
- *
- * Get the show mask setting of the specified layer.
- *
- * This procedure returns the specified layer's show mask setting. This
- * controls whether the layer or its mask is visible. TRUE indicates
- * that the mask should be visible. If the layer has no mask, then this
- * function returns an error.
- *
- * Returns: The layer's show mask setting.
- **/
-gboolean
-_gimp_layer_get_show_mask (gint32 layer_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean show_mask = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-get-show-mask",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-get-show-mask",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- show_mask = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return show_mask;
-}
-
-/**
- * gimp_layer_set_show_mask:
- * @layer: The layer.
- * @show_mask: The new layer's show mask setting.
- *
- * Set the show mask setting of the specified layer.
- *
- * This procedure sets the specified layer's show mask setting. This
- * controls whether the layer or its mask is visible. TRUE indicates
- * that the mask should be visible. If there is no layer mask, this
- * function will return an error.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_layer_set_show_mask (GimpLayer *layer,
- gboolean show_mask)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, layer,
- G_TYPE_BOOLEAN, show_mask,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-set-show-mask",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-set-show-mask",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_layer_set_show_mask: (skip)
- * @layer_ID: The layer.
- * @show_mask: The new layer's show mask setting.
- *
- * Set the show mask setting of the specified layer.
- *
- * This procedure sets the specified layer's show mask setting. This
- * controls whether the layer or its mask is visible. TRUE indicates
- * that the mask should be visible. If there is no layer mask, this
- * function will return an error.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_layer_set_show_mask (gint32 layer_ID,
- gboolean show_mask)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_BOOLEAN, show_mask,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-set-show-mask",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-set-show-mask",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_layer_get_edit_mask:
- * @layer: The layer.
- *
- * Get the edit mask setting of the specified layer.
- *
- * This procedure returns the specified layer's edit mask setting. If
- * the value is TRUE, then the layer mask for this layer is currently
- * active, and not the layer.
- *
- * Returns: The layer's edit mask setting.
- **/
-gboolean
-gimp_layer_get_edit_mask (GimpLayer *layer)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean edit_mask = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, layer,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-get-edit-mask",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-get-edit-mask",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- edit_mask = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return edit_mask;
-}
-
-/**
- * _gimp_layer_get_edit_mask: (skip)
- * @layer_ID: The layer.
- *
- * Get the edit mask setting of the specified layer.
- *
- * This procedure returns the specified layer's edit mask setting. If
- * the value is TRUE, then the layer mask for this layer is currently
- * active, and not the layer.
- *
- * Returns: The layer's edit mask setting.
- **/
-gboolean
-_gimp_layer_get_edit_mask (gint32 layer_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean edit_mask = FALSE;
+ gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
+ GIMP_TYPE_LAYER, layer,
+ GIMP_TYPE_LAYER_MASK, mask,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-get-edit-mask",
+ "gimp-layer-add-mask",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-layer-get-edit-mask",
+ return_vals = gimp_run_procedure_array ("gimp-layer-add-mask",
args);
gimp_value_array_unref (args);
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- edit_mask = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
+ success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
- return edit_mask;
+ return success;
}
/**
- * gimp_layer_set_edit_mask:
- * @layer: The layer.
- * @edit_mask: The new layer's edit mask setting.
+ * gimp_layer_remove_mask:
+ * @layer: The layer from which to remove mask.
+ * @mode: Removal mode.
*
- * Set the edit mask setting of the specified layer.
+ * Remove the specified layer mask from the layer.
*
- * This procedure sets the specified layer's edit mask setting. This
- * controls whether the layer or it's mask is currently active for
- * editing. If the specified layer has no layer mask, then this
- * procedure will return an error.
+ * This procedure removes the specified layer mask from the layer. If
+ * the mask doesn't exist, an error is returned.
*
* Returns: TRUE on success.
**/
gboolean
-gimp_layer_set_edit_mask (GimpLayer *layer,
- gboolean edit_mask)
+gimp_layer_remove_mask (GimpLayer *layer,
+ GimpMaskApplyMode mode)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -2140,15 +775,15 @@ gimp_layer_set_edit_mask (GimpLayer *layer,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER, layer,
- G_TYPE_BOOLEAN, edit_mask,
+ GIMP_TYPE_MASK_APPLY_MODE, mode,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-set-edit-mask",
+ "gimp-layer-remove-mask",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-layer-set-edit-mask",
+ return_vals = gimp_run_procedure_array ("gimp-layer-remove-mask",
args);
gimp_value_array_unref (args);
@@ -2160,66 +795,64 @@ gimp_layer_set_edit_mask (GimpLayer *layer,
}
/**
- * _gimp_layer_set_edit_mask: (skip)
- * @layer_ID: The layer.
- * @edit_mask: The new layer's edit mask setting.
+ * gimp_layer_is_floating_sel:
+ * @layer: The layer.
*
- * Set the edit mask setting of the specified layer.
+ * Is the specified layer a floating selection?
*
- * This procedure sets the specified layer's edit mask setting. This
- * controls whether the layer or it's mask is currently active for
- * editing. If the specified layer has no layer mask, then this
- * procedure will return an error.
+ * This procedure returns whether the layer is a floating selection.
+ * Floating selections are special cases of layers which are attached
+ * to a specific drawable.
*
- * Returns: TRUE on success.
+ * Returns: TRUE if the layer is a floating selection.
**/
gboolean
-_gimp_layer_set_edit_mask (gint32 layer_ID,
- gboolean edit_mask)
+gimp_layer_is_floating_sel (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ gboolean is_floating_sel = FALSE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_BOOLEAN, edit_mask,
+ GIMP_TYPE_LAYER, layer,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-set-edit-mask",
+ "gimp-layer-is-floating-sel",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-layer-set-edit-mask",
+ return_vals = gimp_run_procedure_array ("gimp-layer-is-floating-sel",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ is_floating_sel = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return is_floating_sel;
}
/**
- * gimp_layer_get_opacity:
+ * gimp_layer_get_lock_alpha:
* @layer: The layer.
*
- * Get the opacity of the specified layer.
+ * Get the lock alpha channel setting of the specified layer.
*
- * This procedure returns the specified layer's opacity.
+ * This procedure returns the specified layer's lock alpha channel
+ * setting.
*
- * Returns: The layer opacity.
+ * Returns: The layer's lock alpha channel setting.
**/
-gdouble
-gimp_layer_get_opacity (GimpLayer *layer)
+gboolean
+gimp_layer_get_lock_alpha (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gdouble opacity = 0.0;
+ gboolean lock_alpha = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER, layer,
@@ -2227,115 +860,121 @@ gimp_layer_get_opacity (GimpLayer *layer)
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-get-opacity",
+ "gimp-layer-get-lock-alpha",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-layer-get-opacity",
+ return_vals = gimp_run_procedure_array ("gimp-layer-get-lock-alpha",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- opacity = g_value_get_double (gimp_value_array_index (return_vals, 1));
+ lock_alpha = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return opacity;
+ return lock_alpha;
}
/**
- * _gimp_layer_get_opacity: (skip)
- * @layer_ID: The layer.
+ * gimp_layer_set_lock_alpha:
+ * @layer: The layer.
+ * @lock_alpha: The new layer's lock alpha channel setting.
*
- * Get the opacity of the specified layer.
+ * Set the lock alpha channel setting of the specified layer.
*
- * This procedure returns the specified layer's opacity.
+ * This procedure sets the specified layer's lock alpha channel
+ * setting.
*
- * Returns: The layer opacity.
+ * Returns: TRUE on success.
**/
-gdouble
-_gimp_layer_get_opacity (gint32 layer_ID)
+gboolean
+gimp_layer_set_lock_alpha (GimpLayer *layer,
+ gboolean lock_alpha)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gdouble opacity = 0.0;
+ gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
+ GIMP_TYPE_LAYER, layer,
+ G_TYPE_BOOLEAN, lock_alpha,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-get-opacity",
+ "gimp-layer-set-lock-alpha",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-layer-get-opacity",
+ return_vals = gimp_run_procedure_array ("gimp-layer-set-lock-alpha",
args);
gimp_value_array_unref (args);
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- opacity = g_value_get_double (gimp_value_array_index (return_vals, 1));
+ success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
- return opacity;
+ return success;
}
/**
- * gimp_layer_set_opacity:
+ * gimp_layer_get_apply_mask:
* @layer: The layer.
- * @opacity: The new layer opacity.
*
- * Set the opacity of the specified layer.
+ * Get the apply mask setting of the specified layer.
*
- * This procedure sets the specified layer's opacity.
+ * This procedure returns the specified layer's apply mask setting. If
+ * the value is TRUE, then the layer mask for this layer is currently
+ * being composited with the layer's alpha channel.
*
- * Returns: TRUE on success.
+ * Returns: The layer's apply mask setting.
**/
gboolean
-gimp_layer_set_opacity (GimpLayer *layer,
- gdouble opacity)
+gimp_layer_get_apply_mask (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ gboolean apply_mask = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER, layer,
- G_TYPE_DOUBLE, opacity,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-set-opacity",
+ "gimp-layer-get-apply-mask",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-layer-set-opacity",
+ return_vals = gimp_run_procedure_array ("gimp-layer-get-apply-mask",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ apply_mask = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return apply_mask;
}
/**
- * _gimp_layer_set_opacity: (skip)
- * @layer_ID: The layer.
- * @opacity: The new layer opacity.
+ * gimp_layer_set_apply_mask:
+ * @layer: The layer.
+ * @apply_mask: The new layer's apply mask setting.
*
- * Set the opacity of the specified layer.
+ * Set the apply mask setting of the specified layer.
*
- * This procedure sets the specified layer's opacity.
+ * This procedure sets the specified layer's apply mask setting. This
+ * controls whether the layer's mask is currently affecting the alpha
+ * channel. If there is no layer mask, this function will return an
+ * error.
*
* Returns: TRUE on success.
**/
gboolean
-_gimp_layer_set_opacity (gint32 layer_ID,
- gdouble opacity)
+gimp_layer_set_apply_mask (GimpLayer *layer,
+ gboolean apply_mask)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -2343,16 +982,16 @@ _gimp_layer_set_opacity (gint32 layer_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_DOUBLE, opacity,
+ GIMP_TYPE_LAYER, layer,
+ G_TYPE_BOOLEAN, apply_mask,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-set-opacity",
+ "gimp-layer-set-apply-mask",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-layer-set-opacity",
+ return_vals = gimp_run_procedure_array ("gimp-layer-set-apply-mask",
args);
gimp_value_array_unref (args);
@@ -2364,22 +1003,25 @@ _gimp_layer_set_opacity (gint32 layer_ID,
}
/**
- * gimp_layer_get_mode:
+ * gimp_layer_get_show_mask:
* @layer: The layer.
*
- * Get the combination mode of the specified layer.
+ * Get the show mask setting of the specified layer.
*
- * This procedure returns the specified layer's combination mode.
+ * This procedure returns the specified layer's show mask setting. This
+ * controls whether the layer or its mask is visible. TRUE indicates
+ * that the mask should be visible. If the layer has no mask, then this
+ * function returns an error.
*
- * Returns: The layer combination mode.
+ * Returns: The layer's show mask setting.
**/
-GimpLayerMode
-gimp_layer_get_mode (GimpLayer *layer)
+gboolean
+gimp_layer_get_show_mask (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- GimpLayerMode mode = 0;
+ gboolean show_mask = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER, layer,
@@ -2387,115 +1029,123 @@ gimp_layer_get_mode (GimpLayer *layer)
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-get-mode",
+ "gimp-layer-get-show-mask",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-layer-get-mode",
+ return_vals = gimp_run_procedure_array ("gimp-layer-get-show-mask",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- mode = g_value_get_enum (gimp_value_array_index (return_vals, 1));
+ show_mask = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return mode;
+ return show_mask;
}
/**
- * _gimp_layer_get_mode: (skip)
- * @layer_ID: The layer.
+ * gimp_layer_set_show_mask:
+ * @layer: The layer.
+ * @show_mask: The new layer's show mask setting.
*
- * Get the combination mode of the specified layer.
+ * Set the show mask setting of the specified layer.
*
- * This procedure returns the specified layer's combination mode.
+ * This procedure sets the specified layer's show mask setting. This
+ * controls whether the layer or its mask is visible. TRUE indicates
+ * that the mask should be visible. If there is no layer mask, this
+ * function will return an error.
*
- * Returns: The layer combination mode.
+ * Returns: TRUE on success.
**/
-GimpLayerMode
-_gimp_layer_get_mode (gint32 layer_ID)
+gboolean
+gimp_layer_set_show_mask (GimpLayer *layer,
+ gboolean show_mask)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- GimpLayerMode mode = 0;
+ gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
+ GIMP_TYPE_LAYER, layer,
+ G_TYPE_BOOLEAN, show_mask,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-get-mode",
+ "gimp-layer-set-show-mask",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-layer-get-mode",
+ return_vals = gimp_run_procedure_array ("gimp-layer-set-show-mask",
args);
gimp_value_array_unref (args);
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- mode = g_value_get_enum (gimp_value_array_index (return_vals, 1));
+ success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
- return mode;
+ return success;
}
/**
- * gimp_layer_set_mode:
+ * gimp_layer_get_edit_mask:
* @layer: The layer.
- * @mode: The new layer combination mode.
*
- * Set the combination mode of the specified layer.
+ * Get the edit mask setting of the specified layer.
*
- * This procedure sets the specified layer's combination mode.
+ * This procedure returns the specified layer's edit mask setting. If
+ * the value is TRUE, then the layer mask for this layer is currently
+ * active, and not the layer.
*
- * Returns: TRUE on success.
+ * Returns: The layer's edit mask setting.
**/
gboolean
-gimp_layer_set_mode (GimpLayer *layer,
- GimpLayerMode mode)
+gimp_layer_get_edit_mask (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ gboolean edit_mask = FALSE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER, layer,
- GIMP_TYPE_LAYER_MODE, mode,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-set-mode",
+ "gimp-layer-get-edit-mask",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-layer-set-mode",
+ return_vals = gimp_run_procedure_array ("gimp-layer-get-edit-mask",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ edit_mask = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return edit_mask;
}
/**
- * _gimp_layer_set_mode: (skip)
- * @layer_ID: The layer.
- * @mode: The new layer combination mode.
+ * gimp_layer_set_edit_mask:
+ * @layer: The layer.
+ * @edit_mask: The new layer's edit mask setting.
*
- * Set the combination mode of the specified layer.
+ * Set the edit mask setting of the specified layer.
*
- * This procedure sets the specified layer's combination mode.
+ * This procedure sets the specified layer's edit mask setting. This
+ * controls whether the layer or it's mask is currently active for
+ * editing. If the specified layer has no layer mask, then this
+ * procedure will return an error.
*
* Returns: TRUE on success.
**/
gboolean
-_gimp_layer_set_mode (gint32 layer_ID,
- GimpLayerMode mode)
+gimp_layer_set_edit_mask (GimpLayer *layer,
+ gboolean edit_mask)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -2503,16 +1153,16 @@ _gimp_layer_set_mode (gint32 layer_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- GIMP_TYPE_LAYER_MODE, mode,
+ GIMP_TYPE_LAYER, layer,
+ G_TYPE_BOOLEAN, edit_mask,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-set-mode",
+ "gimp-layer-set-edit-mask",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-layer-set-mode",
+ return_vals = gimp_run_procedure_array ("gimp-layer-set-edit-mask",
args);
gimp_value_array_unref (args);
@@ -2524,24 +1174,22 @@ _gimp_layer_set_mode (gint32 layer_ID,
}
/**
- * gimp_layer_get_blend_space:
+ * gimp_layer_get_opacity:
* @layer: The layer.
*
- * Get the blend space of the specified layer.
- *
- * This procedure returns the specified layer's blend space.
+ * Get the opacity of the specified layer.
*
- * Returns: The layer blend space.
+ * This procedure returns the specified layer's opacity.
*
- * Since: 2.10
+ * Returns: The layer opacity.
**/
-GimpLayerColorSpace
-gimp_layer_get_blend_space (GimpLayer *layer)
+gdouble
+gimp_layer_get_opacity (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- GimpLayerColorSpace blend_space = 0;
+ gdouble opacity = 0.0;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER, layer,
@@ -2549,121 +1197,115 @@ gimp_layer_get_blend_space (GimpLayer *layer)
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-get-blend-space",
+ "gimp-layer-get-opacity",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-layer-get-blend-space",
+ return_vals = gimp_run_procedure_array ("gimp-layer-get-opacity",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- blend_space = g_value_get_enum (gimp_value_array_index (return_vals, 1));
+ opacity = g_value_get_double (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return blend_space;
+ return opacity;
}
/**
- * _gimp_layer_get_blend_space: (skip)
- * @layer_ID: The layer.
- *
- * Get the blend space of the specified layer.
+ * gimp_layer_set_opacity:
+ * @layer: The layer.
+ * @opacity: The new layer opacity.
*
- * This procedure returns the specified layer's blend space.
+ * Set the opacity of the specified layer.
*
- * Returns: The layer blend space.
+ * This procedure sets the specified layer's opacity.
*
- * Since: 2.10
+ * Returns: TRUE on success.
**/
-GimpLayerColorSpace
-_gimp_layer_get_blend_space (gint32 layer_ID)
+gboolean
+gimp_layer_set_opacity (GimpLayer *layer,
+ gdouble opacity)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- GimpLayerColorSpace blend_space = 0;
+ gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
+ GIMP_TYPE_LAYER, layer,
+ G_TYPE_DOUBLE, opacity,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-get-blend-space",
+ "gimp-layer-set-opacity",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-layer-get-blend-space",
+ return_vals = gimp_run_procedure_array ("gimp-layer-set-opacity",
args);
gimp_value_array_unref (args);
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- blend_space = g_value_get_enum (gimp_value_array_index (return_vals, 1));
+ success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
- return blend_space;
+ return success;
}
/**
- * gimp_layer_set_blend_space:
+ * gimp_layer_get_mode:
* @layer: The layer.
- * @blend_space: The new layer blend space.
*
- * Set the blend space of the specified layer.
- *
- * This procedure sets the specified layer's blend space.
+ * Get the combination mode of the specified layer.
*
- * Returns: TRUE on success.
+ * This procedure returns the specified layer's combination mode.
*
- * Since: 2.10
+ * Returns: The layer combination mode.
**/
-gboolean
-gimp_layer_set_blend_space (GimpLayer *layer,
- GimpLayerColorSpace blend_space)
+GimpLayerMode
+gimp_layer_get_mode (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ GimpLayerMode mode = 0;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER, layer,
- GIMP_TYPE_LAYER_COLOR_SPACE, blend_space,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-set-blend-space",
+ "gimp-layer-get-mode",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-layer-set-blend-space",
+ return_vals = gimp_run_procedure_array ("gimp-layer-get-mode",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ mode = g_value_get_enum (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return mode;
}
/**
- * _gimp_layer_set_blend_space: (skip)
- * @layer_ID: The layer.
- * @blend_space: The new layer blend space.
+ * gimp_layer_set_mode:
+ * @layer: The layer.
+ * @mode: The new layer combination mode.
*
- * Set the blend space of the specified layer.
+ * Set the combination mode of the specified layer.
*
- * This procedure sets the specified layer's blend space.
+ * This procedure sets the specified layer's combination mode.
*
* Returns: TRUE on success.
- *
- * Since: 2.10
**/
gboolean
-_gimp_layer_set_blend_space (gint32 layer_ID,
- GimpLayerColorSpace blend_space)
+gimp_layer_set_mode (GimpLayer *layer,
+ GimpLayerMode mode)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -2671,16 +1313,16 @@ _gimp_layer_set_blend_space (gint32 layer_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- GIMP_TYPE_LAYER_COLOR_SPACE, blend_space,
+ GIMP_TYPE_LAYER, layer,
+ GIMP_TYPE_LAYER_MODE, mode,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-set-blend-space",
+ "gimp-layer-set-mode",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-layer-set-blend-space",
+ return_vals = gimp_run_procedure_array ("gimp-layer-set-mode",
args);
gimp_value_array_unref (args);
@@ -2692,24 +1334,24 @@ _gimp_layer_set_blend_space (gint32 layer_ID,
}
/**
- * gimp_layer_get_composite_space:
+ * gimp_layer_get_blend_space:
* @layer: The layer.
*
- * Get the composite space of the specified layer.
+ * Get the blend space of the specified layer.
*
- * This procedure returns the specified layer's composite space.
+ * This procedure returns the specified layer's blend space.
*
- * Returns: The layer composite space.
+ * Returns: The layer blend space.
*
* Since: 2.10
**/
GimpLayerColorSpace
-gimp_layer_get_composite_space (GimpLayer *layer)
+gimp_layer_get_blend_space (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- GimpLayerColorSpace composite_space = 0;
+ GimpLayerColorSpace blend_space = 0;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER, layer,
@@ -2717,108 +1359,108 @@ gimp_layer_get_composite_space (GimpLayer *layer)
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-get-composite-space",
+ "gimp-layer-get-blend-space",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-layer-get-composite-space",
+ return_vals = gimp_run_procedure_array ("gimp-layer-get-blend-space",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- composite_space = g_value_get_enum (gimp_value_array_index (return_vals, 1));
+ blend_space = g_value_get_enum (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return composite_space;
+ return blend_space;
}
/**
- * _gimp_layer_get_composite_space: (skip)
- * @layer_ID: The layer.
+ * gimp_layer_set_blend_space:
+ * @layer: The layer.
+ * @blend_space: The new layer blend space.
*
- * Get the composite space of the specified layer.
+ * Set the blend space of the specified layer.
*
- * This procedure returns the specified layer's composite space.
+ * This procedure sets the specified layer's blend space.
*
- * Returns: The layer composite space.
+ * Returns: TRUE on success.
*
* Since: 2.10
**/
-GimpLayerColorSpace
-_gimp_layer_get_composite_space (gint32 layer_ID)
+gboolean
+gimp_layer_set_blend_space (GimpLayer *layer,
+ GimpLayerColorSpace blend_space)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- GimpLayerColorSpace composite_space = 0;
+ gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
+ GIMP_TYPE_LAYER, layer,
+ GIMP_TYPE_LAYER_COLOR_SPACE, blend_space,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-get-composite-space",
+ "gimp-layer-set-blend-space",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-layer-get-composite-space",
+ return_vals = gimp_run_procedure_array ("gimp-layer-set-blend-space",
args);
gimp_value_array_unref (args);
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- composite_space = g_value_get_enum (gimp_value_array_index (return_vals, 1));
+ success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
- return composite_space;
+ return success;
}
/**
- * gimp_layer_set_composite_space:
+ * gimp_layer_get_composite_space:
* @layer: The layer.
- * @composite_space: The new layer composite space.
*
- * Set the composite space of the specified layer.
+ * Get the composite space of the specified layer.
*
- * This procedure sets the specified layer's composite space.
+ * This procedure returns the specified layer's composite space.
*
- * Returns: TRUE on success.
+ * Returns: The layer composite space.
*
* Since: 2.10
**/
-gboolean
-gimp_layer_set_composite_space (GimpLayer *layer,
- GimpLayerColorSpace composite_space)
+GimpLayerColorSpace
+gimp_layer_get_composite_space (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ GimpLayerColorSpace composite_space = 0;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER, layer,
- GIMP_TYPE_LAYER_COLOR_SPACE, composite_space,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-set-composite-space",
+ "gimp-layer-get-composite-space",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-layer-set-composite-space",
+ return_vals = gimp_run_procedure_array ("gimp-layer-get-composite-space",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ composite_space = g_value_get_enum (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return composite_space;
}
/**
- * _gimp_layer_set_composite_space: (skip)
- * @layer_ID: The layer.
+ * gimp_layer_set_composite_space:
+ * @layer: The layer.
* @composite_space: The new layer composite space.
*
* Set the composite space of the specified layer.
@@ -2830,8 +1472,8 @@ gimp_layer_set_composite_space (GimpLayer *layer,
* Since: 2.10
**/
gboolean
-_gimp_layer_set_composite_space (gint32 layer_ID,
- GimpLayerColorSpace composite_space)
+gimp_layer_set_composite_space (GimpLayer *layer,
+ GimpLayerColorSpace composite_space)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -2839,7 +1481,7 @@ _gimp_layer_set_composite_space (gint32 layer_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
+ GIMP_TYPE_LAYER, layer,
GIMP_TYPE_LAYER_COLOR_SPACE, composite_space,
G_TYPE_NONE);
@@ -2900,47 +1542,6 @@ gimp_layer_get_composite_mode (GimpLayer *layer)
return composite_mode;
}
-/**
- * _gimp_layer_get_composite_mode: (skip)
- * @layer_ID: The layer.
- *
- * Get the composite mode of the specified layer.
- *
- * This procedure returns the specified layer's composite mode.
- *
- * Returns: The layer composite mode.
- *
- * Since: 2.10
- **/
-GimpLayerCompositeMode
-_gimp_layer_get_composite_mode (gint32 layer_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- GimpLayerCompositeMode composite_mode = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-get-composite-mode",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-get-composite-mode",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- composite_mode = g_value_get_enum (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return composite_mode;
-}
-
/**
* gimp_layer_set_composite_mode:
* @layer: The layer.
@@ -2983,46 +1584,3 @@ gimp_layer_set_composite_mode (GimpLayer *layer,
return success;
}
-
-/**
- * _gimp_layer_set_composite_mode: (skip)
- * @layer_ID: The layer.
- * @composite_mode: The new layer composite mode.
- *
- * Set the composite mode of the specified layer.
- *
- * This procedure sets the specified layer's composite mode.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-_gimp_layer_set_composite_mode (gint32 layer_ID,
- GimpLayerCompositeMode composite_mode)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- GIMP_TYPE_LAYER_COMPOSITE_MODE, composite_mode,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-layer-set-composite-mode",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-layer-set-composite-mode",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
diff --git a/libgimp/gimplayer_pdb.h b/libgimp/gimplayer_pdb.h
index a06e6f5686..a1efa07004 100644
--- a/libgimp/gimplayer_pdb.h
+++ b/libgimp/gimplayer_pdb.h
@@ -32,10 +32,6 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
G_GNUC_INTERNAL GimpLayer* _gimp_layer_new (GimpImage *image,
gint width,
gint height,
@@ -103,107 +99,6 @@ GimpLayerCompositeMode gimp_layer_get_composite_mode (GimpLayer
gboolean gimp_layer_set_composite_mode (GimpLayer *layer,
GimpLayerCompositeMode composite_mode);
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_layer_new_from_visible _gimp_layer_new_from_visible
-#define gimp_layer_new_from_drawable _gimp_layer_new_from_drawable
-#define gimp_layer_group_new _gimp_layer_group_new
-#define gimp_layer_add_alpha _gimp_layer_add_alpha
-#define gimp_layer_flatten _gimp_layer_flatten
-#define gimp_layer_scale _gimp_layer_scale
-#define gimp_layer_resize _gimp_layer_resize
-#define gimp_layer_resize_to_image_size _gimp_layer_resize_to_image_size
-#define gimp_layer_set_offsets _gimp_layer_set_offsets
-#define gimp_layer_create_mask _gimp_layer_create_mask
-#define gimp_layer_get_mask _gimp_layer_get_mask
-#define gimp_layer_from_mask _gimp_layer_from_mask
-#define gimp_layer_add_mask _gimp_layer_add_mask
-#define gimp_layer_remove_mask _gimp_layer_remove_mask
-#define gimp_layer_is_floating_sel _gimp_layer_is_floating_sel
-#define gimp_layer_get_lock_alpha _gimp_layer_get_lock_alpha
-#define gimp_layer_set_lock_alpha _gimp_layer_set_lock_alpha
-#define gimp_layer_get_apply_mask _gimp_layer_get_apply_mask
-#define gimp_layer_set_apply_mask _gimp_layer_set_apply_mask
-#define gimp_layer_get_show_mask _gimp_layer_get_show_mask
-#define gimp_layer_set_show_mask _gimp_layer_set_show_mask
-#define gimp_layer_get_edit_mask _gimp_layer_get_edit_mask
-#define gimp_layer_set_edit_mask _gimp_layer_set_edit_mask
-#define gimp_layer_get_opacity _gimp_layer_get_opacity
-#define gimp_layer_set_opacity _gimp_layer_set_opacity
-#define gimp_layer_get_mode _gimp_layer_get_mode
-#define gimp_layer_set_mode _gimp_layer_set_mode
-#define gimp_layer_get_blend_space _gimp_layer_get_blend_space
-#define gimp_layer_set_blend_space _gimp_layer_set_blend_space
-#define gimp_layer_get_composite_space _gimp_layer_get_composite_space
-#define gimp_layer_set_composite_space _gimp_layer_set_composite_space
-#define gimp_layer_get_composite_mode _gimp_layer_get_composite_mode
-#define gimp_layer_set_composite_mode _gimp_layer_set_composite_mode
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-gint32 _gimp_layer_new_from_visible (gint32 image_ID,
- gint32 dest_image_ID,
- const gchar *name);
-gint32 _gimp_layer_new_from_drawable (gint32 drawable_ID,
- gint32 dest_image_ID);
-gint32 _gimp_layer_group_new (gint32 image_ID);
-gboolean _gimp_layer_add_alpha (gint32 layer_ID);
-gboolean _gimp_layer_flatten (gint32 layer_ID);
-gboolean _gimp_layer_scale (gint32 layer_ID,
- gint new_width,
- gint new_height,
- gboolean local_origin);
-gboolean _gimp_layer_resize (gint32 layer_ID,
- gint new_width,
- gint new_height,
- gint offx,
- gint offy);
-gboolean _gimp_layer_resize_to_image_size (gint32 layer_ID);
-gboolean _gimp_layer_set_offsets (gint32 layer_ID,
- gint offx,
- gint offy);
-gint32 _gimp_layer_create_mask (gint32 layer_ID,
- GimpAddMaskType mask_type);
-gint32 _gimp_layer_get_mask (gint32 layer_ID);
-gint32 _gimp_layer_from_mask (gint32 mask_ID);
-gboolean _gimp_layer_add_mask (gint32 layer_ID,
- gint32 mask_ID);
-gboolean _gimp_layer_remove_mask (gint32 layer_ID,
- GimpMaskApplyMode mode);
-gboolean _gimp_layer_is_floating_sel (gint32 layer_ID);
-gboolean _gimp_layer_get_lock_alpha (gint32 layer_ID);
-gboolean _gimp_layer_set_lock_alpha (gint32 layer_ID,
- gboolean lock_alpha);
-gboolean _gimp_layer_get_apply_mask (gint32 layer_ID);
-gboolean _gimp_layer_set_apply_mask (gint32 layer_ID,
- gboolean apply_mask);
-gboolean _gimp_layer_get_show_mask (gint32 layer_ID);
-gboolean _gimp_layer_set_show_mask (gint32 layer_ID,
- gboolean show_mask);
-gboolean _gimp_layer_get_edit_mask (gint32 layer_ID);
-gboolean _gimp_layer_set_edit_mask (gint32 layer_ID,
- gboolean edit_mask);
-gdouble _gimp_layer_get_opacity (gint32 layer_ID);
-gboolean _gimp_layer_set_opacity (gint32 layer_ID,
- gdouble opacity);
-GimpLayerMode _gimp_layer_get_mode (gint32 layer_ID);
-gboolean _gimp_layer_set_mode (gint32 layer_ID,
- GimpLayerMode mode);
-GimpLayerColorSpace _gimp_layer_get_blend_space (gint32 layer_ID);
-gboolean _gimp_layer_set_blend_space (gint32 layer_ID,
- GimpLayerColorSpace blend_space);
-GimpLayerColorSpace _gimp_layer_get_composite_space (gint32 layer_ID);
-gboolean _gimp_layer_set_composite_space (gint32 layer_ID,
- GimpLayerColorSpace composite_space);
-GimpLayerCompositeMode _gimp_layer_get_composite_mode (gint32 layer_ID);
-gboolean _gimp_layer_set_composite_mode (gint32 layer_ID,
- GimpLayerCompositeMode composite_mode);
-
G_END_DECLS
diff --git a/libgimp/gimpmessage_pdb.h b/libgimp/gimpmessage_pdb.h
index eec8adc71b..a23fe59ce1 100644
--- a/libgimp/gimpmessage_pdb.h
+++ b/libgimp/gimpmessage_pdb.h
@@ -36,22 +36,6 @@ gboolean gimp_message (const gchar *message
GimpMessageHandlerType gimp_message_get_handler (void);
gboolean gimp_message_set_handler (GimpMessageHandlerType handler);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimppainttools_pdb.c b/libgimp/gimppainttools_pdb.c
index e6770c9739..6813882b42 100644
--- a/libgimp/gimppainttools_pdb.c
+++ b/libgimp/gimppainttools_pdb.c
@@ -86,58 +86,6 @@ gimp_airbrush (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_airbrush: (skip)
- * @drawable_ID: The affected drawable.
- * @pressure: The pressure of the airbrush strokes.
- * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
- * @strokes: (array length=num_strokes) (element-type gdouble): Array of stroke coordinates: { s1.x, s1.y,
s2.x, s2.y, ..., sn.x, sn.y }.
- *
- * Paint in the current brush with varying pressure. Paint application
- * is time-dependent.
- *
- * This tool simulates the use of an airbrush. Paint pressure
- * represents the relative intensity of the paint application. High
- * pressure results in a thicker layer of paint while low pressure
- * results in a thinner layer.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_airbrush (gint32 drawable_ID,
- gdouble pressure,
- gint num_strokes,
- const gdouble *strokes)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_DOUBLE, pressure,
- G_TYPE_INT, num_strokes,
- GIMP_TYPE_FLOAT_ARRAY, NULL,
- G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 3), strokes, num_strokes);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-airbrush",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-airbrush",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_airbrush_default:
* @drawable: The affected drawable.
@@ -187,55 +135,6 @@ gimp_airbrush_default (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_airbrush_default: (skip)
- * @drawable_ID: The affected drawable.
- * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
- * @strokes: (array length=num_strokes) (element-type gdouble): Array of stroke coordinates: { s1.x, s1.y,
s2.x, s2.y, ..., sn.x, sn.y }.
- *
- * Paint in the current brush with varying pressure. Paint application
- * is time-dependent.
- *
- * This tool simulates the use of an airbrush. It is similar to
- * gimp_airbrush() except that the pressure is derived from the
- * airbrush tools options box. It the option has not been set the
- * default for the option will be used.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_airbrush_default (gint32 drawable_ID,
- gint num_strokes,
- const gdouble *strokes)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_INT, num_strokes,
- GIMP_TYPE_FLOAT_ARRAY, NULL,
- G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 2), strokes, num_strokes);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-airbrush-default",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-airbrush-default",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_clone:
* @drawable: The affected drawable.
@@ -305,40 +204,26 @@ gimp_clone (GimpDrawable *drawable,
}
/**
- * _gimp_clone: (skip)
- * @drawable_ID: The affected drawable.
- * @src_drawable_ID: The source drawable.
- * @clone_type: The type of clone.
- * @src_x: The x coordinate in the source image.
- * @src_y: The y coordinate in the source image.
+ * gimp_clone_default:
+ * @drawable: The affected drawable.
* @num_strokes: Number of stroke control points (count each coordinate as 2 points).
* @strokes: (array length=num_strokes) (element-type gdouble): Array of stroke coordinates: { s1.x, s1.y,
s2.x, s2.y, ..., sn.x, sn.y }.
*
* Clone from the source to the dest drawable using the current brush
*
* This tool clones (copies) from the source drawable starting at the
- * specified source coordinates to the dest drawable. If the
- * \"clone_type\" argument is set to PATTERN-CLONE, then the current
- * pattern is used as the source and the \"src_drawable\" argument is
- * ignored. Pattern cloning assumes a tileable pattern and mods the sum
- * of the src coordinates and subsequent stroke offsets with the width
- * and height of the pattern. For image cloning, if the sum of the src
- * coordinates and subsequent stroke offsets exceeds the extents of the
- * src drawable, then no paint is transferred. The clone tool is
- * capable of transforming between any image types including
- * RGB->Indexed--although converting from any type to indexed is
- * significantly slower.
+ * specified source coordinates to the dest drawable. This function
+ * performs exactly the same as the gimp_clone() function except that
+ * the tools arguments are obtained from the clones option dialog. It
+ * this dialog has not been activated then the dialogs default values
+ * will be used.
*
* Returns: TRUE on success.
**/
gboolean
-_gimp_clone (gint32 drawable_ID,
- gint32 src_drawable_ID,
- GimpCloneType clone_type,
- gdouble src_x,
- gdouble src_y,
- gint num_strokes,
- const gdouble *strokes)
+gimp_clone_default (GimpDrawable *drawable,
+ gint num_strokes,
+ const gdouble *strokes)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -346,22 +231,18 @@ _gimp_clone (gint32 drawable_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (src_drawable_ID),
- GIMP_TYPE_CLONE_TYPE, clone_type,
- G_TYPE_DOUBLE, src_x,
- G_TYPE_DOUBLE, src_y,
+ GIMP_TYPE_DRAWABLE, drawable,
G_TYPE_INT, num_strokes,
GIMP_TYPE_FLOAT_ARRAY, NULL,
G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 6), strokes, num_strokes);
+ gimp_value_set_float_array (gimp_value_array_index (args, 2), strokes, num_strokes);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-clone",
+ "gimp-clone-default",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-clone",
+ return_vals = gimp_run_procedure_array ("gimp-clone-default",
args);
gimp_value_array_unref (args);
@@ -373,26 +254,28 @@ _gimp_clone (gint32 drawable_ID,
}
/**
- * gimp_clone_default:
+ * gimp_convolve:
* @drawable: The affected drawable.
+ * @pressure: The pressure.
+ * @convolve_type: Convolve type.
* @num_strokes: Number of stroke control points (count each coordinate as 2 points).
* @strokes: (array length=num_strokes) (element-type gdouble): Array of stroke coordinates: { s1.x, s1.y,
s2.x, s2.y, ..., sn.x, sn.y }.
*
- * Clone from the source to the dest drawable using the current brush
+ * Convolve (Blur, Sharpen) using the current brush.
*
- * This tool clones (copies) from the source drawable starting at the
- * specified source coordinates to the dest drawable. This function
- * performs exactly the same as the gimp_clone() function except that
- * the tools arguments are obtained from the clones option dialog. It
- * this dialog has not been activated then the dialogs default values
- * will be used.
+ * This tool convolves the specified drawable with either a sharpening
+ * or blurring kernel. The pressure parameter controls the magnitude of
+ * the operation. Like the paintbrush, this tool linearly interpolates
+ * between the specified stroke coordinates.
*
* Returns: TRUE on success.
**/
gboolean
-gimp_clone_default (GimpDrawable *drawable,
- gint num_strokes,
- const gdouble *strokes)
+gimp_convolve (GimpDrawable *drawable,
+ gdouble pressure,
+ GimpConvolveType convolve_type,
+ gint num_strokes,
+ const gdouble *strokes)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -401,17 +284,19 @@ gimp_clone_default (GimpDrawable *drawable,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_DRAWABLE, drawable,
+ G_TYPE_DOUBLE, pressure,
+ GIMP_TYPE_CONVOLVE_TYPE, convolve_type,
G_TYPE_INT, num_strokes,
GIMP_TYPE_FLOAT_ARRAY, NULL,
G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 2), strokes, num_strokes);
+ gimp_value_set_float_array (gimp_value_array_index (args, 4), strokes, num_strokes);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-clone-default",
+ "gimp-convolve",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-clone-default",
+ return_vals = gimp_run_procedure_array ("gimp-convolve",
args);
gimp_value_array_unref (args);
@@ -423,26 +308,25 @@ gimp_clone_default (GimpDrawable *drawable,
}
/**
- * _gimp_clone_default: (skip)
- * @drawable_ID: The affected drawable.
+ * gimp_convolve_default:
+ * @drawable: The affected drawable.
* @num_strokes: Number of stroke control points (count each coordinate as 2 points).
* @strokes: (array length=num_strokes) (element-type gdouble): Array of stroke coordinates: { s1.x, s1.y,
s2.x, s2.y, ..., sn.x, sn.y }.
*
- * Clone from the source to the dest drawable using the current brush
+ * Convolve (Blur, Sharpen) using the current brush.
*
- * This tool clones (copies) from the source drawable starting at the
- * specified source coordinates to the dest drawable. This function
- * performs exactly the same as the gimp_clone() function except that
- * the tools arguments are obtained from the clones option dialog. It
- * this dialog has not been activated then the dialogs default values
- * will be used.
+ * This tool convolves the specified drawable with either a sharpening
+ * or blurring kernel. This function performs exactly the same as the
+ * gimp_convolve() function except that the tools arguments are
+ * obtained from the convolve option dialog. It this dialog has not
+ * been activated then the dialogs default values will be used.
*
* Returns: TRUE on success.
**/
gboolean
-_gimp_clone_default (gint32 drawable_ID,
- gint num_strokes,
- const gdouble *strokes)
+gimp_convolve_default (GimpDrawable *drawable,
+ gint num_strokes,
+ const gdouble *strokes)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -450,7 +334,7 @@ _gimp_clone_default (gint32 drawable_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
+ GIMP_TYPE_DRAWABLE, drawable,
G_TYPE_INT, num_strokes,
GIMP_TYPE_FLOAT_ARRAY, NULL,
G_TYPE_NONE);
@@ -458,10 +342,10 @@ _gimp_clone_default (gint32 drawable_ID,
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-clone-default",
+ "gimp-convolve-default",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-clone-default",
+ return_vals = gimp_run_procedure_array ("gimp-convolve-default",
args);
gimp_value_array_unref (args);
@@ -473,28 +357,27 @@ _gimp_clone_default (gint32 drawable_ID,
}
/**
- * gimp_convolve:
+ * gimp_dodgeburn:
* @drawable: The affected drawable.
- * @pressure: The pressure.
- * @convolve_type: Convolve type.
+ * @exposure: The exposure of the strokes.
+ * @dodgeburn_type: The type either dodge or burn.
+ * @dodgeburn_mode: The mode.
* @num_strokes: Number of stroke control points (count each coordinate as 2 points).
* @strokes: (array length=num_strokes) (element-type gdouble): Array of stroke coordinates: { s1.x, s1.y,
s2.x, s2.y, ..., sn.x, sn.y }.
*
- * Convolve (Blur, Sharpen) using the current brush.
+ * Dodgeburn image with varying exposure.
*
- * This tool convolves the specified drawable with either a sharpening
- * or blurring kernel. The pressure parameter controls the magnitude of
- * the operation. Like the paintbrush, this tool linearly interpolates
- * between the specified stroke coordinates.
+ * Dodgeburn. More details here later.
*
* Returns: TRUE on success.
**/
gboolean
-gimp_convolve (GimpDrawable *drawable,
- gdouble pressure,
- GimpConvolveType convolve_type,
- gint num_strokes,
- const gdouble *strokes)
+gimp_dodgeburn (GimpDrawable *drawable,
+ gdouble exposure,
+ GimpDodgeBurnType dodgeburn_type,
+ GimpTransferMode dodgeburn_mode,
+ gint num_strokes,
+ const gdouble *strokes)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -503,19 +386,20 @@ gimp_convolve (GimpDrawable *drawable,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_DRAWABLE, drawable,
- G_TYPE_DOUBLE, pressure,
- GIMP_TYPE_CONVOLVE_TYPE, convolve_type,
+ G_TYPE_DOUBLE, exposure,
+ GIMP_TYPE_DODGE_BURN_TYPE, dodgeburn_type,
+ GIMP_TYPE_TRANSFER_MODE, dodgeburn_mode,
G_TYPE_INT, num_strokes,
GIMP_TYPE_FLOAT_ARRAY, NULL,
G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 4), strokes, num_strokes);
+ gimp_value_set_float_array (gimp_value_array_index (args, 5), strokes, num_strokes);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-convolve",
+ "gimp-dodgeburn",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-convolve",
+ return_vals = gimp_run_procedure_array ("gimp-dodgeburn",
args);
gimp_value_array_unref (args);
@@ -527,28 +411,24 @@ gimp_convolve (GimpDrawable *drawable,
}
/**
- * _gimp_convolve: (skip)
- * @drawable_ID: The affected drawable.
- * @pressure: The pressure.
- * @convolve_type: Convolve type.
+ * gimp_dodgeburn_default:
+ * @drawable: The affected drawable.
* @num_strokes: Number of stroke control points (count each coordinate as 2 points).
* @strokes: (array length=num_strokes) (element-type gdouble): Array of stroke coordinates: { s1.x, s1.y,
s2.x, s2.y, ..., sn.x, sn.y }.
*
- * Convolve (Blur, Sharpen) using the current brush.
+ * Dodgeburn image with varying exposure. This is the same as the
+ * gimp_dodgeburn() function except that the exposure, type and mode
+ * are taken from the tools option dialog. If the dialog has not been
+ * activated then the defaults as used by the dialog will be used.
*
- * This tool convolves the specified drawable with either a sharpening
- * or blurring kernel. The pressure parameter controls the magnitude of
- * the operation. Like the paintbrush, this tool linearly interpolates
- * between the specified stroke coordinates.
+ * Dodgeburn. More details here later.
*
* Returns: TRUE on success.
**/
gboolean
-_gimp_convolve (gint32 drawable_ID,
- gdouble pressure,
- GimpConvolveType convolve_type,
- gint num_strokes,
- const gdouble *strokes)
+gimp_dodgeburn_default (GimpDrawable *drawable,
+ gint num_strokes,
+ const gdouble *strokes)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -556,20 +436,18 @@ _gimp_convolve (gint32 drawable_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_DOUBLE, pressure,
- GIMP_TYPE_CONVOLVE_TYPE, convolve_type,
+ GIMP_TYPE_DRAWABLE, drawable,
G_TYPE_INT, num_strokes,
GIMP_TYPE_FLOAT_ARRAY, NULL,
G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 4), strokes, num_strokes);
+ gimp_value_set_float_array (gimp_value_array_index (args, 2), strokes, num_strokes);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-convolve",
+ "gimp-dodgeburn-default",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-convolve",
+ return_vals = gimp_run_procedure_array ("gimp-dodgeburn-default",
args);
gimp_value_array_unref (args);
@@ -581,316 +459,14 @@ _gimp_convolve (gint32 drawable_ID,
}
/**
- * gimp_convolve_default:
+ * gimp_eraser:
* @drawable: The affected drawable.
* @num_strokes: Number of stroke control points (count each coordinate as 2 points).
* @strokes: (array length=num_strokes) (element-type gdouble): Array of stroke coordinates: { s1.x, s1.y,
s2.x, s2.y, ..., sn.x, sn.y }.
+ * @hardness: How to apply the brush.
+ * @method: The paint method to use.
*
- * Convolve (Blur, Sharpen) using the current brush.
- *
- * This tool convolves the specified drawable with either a sharpening
- * or blurring kernel. This function performs exactly the same as the
- * gimp_convolve() function except that the tools arguments are
- * obtained from the convolve option dialog. It this dialog has not
- * been activated then the dialogs default values will be used.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_convolve_default (GimpDrawable *drawable,
- gint num_strokes,
- const gdouble *strokes)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, drawable,
- G_TYPE_INT, num_strokes,
- GIMP_TYPE_FLOAT_ARRAY, NULL,
- G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 2), strokes, num_strokes);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-convolve-default",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-convolve-default",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_convolve_default: (skip)
- * @drawable_ID: The affected drawable.
- * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
- * @strokes: (array length=num_strokes) (element-type gdouble): Array of stroke coordinates: { s1.x, s1.y,
s2.x, s2.y, ..., sn.x, sn.y }.
- *
- * Convolve (Blur, Sharpen) using the current brush.
- *
- * This tool convolves the specified drawable with either a sharpening
- * or blurring kernel. This function performs exactly the same as the
- * gimp_convolve() function except that the tools arguments are
- * obtained from the convolve option dialog. It this dialog has not
- * been activated then the dialogs default values will be used.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_convolve_default (gint32 drawable_ID,
- gint num_strokes,
- const gdouble *strokes)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_INT, num_strokes,
- GIMP_TYPE_FLOAT_ARRAY, NULL,
- G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 2), strokes, num_strokes);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-convolve-default",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-convolve-default",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_dodgeburn:
- * @drawable: The affected drawable.
- * @exposure: The exposure of the strokes.
- * @dodgeburn_type: The type either dodge or burn.
- * @dodgeburn_mode: The mode.
- * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
- * @strokes: (array length=num_strokes) (element-type gdouble): Array of stroke coordinates: { s1.x, s1.y,
s2.x, s2.y, ..., sn.x, sn.y }.
- *
- * Dodgeburn image with varying exposure.
- *
- * Dodgeburn. More details here later.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_dodgeburn (GimpDrawable *drawable,
- gdouble exposure,
- GimpDodgeBurnType dodgeburn_type,
- GimpTransferMode dodgeburn_mode,
- gint num_strokes,
- const gdouble *strokes)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, drawable,
- G_TYPE_DOUBLE, exposure,
- GIMP_TYPE_DODGE_BURN_TYPE, dodgeburn_type,
- GIMP_TYPE_TRANSFER_MODE, dodgeburn_mode,
- G_TYPE_INT, num_strokes,
- GIMP_TYPE_FLOAT_ARRAY, NULL,
- G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 5), strokes, num_strokes);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-dodgeburn",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-dodgeburn",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_dodgeburn: (skip)
- * @drawable_ID: The affected drawable.
- * @exposure: The exposure of the strokes.
- * @dodgeburn_type: The type either dodge or burn.
- * @dodgeburn_mode: The mode.
- * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
- * @strokes: (array length=num_strokes) (element-type gdouble): Array of stroke coordinates: { s1.x, s1.y,
s2.x, s2.y, ..., sn.x, sn.y }.
- *
- * Dodgeburn image with varying exposure.
- *
- * Dodgeburn. More details here later.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_dodgeburn (gint32 drawable_ID,
- gdouble exposure,
- GimpDodgeBurnType dodgeburn_type,
- GimpTransferMode dodgeburn_mode,
- gint num_strokes,
- const gdouble *strokes)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_DOUBLE, exposure,
- GIMP_TYPE_DODGE_BURN_TYPE, dodgeburn_type,
- GIMP_TYPE_TRANSFER_MODE, dodgeburn_mode,
- G_TYPE_INT, num_strokes,
- GIMP_TYPE_FLOAT_ARRAY, NULL,
- G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 5), strokes, num_strokes);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-dodgeburn",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-dodgeburn",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_dodgeburn_default:
- * @drawable: The affected drawable.
- * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
- * @strokes: (array length=num_strokes) (element-type gdouble): Array of stroke coordinates: { s1.x, s1.y,
s2.x, s2.y, ..., sn.x, sn.y }.
- *
- * Dodgeburn image with varying exposure. This is the same as the
- * gimp_dodgeburn() function except that the exposure, type and mode
- * are taken from the tools option dialog. If the dialog has not been
- * activated then the defaults as used by the dialog will be used.
- *
- * Dodgeburn. More details here later.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_dodgeburn_default (GimpDrawable *drawable,
- gint num_strokes,
- const gdouble *strokes)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, drawable,
- G_TYPE_INT, num_strokes,
- GIMP_TYPE_FLOAT_ARRAY, NULL,
- G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 2), strokes, num_strokes);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-dodgeburn-default",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-dodgeburn-default",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_dodgeburn_default: (skip)
- * @drawable_ID: The affected drawable.
- * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
- * @strokes: (array length=num_strokes) (element-type gdouble): Array of stroke coordinates: { s1.x, s1.y,
s2.x, s2.y, ..., sn.x, sn.y }.
- *
- * Dodgeburn image with varying exposure. This is the same as the
- * gimp_dodgeburn() function except that the exposure, type and mode
- * are taken from the tools option dialog. If the dialog has not been
- * activated then the defaults as used by the dialog will be used.
- *
- * Dodgeburn. More details here later.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_dodgeburn_default (gint32 drawable_ID,
- gint num_strokes,
- const gdouble *strokes)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_INT, num_strokes,
- GIMP_TYPE_FLOAT_ARRAY, NULL,
- G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 2), strokes, num_strokes);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-dodgeburn-default",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-dodgeburn-default",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_eraser:
- * @drawable: The affected drawable.
- * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
- * @strokes: (array length=num_strokes) (element-type gdouble): Array of stroke coordinates: { s1.x, s1.y,
s2.x, s2.y, ..., sn.x, sn.y }.
- * @hardness: How to apply the brush.
- * @method: The paint method to use.
- *
- * Erase using the current brush.
+ * Erase using the current brush.
*
* This tool erases using the current brush mask. If the specified
* drawable contains an alpha channel, then the erased pixels will
@@ -937,61 +513,6 @@ gimp_eraser (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_eraser: (skip)
- * @drawable_ID: The affected drawable.
- * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
- * @strokes: (array length=num_strokes) (element-type gdouble): Array of stroke coordinates: { s1.x, s1.y,
s2.x, s2.y, ..., sn.x, sn.y }.
- * @hardness: How to apply the brush.
- * @method: The paint method to use.
- *
- * Erase using the current brush.
- *
- * This tool erases using the current brush mask. If the specified
- * drawable contains an alpha channel, then the erased pixels will
- * become transparent. Otherwise, the eraser tool replaces the contents
- * of the drawable with the background color. Like paintbrush, this
- * tool linearly interpolates between the specified stroke coordinates.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_eraser (gint32 drawable_ID,
- gint num_strokes,
- const gdouble *strokes,
- GimpBrushApplicationMode hardness,
- GimpPaintApplicationMode method)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_INT, num_strokes,
- GIMP_TYPE_FLOAT_ARRAY, NULL,
- GIMP_TYPE_BRUSH_APPLICATION_MODE, hardness,
- GIMP_TYPE_PAINT_APPLICATION_MODE, method,
- G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 2), strokes, num_strokes);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-eraser",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-eraser",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_eraser_default:
* @drawable: The affected drawable.
@@ -1041,55 +562,6 @@ gimp_eraser_default (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_eraser_default: (skip)
- * @drawable_ID: The affected drawable.
- * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
- * @strokes: (array length=num_strokes) (element-type gdouble): Array of stroke coordinates: { s1.x, s1.y,
s2.x, s2.y, ..., sn.x, sn.y }.
- *
- * Erase using the current brush.
- *
- * This tool erases using the current brush mask. This function
- * performs exactly the same as the gimp_eraser() function except that
- * the tools arguments are obtained from the eraser option dialog. It
- * this dialog has not been activated then the dialogs default values
- * will be used.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_eraser_default (gint32 drawable_ID,
- gint num_strokes,
- const gdouble *strokes)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_INT, num_strokes,
- GIMP_TYPE_FLOAT_ARRAY, NULL,
- G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 2), strokes, num_strokes);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-eraser-default",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-eraser-default",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_heal:
* @drawable: The affected drawable.
@@ -1115,126 +587,10 @@ _gimp_eraser_default (gint32 drawable_ID,
gboolean
gimp_heal (GimpDrawable *drawable,
GimpDrawable *src_drawable,
- gdouble src_x,
- gdouble src_y,
- gint num_strokes,
- const gdouble *strokes)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, drawable,
- GIMP_TYPE_DRAWABLE, src_drawable,
- G_TYPE_DOUBLE, src_x,
- G_TYPE_DOUBLE, src_y,
- G_TYPE_INT, num_strokes,
- GIMP_TYPE_FLOAT_ARRAY, NULL,
- G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 5), strokes, num_strokes);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-heal",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-heal",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_heal: (skip)
- * @drawable_ID: The affected drawable.
- * @src_drawable_ID: The source drawable.
- * @src_x: The x coordinate in the source image.
- * @src_y: The y coordinate in the source image.
- * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
- * @strokes: (array length=num_strokes) (element-type gdouble): Array of stroke coordinates: { s1.x, s1.y,
s2.x, s2.y, ..., sn.x, sn.y }.
- *
- * Heal from the source to the dest drawable using the current brush
- *
- * This tool heals the source drawable starting at the specified source
- * coordinates to the dest drawable. For image healing, if the sum of
- * the src coordinates and subsequent stroke offsets exceeds the
- * extents of the src drawable, then no paint is transferred. The
- * healing tool is capable of transforming between any image types
- * except RGB->Indexed.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.4
- **/
-gboolean
-_gimp_heal (gint32 drawable_ID,
- gint32 src_drawable_ID,
- gdouble src_x,
- gdouble src_y,
- gint num_strokes,
- const gdouble *strokes)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (src_drawable_ID),
- G_TYPE_DOUBLE, src_x,
- G_TYPE_DOUBLE, src_y,
- G_TYPE_INT, num_strokes,
- GIMP_TYPE_FLOAT_ARRAY, NULL,
- G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 5), strokes, num_strokes);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-heal",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-heal",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_heal_default:
- * @drawable: The affected drawable.
- * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
- * @strokes: (array length=num_strokes) (element-type gdouble): Array of stroke coordinates: { s1.x, s1.y,
s2.x, s2.y, ..., sn.x, sn.y }.
- *
- * Heal from the source to the dest drawable using the current brush
- *
- * This tool heals from the source drawable starting at the specified
- * source coordinates to the dest drawable. This function performs
- * exactly the same as the gimp_heal() function except that the tools
- * arguments are obtained from the healing option dialog. It this
- * dialog has not been activated then the dialogs default values will
- * be used.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.4
- **/
-gboolean
-gimp_heal_default (GimpDrawable *drawable,
- gint num_strokes,
- const gdouble *strokes)
+ gdouble src_x,
+ gdouble src_y,
+ gint num_strokes,
+ const gdouble *strokes)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -1243,17 +599,20 @@ gimp_heal_default (GimpDrawable *drawable,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_DRAWABLE, drawable,
+ GIMP_TYPE_DRAWABLE, src_drawable,
+ G_TYPE_DOUBLE, src_x,
+ G_TYPE_DOUBLE, src_y,
G_TYPE_INT, num_strokes,
GIMP_TYPE_FLOAT_ARRAY, NULL,
G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 2), strokes, num_strokes);
+ gimp_value_set_float_array (gimp_value_array_index (args, 5), strokes, num_strokes);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-heal-default",
+ "gimp-heal",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-heal-default",
+ return_vals = gimp_run_procedure_array ("gimp-heal",
args);
gimp_value_array_unref (args);
@@ -1265,8 +624,8 @@ gimp_heal_default (GimpDrawable *drawable,
}
/**
- * _gimp_heal_default: (skip)
- * @drawable_ID: The affected drawable.
+ * gimp_heal_default:
+ * @drawable: The affected drawable.
* @num_strokes: Number of stroke control points (count each coordinate as 2 points).
* @strokes: (array length=num_strokes) (element-type gdouble): Array of stroke coordinates: { s1.x, s1.y,
s2.x, s2.y, ..., sn.x, sn.y }.
*
@@ -1284,9 +643,9 @@ gimp_heal_default (GimpDrawable *drawable,
* Since: 2.4
**/
gboolean
-_gimp_heal_default (gint32 drawable_ID,
- gint num_strokes,
- const gdouble *strokes)
+gimp_heal_default (GimpDrawable *drawable,
+ gint num_strokes,
+ const gdouble *strokes)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -1294,7 +653,7 @@ _gimp_heal_default (gint32 drawable_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
+ GIMP_TYPE_DRAWABLE, drawable,
G_TYPE_INT, num_strokes,
GIMP_TYPE_FLOAT_ARRAY, NULL,
G_TYPE_NONE);
@@ -1379,69 +738,6 @@ gimp_paintbrush (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_paintbrush: (skip)
- * @drawable_ID: The affected drawable.
- * @fade_out: Fade out parameter.
- * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
- * @strokes: (array length=num_strokes) (element-type gdouble): Array of stroke coordinates: { s1.x, s1.y,
s2.x, s2.y, ..., sn.x, sn.y }.
- * @method: The paint method to use.
- * @gradient_length: Length of gradient to draw.
- *
- * Paint in the current brush with optional fade out parameter and pull
- * colors from a gradient.
- *
- * This tool is the standard paintbrush. It draws linearly interpolated
- * lines through the specified stroke coordinates. It operates on the
- * specified drawable in the foreground color with the active brush.
- * The 'fade-out' parameter is measured in pixels and allows the brush
- * stroke to linearly fall off. The pressure is set to the maximum at
- * the beginning of the stroke. As the distance of the stroke nears the
- * fade-out value, the pressure will approach zero. The gradient-length
- * is the distance to spread the gradient over. It is measured in
- * pixels. If the gradient-length is 0, no gradient is used.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_paintbrush (gint32 drawable_ID,
- gdouble fade_out,
- gint num_strokes,
- const gdouble *strokes,
- GimpPaintApplicationMode method,
- gdouble gradient_length)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_DOUBLE, fade_out,
- G_TYPE_INT, num_strokes,
- GIMP_TYPE_FLOAT_ARRAY, NULL,
- GIMP_TYPE_PAINT_APPLICATION_MODE, method,
- G_TYPE_DOUBLE, gradient_length,
- G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 3), strokes, num_strokes);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-paintbrush",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-paintbrush",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_paintbrush_default:
* @drawable: The affected drawable.
@@ -1500,64 +796,6 @@ gimp_paintbrush_default (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_paintbrush_default: (skip)
- * @drawable_ID: The affected drawable.
- * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
- * @strokes: (array length=num_strokes) (element-type gdouble): Array of stroke coordinates: { s1.x, s1.y,
s2.x, s2.y, ..., sn.x, sn.y }.
- *
- * Paint in the current brush. The fade out parameter and pull colors
- * from a gradient parameter are set from the paintbrush options
- * dialog. If this dialog has not been activated then the dialog
- * defaults will be used.
- *
- * This tool is similar to the standard paintbrush. It draws linearly
- * interpolated lines through the specified stroke coordinates. It
- * operates on the specified drawable in the foreground color with the
- * active brush. The 'fade-out' parameter is measured in pixels and
- * allows the brush stroke to linearly fall off (value obtained from
- * the option dialog). The pressure is set to the maximum at the
- * beginning of the stroke. As the distance of the stroke nears the
- * fade-out value, the pressure will approach zero. The gradient-length
- * (value obtained from the option dialog) is the distance to spread
- * the gradient over. It is measured in pixels. If the gradient-length
- * is 0, no gradient is used.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_paintbrush_default (gint32 drawable_ID,
- gint num_strokes,
- const gdouble *strokes)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_INT, num_strokes,
- GIMP_TYPE_FLOAT_ARRAY, NULL,
- G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 2), strokes, num_strokes);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-paintbrush-default",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-paintbrush-default",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_pencil:
* @drawable: The affected drawable.
@@ -1608,56 +846,6 @@ gimp_pencil (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_pencil: (skip)
- * @drawable_ID: The affected drawable.
- * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
- * @strokes: (array length=num_strokes) (element-type gdouble): Array of stroke coordinates: { s1.x, s1.y,
s2.x, s2.y, ..., sn.x, sn.y }.
- *
- * Paint in the current brush without sub-pixel sampling.
- *
- * This tool is the standard pencil. It draws linearly interpolated
- * lines through the specified stroke coordinates. It operates on the
- * specified drawable in the foreground color with the active brush.
- * The brush mask is treated as though it contains only black and white
- * values. Any value below half is treated as black; any above half, as
- * white.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_pencil (gint32 drawable_ID,
- gint num_strokes,
- const gdouble *strokes)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_INT, num_strokes,
- GIMP_TYPE_FLOAT_ARRAY, NULL,
- G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 2), strokes, num_strokes);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-pencil",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-pencil",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_smudge:
* @drawable: The affected drawable.
@@ -1708,56 +896,6 @@ gimp_smudge (GimpDrawable *drawable,
return success;
}
-/**
- * _gimp_smudge: (skip)
- * @drawable_ID: The affected drawable.
- * @pressure: The pressure of the smudge strokes.
- * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
- * @strokes: (array length=num_strokes) (element-type gdouble): Array of stroke coordinates: { s1.x, s1.y,
s2.x, s2.y, ..., sn.x, sn.y }.
- *
- * Smudge image with varying pressure.
- *
- * This tool simulates a smudge using the current brush. High pressure
- * results in a greater smudge of paint while low pressure results in a
- * lesser smudge.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_smudge (gint32 drawable_ID,
- gdouble pressure,
- gint num_strokes,
- const gdouble *strokes)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_DOUBLE, pressure,
- G_TYPE_INT, num_strokes,
- GIMP_TYPE_FLOAT_ARRAY, NULL,
- G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 3), strokes, num_strokes);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-smudge",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-smudge",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_smudge_default:
* @drawable: The affected drawable.
@@ -1805,51 +943,3 @@ gimp_smudge_default (GimpDrawable *drawable,
return success;
}
-
-/**
- * _gimp_smudge_default: (skip)
- * @drawable_ID: The affected drawable.
- * @num_strokes: Number of stroke control points (count each coordinate as 2 points).
- * @strokes: (array length=num_strokes) (element-type gdouble): Array of stroke coordinates: { s1.x, s1.y,
s2.x, s2.y, ..., sn.x, sn.y }.
- *
- * Smudge image with varying pressure.
- *
- * This tool simulates a smudge using the current brush. It behaves
- * exactly the same as gimp_smudge() except that the pressure value is
- * taken from the smudge tool options or the options default if the
- * tools option dialog has not been activated.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_smudge_default (gint32 drawable_ID,
- gint num_strokes,
- const gdouble *strokes)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_INT, num_strokes,
- GIMP_TYPE_FLOAT_ARRAY, NULL,
- G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 2), strokes, num_strokes);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-smudge-default",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-smudge-default",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
diff --git a/libgimp/gimppainttools_pdb.h b/libgimp/gimppainttools_pdb.h
index ec648c32ae..802351c3dd 100644
--- a/libgimp/gimppainttools_pdb.h
+++ b/libgimp/gimppainttools_pdb.h
@@ -32,10 +32,6 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
gboolean gimp_airbrush (GimpDrawable *drawable,
gdouble pressure,
gint num_strokes,
@@ -107,104 +103,6 @@ gboolean gimp_smudge_default (GimpDrawable *drawable,
gint num_strokes,
const gdouble *strokes);
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_airbrush _gimp_airbrush
-#define gimp_airbrush_default _gimp_airbrush_default
-#define gimp_clone _gimp_clone
-#define gimp_clone_default _gimp_clone_default
-#define gimp_convolve _gimp_convolve
-#define gimp_convolve_default _gimp_convolve_default
-#define gimp_dodgeburn _gimp_dodgeburn
-#define gimp_dodgeburn_default _gimp_dodgeburn_default
-#define gimp_eraser _gimp_eraser
-#define gimp_eraser_default _gimp_eraser_default
-#define gimp_heal _gimp_heal
-#define gimp_heal_default _gimp_heal_default
-#define gimp_paintbrush _gimp_paintbrush
-#define gimp_paintbrush_default _gimp_paintbrush_default
-#define gimp_pencil _gimp_pencil
-#define gimp_smudge _gimp_smudge
-#define gimp_smudge_default _gimp_smudge_default
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-gboolean _gimp_airbrush (gint32 drawable_ID,
- gdouble pressure,
- gint num_strokes,
- const gdouble *strokes);
-gboolean _gimp_airbrush_default (gint32 drawable_ID,
- gint num_strokes,
- const gdouble *strokes);
-gboolean _gimp_clone (gint32 drawable_ID,
- gint32 src_drawable_ID,
- GimpCloneType clone_type,
- gdouble src_x,
- gdouble src_y,
- gint num_strokes,
- const gdouble *strokes);
-gboolean _gimp_clone_default (gint32 drawable_ID,
- gint num_strokes,
- const gdouble *strokes);
-gboolean _gimp_convolve (gint32 drawable_ID,
- gdouble pressure,
- GimpConvolveType convolve_type,
- gint num_strokes,
- const gdouble *strokes);
-gboolean _gimp_convolve_default (gint32 drawable_ID,
- gint num_strokes,
- const gdouble *strokes);
-gboolean _gimp_dodgeburn (gint32 drawable_ID,
- gdouble exposure,
- GimpDodgeBurnType dodgeburn_type,
- GimpTransferMode dodgeburn_mode,
- gint num_strokes,
- const gdouble *strokes);
-gboolean _gimp_dodgeburn_default (gint32 drawable_ID,
- gint num_strokes,
- const gdouble *strokes);
-gboolean _gimp_eraser (gint32 drawable_ID,
- gint num_strokes,
- const gdouble *strokes,
- GimpBrushApplicationMode hardness,
- GimpPaintApplicationMode method);
-gboolean _gimp_eraser_default (gint32 drawable_ID,
- gint num_strokes,
- const gdouble *strokes);
-gboolean _gimp_heal (gint32 drawable_ID,
- gint32 src_drawable_ID,
- gdouble src_x,
- gdouble src_y,
- gint num_strokes,
- const gdouble *strokes);
-gboolean _gimp_heal_default (gint32 drawable_ID,
- gint num_strokes,
- const gdouble *strokes);
-gboolean _gimp_paintbrush (gint32 drawable_ID,
- gdouble fade_out,
- gint num_strokes,
- const gdouble *strokes,
- GimpPaintApplicationMode method,
- gdouble gradient_length);
-gboolean _gimp_paintbrush_default (gint32 drawable_ID,
- gint num_strokes,
- const gdouble *strokes);
-gboolean _gimp_pencil (gint32 drawable_ID,
- gint num_strokes,
- const gdouble *strokes);
-gboolean _gimp_smudge (gint32 drawable_ID,
- gdouble pressure,
- gint num_strokes,
- const gdouble *strokes);
-gboolean _gimp_smudge_default (gint32 drawable_ID,
- gint num_strokes,
- const gdouble *strokes);
-
G_END_DECLS
diff --git a/libgimp/gimppalette_pdb.h b/libgimp/gimppalette_pdb.h
index 093dc5b296..d9dd379e29 100644
--- a/libgimp/gimppalette_pdb.h
+++ b/libgimp/gimppalette_pdb.h
@@ -64,22 +64,6 @@ gboolean gimp_palette_entry_set_name (const gchar *name,
gint entry_num,
const gchar *entry_name);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimppalettes_pdb.h b/libgimp/gimppalettes_pdb.h
index f1ad8fd214..3b65fe22c5 100644
--- a/libgimp/gimppalettes_pdb.h
+++ b/libgimp/gimppalettes_pdb.h
@@ -36,22 +36,6 @@ gboolean gimp_palettes_refresh (void);
gchar** gimp_palettes_get_list (const gchar *filter,
gint *num_palettes);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimppaletteselect_pdb.h b/libgimp/gimppaletteselect_pdb.h
index 129f68fc22..221ec4b7b3 100644
--- a/libgimp/gimppaletteselect_pdb.h
+++ b/libgimp/gimppaletteselect_pdb.h
@@ -39,22 +39,6 @@ gboolean gimp_palettes_close_popup (const gchar *palette_callback);
gboolean gimp_palettes_set_popup (const gchar *palette_callback,
const gchar *palette_name);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimppattern_pdb.h b/libgimp/gimppattern_pdb.h
index 20ff52fc8e..71457982c0 100644
--- a/libgimp/gimppattern_pdb.h
+++ b/libgimp/gimppattern_pdb.h
@@ -43,22 +43,6 @@ gboolean gimp_pattern_get_pixels (const gchar *name,
gint *num_color_bytes,
guint8 **color_bytes);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimppatterns_pdb.h b/libgimp/gimppatterns_pdb.h
index 4af62fe321..066d460e3e 100644
--- a/libgimp/gimppatterns_pdb.h
+++ b/libgimp/gimppatterns_pdb.h
@@ -36,22 +36,6 @@ gboolean gimp_patterns_refresh (void);
gchar** gimp_patterns_get_list (const gchar *filter,
gint *num_patterns);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimppatternselect_pdb.h b/libgimp/gimppatternselect_pdb.h
index 7ccb2f42bc..50a04287b4 100644
--- a/libgimp/gimppatternselect_pdb.h
+++ b/libgimp/gimppatternselect_pdb.h
@@ -39,22 +39,6 @@ gboolean gimp_patterns_close_popup (const gchar *pattern_callback);
gboolean gimp_patterns_set_popup (const gchar *pattern_callback,
const gchar *pattern_name);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimppdb_pdb.h b/libgimp/gimppdb_pdb.h
index 68f07caa21..78e1b8cf20 100644
--- a/libgimp/gimppdb_pdb.h
+++ b/libgimp/gimppdb_pdb.h
@@ -65,22 +65,6 @@ G_GNUC_INTERNAL gboolean _gimp_pdb_set_data (const gchar *iden
gint bytes,
const guint8 *data);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimpplugin_pdb.h b/libgimp/gimpplugin_pdb.h
index 324112b02a..1d515a9f02 100644
--- a/libgimp/gimpplugin_pdb.h
+++ b/libgimp/gimpplugin_pdb.h
@@ -47,22 +47,6 @@ G_GNUC_INTERNAL gboolean _gimp_plugin_icon_register (const gc
G_GNUC_INTERNAL gboolean _gimp_plugin_set_pdb_error_handler (GimpPDBErrorHandler handler);
G_GNUC_INTERNAL GimpPDBErrorHandler _gimp_plugin_get_pdb_error_handler (void);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimpprogress_pdb.h b/libgimp/gimpprogress_pdb.h
index d75fc732ea..1bcee8b01d 100644
--- a/libgimp/gimpprogress_pdb.h
+++ b/libgimp/gimpprogress_pdb.h
@@ -32,6 +32,8 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
+G_GNUC_INTERNAL gboolean _gimp_progress_init (const gchar *message,
+ GimpDisplay *gdisplay);
G_GNUC_INTERNAL gboolean _gimp_progress_update (gdouble percentage);
gboolean gimp_progress_pulse (void);
gboolean gimp_progress_set_text (const gchar *message);
@@ -41,23 +43,6 @@ G_GNUC_INTERNAL gboolean _gimp_progress_install (const gchar *progress_
G_GNUC_INTERNAL gboolean _gimp_progress_uninstall (const gchar *progress_callback);
gboolean gimp_progress_cancel (const gchar *progress_callback);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-G_GNUC_INTERNAL gboolean _gimp_progress_init (const gchar *message,
- GimpDisplay *gdisplay);
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimpselection_pdb.c b/libgimp/gimpselection_pdb.c
index ab5d0a60ba..48a5d127f1 100644
--- a/libgimp/gimpselection_pdb.c
+++ b/libgimp/gimpselection_pdb.c
@@ -104,76 +104,6 @@ gimp_selection_bounds (GimpImage *image,
return success;
}
-/**
- * _gimp_selection_bounds: (skip)
- * @image_ID: The image.
- * @non_empty: (out): TRUE if there is a selection.
- * @x1: (out): x coordinate of upper left corner of selection bounds.
- * @y1: (out): y coordinate of upper left corner of selection bounds.
- * @x2: (out): x coordinate of lower right corner of selection bounds.
- * @y2: (out): y coordinate of lower right corner of selection bounds.
- *
- * Find the bounding box of the current selection.
- *
- * This procedure returns whether there is a selection for the
- * specified image. If there is one, the upper left and lower right
- * corners of the bounding box are returned. These coordinates are
- * relative to the image. Please note that the pixel specified by the
- * lower right coordinate of the bounding box is not part of the
- * selection. The selection ends at the upper left corner of this
- * pixel. This means the width of the selection can be calculated as
- * (x2 - x1), its height as (y2 - y1).
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_selection_bounds (gint32 image_ID,
- gboolean *non_empty,
- gint *x1,
- gint *y1,
- gint *x2,
- gint *y2)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-selection-bounds",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-selection-bounds",
- args);
- gimp_value_array_unref (args);
-
- *non_empty = FALSE;
- *x1 = 0;
- *y1 = 0;
- *x2 = 0;
- *y2 = 0;
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- if (success)
- {
- *non_empty = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
- *x1 = g_value_get_int (gimp_value_array_index (return_vals, 2));
- *y1 = g_value_get_int (gimp_value_array_index (return_vals, 3));
- *x2 = g_value_get_int (gimp_value_array_index (return_vals, 4));
- *y2 = g_value_get_int (gimp_value_array_index (return_vals, 5));
- }
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_selection_value:
* @image: The image.
@@ -220,52 +150,6 @@ gimp_selection_value (GimpImage *image,
return value;
}
-/**
- * _gimp_selection_value: (skip)
- * @image_ID: The image.
- * @x: x coordinate of value.
- * @y: y coordinate of value.
- *
- * Find the value of the selection at the specified coordinates.
- *
- * This procedure returns the value of the selection at the specified
- * coordinates. If the coordinates lie out of bounds, 0 is returned.
- *
- * Returns: Value of the selection.
- **/
-gint
-_gimp_selection_value (gint32 image_ID,
- gint x,
- gint y)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint value = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_INT, x,
- G_TYPE_INT, y,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-selection-value",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-selection-value",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- value = g_value_get_int (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return value;
-}
-
/**
* gimp_selection_is_empty:
* @image: The image.
@@ -306,46 +190,6 @@ gimp_selection_is_empty (GimpImage *image)
return is_empty;
}
-/**
- * _gimp_selection_is_empty: (skip)
- * @image_ID: The image.
- *
- * Determine whether the selection is empty.
- *
- * This procedure returns TRUE if the selection for the specified image
- * is empty.
- *
- * Returns: Is the selection empty?
- **/
-gboolean
-_gimp_selection_is_empty (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean is_empty = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-selection-is-empty",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-selection-is-empty",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- is_empty = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return is_empty;
-}
-
/**
* gimp_selection_translate:
* @image: The image.
@@ -354,395 +198,18 @@ _gimp_selection_is_empty (gint32 image_ID)
*
* Translate the selection by the specified offsets.
*
- * This procedure actually translates the selection for the specified
- * image by the specified offsets. Regions that are translated from
- * beyond the bounds of the image are set to empty. Valid regions of
- * the selection which are translated beyond the bounds of the image
- * because of this call are lost.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_selection_translate (GimpImage *image,
- gint offx,
- gint offy)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_INT, offx,
- G_TYPE_INT, offy,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-selection-translate",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-selection-translate",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_selection_translate: (skip)
- * @image_ID: The image.
- * @offx: x offset for translation.
- * @offy: y offset for translation.
- *
- * Translate the selection by the specified offsets.
- *
- * This procedure actually translates the selection for the specified
- * image by the specified offsets. Regions that are translated from
- * beyond the bounds of the image are set to empty. Valid regions of
- * the selection which are translated beyond the bounds of the image
- * because of this call are lost.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_selection_translate (gint32 image_ID,
- gint offx,
- gint offy)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_INT, offx,
- G_TYPE_INT, offy,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-selection-translate",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-selection-translate",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_selection_float:
- * @drawable: The drawable from which to float selection.
- * @offx: x offset for translation.
- * @offy: y offset for translation.
- *
- * Float the selection from the specified drawable with initial offsets
- * as specified.
- *
- * This procedure determines the region of the specified drawable that
- * lies beneath the current selection. The region is then cut from the
- * drawable and the resulting data is made into a new layer which is
- * instantiated as a floating selection. The offsets allow initial
- * positioning of the new floating selection.
- *
- * Returns: (transfer none): The floated layer.
- **/
-GimpLayer *
-_gimp_selection_float (GimpDrawable *drawable,
- gint offx,
- gint offy)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- GimpLayer *layer = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_DRAWABLE, drawable,
- G_TYPE_INT, offx,
- G_TYPE_INT, offy,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-selection-float",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-selection-float",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- layer = g_value_get_object (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return layer;
-}
-
-/**
- * gimp_selection_invert:
- * @image: The image.
- *
- * Invert the selection mask.
- *
- * This procedure inverts the selection mask. For every pixel in the
- * selection channel, its new value is calculated as (255 - old-value).
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_selection_invert (GimpImage *image)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-selection-invert",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-selection-invert",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_selection_invert: (skip)
- * @image_ID: The image.
- *
- * Invert the selection mask.
- *
- * This procedure inverts the selection mask. For every pixel in the
- * selection channel, its new value is calculated as (255 - old-value).
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_selection_invert (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-selection-invert",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-selection-invert",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_selection_sharpen:
- * @image: The image.
- *
- * Sharpen the selection mask.
- *
- * This procedure sharpens the selection mask. For every pixel in the
- * selection channel, if the value is > 127, the new pixel is
- * assigned a value of 255. This removes any \"anti-aliasing\" that
- * might exist in the selection mask's boundary.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_selection_sharpen (GimpImage *image)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-selection-sharpen",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-selection-sharpen",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_selection_sharpen: (skip)
- * @image_ID: The image.
- *
- * Sharpen the selection mask.
- *
- * This procedure sharpens the selection mask. For every pixel in the
- * selection channel, if the value is > 127, the new pixel is
- * assigned a value of 255. This removes any \"anti-aliasing\" that
- * might exist in the selection mask's boundary.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_selection_sharpen (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-selection-sharpen",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-selection-sharpen",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_selection_all:
- * @image: The image.
- *
- * Select all of the image.
- *
- * This procedure sets the selection mask to completely encompass the
- * image. Every pixel in the selection channel is set to 255.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_selection_all (GimpImage *image)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, image,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-selection-all",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-selection-all",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_selection_all: (skip)
- * @image_ID: The image.
- *
- * Select all of the image.
- *
- * This procedure sets the selection mask to completely encompass the
- * image. Every pixel in the selection channel is set to 255.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-_gimp_selection_all (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-selection-all",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-selection-all",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_selection_none:
- * @image: The image.
- *
- * Deselect the entire image.
- *
- * This procedure deselects the entire image. Every pixel in the
- * selection channel is set to 0.
- *
+ * This procedure actually translates the selection for the specified
+ * image by the specified offsets. Regions that are translated from
+ * beyond the bounds of the image are set to empty. Valid regions of
+ * the selection which are translated beyond the bounds of the image
+ * because of this call are lost.
+ *
* Returns: TRUE on success.
**/
gboolean
-gimp_selection_none (GimpImage *image)
+gimp_selection_translate (GimpImage *image,
+ gint offx,
+ gint offy)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -751,14 +218,16 @@ gimp_selection_none (GimpImage *image)
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
+ G_TYPE_INT, offx,
+ G_TYPE_INT, offy,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-selection-none",
+ "gimp-selection-translate",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-selection-none",
+ return_vals = gimp_run_procedure_array ("gimp-selection-translate",
args);
gimp_value_array_unref (args);
@@ -770,59 +239,68 @@ gimp_selection_none (GimpImage *image)
}
/**
- * _gimp_selection_none: (skip)
- * @image_ID: The image.
+ * _gimp_selection_float:
+ * @drawable: The drawable from which to float selection.
+ * @offx: x offset for translation.
+ * @offy: y offset for translation.
*
- * Deselect the entire image.
+ * Float the selection from the specified drawable with initial offsets
+ * as specified.
*
- * This procedure deselects the entire image. Every pixel in the
- * selection channel is set to 0.
+ * This procedure determines the region of the specified drawable that
+ * lies beneath the current selection. The region is then cut from the
+ * drawable and the resulting data is made into a new layer which is
+ * instantiated as a floating selection. The offsets allow initial
+ * positioning of the new floating selection.
*
- * Returns: TRUE on success.
+ * Returns: (transfer none): The floated layer.
**/
-gboolean
-_gimp_selection_none (gint32 image_ID)
+GimpLayer *
+_gimp_selection_float (GimpDrawable *drawable,
+ gint offx,
+ gint offy)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ GimpLayer *layer = NULL;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
+ GIMP_TYPE_DRAWABLE, drawable,
+ G_TYPE_INT, offx,
+ G_TYPE_INT, offy,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-selection-none",
+ "gimp-selection-float",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-selection-none",
+ return_vals = gimp_run_procedure_array ("gimp-selection-float",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ layer = g_value_get_object (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return layer;
}
/**
- * gimp_selection_feather:
+ * gimp_selection_invert:
* @image: The image.
- * @radius: Radius of feather (in pixels).
*
- * Feather the image's selection
+ * Invert the selection mask.
*
- * This procedure feathers the selection. Feathering is implemented
- * using a gaussian blur.
+ * This procedure inverts the selection mask. For every pixel in the
+ * selection channel, its new value is calculated as (255 - old-value).
*
* Returns: TRUE on success.
**/
gboolean
-gimp_selection_feather (GimpImage *image,
- gdouble radius)
+gimp_selection_invert (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -831,15 +309,14 @@ gimp_selection_feather (GimpImage *image,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
- G_TYPE_DOUBLE, radius,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-selection-feather",
+ "gimp-selection-invert",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-selection-feather",
+ return_vals = gimp_run_procedure_array ("gimp-selection-invert",
args);
gimp_value_array_unref (args);
@@ -851,20 +328,20 @@ gimp_selection_feather (GimpImage *image,
}
/**
- * _gimp_selection_feather: (skip)
- * @image_ID: The image.
- * @radius: Radius of feather (in pixels).
+ * gimp_selection_sharpen:
+ * @image: The image.
*
- * Feather the image's selection
+ * Sharpen the selection mask.
*
- * This procedure feathers the selection. Feathering is implemented
- * using a gaussian blur.
+ * This procedure sharpens the selection mask. For every pixel in the
+ * selection channel, if the value is > 127, the new pixel is
+ * assigned a value of 255. This removes any \"anti-aliasing\" that
+ * might exist in the selection mask's boundary.
*
* Returns: TRUE on success.
**/
gboolean
-_gimp_selection_feather (gint32 image_ID,
- gdouble radius)
+gimp_selection_sharpen (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -872,16 +349,15 @@ _gimp_selection_feather (gint32 image_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_DOUBLE, radius,
+ GIMP_TYPE_IMAGE, image,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-selection-feather",
+ "gimp-selection-sharpen",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-selection-feather",
+ return_vals = gimp_run_procedure_array ("gimp-selection-sharpen",
args);
gimp_value_array_unref (args);
@@ -893,21 +369,18 @@ _gimp_selection_feather (gint32 image_ID,
}
/**
- * gimp_selection_border:
+ * gimp_selection_all:
* @image: The image.
- * @radius: Radius of border (in pixels).
*
- * Border the image's selection
+ * Select all of the image.
*
- * This procedure borders the selection. Bordering creates a new
- * selection which is defined along the boundary of the previous
- * selection at every point within the specified radius.
+ * This procedure sets the selection mask to completely encompass the
+ * image. Every pixel in the selection channel is set to 255.
*
* Returns: TRUE on success.
**/
gboolean
-gimp_selection_border (GimpImage *image,
- gint radius)
+gimp_selection_all (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -916,15 +389,14 @@ gimp_selection_border (GimpImage *image,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
- G_TYPE_INT, radius,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-selection-border",
+ "gimp-selection-all",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-selection-border",
+ return_vals = gimp_run_procedure_array ("gimp-selection-all",
args);
gimp_value_array_unref (args);
@@ -936,21 +408,18 @@ gimp_selection_border (GimpImage *image,
}
/**
- * _gimp_selection_border: (skip)
- * @image_ID: The image.
- * @radius: Radius of border (in pixels).
+ * gimp_selection_none:
+ * @image: The image.
*
- * Border the image's selection
+ * Deselect the entire image.
*
- * This procedure borders the selection. Bordering creates a new
- * selection which is defined along the boundary of the previous
- * selection at every point within the specified radius.
+ * This procedure deselects the entire image. Every pixel in the
+ * selection channel is set to 0.
*
* Returns: TRUE on success.
**/
gboolean
-_gimp_selection_border (gint32 image_ID,
- gint radius)
+gimp_selection_none (GimpImage *image)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -958,16 +427,15 @@ _gimp_selection_border (gint32 image_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_INT, radius,
+ GIMP_TYPE_IMAGE, image,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-selection-border",
+ "gimp-selection-none",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-selection-border",
+ return_vals = gimp_run_procedure_array ("gimp-selection-none",
args);
gimp_value_array_unref (args);
@@ -979,20 +447,20 @@ _gimp_selection_border (gint32 image_ID,
}
/**
- * gimp_selection_grow:
+ * gimp_selection_feather:
* @image: The image.
- * @steps: Steps of grow (in pixels).
+ * @radius: Radius of feather (in pixels).
*
- * Grow the image's selection
+ * Feather the image's selection
*
- * This procedure grows the selection. Growing involves expanding the
- * boundary in all directions by the specified pixel amount.
+ * This procedure feathers the selection. Feathering is implemented
+ * using a gaussian blur.
*
* Returns: TRUE on success.
**/
gboolean
-gimp_selection_grow (GimpImage *image,
- gint steps)
+gimp_selection_feather (GimpImage *image,
+ gdouble radius)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -1001,15 +469,15 @@ gimp_selection_grow (GimpImage *image,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_IMAGE, image,
- G_TYPE_INT, steps,
+ G_TYPE_DOUBLE, radius,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-selection-grow",
+ "gimp-selection-feather",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-selection-grow",
+ return_vals = gimp_run_procedure_array ("gimp-selection-feather",
args);
gimp_value_array_unref (args);
@@ -1021,20 +489,21 @@ gimp_selection_grow (GimpImage *image,
}
/**
- * _gimp_selection_grow: (skip)
- * @image_ID: The image.
- * @steps: Steps of grow (in pixels).
+ * gimp_selection_border:
+ * @image: The image.
+ * @radius: Radius of border (in pixels).
*
- * Grow the image's selection
+ * Border the image's selection
*
- * This procedure grows the selection. Growing involves expanding the
- * boundary in all directions by the specified pixel amount.
+ * This procedure borders the selection. Bordering creates a new
+ * selection which is defined along the boundary of the previous
+ * selection at every point within the specified radius.
*
* Returns: TRUE on success.
**/
gboolean
-_gimp_selection_grow (gint32 image_ID,
- gint steps)
+gimp_selection_border (GimpImage *image,
+ gint radius)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -1042,16 +511,16 @@ _gimp_selection_grow (gint32 image_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_INT, steps,
+ GIMP_TYPE_IMAGE, image,
+ G_TYPE_INT, radius,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-selection-grow",
+ "gimp-selection-border",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-selection-grow",
+ return_vals = gimp_run_procedure_array ("gimp-selection-border",
args);
gimp_value_array_unref (args);
@@ -1063,21 +532,20 @@ _gimp_selection_grow (gint32 image_ID,
}
/**
- * gimp_selection_shrink:
+ * gimp_selection_grow:
* @image: The image.
- * @steps: Steps of shrink (in pixels).
+ * @steps: Steps of grow (in pixels).
*
- * Shrink the image's selection
+ * Grow the image's selection
*
- * This procedure shrinks the selection. Shrinking involves trimming
- * the existing selection boundary on all sides by the specified number
- * of pixels.
+ * This procedure grows the selection. Growing involves expanding the
+ * boundary in all directions by the specified pixel amount.
*
* Returns: TRUE on success.
**/
gboolean
-gimp_selection_shrink (GimpImage *image,
- gint steps)
+gimp_selection_grow (GimpImage *image,
+ gint steps)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -1091,10 +559,10 @@ gimp_selection_shrink (GimpImage *image,
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-selection-shrink",
+ "gimp-selection-grow",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-selection-shrink",
+ return_vals = gimp_run_procedure_array ("gimp-selection-grow",
args);
gimp_value_array_unref (args);
@@ -1106,8 +574,8 @@ gimp_selection_shrink (GimpImage *image,
}
/**
- * _gimp_selection_shrink: (skip)
- * @image_ID: The image.
+ * gimp_selection_shrink:
+ * @image: The image.
* @steps: Steps of shrink (in pixels).
*
* Shrink the image's selection
@@ -1119,8 +587,8 @@ gimp_selection_shrink (GimpImage *image,
* Returns: TRUE on success.
**/
gboolean
-_gimp_selection_shrink (gint32 image_ID,
- gint steps)
+gimp_selection_shrink (GimpImage *image,
+ gint steps)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -1128,7 +596,7 @@ _gimp_selection_shrink (gint32 image_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
+ GIMP_TYPE_IMAGE, image,
G_TYPE_INT, steps,
G_TYPE_NONE);
@@ -1191,49 +659,6 @@ gimp_selection_flood (GimpImage *image)
return success;
}
-/**
- * _gimp_selection_flood: (skip)
- * @image_ID: The image.
- *
- * Remove holes from the image's selection
- *
- * This procedure removes holes from the selection, that can come from
- * selecting a patchy area with the Fuzzy Select Tool. In technical
- * terms this procedure floods the selection. See the Algorithms page
- * in the developer wiki for details.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.10
- **/
-gboolean
-_gimp_selection_flood (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-selection-flood",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-selection-flood",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_selection_save:
* @image: The image.
@@ -1274,44 +699,3 @@ gimp_selection_save (GimpImage *image)
return channel;
}
-
-/**
- * _gimp_selection_save: (skip)
- * @image_ID: The image.
- *
- * Copy the selection mask to a new channel.
- *
- * This procedure copies the selection mask and stores the content in a
- * new channel. The new channel is automatically inserted into the
- * image's list of channels.
- *
- * Returns: The new channel.
- **/
-gint32
-_gimp_selection_save (gint32 image_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 channel_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-selection-save",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-selection-save",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- channel_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return channel_ID;
-}
diff --git a/libgimp/gimpselection_pdb.h b/libgimp/gimpselection_pdb.h
index 287df8875d..bda939f468 100644
--- a/libgimp/gimpselection_pdb.h
+++ b/libgimp/gimpselection_pdb.h
@@ -32,10 +32,6 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
gboolean gimp_selection_bounds (GimpImage *image,
gboolean *non_empty,
gint *x1,
@@ -67,58 +63,6 @@ gboolean gimp_selection_shrink (GimpImage *image,
gboolean gimp_selection_flood (GimpImage *image);
GimpChannel* gimp_selection_save (GimpImage *image);
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_selection_bounds _gimp_selection_bounds
-#define gimp_selection_value _gimp_selection_value
-#define gimp_selection_is_empty _gimp_selection_is_empty
-#define gimp_selection_translate _gimp_selection_translate
-#define gimp_selection_invert _gimp_selection_invert
-#define gimp_selection_sharpen _gimp_selection_sharpen
-#define gimp_selection_all _gimp_selection_all
-#define gimp_selection_none _gimp_selection_none
-#define gimp_selection_feather _gimp_selection_feather
-#define gimp_selection_border _gimp_selection_border
-#define gimp_selection_grow _gimp_selection_grow
-#define gimp_selection_shrink _gimp_selection_shrink
-#define gimp_selection_flood _gimp_selection_flood
-#define gimp_selection_save _gimp_selection_save
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-gboolean _gimp_selection_bounds (gint32 image_ID,
- gboolean *non_empty,
- gint *x1,
- gint *y1,
- gint *x2,
- gint *y2);
-gint _gimp_selection_value (gint32 image_ID,
- gint x,
- gint y);
-gboolean _gimp_selection_is_empty (gint32 image_ID);
-gboolean _gimp_selection_translate (gint32 image_ID,
- gint offx,
- gint offy);
-gboolean _gimp_selection_invert (gint32 image_ID);
-gboolean _gimp_selection_sharpen (gint32 image_ID);
-gboolean _gimp_selection_all (gint32 image_ID);
-gboolean _gimp_selection_none (gint32 image_ID);
-gboolean _gimp_selection_feather (gint32 image_ID,
- gdouble radius);
-gboolean _gimp_selection_border (gint32 image_ID,
- gint radius);
-gboolean _gimp_selection_grow (gint32 image_ID,
- gint steps);
-gboolean _gimp_selection_shrink (gint32 image_ID,
- gint steps);
-gboolean _gimp_selection_flood (gint32 image_ID);
-gint32 _gimp_selection_save (gint32 image_ID);
-
G_END_DECLS
diff --git a/libgimp/gimptextlayer_pdb.c b/libgimp/gimptextlayer_pdb.c
index 8723a6e00b..a73718fd70 100644
--- a/libgimp/gimptextlayer_pdb.c
+++ b/libgimp/gimptextlayer_pdb.c
@@ -92,64 +92,6 @@ gimp_text_layer_new (GimpImage *image,
return layer;
}
-/**
- * _gimp_text_layer_new: (skip)
- * @image_ID: The image.
- * @text: The text to generate (in UTF-8 encoding).
- * @fontname: The name of the font.
- * @size: The size of text in either pixels or points.
- * @unit: The units of specified size.
- *
- * Creates a new text layer.
- *
- * This procedure creates a new text layer. The arguments are kept as
- * simple as necessary for the normal case. All text attributes,
- * however, can be modified with the appropriate
- * gimp_text_layer_set_*() procedures. The new layer still needs to be
- * added to the image, as this is not automatic. Add the new layer
- * using gimp_image_insert_layer().
- *
- * Returns: The new text layer.
- *
- * Since: 2.6
- **/
-gint32
-_gimp_text_layer_new (gint32 image_ID,
- const gchar *text,
- const gchar *fontname,
- gdouble size,
- GimpUnit unit)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 layer_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_STRING, text,
- G_TYPE_STRING, fontname,
- G_TYPE_DOUBLE, size,
- GIMP_TYPE_UNIT, unit,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-new",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-new",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- layer_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return layer_ID;
-}
-
/**
* gimp_text_layer_get_text:
* @layer: The text layer.
@@ -192,48 +134,6 @@ gimp_text_layer_get_text (GimpLayer *layer)
return text;
}
-/**
- * _gimp_text_layer_get_text: (skip)
- * @layer_ID: The text layer.
- *
- * Get the text from a text layer as string.
- *
- * This procedure returns the text from a text layer as a string.
- *
- * Returns: The text from the specified text layer.
- * The returned value must be freed with g_free().
- *
- * Since: 2.6
- **/
-gchar *
-_gimp_text_layer_get_text (gint32 layer_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gchar *text = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-get-text",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-get-text",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- text = g_value_dup_string (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return text;
-}
-
/**
* gimp_text_layer_set_text:
* @layer: The text layer.
@@ -277,49 +177,6 @@ gimp_text_layer_set_text (GimpLayer *layer,
return success;
}
-/**
- * _gimp_text_layer_set_text: (skip)
- * @layer_ID: The text layer.
- * @text: The new text to set.
- *
- * Set the text of a text layer.
- *
- * This procedure changes the text of a text layer.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.6
- **/
-gboolean
-_gimp_text_layer_set_text (gint32 layer_ID,
- const gchar *text)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_STRING, text,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-set-text",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-set-text",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_text_layer_get_markup:
* @layer: The text layer.
@@ -367,52 +224,6 @@ gimp_text_layer_get_markup (GimpLayer *layer)
return markup;
}
-/**
- * _gimp_text_layer_get_markup: (skip)
- * @layer_ID: The text layer.
- *
- * Get the markup from a text layer as string.
- *
- * This procedure returns the markup of the styles from a text layer.
- * The markup will be in the form of Pango's markup - See
- * https://www.pango.org/ for more information about Pango and its
- * markup. Note: Setting the markup of a text layer using Pango's
- * markup is not supported for now.
- *
- * Returns: The markup which represents the style of the specified text layer.
- * The returned value must be freed with g_free().
- *
- * Since: 2.8
- **/
-gchar *
-_gimp_text_layer_get_markup (gint32 layer_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gchar *markup = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-get-markup",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-get-markup",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- markup = g_value_dup_string (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return markup;
-}
-
/**
* gimp_text_layer_get_font:
* @layer: The text layer.
@@ -456,48 +267,6 @@ gimp_text_layer_get_font (GimpLayer *layer)
return font;
}
-/**
- * _gimp_text_layer_get_font: (skip)
- * @layer_ID: The text layer.
- *
- * Get the font from a text layer as string.
- *
- * This procedure returns the name of the font from a text layer.
- *
- * Returns: The font which is used in the specified text layer.
- * The returned value must be freed with g_free().
- *
- * Since: 2.6
- **/
-gchar *
-_gimp_text_layer_get_font (gint32 layer_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gchar *font = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-get-font",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-get-font",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- font = g_value_dup_string (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return font;
-}
-
/**
* gimp_text_layer_set_font:
* @layer: The text layer.
@@ -541,49 +310,6 @@ gimp_text_layer_set_font (GimpLayer *layer,
return success;
}
-/**
- * _gimp_text_layer_set_font: (skip)
- * @layer_ID: The text layer.
- * @font: The new font to use.
- *
- * Set the font of a text layer.
- *
- * This procedure modifies the font used in the specified text layer.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.6
- **/
-gboolean
-_gimp_text_layer_set_font (gint32 layer_ID,
- const gchar *font)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_STRING, font,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-set-font",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-set-font",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_text_layer_get_font_size:
* @layer: The text layer.
@@ -633,77 +359,29 @@ gimp_text_layer_get_font_size (GimpLayer *layer,
}
/**
- * _gimp_text_layer_get_font_size: (skip)
- * @layer_ID: The text layer.
- * @unit: (out): The unit used for the font size.
+ * gimp_text_layer_set_font_size:
+ * @layer: The text layer.
+ * @font_size: The font size.
+ * @unit: The unit to use for the font size.
*
- * Get the font size from a text layer.
+ * Set the font size.
*
- * This procedure returns the size of the font which is used in a text
- * layer. You will receive the size as a float 'font-size' in 'unit'
- * units.
+ * This procedure changes the font size of a text layer. The size of
+ * your font will be a double 'font-size' of 'unit' units.
*
- * Returns: The font size.
+ * Returns: TRUE on success.
*
* Since: 2.6
**/
-gdouble
-_gimp_text_layer_get_font_size (gint32 layer_ID,
- GimpUnit *unit)
+gboolean
+gimp_text_layer_set_font_size (GimpLayer *layer,
+ gdouble font_size,
+ GimpUnit unit)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gdouble font_size = 0.0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-get-font-size",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-get-font-size",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- {
- font_size = g_value_get_double (gimp_value_array_index (return_vals, 1));
- *unit = g_value_get_int (gimp_value_array_index (return_vals, 2));
- }
-
- gimp_value_array_unref (return_vals);
-
- return font_size;
-}
-
-/**
- * gimp_text_layer_set_font_size:
- * @layer: The text layer.
- * @font_size: The font size.
- * @unit: The unit to use for the font size.
- *
- * Set the font size.
- *
- * This procedure changes the font size of a text layer. The size of
- * your font will be a double 'font-size' of 'unit' units.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.6
- **/
-gboolean
-gimp_text_layer_set_font_size (GimpLayer *layer,
- gdouble font_size,
- GimpUnit unit)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
+ gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER, layer,
@@ -727,53 +405,6 @@ gimp_text_layer_set_font_size (GimpLayer *layer,
return success;
}
-/**
- * _gimp_text_layer_set_font_size: (skip)
- * @layer_ID: The text layer.
- * @font_size: The font size.
- * @unit: The unit to use for the font size.
- *
- * Set the font size.
- *
- * This procedure changes the font size of a text layer. The size of
- * your font will be a double 'font-size' of 'unit' units.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.6
- **/
-gboolean
-_gimp_text_layer_set_font_size (gint32 layer_ID,
- gdouble font_size,
- GimpUnit unit)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_DOUBLE, font_size,
- GIMP_TYPE_UNIT, unit,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-set-font-size",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-set-font-size",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_text_layer_get_antialias:
* @layer: The text layer.
@@ -783,962 +414,144 @@ _gimp_text_layer_set_font_size (gint32 layer_ID,
* This procedure checks if antialiasing is enabled in the specified
* text layer.
*
- * Returns: A flag which is true if antialiasing is used for rendering the font in the text layer.
- *
- * Since: 2.6
- **/
-gboolean
-gimp_text_layer_get_antialias (GimpLayer *layer)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean antialias = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, layer,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-get-antialias",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-get-antialias",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- antialias = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return antialias;
-}
-
-/**
- * _gimp_text_layer_get_antialias: (skip)
- * @layer_ID: The text layer.
- *
- * Check if antialiasing is used in the text layer.
- *
- * This procedure checks if antialiasing is enabled in the specified
- * text layer.
- *
- * Returns: A flag which is true if antialiasing is used for rendering the font in the text layer.
- *
- * Since: 2.6
- **/
-gboolean
-_gimp_text_layer_get_antialias (gint32 layer_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean antialias = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-get-antialias",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-get-antialias",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- antialias = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return antialias;
-}
-
-/**
- * gimp_text_layer_set_antialias:
- * @layer: The text layer.
- * @antialias: Enable/disable antialiasing of the text.
- *
- * Enable/disable anti-aliasing in a text layer.
- *
- * This procedure enables or disables anti-aliasing of the text in a
- * text layer.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.6
- **/
-gboolean
-gimp_text_layer_set_antialias (GimpLayer *layer,
- gboolean antialias)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, layer,
- G_TYPE_BOOLEAN, antialias,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-set-antialias",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-set-antialias",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_text_layer_set_antialias: (skip)
- * @layer_ID: The text layer.
- * @antialias: Enable/disable antialiasing of the text.
- *
- * Enable/disable anti-aliasing in a text layer.
- *
- * This procedure enables or disables anti-aliasing of the text in a
- * text layer.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.6
- **/
-gboolean
-_gimp_text_layer_set_antialias (gint32 layer_ID,
- gboolean antialias)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_BOOLEAN, antialias,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-set-antialias",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-set-antialias",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_text_layer_get_hint_style:
- * @layer: The text layer.
- *
- * Get information about hinting in the specified text layer.
- *
- * This procedure provides information about the hinting that is being
- * used in a text layer. Hinting can be optimized for fidelity or
- * contrast or it can be turned entirely off.
- *
- * Returns: The hint style used for font outlines.
- *
- * Since: 2.8
- **/
-GimpTextHintStyle
-gimp_text_layer_get_hint_style (GimpLayer *layer)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- GimpTextHintStyle style = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, layer,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-get-hint-style",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-get-hint-style",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- style = g_value_get_enum (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return style;
-}
-
-/**
- * _gimp_text_layer_get_hint_style: (skip)
- * @layer_ID: The text layer.
- *
- * Get information about hinting in the specified text layer.
- *
- * This procedure provides information about the hinting that is being
- * used in a text layer. Hinting can be optimized for fidelity or
- * contrast or it can be turned entirely off.
- *
- * Returns: The hint style used for font outlines.
- *
- * Since: 2.8
- **/
-GimpTextHintStyle
-_gimp_text_layer_get_hint_style (gint32 layer_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- GimpTextHintStyle style = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-get-hint-style",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-get-hint-style",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- style = g_value_get_enum (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return style;
-}
-
-/**
- * gimp_text_layer_set_hint_style:
- * @layer: The text layer.
- * @style: The new hint style.
- *
- * Control how font outlines are hinted in a text layer.
- *
- * This procedure sets the hint style for font outlines in a text
- * layer. This controls whether to fit font outlines to the pixel grid,
- * and if so, whether to optimize for fidelity or contrast.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.8
- **/
-gboolean
-gimp_text_layer_set_hint_style (GimpLayer *layer,
- GimpTextHintStyle style)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, layer,
- GIMP_TYPE_TEXT_HINT_STYLE, style,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-set-hint-style",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-set-hint-style",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_text_layer_set_hint_style: (skip)
- * @layer_ID: The text layer.
- * @style: The new hint style.
- *
- * Control how font outlines are hinted in a text layer.
- *
- * This procedure sets the hint style for font outlines in a text
- * layer. This controls whether to fit font outlines to the pixel grid,
- * and if so, whether to optimize for fidelity or contrast.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.8
- **/
-gboolean
-_gimp_text_layer_set_hint_style (gint32 layer_ID,
- GimpTextHintStyle style)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- GIMP_TYPE_TEXT_HINT_STYLE, style,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-set-hint-style",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-set-hint-style",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_text_layer_get_kerning:
- * @layer: The text layer.
- *
- * Check if kerning is used in the text layer.
- *
- * This procedure checks if kerning is enabled in the specified text
- * layer.
- *
- * Returns: A flag which is true if kerning is used in the text layer.
- *
- * Since: 2.6
- **/
-gboolean
-gimp_text_layer_get_kerning (GimpLayer *layer)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean kerning = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, layer,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-get-kerning",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-get-kerning",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- kerning = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return kerning;
-}
-
-/**
- * _gimp_text_layer_get_kerning: (skip)
- * @layer_ID: The text layer.
- *
- * Check if kerning is used in the text layer.
- *
- * This procedure checks if kerning is enabled in the specified text
- * layer.
- *
- * Returns: A flag which is true if kerning is used in the text layer.
- *
- * Since: 2.6
- **/
-gboolean
-_gimp_text_layer_get_kerning (gint32 layer_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean kerning = FALSE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-get-kerning",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-get-kerning",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- kerning = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return kerning;
-}
-
-/**
- * gimp_text_layer_set_kerning:
- * @layer: The text layer.
- * @kerning: Enable/disable kerning in the text.
- *
- * Enable/disable kerning in a text layer.
- *
- * This procedure enables or disables kerning in a text layer.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.6
- **/
-gboolean
-gimp_text_layer_set_kerning (GimpLayer *layer,
- gboolean kerning)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, layer,
- G_TYPE_BOOLEAN, kerning,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-set-kerning",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-set-kerning",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_text_layer_set_kerning: (skip)
- * @layer_ID: The text layer.
- * @kerning: Enable/disable kerning in the text.
- *
- * Enable/disable kerning in a text layer.
- *
- * This procedure enables or disables kerning in a text layer.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.6
- **/
-gboolean
-_gimp_text_layer_set_kerning (gint32 layer_ID,
- gboolean kerning)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_BOOLEAN, kerning,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-set-kerning",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-set-kerning",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_text_layer_get_language:
- * @layer: The text layer.
- *
- * Get the language used in the text layer.
- *
- * This procedure returns the language string which is set for the text
- * in the text layer.
- *
- * Returns: (transfer full): The language used in the text layer.
- * The returned value must be freed with g_free().
- *
- * Since: 2.6
- **/
-gchar *
-gimp_text_layer_get_language (GimpLayer *layer)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gchar *language = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, layer,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-get-language",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-get-language",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- language = g_value_dup_string (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return language;
-}
-
-/**
- * _gimp_text_layer_get_language: (skip)
- * @layer_ID: The text layer.
- *
- * Get the language used in the text layer.
- *
- * This procedure returns the language string which is set for the text
- * in the text layer.
- *
- * Returns: The language used in the text layer.
- * The returned value must be freed with g_free().
- *
- * Since: 2.6
- **/
-gchar *
-_gimp_text_layer_get_language (gint32 layer_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gchar *language = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-get-language",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-get-language",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- language = g_value_dup_string (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return language;
-}
-
-/**
- * gimp_text_layer_set_language:
- * @layer: The text layer.
- * @language: The new language to use for the text layer.
- *
- * Set the language of the text layer.
- *
- * This procedure sets the language of the text in text layer. For some
- * scripts the language has an influence of how the text is rendered.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.6
- **/
-gboolean
-gimp_text_layer_set_language (GimpLayer *layer,
- const gchar *language)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, layer,
- G_TYPE_STRING, language,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-set-language",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-set-language",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_text_layer_set_language: (skip)
- * @layer_ID: The text layer.
- * @language: The new language to use for the text layer.
- *
- * Set the language of the text layer.
- *
- * This procedure sets the language of the text in text layer. For some
- * scripts the language has an influence of how the text is rendered.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.6
- **/
-gboolean
-_gimp_text_layer_set_language (gint32 layer_ID,
- const gchar *language)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_STRING, language,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-set-language",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-set-language",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_text_layer_get_base_direction:
- * @layer: The text layer.
- *
- * Get the base direction used for rendering the text layer.
- *
- * This procedure returns the base direction used for rendering the
- * text in the text layer
- *
- * Returns: The based direction used for the text layer.
- *
- * Since: 2.6
- **/
-GimpTextDirection
-gimp_text_layer_get_base_direction (GimpLayer *layer)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- GimpTextDirection direction = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, layer,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-get-base-direction",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-get-base-direction",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- direction = g_value_get_enum (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return direction;
-}
-
-/**
- * _gimp_text_layer_get_base_direction: (skip)
- * @layer_ID: The text layer.
- *
- * Get the base direction used for rendering the text layer.
- *
- * This procedure returns the base direction used for rendering the
- * text in the text layer
- *
- * Returns: The based direction used for the text layer.
- *
- * Since: 2.6
- **/
-GimpTextDirection
-_gimp_text_layer_get_base_direction (gint32 layer_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- GimpTextDirection direction = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-get-base-direction",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-get-base-direction",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- direction = g_value_get_enum (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return direction;
-}
-
-/**
- * gimp_text_layer_set_base_direction:
- * @layer: The text layer.
- * @direction: The base direction of the text.
- *
- * Set the base direction in the text layer.
- *
- * This procedure sets the base direction used in applying the Unicode
- * bidirectional algorithm when rendering the text.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.6
- **/
-gboolean
-gimp_text_layer_set_base_direction (GimpLayer *layer,
- GimpTextDirection direction)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, layer,
- GIMP_TYPE_TEXT_DIRECTION, direction,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-set-base-direction",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-set-base-direction",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_text_layer_set_base_direction: (skip)
- * @layer_ID: The text layer.
- * @direction: The base direction of the text.
- *
- * Set the base direction in the text layer.
- *
- * This procedure sets the base direction used in applying the Unicode
- * bidirectional algorithm when rendering the text.
- *
- * Returns: TRUE on success.
+ * Returns: A flag which is true if antialiasing is used for rendering the font in the text layer.
*
* Since: 2.6
**/
gboolean
-_gimp_text_layer_set_base_direction (gint32 layer_ID,
- GimpTextDirection direction)
+gimp_text_layer_get_antialias (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ gboolean antialias = FALSE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- GIMP_TYPE_TEXT_DIRECTION, direction,
+ GIMP_TYPE_LAYER, layer,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-set-base-direction",
+ "gimp-text-layer-get-antialias",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-set-base-direction",
+ return_vals = gimp_run_procedure_array ("gimp-text-layer-get-antialias",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ antialias = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return antialias;
}
/**
- * gimp_text_layer_get_justification:
+ * gimp_text_layer_set_antialias:
* @layer: The text layer.
+ * @antialias: Enable/disable antialiasing of the text.
*
- * Get the text justification information of the text layer.
+ * Enable/disable anti-aliasing in a text layer.
*
- * This procedure returns the alignment of the lines in the text layer
- * relative to each other.
+ * This procedure enables or disables anti-aliasing of the text in a
+ * text layer.
*
- * Returns: The justification used in the text layer.
+ * Returns: TRUE on success.
*
* Since: 2.6
**/
-GimpTextJustification
-gimp_text_layer_get_justification (GimpLayer *layer)
+gboolean
+gimp_text_layer_set_antialias (GimpLayer *layer,
+ gboolean antialias)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- GimpTextJustification justify = 0;
+ gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER, layer,
+ G_TYPE_BOOLEAN, antialias,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-get-justification",
+ "gimp-text-layer-set-antialias",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-get-justification",
+ return_vals = gimp_run_procedure_array ("gimp-text-layer-set-antialias",
args);
gimp_value_array_unref (args);
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- justify = g_value_get_enum (gimp_value_array_index (return_vals, 1));
+ success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
- return justify;
+ return success;
}
/**
- * _gimp_text_layer_get_justification: (skip)
- * @layer_ID: The text layer.
+ * gimp_text_layer_get_hint_style:
+ * @layer: The text layer.
*
- * Get the text justification information of the text layer.
+ * Get information about hinting in the specified text layer.
*
- * This procedure returns the alignment of the lines in the text layer
- * relative to each other.
+ * This procedure provides information about the hinting that is being
+ * used in a text layer. Hinting can be optimized for fidelity or
+ * contrast or it can be turned entirely off.
*
- * Returns: The justification used in the text layer.
+ * Returns: The hint style used for font outlines.
*
- * Since: 2.6
+ * Since: 2.8
**/
-GimpTextJustification
-_gimp_text_layer_get_justification (gint32 layer_ID)
+GimpTextHintStyle
+gimp_text_layer_get_hint_style (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- GimpTextJustification justify = 0;
+ GimpTextHintStyle style = 0;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
+ GIMP_TYPE_LAYER, layer,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-get-justification",
+ "gimp-text-layer-get-hint-style",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-get-justification",
+ return_vals = gimp_run_procedure_array ("gimp-text-layer-get-hint-style",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- justify = g_value_get_enum (gimp_value_array_index (return_vals, 1));
+ style = g_value_get_enum (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return justify;
+ return style;
}
/**
- * gimp_text_layer_set_justification:
+ * gimp_text_layer_set_hint_style:
* @layer: The text layer.
- * @justify: The justification for your text.
+ * @style: The new hint style.
*
- * Set the justification of the text in a text layer.
+ * Control how font outlines are hinted in a text layer.
*
- * This procedure sets the alignment of the lines in the text layer
- * relative to each other.
+ * This procedure sets the hint style for font outlines in a text
+ * layer. This controls whether to fit font outlines to the pixel grid,
+ * and if so, whether to optimize for fidelity or contrast.
*
* Returns: TRUE on success.
*
- * Since: 2.6
+ * Since: 2.8
**/
gboolean
-gimp_text_layer_set_justification (GimpLayer *layer,
- GimpTextJustification justify)
+gimp_text_layer_set_hint_style (GimpLayer *layer,
+ GimpTextHintStyle style)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -1747,15 +560,15 @@ gimp_text_layer_set_justification (GimpLayer *layer,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER, layer,
- GIMP_TYPE_TEXT_JUSTIFICATION, justify,
+ GIMP_TYPE_TEXT_HINT_STYLE, style,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-set-justification",
+ "gimp-text-layer-set-hint-style",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-set-justification",
+ return_vals = gimp_run_procedure_array ("gimp-text-layer-set-hint-style",
args);
gimp_value_array_unref (args);
@@ -1767,65 +580,63 @@ gimp_text_layer_set_justification (GimpLayer *layer,
}
/**
- * _gimp_text_layer_set_justification: (skip)
- * @layer_ID: The text layer.
- * @justify: The justification for your text.
+ * gimp_text_layer_get_kerning:
+ * @layer: The text layer.
*
- * Set the justification of the text in a text layer.
+ * Check if kerning is used in the text layer.
*
- * This procedure sets the alignment of the lines in the text layer
- * relative to each other.
+ * This procedure checks if kerning is enabled in the specified text
+ * layer.
*
- * Returns: TRUE on success.
+ * Returns: A flag which is true if kerning is used in the text layer.
*
* Since: 2.6
**/
gboolean
-_gimp_text_layer_set_justification (gint32 layer_ID,
- GimpTextJustification justify)
+gimp_text_layer_get_kerning (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ gboolean kerning = FALSE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- GIMP_TYPE_TEXT_JUSTIFICATION, justify,
+ GIMP_TYPE_LAYER, layer,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-set-justification",
+ "gimp-text-layer-get-kerning",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-set-justification",
+ return_vals = gimp_run_procedure_array ("gimp-text-layer-get-kerning",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ kerning = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return kerning;
}
/**
- * gimp_text_layer_get_color:
+ * gimp_text_layer_set_kerning:
* @layer: The text layer.
- * @color: (out caller-allocates): The color of the text.
+ * @kerning: Enable/disable kerning in the text.
*
- * Get the color of the text in a text layer.
+ * Enable/disable kerning in a text layer.
*
- * This procedure returns the color of the text in a text layer.
+ * This procedure enables or disables kerning in a text layer.
*
* Returns: TRUE on success.
*
* Since: 2.6
**/
gboolean
-gimp_text_layer_get_color (GimpLayer *layer,
- GimpRGB *color)
+gimp_text_layer_set_kerning (GimpLayer *layer,
+ gboolean kerning)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -1834,88 +645,85 @@ gimp_text_layer_get_color (GimpLayer *layer,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER, layer,
+ G_TYPE_BOOLEAN, kerning,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-get-color",
+ "gimp-text-layer-set-kerning",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-get-color",
+ return_vals = gimp_run_procedure_array ("gimp-text-layer-set-kerning",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
- if (success)
- gimp_value_get_rgb (gimp_value_array_index (return_vals, 1), &*color);
-
gimp_value_array_unref (return_vals);
return success;
}
/**
- * _gimp_text_layer_get_color: (skip)
- * @layer_ID: The text layer.
- * @color: (out caller-allocates): The color of the text.
+ * gimp_text_layer_get_language:
+ * @layer: The text layer.
*
- * Get the color of the text in a text layer.
+ * Get the language used in the text layer.
*
- * This procedure returns the color of the text in a text layer.
+ * This procedure returns the language string which is set for the text
+ * in the text layer.
*
- * Returns: TRUE on success.
+ * Returns: (transfer full): The language used in the text layer.
+ * The returned value must be freed with g_free().
*
* Since: 2.6
**/
-gboolean
-_gimp_text_layer_get_color (gint32 layer_ID,
- GimpRGB *color)
+gchar *
+gimp_text_layer_get_language (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ gchar *language = NULL;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
+ GIMP_TYPE_LAYER, layer,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-get-color",
+ "gimp-text-layer-get-language",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-get-color",
+ return_vals = gimp_run_procedure_array ("gimp-text-layer-get-language",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- if (success)
- gimp_value_get_rgb (gimp_value_array_index (return_vals, 1), &*color);
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ language = g_value_dup_string (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return language;
}
/**
- * gimp_text_layer_set_color:
+ * gimp_text_layer_set_language:
* @layer: The text layer.
- * @color: The color to use for the text.
+ * @language: The new language to use for the text layer.
*
- * Set the color of the text in the text layer.
+ * Set the language of the text layer.
*
- * This procedure sets the text color in the text layer 'layer'.
+ * This procedure sets the language of the text in text layer. For some
+ * scripts the language has an influence of how the text is rendered.
*
* Returns: TRUE on success.
*
* Since: 2.6
**/
gboolean
-gimp_text_layer_set_color (GimpLayer *layer,
- const GimpRGB *color)
+gimp_text_layer_set_language (GimpLayer *layer,
+ const gchar *language)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -1924,15 +732,15 @@ gimp_text_layer_set_color (GimpLayer *layer,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER, layer,
- GIMP_TYPE_RGB, color,
+ G_TYPE_STRING, language,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-set-color",
+ "gimp-text-layer-set-language",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-set-color",
+ return_vals = gimp_run_procedure_array ("gimp-text-layer-set-language",
args);
gimp_value_array_unref (args);
@@ -1944,149 +752,150 @@ gimp_text_layer_set_color (GimpLayer *layer,
}
/**
- * _gimp_text_layer_set_color: (skip)
- * @layer_ID: The text layer.
- * @color: The color to use for the text.
+ * gimp_text_layer_get_base_direction:
+ * @layer: The text layer.
*
- * Set the color of the text in the text layer.
+ * Get the base direction used for rendering the text layer.
*
- * This procedure sets the text color in the text layer 'layer'.
+ * This procedure returns the base direction used for rendering the
+ * text in the text layer
*
- * Returns: TRUE on success.
+ * Returns: The based direction used for the text layer.
*
* Since: 2.6
**/
-gboolean
-_gimp_text_layer_set_color (gint32 layer_ID,
- const GimpRGB *color)
+GimpTextDirection
+gimp_text_layer_get_base_direction (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ GimpTextDirection direction = 0;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- GIMP_TYPE_RGB, color,
+ GIMP_TYPE_LAYER, layer,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-set-color",
+ "gimp-text-layer-get-base-direction",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-set-color",
+ return_vals = gimp_run_procedure_array ("gimp-text-layer-get-base-direction",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ direction = g_value_get_enum (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return direction;
}
/**
- * gimp_text_layer_get_indent:
+ * gimp_text_layer_set_base_direction:
* @layer: The text layer.
+ * @direction: The base direction of the text.
*
- * Get the line indentation of text layer.
+ * Set the base direction in the text layer.
*
- * This procedure returns the indentation of the first line in a text
- * layer.
+ * This procedure sets the base direction used in applying the Unicode
+ * bidirectional algorithm when rendering the text.
*
- * Returns: The indentation value of the first line.
+ * Returns: TRUE on success.
*
* Since: 2.6
**/
-gdouble
-gimp_text_layer_get_indent (GimpLayer *layer)
+gboolean
+gimp_text_layer_set_base_direction (GimpLayer *layer,
+ GimpTextDirection direction)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gdouble indent = 0.0;
+ gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER, layer,
+ GIMP_TYPE_TEXT_DIRECTION, direction,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-get-indent",
+ "gimp-text-layer-set-base-direction",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-get-indent",
+ return_vals = gimp_run_procedure_array ("gimp-text-layer-set-base-direction",
args);
gimp_value_array_unref (args);
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- indent = g_value_get_double (gimp_value_array_index (return_vals, 1));
+ success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
- return indent;
+ return success;
}
/**
- * _gimp_text_layer_get_indent: (skip)
- * @layer_ID: The text layer.
+ * gimp_text_layer_get_justification:
+ * @layer: The text layer.
*
- * Get the line indentation of text layer.
+ * Get the text justification information of the text layer.
*
- * This procedure returns the indentation of the first line in a text
- * layer.
+ * This procedure returns the alignment of the lines in the text layer
+ * relative to each other.
*
- * Returns: The indentation value of the first line.
+ * Returns: The justification used in the text layer.
*
* Since: 2.6
**/
-gdouble
-_gimp_text_layer_get_indent (gint32 layer_ID)
+GimpTextJustification
+gimp_text_layer_get_justification (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gdouble indent = 0.0;
+ GimpTextJustification justify = 0;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
+ GIMP_TYPE_LAYER, layer,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-get-indent",
+ "gimp-text-layer-get-justification",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-get-indent",
+ return_vals = gimp_run_procedure_array ("gimp-text-layer-get-justification",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- indent = g_value_get_double (gimp_value_array_index (return_vals, 1));
+ justify = g_value_get_enum (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return indent;
+ return justify;
}
/**
- * gimp_text_layer_set_indent:
+ * gimp_text_layer_set_justification:
* @layer: The text layer.
- * @indent: The indentation for the first line.
+ * @justify: The justification for your text.
*
- * Set the indentation of the first line in a text layer.
+ * Set the justification of the text in a text layer.
*
- * This procedure sets the indentation of the first line in the text
- * layer.
+ * This procedure sets the alignment of the lines in the text layer
+ * relative to each other.
*
* Returns: TRUE on success.
*
* Since: 2.6
**/
gboolean
-gimp_text_layer_set_indent (GimpLayer *layer,
- gdouble indent)
+gimp_text_layer_set_justification (GimpLayer *layer,
+ GimpTextJustification justify)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -2095,15 +904,15 @@ gimp_text_layer_set_indent (GimpLayer *layer,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER, layer,
- G_TYPE_DOUBLE, indent,
+ GIMP_TYPE_TEXT_JUSTIFICATION, justify,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-set-indent",
+ "gimp-text-layer-set-justification",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-set-indent",
+ return_vals = gimp_run_procedure_array ("gimp-text-layer-set-justification",
args);
gimp_value_array_unref (args);
@@ -2115,22 +924,21 @@ gimp_text_layer_set_indent (GimpLayer *layer,
}
/**
- * _gimp_text_layer_set_indent: (skip)
- * @layer_ID: The text layer.
- * @indent: The indentation for the first line.
+ * gimp_text_layer_get_color:
+ * @layer: The text layer.
+ * @color: (out caller-allocates): The color of the text.
*
- * Set the indentation of the first line in a text layer.
+ * Get the color of the text in a text layer.
*
- * This procedure sets the indentation of the first line in the text
- * layer.
+ * This procedure returns the color of the text in a text layer.
*
* Returns: TRUE on success.
*
* Since: 2.6
**/
gboolean
-_gimp_text_layer_set_indent (gint32 layer_ID,
- gdouble indent)
+gimp_text_layer_get_color (GimpLayer *layer,
+ GimpRGB *color)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -2138,118 +946,121 @@ _gimp_text_layer_set_indent (gint32 layer_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_DOUBLE, indent,
+ GIMP_TYPE_LAYER, layer,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-set-indent",
+ "gimp-text-layer-get-color",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-set-indent",
+ return_vals = gimp_run_procedure_array ("gimp-text-layer-get-color",
args);
gimp_value_array_unref (args);
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (success)
+ gimp_value_get_rgb (gimp_value_array_index (return_vals, 1), &*color);
+
gimp_value_array_unref (return_vals);
return success;
}
/**
- * gimp_text_layer_get_line_spacing:
+ * gimp_text_layer_set_color:
* @layer: The text layer.
+ * @color: The color to use for the text.
*
- * Get the spacing between lines of text.
+ * Set the color of the text in the text layer.
*
- * This procedure returns the line-spacing between lines of text in a
- * text layer.
+ * This procedure sets the text color in the text layer 'layer'.
*
- * Returns: The line-spacing value.
+ * Returns: TRUE on success.
*
* Since: 2.6
**/
-gdouble
-gimp_text_layer_get_line_spacing (GimpLayer *layer)
+gboolean
+gimp_text_layer_set_color (GimpLayer *layer,
+ const GimpRGB *color)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gdouble line_spacing = 0.0;
+ gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER, layer,
+ GIMP_TYPE_RGB, color,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-get-line-spacing",
+ "gimp-text-layer-set-color",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-get-line-spacing",
+ return_vals = gimp_run_procedure_array ("gimp-text-layer-set-color",
args);
gimp_value_array_unref (args);
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- line_spacing = g_value_get_double (gimp_value_array_index (return_vals, 1));
+ success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
- return line_spacing;
+ return success;
}
/**
- * _gimp_text_layer_get_line_spacing: (skip)
- * @layer_ID: The text layer.
+ * gimp_text_layer_get_indent:
+ * @layer: The text layer.
*
- * Get the spacing between lines of text.
+ * Get the line indentation of text layer.
*
- * This procedure returns the line-spacing between lines of text in a
- * text layer.
+ * This procedure returns the indentation of the first line in a text
+ * layer.
*
- * Returns: The line-spacing value.
+ * Returns: The indentation value of the first line.
*
* Since: 2.6
**/
gdouble
-_gimp_text_layer_get_line_spacing (gint32 layer_ID)
+gimp_text_layer_get_indent (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gdouble line_spacing = 0.0;
+ gdouble indent = 0.0;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
+ GIMP_TYPE_LAYER, layer,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-get-line-spacing",
+ "gimp-text-layer-get-indent",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-get-line-spacing",
+ return_vals = gimp_run_procedure_array ("gimp-text-layer-get-indent",
args);
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- line_spacing = g_value_get_double (gimp_value_array_index (return_vals, 1));
+ indent = g_value_get_double (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return line_spacing;
+ return indent;
}
/**
- * gimp_text_layer_set_line_spacing:
+ * gimp_text_layer_set_indent:
* @layer: The text layer.
- * @line_spacing: The additional line spacing to use.
+ * @indent: The indentation for the first line.
*
- * Adjust the line spacing in a text layer.
+ * Set the indentation of the first line in a text layer.
*
- * This procedure sets the additional spacing used between lines a text
+ * This procedure sets the indentation of the first line in the text
* layer.
*
* Returns: TRUE on success.
@@ -2257,8 +1068,8 @@ _gimp_text_layer_get_line_spacing (gint32 layer_ID)
* Since: 2.6
**/
gboolean
-gimp_text_layer_set_line_spacing (GimpLayer *layer,
- gdouble line_spacing)
+gimp_text_layer_set_indent (GimpLayer *layer,
+ gdouble indent)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -2267,15 +1078,15 @@ gimp_text_layer_set_line_spacing (GimpLayer *layer,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER, layer,
- G_TYPE_DOUBLE, line_spacing,
+ G_TYPE_DOUBLE, indent,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-set-line-spacing",
+ "gimp-text-layer-set-indent",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-set-line-spacing",
+ return_vals = gimp_run_procedure_array ("gimp-text-layer-set-indent",
args);
gimp_value_array_unref (args);
@@ -2287,94 +1098,94 @@ gimp_text_layer_set_line_spacing (GimpLayer *layer,
}
/**
- * _gimp_text_layer_set_line_spacing: (skip)
- * @layer_ID: The text layer.
- * @line_spacing: The additional line spacing to use.
+ * gimp_text_layer_get_line_spacing:
+ * @layer: The text layer.
*
- * Adjust the line spacing in a text layer.
+ * Get the spacing between lines of text.
*
- * This procedure sets the additional spacing used between lines a text
- * layer.
+ * This procedure returns the line-spacing between lines of text in a
+ * text layer.
*
- * Returns: TRUE on success.
+ * Returns: The line-spacing value.
*
* Since: 2.6
**/
-gboolean
-_gimp_text_layer_set_line_spacing (gint32 layer_ID,
- gdouble line_spacing)
+gdouble
+gimp_text_layer_get_line_spacing (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ gdouble line_spacing = 0.0;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_DOUBLE, line_spacing,
+ GIMP_TYPE_LAYER, layer,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-set-line-spacing",
+ "gimp-text-layer-get-line-spacing",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-set-line-spacing",
+ return_vals = gimp_run_procedure_array ("gimp-text-layer-get-line-spacing",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ line_spacing = g_value_get_double (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return line_spacing;
}
/**
- * gimp_text_layer_get_letter_spacing:
+ * gimp_text_layer_set_line_spacing:
* @layer: The text layer.
+ * @line_spacing: The additional line spacing to use.
*
- * Get the letter spacing used in a text layer.
+ * Adjust the line spacing in a text layer.
*
- * This procedure returns the additional spacing between the single
- * glyphs in a text layer.
+ * This procedure sets the additional spacing used between lines a text
+ * layer.
*
- * Returns: The letter-spacing value.
+ * Returns: TRUE on success.
*
* Since: 2.6
**/
-gdouble
-gimp_text_layer_get_letter_spacing (GimpLayer *layer)
+gboolean
+gimp_text_layer_set_line_spacing (GimpLayer *layer,
+ gdouble line_spacing)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gdouble letter_spacing = 0.0;
+ gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_LAYER, layer,
+ G_TYPE_DOUBLE, line_spacing,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-get-letter-spacing",
+ "gimp-text-layer-set-line-spacing",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-get-letter-spacing",
+ return_vals = gimp_run_procedure_array ("gimp-text-layer-set-line-spacing",
args);
gimp_value_array_unref (args);
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- letter_spacing = g_value_get_double (gimp_value_array_index (return_vals, 1));
+ success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
gimp_value_array_unref (return_vals);
- return letter_spacing;
+ return success;
}
/**
- * _gimp_text_layer_get_letter_spacing: (skip)
- * @layer_ID: The text layer.
+ * gimp_text_layer_get_letter_spacing:
+ * @layer: The text layer.
*
* Get the letter spacing used in a text layer.
*
@@ -2386,7 +1197,7 @@ gimp_text_layer_get_letter_spacing (GimpLayer *layer)
* Since: 2.6
**/
gdouble
-_gimp_text_layer_get_letter_spacing (gint32 layer_ID)
+gimp_text_layer_get_letter_spacing (GimpLayer *layer)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -2394,7 +1205,7 @@ _gimp_text_layer_get_letter_spacing (gint32 layer_ID)
gdouble letter_spacing = 0.0;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
+ GIMP_TYPE_LAYER, layer,
G_TYPE_NONE);
if (pdb)
@@ -2458,50 +1269,6 @@ gimp_text_layer_set_letter_spacing (GimpLayer *layer,
return success;
}
-/**
- * _gimp_text_layer_set_letter_spacing: (skip)
- * @layer_ID: The text layer.
- * @letter_spacing: The additional letter spacing to use.
- *
- * Adjust the letter spacing in a text layer.
- *
- * This procedure sets the additional spacing between the single glyphs
- * in a text layer.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.6
- **/
-gboolean
-_gimp_text_layer_set_letter_spacing (gint32 layer_ID,
- gdouble letter_spacing)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_DOUBLE, letter_spacing,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-set-letter-spacing",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-set-letter-spacing",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_text_layer_resize:
* @layer: The text layer.
@@ -2549,51 +1316,3 @@ gimp_text_layer_resize (GimpLayer *layer,
return success;
}
-
-/**
- * _gimp_text_layer_resize: (skip)
- * @layer_ID: The text layer.
- * @width: The new box width in pixels.
- * @height: The new box height in pixels.
- *
- * Resize the box of a text layer.
- *
- * This procedure changes the width and height of a text layer while
- * keeping it as a text layer and not converting it to a bitmap like
- * gimp_layer_resize() would do.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.8
- **/
-gboolean
-_gimp_text_layer_resize (gint32 layer_ID,
- gdouble width,
- gdouble height)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_DOUBLE, width,
- G_TYPE_DOUBLE, height,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-layer-resize",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-layer-resize",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
diff --git a/libgimp/gimptextlayer_pdb.h b/libgimp/gimptextlayer_pdb.h
index eb0c3f56f4..e9689bf082 100644
--- a/libgimp/gimptextlayer_pdb.h
+++ b/libgimp/gimptextlayer_pdb.h
@@ -32,10 +32,6 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
GimpLayer* gimp_text_layer_new (GimpImage *image,
const gchar *text,
const gchar *fontname,
@@ -88,97 +84,6 @@ gboolean gimp_text_layer_resize (GimpLayer
gdouble width,
gdouble height);
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_text_layer_new _gimp_text_layer_new
-#define gimp_text_layer_get_text _gimp_text_layer_get_text
-#define gimp_text_layer_set_text _gimp_text_layer_set_text
-#define gimp_text_layer_get_markup _gimp_text_layer_get_markup
-#define gimp_text_layer_get_font _gimp_text_layer_get_font
-#define gimp_text_layer_set_font _gimp_text_layer_set_font
-#define gimp_text_layer_get_font_size _gimp_text_layer_get_font_size
-#define gimp_text_layer_set_font_size _gimp_text_layer_set_font_size
-#define gimp_text_layer_get_antialias _gimp_text_layer_get_antialias
-#define gimp_text_layer_set_antialias _gimp_text_layer_set_antialias
-#define gimp_text_layer_get_hint_style _gimp_text_layer_get_hint_style
-#define gimp_text_layer_set_hint_style _gimp_text_layer_set_hint_style
-#define gimp_text_layer_get_kerning _gimp_text_layer_get_kerning
-#define gimp_text_layer_set_kerning _gimp_text_layer_set_kerning
-#define gimp_text_layer_get_language _gimp_text_layer_get_language
-#define gimp_text_layer_set_language _gimp_text_layer_set_language
-#define gimp_text_layer_get_base_direction _gimp_text_layer_get_base_direction
-#define gimp_text_layer_set_base_direction _gimp_text_layer_set_base_direction
-#define gimp_text_layer_get_justification _gimp_text_layer_get_justification
-#define gimp_text_layer_set_justification _gimp_text_layer_set_justification
-#define gimp_text_layer_get_color _gimp_text_layer_get_color
-#define gimp_text_layer_set_color _gimp_text_layer_set_color
-#define gimp_text_layer_get_indent _gimp_text_layer_get_indent
-#define gimp_text_layer_set_indent _gimp_text_layer_set_indent
-#define gimp_text_layer_get_line_spacing _gimp_text_layer_get_line_spacing
-#define gimp_text_layer_set_line_spacing _gimp_text_layer_set_line_spacing
-#define gimp_text_layer_get_letter_spacing _gimp_text_layer_get_letter_spacing
-#define gimp_text_layer_set_letter_spacing _gimp_text_layer_set_letter_spacing
-#define gimp_text_layer_resize _gimp_text_layer_resize
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-gint32 _gimp_text_layer_new (gint32 image_ID,
- const gchar *text,
- const gchar *fontname,
- gdouble size,
- GimpUnit unit);
-gchar* _gimp_text_layer_get_text (gint32 layer_ID);
-gboolean _gimp_text_layer_set_text (gint32 layer_ID,
- const gchar *text);
-gchar* _gimp_text_layer_get_markup (gint32 layer_ID);
-gchar* _gimp_text_layer_get_font (gint32 layer_ID);
-gboolean _gimp_text_layer_set_font (gint32 layer_ID,
- const gchar *font);
-gdouble _gimp_text_layer_get_font_size (gint32 layer_ID,
- GimpUnit *unit);
-gboolean _gimp_text_layer_set_font_size (gint32 layer_ID,
- gdouble font_size,
- GimpUnit unit);
-gboolean _gimp_text_layer_get_antialias (gint32 layer_ID);
-gboolean _gimp_text_layer_set_antialias (gint32 layer_ID,
- gboolean antialias);
-GimpTextHintStyle _gimp_text_layer_get_hint_style (gint32 layer_ID);
-gboolean _gimp_text_layer_set_hint_style (gint32 layer_ID,
- GimpTextHintStyle style);
-gboolean _gimp_text_layer_get_kerning (gint32 layer_ID);
-gboolean _gimp_text_layer_set_kerning (gint32 layer_ID,
- gboolean kerning);
-gchar* _gimp_text_layer_get_language (gint32 layer_ID);
-gboolean _gimp_text_layer_set_language (gint32 layer_ID,
- const gchar *language);
-GimpTextDirection _gimp_text_layer_get_base_direction (gint32 layer_ID);
-gboolean _gimp_text_layer_set_base_direction (gint32 layer_ID,
- GimpTextDirection direction);
-GimpTextJustification _gimp_text_layer_get_justification (gint32 layer_ID);
-gboolean _gimp_text_layer_set_justification (gint32 layer_ID,
- GimpTextJustification justify);
-gboolean _gimp_text_layer_get_color (gint32 layer_ID,
- GimpRGB *color);
-gboolean _gimp_text_layer_set_color (gint32 layer_ID,
- const GimpRGB *color);
-gdouble _gimp_text_layer_get_indent (gint32 layer_ID);
-gboolean _gimp_text_layer_set_indent (gint32 layer_ID,
- gdouble indent);
-gdouble _gimp_text_layer_get_line_spacing (gint32 layer_ID);
-gboolean _gimp_text_layer_set_line_spacing (gint32 layer_ID,
- gdouble line_spacing);
-gdouble _gimp_text_layer_get_letter_spacing (gint32 layer_ID);
-gboolean _gimp_text_layer_set_letter_spacing (gint32 layer_ID,
- gdouble letter_spacing);
-gboolean _gimp_text_layer_resize (gint32 layer_ID,
- gdouble width,
- gdouble height);
-
G_END_DECLS
diff --git a/libgimp/gimptexttool_pdb.c b/libgimp/gimptexttool_pdb.c
index b842a3e0be..3b7e3cf8af 100644
--- a/libgimp/gimptexttool_pdb.c
+++ b/libgimp/gimptexttool_pdb.c
@@ -114,85 +114,6 @@ gimp_text_fontname (GimpImage *image,
return text_layer;
}
-/**
- * _gimp_text_fontname: (skip)
- * @image_ID: The image.
- * @drawable_ID: (nullable): The affected drawable: (%NULL for a new text layer).
- * @x: The x coordinate for the left of the text bounding box.
- * @y: The y coordinate for the top of the text bounding box.
- * @text: The text to generate (in UTF-8 encoding).
- * @border: The size of the border.
- * @antialias: Antialiasing.
- * @size: The size of text in either pixels or points.
- * @size_type: The units of specified size.
- * @fontname: The name of the font.
- *
- * Add text at the specified location as a floating selection or a new
- * layer.
- *
- * This tool requires a fontname matching an installed PangoFT2 font.
- * You can specify the fontsize in units of pixels or points, and the
- * appropriate metric is specified using the size_type argument. The x
- * and y parameters together control the placement of the new text by
- * specifying the upper left corner of the text bounding box. If the
- * specified drawable parameter is valid, the text will be created as a
- * floating selection attached to the drawable. If the drawable
- * parameter is not valid (%NULL), the text will appear as a new layer.
- * Finally, a border can be specified around the final rendered text.
- * The border is measured in pixels. Parameter size-type is not used
- * and is currently ignored. If you need to display a font in points,
- * divide the size in points by 72.0 and multiply it by the image's
- * vertical resolution.
- *
- * Returns: (nullable): The new text layer or %NULL if no layer was created.
- **/
-gint32
-_gimp_text_fontname (gint32 image_ID,
- gint32 drawable_ID,
- gdouble x,
- gdouble y,
- const gchar *text,
- gint border,
- gboolean antialias,
- gdouble size,
- GimpSizeType size_type,
- const gchar *fontname)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 text_layer_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_DRAWABLE, gimp_item_get_by_id (drawable_ID),
- G_TYPE_DOUBLE, x,
- G_TYPE_DOUBLE, y,
- G_TYPE_STRING, text,
- G_TYPE_INT, border,
- G_TYPE_BOOLEAN, antialias,
- G_TYPE_DOUBLE, size,
- GIMP_TYPE_SIZE_TYPE, size_type,
- G_TYPE_STRING, fontname,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-text-fontname",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-text-fontname",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- text_layer_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return text_layer_ID;
-}
-
/**
* gimp_text_get_extents_fontname:
* @text: The text to generate (in UTF-8 encoding).
diff --git a/libgimp/gimptexttool_pdb.h b/libgimp/gimptexttool_pdb.h
index 09d1fe5093..8adc1a4614 100644
--- a/libgimp/gimptexttool_pdb.h
+++ b/libgimp/gimptexttool_pdb.h
@@ -32,49 +32,24 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-gboolean gimp_text_get_extents_fontname (const gchar *text,
- gdouble size,
- GimpSizeType size_type,
- const gchar *fontname,
- gint *width,
- gint *height,
- gint *ascent,
- gint *descent);
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-GimpLayer* gimp_text_fontname (GimpImage *image,
- GimpDrawable *drawable,
- gdouble x,
- gdouble y,
- const gchar *text,
- gint border,
- gboolean antialias,
- gdouble size,
- GimpSizeType size_type,
- const gchar *fontname);
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_text_fontname _gimp_text_fontname
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-gint32 _gimp_text_fontname (gint32 image_ID,
- gint32 drawable_ID,
- gdouble x,
- gdouble y,
- const gchar *text,
- gint border,
- gboolean antialias,
- gdouble size,
- GimpSizeType size_type,
- const gchar *fontname);
+GimpLayer* gimp_text_fontname (GimpImage *image,
+ GimpDrawable *drawable,
+ gdouble x,
+ gdouble y,
+ const gchar *text,
+ gint border,
+ gboolean antialias,
+ gdouble size,
+ GimpSizeType size_type,
+ const gchar *fontname);
+gboolean gimp_text_get_extents_fontname (const gchar *text,
+ gdouble size,
+ GimpSizeType size_type,
+ const gchar *fontname,
+ gint *width,
+ gint *height,
+ gint *ascent,
+ gint *descent);
G_END_DECLS
diff --git a/libgimp/gimpunit_pdb.h b/libgimp/gimpunit_pdb.h
index c5f2cfd8a1..3481649149 100644
--- a/libgimp/gimpunit_pdb.h
+++ b/libgimp/gimpunit_pdb.h
@@ -52,22 +52,6 @@ G_GNUC_INTERNAL gchar* _gimp_unit_get_abbreviation (GimpUnit u
G_GNUC_INTERNAL gchar* _gimp_unit_get_singular (GimpUnit unit_id);
G_GNUC_INTERNAL gchar* _gimp_unit_get_plural (GimpUnit unit_id);
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-
-
G_END_DECLS
diff --git a/libgimp/gimpvectors_pdb.c b/libgimp/gimpvectors_pdb.c
index f6e21e8ee6..4c24ae173c 100644
--- a/libgimp/gimpvectors_pdb.c
+++ b/libgimp/gimpvectors_pdb.c
@@ -80,51 +80,6 @@ gimp_vectors_new (GimpImage *image,
return vectors;
}
-/**
- * _gimp_vectors_new: (skip)
- * @image_ID: The image.
- * @name: the name of the new vector object.
- *
- * Creates a new empty vectors object.
- *
- * Creates a new empty vectors object. The vectors object needs to be
- * added to the image using gimp_image_insert_vectors().
- *
- * Returns: the current vector object, 0 if no vector exists in the image.
- *
- * Since: 2.4
- **/
-gint32
-_gimp_vectors_new (gint32 image_ID,
- const gchar *name)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 vectors_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_STRING, name,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-new",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-vectors-new",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- vectors_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return vectors_ID;
-}
-
/**
* gimp_vectors_new_from_text_layer:
* @image: The image.
@@ -170,51 +125,6 @@ gimp_vectors_new_from_text_layer (GimpImage *image,
return vectors;
}
-/**
- * _gimp_vectors_new_from_text_layer: (skip)
- * @image_ID: The image.
- * @layer_ID: The text layer.
- *
- * Creates a new vectors object from a text layer.
- *
- * Creates a new vectors object from a text layer. The vectors object
- * needs to be added to the image using gimp_image_insert_vectors().
- *
- * Returns: The vectors of the text layer.
- *
- * Since: 2.6
- **/
-gint32
-_gimp_vectors_new_from_text_layer (gint32 image_ID,
- gint32 layer_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 vectors_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_LAYER, gimp_item_get_by_id (layer_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-new-from-text-layer",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-vectors-new-from-text-layer",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- vectors_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return vectors_ID;
-}
-
/**
* gimp_vectors_copy:
* @vectors: The vectors object to copy.
@@ -257,48 +167,6 @@ gimp_vectors_copy (GimpVectors *vectors)
return vectors_copy;
}
-/**
- * _gimp_vectors_copy: (skip)
- * @vectors_ID: The vectors object to copy.
- *
- * Copy a vectors object.
- *
- * This procedure copies the specified vectors object and returns the
- * copy.
- *
- * Returns: The newly copied vectors object.
- *
- * Since: 2.6
- **/
-gint32
-_gimp_vectors_copy (gint32 vectors_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint32 vectors_copy_ID = -1;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_VECTORS, gimp_item_get_by_id (vectors_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-copy",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-vectors-copy",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- vectors_copy_ID = gimp_item_get_id (g_value_get_object (gimp_value_array_index (return_vals, 1)));
-
- gimp_value_array_unref (return_vals);
-
- return vectors_copy_ID;
-}
-
/**
* gimp_vectors_get_strokes:
* @vectors: The vectors object.
@@ -350,57 +218,6 @@ gimp_vectors_get_strokes (GimpVectors *vectors,
return stroke_ids;
}
-/**
- * _gimp_vectors_get_strokes: (skip)
- * @vectors_ID: The vectors object.
- * @num_strokes: (out): The number of strokes returned.
- *
- * List the strokes associated with the passed path.
- *
- * Returns an Array with the stroke-IDs associated with the passed
- * path.
- *
- * Returns: (array length=num_strokes):
- * List of the strokes belonging to the path.
- * The returned value must be freed with g_free().
- *
- * Since: 2.4
- **/
-gint *
-_gimp_vectors_get_strokes (gint32 vectors_ID,
- gint *num_strokes)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint *stroke_ids = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_VECTORS, gimp_item_get_by_id (vectors_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-get-strokes",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-vectors-get-strokes",
- args);
- gimp_value_array_unref (args);
-
- *num_strokes = 0;
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- {
- *num_strokes = g_value_get_int (gimp_value_array_index (return_vals, 1));
- stroke_ids = gimp_value_dup_int32_array (gimp_value_array_index (return_vals, 2));
- }
-
- gimp_value_array_unref (return_vals);
-
- return stroke_ids;
-}
-
/**
* gimp_vectors_stroke_get_length:
* @vectors: The vectors object.
@@ -448,53 +265,6 @@ gimp_vectors_stroke_get_length (GimpVectors *vectors,
return length;
}
-/**
- * _gimp_vectors_stroke_get_length: (skip)
- * @vectors_ID: The vectors object.
- * @stroke_id: The stroke ID.
- * @precision: The precision used for the approximation.
- *
- * Measure the length of the given stroke.
- *
- * Measure the length of the given stroke.
- *
- * Returns: The length (in pixels) of the given stroke.
- *
- * Since: 2.4
- **/
-gdouble
-_gimp_vectors_stroke_get_length (gint32 vectors_ID,
- gint stroke_id,
- gdouble precision)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gdouble length = 0.0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_VECTORS, gimp_item_get_by_id (vectors_ID),
- G_TYPE_INT, stroke_id,
- G_TYPE_DOUBLE, precision,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-stroke-get-length",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-get-length",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- length = g_value_get_double (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return length;
-}
-
/**
* gimp_vectors_stroke_get_point_at_dist:
* @vectors: The vectors object.
@@ -571,38 +341,21 @@ gimp_vectors_stroke_get_point_at_dist (GimpVectors *vectors,
}
/**
- * _gimp_vectors_stroke_get_point_at_dist: (skip)
- * @vectors_ID: The vectors object.
+ * gimp_vectors_remove_stroke:
+ * @vectors: The vectors object.
* @stroke_id: The stroke ID.
- * @dist: The given distance.
- * @precision: The precision used for the approximation.
- * @x_point: (out): The x position of the point.
- * @y_point: (out): The y position of the point.
- * @slope: (out): The slope (dy / dx) at the specified point.
- * @valid: (out): Indicator for the validity of the returned data.
*
- * Get point at a specified distance along the stroke.
+ * remove the stroke from a vectors object.
*
- * This will return the x,y position of a point at a given distance
- * along the stroke. The distance will be obtained by first digitizing
- * the curve internally and then walking along the curve. For a closed
- * stroke the start of the path is the first point on the path that was
- * created. This might not be obvious. If the stroke is not long
- * enough, a \"valid\" flag will be FALSE.
+ * Remove the stroke from a vectors object.
*
* Returns: TRUE on success.
*
* Since: 2.4
**/
gboolean
-_gimp_vectors_stroke_get_point_at_dist (gint32 vectors_ID,
- gint stroke_id,
- gdouble dist,
- gdouble precision,
- gdouble *x_point,
- gdouble *y_point,
- gdouble *slope,
- gboolean *valid)
+gimp_vectors_remove_stroke (GimpVectors *vectors,
+ gint stroke_id)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -610,57 +363,42 @@ _gimp_vectors_stroke_get_point_at_dist (gint32 vectors_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_VECTORS, gimp_item_get_by_id (vectors_ID),
+ GIMP_TYPE_VECTORS, vectors,
G_TYPE_INT, stroke_id,
- G_TYPE_DOUBLE, dist,
- G_TYPE_DOUBLE, precision,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-stroke-get-point-at-dist",
+ "gimp-vectors-remove-stroke",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-get-point-at-dist",
+ return_vals = gimp_run_procedure_array ("gimp-vectors-remove-stroke",
args);
gimp_value_array_unref (args);
- *x_point = 0.0;
- *y_point = 0.0;
- *slope = 0.0;
- *valid = FALSE;
-
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
- if (success)
- {
- *x_point = g_value_get_double (gimp_value_array_index (return_vals, 1));
- *y_point = g_value_get_double (gimp_value_array_index (return_vals, 2));
- *slope = g_value_get_double (gimp_value_array_index (return_vals, 3));
- *valid = g_value_get_boolean (gimp_value_array_index (return_vals, 4));
- }
-
gimp_value_array_unref (return_vals);
return success;
}
/**
- * gimp_vectors_remove_stroke:
+ * gimp_vectors_stroke_close:
* @vectors: The vectors object.
* @stroke_id: The stroke ID.
*
- * remove the stroke from a vectors object.
+ * closes the specified stroke.
*
- * Remove the stroke from a vectors object.
+ * Closes the specified stroke.
*
* Returns: TRUE on success.
*
* Since: 2.4
**/
gboolean
-gimp_vectors_remove_stroke (GimpVectors *vectors,
- gint stroke_id)
+gimp_vectors_stroke_close (GimpVectors *vectors,
+ gint stroke_id)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -674,10 +412,10 @@ gimp_vectors_remove_stroke (GimpVectors *vectors,
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-remove-stroke",
+ "gimp-vectors-stroke-close",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-vectors-remove-stroke",
+ return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-close",
args);
gimp_value_array_unref (args);
@@ -689,21 +427,25 @@ gimp_vectors_remove_stroke (GimpVectors *vectors,
}
/**
- * _gimp_vectors_remove_stroke: (skip)
- * @vectors_ID: The vectors object.
+ * gimp_vectors_stroke_translate:
+ * @vectors: The vectors object.
* @stroke_id: The stroke ID.
+ * @off_x: Offset in x direction.
+ * @off_y: Offset in y direction.
*
- * remove the stroke from a vectors object.
+ * translate the given stroke.
*
- * Remove the stroke from a vectors object.
+ * Translate the given stroke.
*
* Returns: TRUE on success.
*
* Since: 2.4
**/
gboolean
-_gimp_vectors_remove_stroke (gint32 vectors_ID,
- gint stroke_id)
+gimp_vectors_stroke_translate (GimpVectors *vectors,
+ gint stroke_id,
+ gint off_x,
+ gint off_y)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -711,16 +453,18 @@ _gimp_vectors_remove_stroke (gint32 vectors_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_VECTORS, gimp_item_get_by_id (vectors_ID),
+ GIMP_TYPE_VECTORS, vectors,
G_TYPE_INT, stroke_id,
+ G_TYPE_INT, off_x,
+ G_TYPE_INT, off_y,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-remove-stroke",
+ "gimp-vectors-stroke-translate",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-vectors-remove-stroke",
+ return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-translate",
args);
gimp_value_array_unref (args);
@@ -732,21 +476,25 @@ _gimp_vectors_remove_stroke (gint32 vectors_ID,
}
/**
- * gimp_vectors_stroke_close:
+ * gimp_vectors_stroke_scale:
* @vectors: The vectors object.
* @stroke_id: The stroke ID.
+ * @scale_x: Scale factor in x direction.
+ * @scale_y: Scale factor in y direction.
*
- * closes the specified stroke.
+ * scales the given stroke.
*
- * Closes the specified stroke.
+ * Scale the given stroke.
*
* Returns: TRUE on success.
*
* Since: 2.4
**/
gboolean
-gimp_vectors_stroke_close (GimpVectors *vectors,
- gint stroke_id)
+gimp_vectors_stroke_scale (GimpVectors *vectors,
+ gint stroke_id,
+ gdouble scale_x,
+ gdouble scale_y)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -756,14 +504,16 @@ gimp_vectors_stroke_close (GimpVectors *vectors,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_VECTORS, vectors,
G_TYPE_INT, stroke_id,
+ G_TYPE_DOUBLE, scale_x,
+ G_TYPE_DOUBLE, scale_y,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-stroke-close",
+ "gimp-vectors-stroke-scale",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-close",
+ return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-scale",
args);
gimp_value_array_unref (args);
@@ -775,21 +525,27 @@ gimp_vectors_stroke_close (GimpVectors *vectors,
}
/**
- * _gimp_vectors_stroke_close: (skip)
- * @vectors_ID: The vectors object.
+ * gimp_vectors_stroke_rotate:
+ * @vectors: The vectors object.
* @stroke_id: The stroke ID.
+ * @center_x: X coordinate of the rotation center.
+ * @center_y: Y coordinate of the rotation center.
+ * @angle: angle to rotate about.
*
- * closes the specified stroke.
+ * rotates the given stroke.
*
- * Closes the specified stroke.
+ * Rotates the given stroke around given center by angle (in degrees).
*
* Returns: TRUE on success.
*
* Since: 2.4
**/
gboolean
-_gimp_vectors_stroke_close (gint32 vectors_ID,
- gint stroke_id)
+gimp_vectors_stroke_rotate (GimpVectors *vectors,
+ gint stroke_id,
+ gdouble center_x,
+ gdouble center_y,
+ gdouble angle)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -797,16 +553,19 @@ _gimp_vectors_stroke_close (gint32 vectors_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_VECTORS, gimp_item_get_by_id (vectors_ID),
+ GIMP_TYPE_VECTORS, vectors,
G_TYPE_INT, stroke_id,
+ G_TYPE_DOUBLE, center_x,
+ G_TYPE_DOUBLE, center_y,
+ G_TYPE_DOUBLE, angle,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-stroke-close",
+ "gimp-vectors-stroke-rotate",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-close",
+ return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-rotate",
args);
gimp_value_array_unref (args);
@@ -818,25 +577,25 @@ _gimp_vectors_stroke_close (gint32 vectors_ID,
}
/**
- * gimp_vectors_stroke_translate:
+ * gimp_vectors_stroke_flip:
* @vectors: The vectors object.
* @stroke_id: The stroke ID.
- * @off_x: Offset in x direction.
- * @off_y: Offset in y direction.
+ * @flip_type: Flip orientation, either vertical or horizontal.
+ * @axis: axis coordinate about which to flip, in pixels.
*
- * translate the given stroke.
+ * flips the given stroke.
*
- * Translate the given stroke.
+ * Rotates the given stroke around given center by angle (in degrees).
*
* Returns: TRUE on success.
*
* Since: 2.4
**/
gboolean
-gimp_vectors_stroke_translate (GimpVectors *vectors,
- gint stroke_id,
- gint off_x,
- gint off_y)
+gimp_vectors_stroke_flip (GimpVectors *vectors,
+ gint stroke_id,
+ GimpOrientationType flip_type,
+ gdouble axis)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -846,16 +605,16 @@ gimp_vectors_stroke_translate (GimpVectors *vectors,
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_VECTORS, vectors,
G_TYPE_INT, stroke_id,
- G_TYPE_INT, off_x,
- G_TYPE_INT, off_y,
+ GIMP_TYPE_ORIENTATION_TYPE, flip_type,
+ G_TYPE_DOUBLE, axis,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-stroke-translate",
+ "gimp-vectors-stroke-flip",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-translate",
+ return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-flip",
args);
gimp_value_array_unref (args);
@@ -867,25 +626,31 @@ gimp_vectors_stroke_translate (GimpVectors *vectors,
}
/**
- * _gimp_vectors_stroke_translate: (skip)
- * @vectors_ID: The vectors object.
+ * gimp_vectors_stroke_flip_free:
+ * @vectors: The vectors object.
* @stroke_id: The stroke ID.
- * @off_x: Offset in x direction.
- * @off_y: Offset in y direction.
+ * @x1: X coordinate of the first point of the flipping axis.
+ * @y1: Y coordinate of the first point of the flipping axis.
+ * @x2: X coordinate of the second point of the flipping axis.
+ * @y2: Y coordinate of the second point of the flipping axis.
*
- * translate the given stroke.
+ * flips the given stroke about an arbitrary axis.
*
- * Translate the given stroke.
+ * Flips the given stroke about an arbitrary axis. Axis is defined by
+ * two coordinates in the image (in pixels), through which the flipping
+ * axis passes.
*
* Returns: TRUE on success.
*
* Since: 2.4
**/
gboolean
-_gimp_vectors_stroke_translate (gint32 vectors_ID,
- gint stroke_id,
- gint off_x,
- gint off_y)
+gimp_vectors_stroke_flip_free (GimpVectors *vectors,
+ gint stroke_id,
+ gdouble x1,
+ gdouble y1,
+ gdouble x2,
+ gdouble y2)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -893,18 +658,20 @@ _gimp_vectors_stroke_translate (gint32 vectors_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_VECTORS, gimp_item_get_by_id (vectors_ID),
+ GIMP_TYPE_VECTORS, vectors,
G_TYPE_INT, stroke_id,
- G_TYPE_INT, off_x,
- G_TYPE_INT, off_y,
+ G_TYPE_DOUBLE, x1,
+ G_TYPE_DOUBLE, y1,
+ G_TYPE_DOUBLE, x2,
+ G_TYPE_DOUBLE, y2,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-stroke-translate",
+ "gimp-vectors-stroke-flip-free",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-translate",
+ return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-flip-free",
args);
gimp_value_array_unref (args);
@@ -916,784 +683,190 @@ _gimp_vectors_stroke_translate (gint32 vectors_ID,
}
/**
- * gimp_vectors_stroke_scale:
+ * gimp_vectors_stroke_get_points:
* @vectors: The vectors object.
* @stroke_id: The stroke ID.
- * @scale_x: Scale factor in x direction.
- * @scale_y: Scale factor in y direction.
+ * @num_points: (out): The number of floats returned.
+ * @controlpoints: (out) (array length=num_points) (element-type gdouble) (transfer full): List of the
control points for the stroke (x0, y0, x1, y1, ...).
+ * @closed: (out): Whether the stroke is closed or not.
*
- * scales the given stroke.
+ * returns the control points of a stroke.
*
- * Scale the given stroke.
+ * returns the control points of a stroke. The interpretation of the
+ * coordinates returned depends on the type of the stroke. For Gimp 2.4
+ * this is always a bezier stroke, where the coordinates are the
+ * control points.
*
- * Returns: TRUE on success.
+ * Returns: type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now).
*
* Since: 2.4
**/
-gboolean
-gimp_vectors_stroke_scale (GimpVectors *vectors,
- gint stroke_id,
- gdouble scale_x,
- gdouble scale_y)
+GimpVectorsStrokeType
+gimp_vectors_stroke_get_points (GimpVectors *vectors,
+ gint stroke_id,
+ gint *num_points,
+ gdouble **controlpoints,
+ gboolean *closed)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ GimpVectorsStrokeType type = 0;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_VECTORS, vectors,
G_TYPE_INT, stroke_id,
- G_TYPE_DOUBLE, scale_x,
- G_TYPE_DOUBLE, scale_y,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-stroke-scale",
+ "gimp-vectors-stroke-get-points",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-scale",
+ return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-get-points",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ *num_points = 0;
+
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ {
+ type = g_value_get_enum (gimp_value_array_index (return_vals, 1));
+ *num_points = g_value_get_int (gimp_value_array_index (return_vals, 2));
+ *controlpoints = gimp_value_dup_float_array (gimp_value_array_index (return_vals, 3));
+ *closed = g_value_get_boolean (gimp_value_array_index (return_vals, 4));
+ }
gimp_value_array_unref (return_vals);
- return success;
+ return type;
}
/**
- * _gimp_vectors_stroke_scale: (skip)
- * @vectors_ID: The vectors object.
- * @stroke_id: The stroke ID.
- * @scale_x: Scale factor in x direction.
- * @scale_y: Scale factor in y direction.
+ * gimp_vectors_stroke_new_from_points:
+ * @vectors: The vectors object.
+ * @type: type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now).
+ * @num_points: The number of elements in the array, i.e. the number of controlpoints in the stroke * 2 (x-
and y-coordinate).
+ * @controlpoints: (array length=num_points) (element-type gdouble): List of the x- and y-coordinates of the
control points.
+ * @closed: Whether the stroke is to be closed or not.
*
- * scales the given stroke.
+ * Adds a stroke of a given type to the vectors object.
*
- * Scale the given stroke.
+ * Adds a stroke of a given type to the vectors object. The coordinates
+ * of the control points can be specified. For now only strokes of the
+ * type GIMP_VECTORS_STROKE_TYPE_BEZIER are supported. The control
+ * points are specified as a pair of float values for the x- and
+ * y-coordinate. The Bezier stroke type needs a multiple of three
+ * control points. Each Bezier segment endpoint (anchor, A) has two
+ * additional control points (C) associated. They are specified in the
+ * order CACCACCAC...
*
- * Returns: TRUE on success.
+ * Returns: The stroke ID of the newly created stroke.
*
* Since: 2.4
**/
-gboolean
-_gimp_vectors_stroke_scale (gint32 vectors_ID,
- gint stroke_id,
- gdouble scale_x,
- gdouble scale_y)
+gint
+gimp_vectors_stroke_new_from_points (GimpVectors *vectors,
+ GimpVectorsStrokeType type,
+ gint num_points,
+ const gdouble *controlpoints,
+ gboolean closed)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ gint stroke_id = 0;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_VECTORS, gimp_item_get_by_id (vectors_ID),
- G_TYPE_INT, stroke_id,
- G_TYPE_DOUBLE, scale_x,
- G_TYPE_DOUBLE, scale_y,
+ GIMP_TYPE_VECTORS, vectors,
+ GIMP_TYPE_VECTORS_STROKE_TYPE, type,
+ G_TYPE_INT, num_points,
+ GIMP_TYPE_FLOAT_ARRAY, NULL,
+ G_TYPE_BOOLEAN, closed,
G_TYPE_NONE);
+ gimp_value_set_float_array (gimp_value_array_index (args, 3), controlpoints, num_points);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-stroke-scale",
+ "gimp-vectors-stroke-new-from-points",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-scale",
+ return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-new-from-points",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ stroke_id = g_value_get_int (gimp_value_array_index (return_vals, 1));
gimp_value_array_unref (return_vals);
- return success;
+ return stroke_id;
}
/**
- * gimp_vectors_stroke_rotate:
+ * gimp_vectors_stroke_interpolate:
* @vectors: The vectors object.
* @stroke_id: The stroke ID.
- * @center_x: X coordinate of the rotation center.
- * @center_y: Y coordinate of the rotation center.
- * @angle: angle to rotate about.
+ * @precision: The precision used for the approximation.
+ * @num_coords: (out): The number of floats returned.
+ * @closed: (out): Whether the stroke is closed or not.
*
- * rotates the given stroke.
+ * returns polygonal approximation of the stroke.
*
- * Rotates the given stroke around given center by angle (in degrees).
+ * returns polygonal approximation of the stroke.
*
- * Returns: TRUE on success.
+ * Returns: (array length=num_coords) (element-type gdouble) (transfer full):
+ * List of the coords along the path (x0, y0, x1, y1, ...).
+ * The returned value must be freed with g_free().
*
* Since: 2.4
**/
-gboolean
-gimp_vectors_stroke_rotate (GimpVectors *vectors,
- gint stroke_id,
- gdouble center_x,
- gdouble center_y,
- gdouble angle)
+gdouble *
+gimp_vectors_stroke_interpolate (GimpVectors *vectors,
+ gint stroke_id,
+ gdouble precision,
+ gint *num_coords,
+ gboolean *closed)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
GimpValueArray *return_vals;
- gboolean success = TRUE;
+ gdouble *coords = NULL;
args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_VECTORS, vectors,
G_TYPE_INT, stroke_id,
- G_TYPE_DOUBLE, center_x,
- G_TYPE_DOUBLE, center_y,
- G_TYPE_DOUBLE, angle,
+ G_TYPE_DOUBLE, precision,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-stroke-rotate",
+ "gimp-vectors-stroke-interpolate",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-rotate",
+ return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-interpolate",
args);
gimp_value_array_unref (args);
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
+ *num_coords = 0;
+
+ if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
+ {
+ *num_coords = g_value_get_int (gimp_value_array_index (return_vals, 1));
+ coords = gimp_value_dup_float_array (gimp_value_array_index (return_vals, 2));
+ *closed = g_value_get_boolean (gimp_value_array_index (return_vals, 3));
+ }
gimp_value_array_unref (return_vals);
- return success;
+ return coords;
}
/**
- * _gimp_vectors_stroke_rotate: (skip)
- * @vectors_ID: The vectors object.
- * @stroke_id: The stroke ID.
- * @center_x: X coordinate of the rotation center.
- * @center_y: Y coordinate of the rotation center.
- * @angle: angle to rotate about.
- *
- * rotates the given stroke.
- *
- * Rotates the given stroke around given center by angle (in degrees).
- *
- * Returns: TRUE on success.
- *
- * Since: 2.4
- **/
-gboolean
-_gimp_vectors_stroke_rotate (gint32 vectors_ID,
- gint stroke_id,
- gdouble center_x,
- gdouble center_y,
- gdouble angle)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_VECTORS, gimp_item_get_by_id (vectors_ID),
- G_TYPE_INT, stroke_id,
- G_TYPE_DOUBLE, center_x,
- G_TYPE_DOUBLE, center_y,
- G_TYPE_DOUBLE, angle,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-stroke-rotate",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-rotate",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_vectors_stroke_flip:
- * @vectors: The vectors object.
- * @stroke_id: The stroke ID.
- * @flip_type: Flip orientation, either vertical or horizontal.
- * @axis: axis coordinate about which to flip, in pixels.
- *
- * flips the given stroke.
- *
- * Rotates the given stroke around given center by angle (in degrees).
- *
- * Returns: TRUE on success.
- *
- * Since: 2.4
- **/
-gboolean
-gimp_vectors_stroke_flip (GimpVectors *vectors,
- gint stroke_id,
- GimpOrientationType flip_type,
- gdouble axis)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_VECTORS, vectors,
- G_TYPE_INT, stroke_id,
- GIMP_TYPE_ORIENTATION_TYPE, flip_type,
- G_TYPE_DOUBLE, axis,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-stroke-flip",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-flip",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_vectors_stroke_flip: (skip)
- * @vectors_ID: The vectors object.
- * @stroke_id: The stroke ID.
- * @flip_type: Flip orientation, either vertical or horizontal.
- * @axis: axis coordinate about which to flip, in pixels.
- *
- * flips the given stroke.
- *
- * Rotates the given stroke around given center by angle (in degrees).
- *
- * Returns: TRUE on success.
- *
- * Since: 2.4
- **/
-gboolean
-_gimp_vectors_stroke_flip (gint32 vectors_ID,
- gint stroke_id,
- GimpOrientationType flip_type,
- gdouble axis)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_VECTORS, gimp_item_get_by_id (vectors_ID),
- G_TYPE_INT, stroke_id,
- GIMP_TYPE_ORIENTATION_TYPE, flip_type,
- G_TYPE_DOUBLE, axis,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-stroke-flip",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-flip",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_vectors_stroke_flip_free:
- * @vectors: The vectors object.
- * @stroke_id: The stroke ID.
- * @x1: X coordinate of the first point of the flipping axis.
- * @y1: Y coordinate of the first point of the flipping axis.
- * @x2: X coordinate of the second point of the flipping axis.
- * @y2: Y coordinate of the second point of the flipping axis.
- *
- * flips the given stroke about an arbitrary axis.
- *
- * Flips the given stroke about an arbitrary axis. Axis is defined by
- * two coordinates in the image (in pixels), through which the flipping
- * axis passes.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.4
- **/
-gboolean
-gimp_vectors_stroke_flip_free (GimpVectors *vectors,
- gint stroke_id,
- gdouble x1,
- gdouble y1,
- gdouble x2,
- gdouble y2)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_VECTORS, vectors,
- G_TYPE_INT, stroke_id,
- G_TYPE_DOUBLE, x1,
- G_TYPE_DOUBLE, y1,
- G_TYPE_DOUBLE, x2,
- G_TYPE_DOUBLE, y2,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-stroke-flip-free",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-flip-free",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_vectors_stroke_flip_free: (skip)
- * @vectors_ID: The vectors object.
- * @stroke_id: The stroke ID.
- * @x1: X coordinate of the first point of the flipping axis.
- * @y1: Y coordinate of the first point of the flipping axis.
- * @x2: X coordinate of the second point of the flipping axis.
- * @y2: Y coordinate of the second point of the flipping axis.
- *
- * flips the given stroke about an arbitrary axis.
- *
- * Flips the given stroke about an arbitrary axis. Axis is defined by
- * two coordinates in the image (in pixels), through which the flipping
- * axis passes.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.4
- **/
-gboolean
-_gimp_vectors_stroke_flip_free (gint32 vectors_ID,
- gint stroke_id,
- gdouble x1,
- gdouble y1,
- gdouble x2,
- gdouble y2)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_VECTORS, gimp_item_get_by_id (vectors_ID),
- G_TYPE_INT, stroke_id,
- G_TYPE_DOUBLE, x1,
- G_TYPE_DOUBLE, y1,
- G_TYPE_DOUBLE, x2,
- G_TYPE_DOUBLE, y2,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-stroke-flip-free",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-flip-free",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_vectors_stroke_get_points:
- * @vectors: The vectors object.
- * @stroke_id: The stroke ID.
- * @num_points: (out): The number of floats returned.
- * @controlpoints: (out) (array length=num_points) (element-type gdouble) (transfer full): List of the
control points for the stroke (x0, y0, x1, y1, ...).
- * @closed: (out): Whether the stroke is closed or not.
- *
- * returns the control points of a stroke.
- *
- * returns the control points of a stroke. The interpretation of the
- * coordinates returned depends on the type of the stroke. For Gimp 2.4
- * this is always a bezier stroke, where the coordinates are the
- * control points.
- *
- * Returns: type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now).
- *
- * Since: 2.4
- **/
-GimpVectorsStrokeType
-gimp_vectors_stroke_get_points (GimpVectors *vectors,
- gint stroke_id,
- gint *num_points,
- gdouble **controlpoints,
- gboolean *closed)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- GimpVectorsStrokeType type = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_VECTORS, vectors,
- G_TYPE_INT, stroke_id,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-stroke-get-points",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-get-points",
- args);
- gimp_value_array_unref (args);
-
- *num_points = 0;
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- {
- type = g_value_get_enum (gimp_value_array_index (return_vals, 1));
- *num_points = g_value_get_int (gimp_value_array_index (return_vals, 2));
- *controlpoints = gimp_value_dup_float_array (gimp_value_array_index (return_vals, 3));
- *closed = g_value_get_boolean (gimp_value_array_index (return_vals, 4));
- }
-
- gimp_value_array_unref (return_vals);
-
- return type;
-}
-
-/**
- * _gimp_vectors_stroke_get_points: (skip)
- * @vectors_ID: The vectors object.
- * @stroke_id: The stroke ID.
- * @num_points: (out): The number of floats returned.
- * @controlpoints: (out) (array length=num_points): List of the control points for the stroke (x0, y0, x1,
y1, ...).
- * @closed: (out): Whether the stroke is closed or not.
- *
- * returns the control points of a stroke.
- *
- * returns the control points of a stroke. The interpretation of the
- * coordinates returned depends on the type of the stroke. For Gimp 2.4
- * this is always a bezier stroke, where the coordinates are the
- * control points.
- *
- * Returns: type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now).
- *
- * Since: 2.4
- **/
-GimpVectorsStrokeType
-_gimp_vectors_stroke_get_points (gint32 vectors_ID,
- gint stroke_id,
- gint *num_points,
- gdouble **controlpoints,
- gboolean *closed)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- GimpVectorsStrokeType type = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_VECTORS, gimp_item_get_by_id (vectors_ID),
- G_TYPE_INT, stroke_id,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-stroke-get-points",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-get-points",
- args);
- gimp_value_array_unref (args);
-
- *num_points = 0;
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- {
- type = g_value_get_enum (gimp_value_array_index (return_vals, 1));
- *num_points = g_value_get_int (gimp_value_array_index (return_vals, 2));
- *controlpoints = gimp_value_dup_float_array (gimp_value_array_index (return_vals, 3));
- *closed = g_value_get_boolean (gimp_value_array_index (return_vals, 4));
- }
-
- gimp_value_array_unref (return_vals);
-
- return type;
-}
-
-/**
- * gimp_vectors_stroke_new_from_points:
- * @vectors: The vectors object.
- * @type: type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now).
- * @num_points: The number of elements in the array, i.e. the number of controlpoints in the stroke * 2 (x-
and y-coordinate).
- * @controlpoints: (array length=num_points) (element-type gdouble): List of the x- and y-coordinates of the
control points.
- * @closed: Whether the stroke is to be closed or not.
- *
- * Adds a stroke of a given type to the vectors object.
- *
- * Adds a stroke of a given type to the vectors object. The coordinates
- * of the control points can be specified. For now only strokes of the
- * type GIMP_VECTORS_STROKE_TYPE_BEZIER are supported. The control
- * points are specified as a pair of float values for the x- and
- * y-coordinate. The Bezier stroke type needs a multiple of three
- * control points. Each Bezier segment endpoint (anchor, A) has two
- * additional control points (C) associated. They are specified in the
- * order CACCACCAC...
- *
- * Returns: The stroke ID of the newly created stroke.
- *
- * Since: 2.4
- **/
-gint
-gimp_vectors_stroke_new_from_points (GimpVectors *vectors,
- GimpVectorsStrokeType type,
- gint num_points,
- const gdouble *controlpoints,
- gboolean closed)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint stroke_id = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_VECTORS, vectors,
- GIMP_TYPE_VECTORS_STROKE_TYPE, type,
- G_TYPE_INT, num_points,
- GIMP_TYPE_FLOAT_ARRAY, NULL,
- G_TYPE_BOOLEAN, closed,
- G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 3), controlpoints, num_points);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-stroke-new-from-points",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-new-from-points",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- stroke_id = g_value_get_int (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return stroke_id;
-}
-
-/**
- * _gimp_vectors_stroke_new_from_points: (skip)
- * @vectors_ID: The vectors object.
- * @type: type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now).
- * @num_points: The number of elements in the array, i.e. the number of controlpoints in the stroke * 2 (x-
and y-coordinate).
- * @controlpoints: (array length=num_points) (element-type gdouble): List of the x- and y-coordinates of the
control points.
- * @closed: Whether the stroke is to be closed or not.
- *
- * Adds a stroke of a given type to the vectors object.
- *
- * Adds a stroke of a given type to the vectors object. The coordinates
- * of the control points can be specified. For now only strokes of the
- * type GIMP_VECTORS_STROKE_TYPE_BEZIER are supported. The control
- * points are specified as a pair of float values for the x- and
- * y-coordinate. The Bezier stroke type needs a multiple of three
- * control points. Each Bezier segment endpoint (anchor, A) has two
- * additional control points (C) associated. They are specified in the
- * order CACCACCAC...
- *
- * Returns: The stroke ID of the newly created stroke.
- *
- * Since: 2.4
- **/
-gint
-_gimp_vectors_stroke_new_from_points (gint32 vectors_ID,
- GimpVectorsStrokeType type,
- gint num_points,
- const gdouble *controlpoints,
- gboolean closed)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint stroke_id = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_VECTORS, gimp_item_get_by_id (vectors_ID),
- GIMP_TYPE_VECTORS_STROKE_TYPE, type,
- G_TYPE_INT, num_points,
- GIMP_TYPE_FLOAT_ARRAY, NULL,
- G_TYPE_BOOLEAN, closed,
- G_TYPE_NONE);
- gimp_value_set_float_array (gimp_value_array_index (args, 3), controlpoints, num_points);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-stroke-new-from-points",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-new-from-points",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- stroke_id = g_value_get_int (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return stroke_id;
-}
-
-/**
- * gimp_vectors_stroke_interpolate:
- * @vectors: The vectors object.
- * @stroke_id: The stroke ID.
- * @precision: The precision used for the approximation.
- * @num_coords: (out): The number of floats returned.
- * @closed: (out): Whether the stroke is closed or not.
- *
- * returns polygonal approximation of the stroke.
- *
- * returns polygonal approximation of the stroke.
- *
- * Returns: (array length=num_coords) (element-type gdouble) (transfer full):
- * List of the coords along the path (x0, y0, x1, y1, ...).
- * The returned value must be freed with g_free().
- *
- * Since: 2.4
- **/
-gdouble *
-gimp_vectors_stroke_interpolate (GimpVectors *vectors,
- gint stroke_id,
- gdouble precision,
- gint *num_coords,
- gboolean *closed)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gdouble *coords = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_VECTORS, vectors,
- G_TYPE_INT, stroke_id,
- G_TYPE_DOUBLE, precision,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-stroke-interpolate",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-interpolate",
- args);
- gimp_value_array_unref (args);
-
- *num_coords = 0;
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- {
- *num_coords = g_value_get_int (gimp_value_array_index (return_vals, 1));
- coords = gimp_value_dup_float_array (gimp_value_array_index (return_vals, 2));
- *closed = g_value_get_boolean (gimp_value_array_index (return_vals, 3));
- }
-
- gimp_value_array_unref (return_vals);
-
- return coords;
-}
-
-/**
- * _gimp_vectors_stroke_interpolate: (skip)
- * @vectors_ID: The vectors object.
- * @stroke_id: The stroke ID.
- * @precision: The precision used for the approximation.
- * @num_coords: (out): The number of floats returned.
- * @closed: (out): Whether the stroke is closed or not.
- *
- * returns polygonal approximation of the stroke.
- *
- * returns polygonal approximation of the stroke.
- *
- * Returns: (array length=num_coords):
- * List of the coords along the path (x0, y0, x1, y1, ...).
- * The returned value must be freed with g_free().
- *
- * Since: 2.4
- **/
-gdouble *
-_gimp_vectors_stroke_interpolate (gint32 vectors_ID,
- gint stroke_id,
- gdouble precision,
- gint *num_coords,
- gboolean *closed)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gdouble *coords = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_VECTORS, gimp_item_get_by_id (vectors_ID),
- G_TYPE_INT, stroke_id,
- G_TYPE_DOUBLE, precision,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-stroke-interpolate",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-vectors-stroke-interpolate",
- args);
- gimp_value_array_unref (args);
-
- *num_coords = 0;
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- {
- *num_coords = g_value_get_int (gimp_value_array_index (return_vals, 1));
- coords = gimp_value_dup_float_array (gimp_value_array_index (return_vals, 2));
- *closed = g_value_get_boolean (gimp_value_array_index (return_vals, 3));
- }
-
- gimp_value_array_unref (return_vals);
-
- return coords;
-}
-
-/**
- * gimp_vectors_bezier_stroke_new_moveto:
- * @vectors: The vectors object.
- * @x0: The x-coordinate of the moveto.
- * @y0: The y-coordinate of the moveto.
+ * gimp_vectors_bezier_stroke_new_moveto:
+ * @vectors: The vectors object.
+ * @x0: The x-coordinate of the moveto.
+ * @y0: The y-coordinate of the moveto.
*
* Adds a bezier stroke with a single moveto to the vectors object.
*
@@ -1736,53 +909,6 @@ gimp_vectors_bezier_stroke_new_moveto (GimpVectors *vectors,
return stroke_id;
}
-/**
- * _gimp_vectors_bezier_stroke_new_moveto: (skip)
- * @vectors_ID: The vectors object.
- * @x0: The x-coordinate of the moveto.
- * @y0: The y-coordinate of the moveto.
- *
- * Adds a bezier stroke with a single moveto to the vectors object.
- *
- * Adds a bezier stroke with a single moveto to the vectors object.
- *
- * Returns: The resulting stroke.
- *
- * Since: 2.4
- **/
-gint
-_gimp_vectors_bezier_stroke_new_moveto (gint32 vectors_ID,
- gdouble x0,
- gdouble y0)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint stroke_id = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_VECTORS, gimp_item_get_by_id (vectors_ID),
- G_TYPE_DOUBLE, x0,
- G_TYPE_DOUBLE, y0,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-bezier-stroke-new-moveto",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-vectors-bezier-stroke-new-moveto",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- stroke_id = g_value_get_int (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return stroke_id;
-}
-
/**
* gimp_vectors_bezier_stroke_lineto:
* @vectors: The vectors object.
@@ -1832,55 +958,6 @@ gimp_vectors_bezier_stroke_lineto (GimpVectors *vectors,
return success;
}
-/**
- * _gimp_vectors_bezier_stroke_lineto: (skip)
- * @vectors_ID: The vectors object.
- * @stroke_id: The stroke ID.
- * @x0: The x-coordinate of the lineto.
- * @y0: The y-coordinate of the lineto.
- *
- * Extends a bezier stroke with a lineto.
- *
- * Extends a bezier stroke with a lineto.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.4
- **/
-gboolean
-_gimp_vectors_bezier_stroke_lineto (gint32 vectors_ID,
- gint stroke_id,
- gdouble x0,
- gdouble y0)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_VECTORS, gimp_item_get_by_id (vectors_ID),
- G_TYPE_INT, stroke_id,
- G_TYPE_DOUBLE, x0,
- G_TYPE_DOUBLE, y0,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-bezier-stroke-lineto",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-vectors-bezier-stroke-lineto",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_vectors_bezier_stroke_conicto:
* @vectors: The vectors object.
@@ -1905,124 +982,8 @@ gimp_vectors_bezier_stroke_conicto (GimpVectors *vectors,
gint stroke_id,
gdouble x0,
gdouble y0,
- gdouble x1,
- gdouble y1)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_VECTORS, vectors,
- G_TYPE_INT, stroke_id,
- G_TYPE_DOUBLE, x0,
- G_TYPE_DOUBLE, y0,
- G_TYPE_DOUBLE, x1,
- G_TYPE_DOUBLE, y1,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-bezier-stroke-conicto",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-vectors-bezier-stroke-conicto",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * _gimp_vectors_bezier_stroke_conicto: (skip)
- * @vectors_ID: The vectors object.
- * @stroke_id: The stroke ID.
- * @x0: The x-coordinate of the control point.
- * @y0: The y-coordinate of the control point.
- * @x1: The x-coordinate of the end point.
- * @y1: The y-coordinate of the end point.
- *
- * Extends a bezier stroke with a conic bezier spline.
- *
- * Extends a bezier stroke with a conic bezier spline. Actually a cubic
- * bezier spline gets added that realizes the shape of a conic bezier
- * spline.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.4
- **/
-gboolean
-_gimp_vectors_bezier_stroke_conicto (gint32 vectors_ID,
- gint stroke_id,
- gdouble x0,
- gdouble y0,
- gdouble x1,
- gdouble y1)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_VECTORS, gimp_item_get_by_id (vectors_ID),
- G_TYPE_INT, stroke_id,
- G_TYPE_DOUBLE, x0,
- G_TYPE_DOUBLE, y0,
- G_TYPE_DOUBLE, x1,
- G_TYPE_DOUBLE, y1,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-bezier-stroke-conicto",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-vectors-bezier-stroke-conicto",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
-/**
- * gimp_vectors_bezier_stroke_cubicto:
- * @vectors: The vectors object.
- * @stroke_id: The stroke ID.
- * @x0: The x-coordinate of the first control point.
- * @y0: The y-coordinate of the first control point.
- * @x1: The x-coordinate of the second control point.
- * @y1: The y-coordinate of the second control point.
- * @x2: The x-coordinate of the end point.
- * @y2: The y-coordinate of the end point.
- *
- * Extends a bezier stroke with a cubic bezier spline.
- *
- * Extends a bezier stroke with a cubic bezier spline.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.4
- **/
-gboolean
-gimp_vectors_bezier_stroke_cubicto (GimpVectors *vectors,
- gint stroke_id,
- gdouble x0,
- gdouble y0,
- gdouble x1,
- gdouble y1,
- gdouble x2,
- gdouble y2)
+ gdouble x1,
+ gdouble y1)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -2036,16 +997,14 @@ gimp_vectors_bezier_stroke_cubicto (GimpVectors *vectors,
G_TYPE_DOUBLE, y0,
G_TYPE_DOUBLE, x1,
G_TYPE_DOUBLE, y1,
- G_TYPE_DOUBLE, x2,
- G_TYPE_DOUBLE, y2,
G_TYPE_NONE);
if (pdb)
return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-bezier-stroke-cubicto",
+ "gimp-vectors-bezier-stroke-conicto",
args);
else
- return_vals = gimp_run_procedure_array ("gimp-vectors-bezier-stroke-cubicto",
+ return_vals = gimp_run_procedure_array ("gimp-vectors-bezier-stroke-conicto",
args);
gimp_value_array_unref (args);
@@ -2057,8 +1016,8 @@ gimp_vectors_bezier_stroke_cubicto (GimpVectors *vectors,
}
/**
- * _gimp_vectors_bezier_stroke_cubicto: (skip)
- * @vectors_ID: The vectors object.
+ * gimp_vectors_bezier_stroke_cubicto:
+ * @vectors: The vectors object.
* @stroke_id: The stroke ID.
* @x0: The x-coordinate of the first control point.
* @y0: The y-coordinate of the first control point.
@@ -2076,14 +1035,14 @@ gimp_vectors_bezier_stroke_cubicto (GimpVectors *vectors,
* Since: 2.4
**/
gboolean
-_gimp_vectors_bezier_stroke_cubicto (gint32 vectors_ID,
- gint stroke_id,
- gdouble x0,
- gdouble y0,
- gdouble x1,
- gdouble y1,
- gdouble x2,
- gdouble y2)
+gimp_vectors_bezier_stroke_cubicto (GimpVectors *vectors,
+ gint stroke_id,
+ gdouble x0,
+ gdouble y0,
+ gdouble x1,
+ gdouble y1,
+ gdouble x2,
+ gdouble y2)
{
GimpPDB *pdb = gimp_get_pdb ();
GimpValueArray *args;
@@ -2091,7 +1050,7 @@ _gimp_vectors_bezier_stroke_cubicto (gint32 vectors_ID,
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_VECTORS, gimp_item_get_by_id (vectors_ID),
+ GIMP_TYPE_VECTORS, vectors,
G_TYPE_INT, stroke_id,
G_TYPE_DOUBLE, x0,
G_TYPE_DOUBLE, y0,
@@ -2173,62 +1132,6 @@ gimp_vectors_bezier_stroke_new_ellipse (GimpVectors *vectors,
return stroke_id;
}
-/**
- * _gimp_vectors_bezier_stroke_new_ellipse: (skip)
- * @vectors_ID: The vectors object.
- * @x0: The x-coordinate of the center.
- * @y0: The y-coordinate of the center.
- * @radius_x: The radius in x direction.
- * @radius_y: The radius in y direction.
- * @angle: The angle the x-axis of the ellipse (radians, counterclockwise).
- *
- * Adds a bezier stroke describing an ellipse the vectors object.
- *
- * Adds a bezier stroke describing an ellipse the vectors object.
- *
- * Returns: The resulting stroke.
- *
- * Since: 2.4
- **/
-gint
-_gimp_vectors_bezier_stroke_new_ellipse (gint32 vectors_ID,
- gdouble x0,
- gdouble y0,
- gdouble radius_x,
- gdouble radius_y,
- gdouble angle)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gint stroke_id = 0;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_VECTORS, gimp_item_get_by_id (vectors_ID),
- G_TYPE_DOUBLE, x0,
- G_TYPE_DOUBLE, y0,
- G_TYPE_DOUBLE, radius_x,
- G_TYPE_DOUBLE, radius_y,
- G_TYPE_DOUBLE, angle,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-bezier-stroke-new-ellipse",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-vectors-bezier-stroke-new-ellipse",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- stroke_id = g_value_get_int (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return stroke_id;
-}
-
/**
* gimp_vectors_import_from_file:
* @image: The image.
@@ -2292,69 +1195,6 @@ gimp_vectors_import_from_file (GimpImage *image,
return success;
}
-/**
- * _gimp_vectors_import_from_file: (skip)
- * @image_ID: The image.
- * @filename: The name of the SVG file to import.
- * @merge: Merge paths into a single vectors object.
- * @scale: Scale the SVG to image dimensions.
- * @num_vectors: (out): The number of newly created vectors.
- * @vectors_ids: (out) (array length=num_vectors): The list of newly created vectors.
- *
- * Import paths from an SVG file.
- *
- * This procedure imports paths from an SVG file. SVG elements other
- * than paths and basic shapes are ignored.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.4
- **/
-gboolean
-_gimp_vectors_import_from_file (gint32 image_ID,
- const gchar *filename,
- gboolean merge,
- gboolean scale,
- gint *num_vectors,
- gint **vectors_ids)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_STRING, filename,
- G_TYPE_BOOLEAN, merge,
- G_TYPE_BOOLEAN, scale,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-import-from-file",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-vectors-import-from-file",
- args);
- gimp_value_array_unref (args);
-
- *num_vectors = 0;
- *vectors_ids = NULL;
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- if (success)
- {
- *num_vectors = g_value_get_int (gimp_value_array_index (return_vals, 1));
- *vectors_ids = gimp_value_dup_int32_array (gimp_value_array_index (return_vals, 2));
- }
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_vectors_import_from_string:
* @image: The image.
@@ -2422,73 +1262,6 @@ gimp_vectors_import_from_string (GimpImage *image,
return success;
}
-/**
- * _gimp_vectors_import_from_string: (skip)
- * @image_ID: The image.
- * @string: A string that must be a complete and valid SVG document.
- * @length: Number of bytes in string or -1 if the string is NULL terminated.
- * @merge: Merge paths into a single vectors object.
- * @scale: Scale the SVG to image dimensions.
- * @num_vectors: (out): The number of newly created vectors.
- * @vectors_ids: (out) (array length=num_vectors): The list of newly created vectors.
- *
- * Import paths from an SVG string.
- *
- * This procedure works like gimp_vectors_import_from_file() but takes
- * a string rather than reading the SVG from a file. This allows you to
- * write scripts that generate SVG and feed it to GIMP.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.4
- **/
-gboolean
-_gimp_vectors_import_from_string (gint32 image_ID,
- const gchar *string,
- gint length,
- gboolean merge,
- gboolean scale,
- gint *num_vectors,
- gint **vectors_ids)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_STRING, string,
- G_TYPE_INT, length,
- G_TYPE_BOOLEAN, merge,
- G_TYPE_BOOLEAN, scale,
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-import-from-string",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-vectors-import-from-string",
- args);
- gimp_value_array_unref (args);
-
- *num_vectors = 0;
- *vectors_ids = NULL;
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- if (success)
- {
- *num_vectors = g_value_get_int (gimp_value_array_index (return_vals, 1));
- *vectors_ids = gimp_value_dup_int32_array (gimp_value_array_index (return_vals, 2));
- }
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_vectors_export_to_file:
* @image: The image.
@@ -2538,55 +1311,6 @@ gimp_vectors_export_to_file (GimpImage *image,
return success;
}
-/**
- * _gimp_vectors_export_to_file: (skip)
- * @image_ID: The image.
- * @filename: The name of the SVG file to create.
- * @vectors_ID: The vectors object to be saved, or 0 for all in the image.
- *
- * save a path as an SVG file.
- *
- * This procedure creates an SVG file to save a Vectors object, that
- * is, a path. The resulting file can be edited using a vector graphics
- * application, or later reloaded into GIMP. If you pass 0 as the
- * 'vectors' argument, then all paths in the image will be exported.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.6
- **/
-gboolean
-_gimp_vectors_export_to_file (gint32 image_ID,
- const gchar *filename,
- gint32 vectors_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gboolean success = TRUE;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- G_TYPE_STRING, filename,
- GIMP_TYPE_VECTORS, gimp_item_get_by_id (vectors_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-export-to-file",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-vectors-export-to-file",
- args);
- gimp_value_array_unref (args);
-
- success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
-
- gimp_value_array_unref (return_vals);
-
- return success;
-}
-
/**
* gimp_vectors_export_to_string:
* @image: The image.
@@ -2635,51 +1359,3 @@ gimp_vectors_export_to_string (GimpImage *image,
return string;
}
-
-/**
- * _gimp_vectors_export_to_string: (skip)
- * @image_ID: The image.
- * @vectors_ID: The vectors object to save, or 0 for all in the image.
- *
- * Save a path as an SVG string.
- *
- * This procedure works like gimp_vectors_export_to_file() but creates
- * a string rather than a file. The contents are a NUL-terminated
- * string that holds a complete XML document. If you pass 0 as the
- * 'vectors' argument, then all paths in the image will be exported.
- *
- * Returns: A string whose contents are a complete SVG document.
- * The returned value must be freed with g_free().
- *
- * Since: 2.6
- **/
-gchar *
-_gimp_vectors_export_to_string (gint32 image_ID,
- gint32 vectors_ID)
-{
- GimpPDB *pdb = gimp_get_pdb ();
- GimpValueArray *args;
- GimpValueArray *return_vals;
- gchar *string = NULL;
-
- args = gimp_value_array_new_from_types (NULL,
- GIMP_TYPE_IMAGE, gimp_image_get_by_id (image_ID),
- GIMP_TYPE_VECTORS, gimp_item_get_by_id (vectors_ID),
- G_TYPE_NONE);
-
- if (pdb)
- return_vals = gimp_pdb_run_procedure_array (pdb,
- "gimp-vectors-export-to-string",
- args);
- else
- return_vals = gimp_run_procedure_array ("gimp-vectors-export-to-string",
- args);
- gimp_value_array_unref (args);
-
- if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
- string = g_value_dup_string (gimp_value_array_index (return_vals, 1));
-
- gimp_value_array_unref (return_vals);
-
- return string;
-}
diff --git a/libgimp/gimpvectors_pdb.h b/libgimp/gimpvectors_pdb.h
index 932553f4fd..168d823bef 100644
--- a/libgimp/gimpvectors_pdb.h
+++ b/libgimp/gimpvectors_pdb.h
@@ -32,10 +32,6 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
GimpVectors* gimp_vectors_new (GimpImage *image,
const gchar *name);
GimpVectors* gimp_vectors_new_from_text_layer (GimpImage *image,
@@ -142,147 +138,6 @@ gboolean gimp_vectors_export_to_file (GimpImage
gchar* gimp_vectors_export_to_string (GimpImage *image,
GimpVectors *vectors);
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_vectors_new _gimp_vectors_new
-#define gimp_vectors_new_from_text_layer _gimp_vectors_new_from_text_layer
-#define gimp_vectors_copy _gimp_vectors_copy
-#define gimp_vectors_get_strokes _gimp_vectors_get_strokes
-#define gimp_vectors_stroke_get_length _gimp_vectors_stroke_get_length
-#define gimp_vectors_stroke_get_point_at_dist _gimp_vectors_stroke_get_point_at_dist
-#define gimp_vectors_remove_stroke _gimp_vectors_remove_stroke
-#define gimp_vectors_stroke_close _gimp_vectors_stroke_close
-#define gimp_vectors_stroke_translate _gimp_vectors_stroke_translate
-#define gimp_vectors_stroke_scale _gimp_vectors_stroke_scale
-#define gimp_vectors_stroke_rotate _gimp_vectors_stroke_rotate
-#define gimp_vectors_stroke_flip _gimp_vectors_stroke_flip
-#define gimp_vectors_stroke_flip_free _gimp_vectors_stroke_flip_free
-#define gimp_vectors_stroke_get_points _gimp_vectors_stroke_get_points
-#define gimp_vectors_stroke_new_from_points _gimp_vectors_stroke_new_from_points
-#define gimp_vectors_stroke_interpolate _gimp_vectors_stroke_interpolate
-#define gimp_vectors_bezier_stroke_new_moveto _gimp_vectors_bezier_stroke_new_moveto
-#define gimp_vectors_bezier_stroke_lineto _gimp_vectors_bezier_stroke_lineto
-#define gimp_vectors_bezier_stroke_conicto _gimp_vectors_bezier_stroke_conicto
-#define gimp_vectors_bezier_stroke_cubicto _gimp_vectors_bezier_stroke_cubicto
-#define gimp_vectors_bezier_stroke_new_ellipse _gimp_vectors_bezier_stroke_new_ellipse
-#define gimp_vectors_import_from_file _gimp_vectors_import_from_file
-#define gimp_vectors_import_from_string _gimp_vectors_import_from_string
-#define gimp_vectors_export_to_file _gimp_vectors_export_to_file
-#define gimp_vectors_export_to_string _gimp_vectors_export_to_string
-
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-gint32 _gimp_vectors_new (gint32 image_ID,
- const gchar *name);
-gint32 _gimp_vectors_new_from_text_layer (gint32 image_ID,
- gint32 layer_ID);
-gint32 _gimp_vectors_copy (gint32 vectors_ID);
-gint* _gimp_vectors_get_strokes (gint32 vectors_ID,
- gint *num_strokes);
-gdouble _gimp_vectors_stroke_get_length (gint32 vectors_ID,
- gint stroke_id,
- gdouble precision);
-gboolean _gimp_vectors_stroke_get_point_at_dist (gint32 vectors_ID,
- gint stroke_id,
- gdouble dist,
- gdouble precision,
- gdouble *x_point,
- gdouble *y_point,
- gdouble *slope,
- gboolean *valid);
-gboolean _gimp_vectors_remove_stroke (gint32 vectors_ID,
- gint stroke_id);
-gboolean _gimp_vectors_stroke_close (gint32 vectors_ID,
- gint stroke_id);
-gboolean _gimp_vectors_stroke_translate (gint32 vectors_ID,
- gint stroke_id,
- gint off_x,
- gint off_y);
-gboolean _gimp_vectors_stroke_scale (gint32 vectors_ID,
- gint stroke_id,
- gdouble scale_x,
- gdouble scale_y);
-gboolean _gimp_vectors_stroke_rotate (gint32 vectors_ID,
- gint stroke_id,
- gdouble center_x,
- gdouble center_y,
- gdouble angle);
-gboolean _gimp_vectors_stroke_flip (gint32 vectors_ID,
- gint stroke_id,
- GimpOrientationType flip_type,
- gdouble axis);
-gboolean _gimp_vectors_stroke_flip_free (gint32 vectors_ID,
- gint stroke_id,
- gdouble x1,
- gdouble y1,
- gdouble x2,
- gdouble y2);
-GimpVectorsStrokeType _gimp_vectors_stroke_get_points (gint32 vectors_ID,
- gint stroke_id,
- gint *num_points,
- gdouble **controlpoints,
- gboolean *closed);
-gint _gimp_vectors_stroke_new_from_points (gint32 vectors_ID,
- GimpVectorsStrokeType type,
- gint num_points,
- const gdouble *controlpoints,
- gboolean closed);
-gdouble* _gimp_vectors_stroke_interpolate (gint32 vectors_ID,
- gint stroke_id,
- gdouble precision,
- gint *num_coords,
- gboolean *closed);
-gint _gimp_vectors_bezier_stroke_new_moveto (gint32 vectors_ID,
- gdouble x0,
- gdouble y0);
-gboolean _gimp_vectors_bezier_stroke_lineto (gint32 vectors_ID,
- gint stroke_id,
- gdouble x0,
- gdouble y0);
-gboolean _gimp_vectors_bezier_stroke_conicto (gint32 vectors_ID,
- gint stroke_id,
- gdouble x0,
- gdouble y0,
- gdouble x1,
- gdouble y1);
-gboolean _gimp_vectors_bezier_stroke_cubicto (gint32 vectors_ID,
- gint stroke_id,
- gdouble x0,
- gdouble y0,
- gdouble x1,
- gdouble y1,
- gdouble x2,
- gdouble y2);
-gint _gimp_vectors_bezier_stroke_new_ellipse (gint32 vectors_ID,
- gdouble x0,
- gdouble y0,
- gdouble radius_x,
- gdouble radius_y,
- gdouble angle);
-gboolean _gimp_vectors_import_from_file (gint32 image_ID,
- const gchar *filename,
- gboolean merge,
- gboolean scale,
- gint *num_vectors,
- gint **vectors_ids);
-gboolean _gimp_vectors_import_from_string (gint32 image_ID,
- const gchar *string,
- gint length,
- gboolean merge,
- gboolean scale,
- gint *num_vectors,
- gint **vectors_ids);
-gboolean _gimp_vectors_export_to_file (gint32 image_ID,
- const gchar *filename,
- gint32 vectors_ID);
-gchar* _gimp_vectors_export_to_string (gint32 image_ID,
- gint32 vectors_ID);
-
G_END_DECLS
diff --git a/pdb/lib.pl b/pdb/lib.pl
index 2274f43f4c..cf06d93ad9 100644
--- a/pdb/lib.pl
+++ b/pdb/lib.pl
@@ -46,22 +46,17 @@ sub desc_wrap {
}
sub generate_fun {
- my ($proc, $out, $api_deprecated, $has_id_arg) = @_;
+ my ($proc, $out) = @_;
my @inargs = @{$proc->{inargs}} if (defined $proc->{inargs});
my @outargs = @{$proc->{outargs}} if (defined $proc->{outargs});
sub libtype {
my $arg = shift;
my $outarg = shift;
- my $api_deprecated = shift;
my ($type, $name) = &arg_parse($arg->{type});
my $argtype = $arg_types{$type};
my $rettype = '';
- if ($api_deprecated && exists $argtype->{id}) {
- return 'gint32 ';
- }
-
if ($type eq 'enum') {
return "$name ";
}
@@ -89,19 +84,10 @@ sub generate_fun {
my $func_annotations = "";
if ($proc->{lib_private}) {
- if ($api_deprecated) {
- # No need to create deprecated versions of private libs.
- return '';
- }
$wrapped = '_';
}
- if ($api_deprecated) {
- $new_funcname = "$wrapped$funcname";
- #push @{$out->{protos_deprecated}}, "GIMP_DEPRECATED_FOR($new_funcname)\n";
- $func_annotations .= " (skip)";
- }
- elsif ($proc->{deprecated}) {
+ if ($proc->{deprecated}) {
if ($proc->{deprecated} eq 'NONE') {
push @{$out->{protos}}, "GIMP_DEPRECATED\n";
}
@@ -113,12 +99,6 @@ sub generate_fun {
}
}
- # Add an underscore for deprecated API. If the original was already
- # private, this will be 2 underscores.
- if ($api_deprecated) {
- $wrapped .= '_';
- }
-
# Find the return argument (defaults to the first arg if not
# explicitly set
my $retarg = undef;
@@ -144,7 +124,7 @@ sub generate_fun {
my ($type) = &arg_parse($retarg->{type});
my $argtype = $arg_types{$type};
my $annotate = "";
- $rettype = &libtype($retarg, 1, $api_deprecated);
+ $rettype = &libtype($retarg, 1);
chop $rettype unless $rettype =~ /\*$/;
$retarg->{retval} = 1;
@@ -156,12 +136,7 @@ sub generate_fun {
$annotate .= " (nullable)";
}
- if ($api_deprecated) {
- if (exists $argtype->{out_annotate_d}) {
- $annotate .= " $argtype->{out_annotate_d}";
- }
- }
- elsif (exists $argtype->{out_annotate}) {
+ if (exists $argtype->{out_annotate}) {
$annotate .= " $argtype->{out_annotate}";
}
@@ -214,9 +189,6 @@ sub generate_fun {
my $desc = exists $_->{desc} ? $_->{desc} : "";
my $var_len;
my $value;
- my $is_id = $arg->{id} && $api_deprecated;
-
- $var .= '_ID' if $is_id;
# This gets passed to gimp_value_array_new_with_types()
if ($type eq 'enum') {
@@ -236,9 +208,6 @@ sub generate_fun {
if (exists $_->{array}) {
$value_array .= "NULL";
}
- elsif (exists $arg->{convert_func} && $api_deprecated) {
- $value_array .= eval qq/"$arg->{convert_func}"/;
- }
else {
$value_array .= "$var";
}
@@ -263,13 +232,11 @@ sub generate_fun {
$usednames{$_->{name}}++;
- $arglist .= &libtype($_, 0, $api_deprecated);
+ $arglist .= &libtype($_, 0);
$arglist .= $_->{name};
- $arglist .= '_ID' if $is_id;
$arglist .= ', ';
$argdesc .= " * \@$_->{name}";
- $argdesc .= '_ID' if $is_id;
$argdesc .= ":";
if (exists $arg->{array}) {
@@ -315,7 +282,6 @@ sub generate_fun {
my ($type) = &arg_parse($_->{type});
my $arg = $arg_types{$type};
my $var;
- my $is_id = $arg->{id} && $api_deprecated;
$return_marshal = "" unless $once++;
@@ -329,21 +295,16 @@ sub generate_fun {
}
elsif (exists $_->{retval}) {
$return_args .= "\n" . ' ' x 2;
- $return_args .= &libtype($_, 1, $api_deprecated);
+ $return_args .= &libtype($_, 1);
# The return value variable
$var = $_->{libname};
- $var .= '_ID' if $is_id;
$return_args .= $var;
# Save the first var to "return" it
$firstvar = $var unless defined $firstvar;
- if ($is_id) {
- # Initialize all IDs to -1
- $return_args .= " = -1";
- }
- elsif ($_->{libdef}) {
+ if ($_->{libdef}) {
$return_args .= " = $_->{libdef}";
}
else {
@@ -396,7 +357,6 @@ CODE
my ($type) = &arg_parse($_->{type});
my $desc = exists $_->{desc} ? $_->{desc} : "";
my $arg = $arg_types{$type};
- my $is_id = $arg->{id} && $api_deprecated;
my $var;
# The return value variable
@@ -407,11 +367,9 @@ CODE
$arglist .= &libtype($_, 1);
$arglist .= '*' unless exists $arg->{struct};
$arglist .= "$_->{libname}";
- $arglist .= '_ID' if $is_id;
$arglist .= ', ';
$argdesc .= " * \@$_->{libname}";
- $argdesc .= '_ID' if $is_id;
if ($arg->{name} eq 'COLOR') {
$argdesc .= ": (out caller-allocates)";
@@ -424,12 +382,7 @@ CODE
$argdesc .= " (array length=@outargs[$argc - 2]->{name})";
}
- if ($api_deprecated) {
- if (exists $arg->{out_annotate_d}) {
- $argdesc .= " $arg->{out_annotate_d}";
- }
- }
- elsif (exists $arg->{out_annotate}) {
+ if (exists $arg->{out_annotate}) {
$argdesc .= " $arg->{out_annotate}";
}
@@ -438,17 +391,11 @@ CODE
$var = exists $_->{retval} ? "" : '*';
$var .= $_->{libname};
- $var .= '_ID' if $is_id;
$value = "gimp_value_array_index (return_vals, $argc)";
$return_marshal .= ' ' x 2 if $#outargs;
- if ($api_deprecated && $arg->{dup_value_func_d}) {
- $return_marshal .= eval qq/" $arg->{dup_value_func_d};\n"/;
- }
- else {
- $return_marshal .= eval qq/" $arg->{dup_value_func};\n"/;
- }
+ $return_marshal .= eval qq/" $arg->{dup_value_func};\n"/;
if ($argdesc) {
unless ($argdesc =~ /[\.\!\?]$/) { $argdesc .= '.' }
@@ -522,17 +469,7 @@ CODE
my $proto = "$hrettype $wrapped$funcname ($arglist);\n";
$proto =~ s/ +/ /g;
- if ($api_deprecated) {
- my $define_dep = "#define $new_funcname $wrapped$funcname";
- push @{$out->{protos_deprecated}}, $proto;
- push @{$out->{defines_deprecated}}, $define_dep;
- }
- elsif (! $has_id_arg){
- push @{$out->{protos_no_alt}}, $proto;
- }
- else {
- push @{$out->{protos}}, $proto;
- }
+ push @{$out->{protos}}, $proto;
my $clist = $arglist;
my $padlen = length($wrapped) + length($funcname) + 2;
@@ -608,11 +545,11 @@ CODE
}
sub generate_hbody {
- my ($out, $extra, $protoname) = @_;
+ my ($out, $extra) = @_;
- if (exists $extra->{${protoname}}) {
+ if (exists $extra->{protos}) {
my $proto = "";
- foreach (split(/\n/, $extra->{${protoname}})) {
+ foreach (split(/\n/, $extra->{protos})) {
next if /^\s*$/;
if (/^\t/ && length($proto)) {
@@ -620,7 +557,7 @@ sub generate_hbody {
$proto .= $_ . "\n";
}
else {
- push @{$out->{${protoname}}}, $proto if length($proto);
+ push @{$out->{protos}}, $proto if length($proto);
s/\s+/ /g; s/^ //; s/ $//;
$proto = $_ . "\n";
@@ -629,7 +566,7 @@ sub generate_hbody {
}
my @longest = (0, 0, 0); my @arglist = (); my $seen = 0;
- foreach (@{$out->{${protoname}}}) {
+ foreach (@{$out->{protos}}) {
my $arglist;
if (!/^GIMP_DEPRECATED/) {
@@ -637,7 +574,7 @@ sub generate_hbody {
$arglist = [ split(' ', $_, 3) ];
- if ($arglist->[1] =~ /^_/ && $protoname ne 'protos_deprecated') {
+ if ($arglist->[1] =~ /^_/) {
$arglist->[0] = "G_GNUC_INTERNAL ".$arglist->[0];
}
@@ -663,7 +600,7 @@ sub generate_hbody {
$longest[2] += $seen;
- @{$out->{${protoname}}} = ();
+ @{$out->{protos}} = ();
foreach (@arglist) {
my $arg;
@@ -699,12 +636,12 @@ sub generate_hbody {
$arg = $_;
}
- push @{$out->{${protoname}}}, $arg;
+ push @{$out->{protos}}, $arg;
}
my $body = '';
$body = $extra->{decls} if exists $extra->{decls};
- foreach (@{$out->{${protoname}}}) { $body .= $_ }
+ foreach (@{$out->{protos}}) { $body .= $_ }
if ($out->{deprecated}) {
$body .= "#endif /* GIMP_DISABLE_DEPRECATED */\n";
}
@@ -725,30 +662,7 @@ sub generate {
my @inargs = @{$proc->{inargs}} if (defined $proc->{inargs});
my @outargs = @{$proc->{outargs}} if (defined $proc->{outargs});
- # Check if any of the argument or returned value is an image.
- $has_id_arg = 0;
- foreach (@outargs) {
- my ($type, @typeinfo) = &arg_parse($_->{type});
- my $arg = $arg_types{$type};
- if (exists $arg->{id}) {
- $has_id_arg = 1;
- last;
- }
- }
- unless ($has_id_arg) {
- foreach (@inargs) {
- my ($type, @typeinfo) = &arg_parse($_->{type});
- my $arg = $arg_types{$type};
- if (exists $arg->{id}) {
- $has_id_arg = 1;
- last;
- }
- }
- }
- $out->{code} .= generate_fun($proc, $out, 0, $has_id_arg);
- if ($has_id_arg) {
- $out->{code} .= generate_fun($proc, $out, 1, $has_id_arg);
- }
+ $out->{code} .= generate_fun($proc, $out);
}
my $lgpl_top = <<'LGPL';
@@ -792,9 +706,6 @@ LGPL
my $hfile = "$builddir/$hname$FILE_EXT";
my $cfile = "$builddir/$cname$FILE_EXT";
my $body;
- my $body_deprecated;
- my $body_no_alt;
- my $defines_deprecated = '';
my $extra = {};
if (exists $main::grp{$group}->{extra}->{lib}) {
@@ -802,11 +713,6 @@ LGPL
}
$body = generate_hbody($out, $extra, "protos");
- $body_deprecated = generate_hbody($out, $extra, "protos_deprecated");
- $body_no_alt = generate_hbody($out, $extra, "protos_no_alt");
- foreach (@{$out->{defines_deprecated}}) {
- $defines_deprecated .= "$_" . "\n";
- }
open HFILE, "> $hfile" or die "Can't open $hfile: $!\n";
print HFILE $lgpl_top;
@@ -826,24 +732,8 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
-$body_no_alt
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
$body
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-$defines_deprecated
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-/* Below API are deprecated and should not be used by new plug-ins.
- * They are not marked internal as a trick to keep the old API alive for now.
- */
-
-$body_deprecated
-
G_END_DECLS
diff --git a/pdb/pdb.pl b/pdb/pdb.pl
index 1487d3ac42..b7462c9512 100644
--- a/pdb/pdb.pl
+++ b/pdb/pdb.pl
@@ -159,10 +159,8 @@ package Gimp::CodeGen::pdb;
out_annotate => '(transfer none)',
get_value_func => '$var = g_value_get_object ($value)',
dup_value_func => '$var = g_value_get_object ($value)',
- dup_value_func_d=> '$var = gimp_display_get_id (g_value_get_object ($value))',
set_value_func => 'g_value_set_object ($value, $var)',
- take_value_func => 'g_value_set_object ($value, $var)' ,
- convert_func => 'gimp_display_get_by_id ($var)'},
+ take_value_func => 'g_value_set_object ($value, $var)' },
image => { name => 'IMAGE',
gtype => 'GIMP_TYPE_IMAGE',
@@ -173,10 +171,8 @@ package Gimp::CodeGen::pdb;
out_annotate => '(transfer none)',
get_value_func => '$var = g_value_get_object ($value)',
dup_value_func => '$var = g_value_get_object ($value)',
- dup_value_func_d=> '$var = gimp_image_get_id (g_value_get_object ($value))',
set_value_func => 'g_value_set_object ($value, $var)',
take_value_func => 'g_value_set_object ($value, $var)',
- convert_func => 'gimp_image_get_by_id ($var)',
headers => [ qw("core/gimpimage.h") ] },
item => { name => 'ITEM',
@@ -188,10 +184,8 @@ package Gimp::CodeGen::pdb;
out_annotate => '(transfer none)',
get_value_func => '$var = g_value_get_object ($value)',
dup_value_func => '$var = g_value_get_object ($value)',
- dup_value_func_d=> '$var = gimp_item_get_id (g_value_get_object ($value))',
set_value_func => 'g_value_set_object ($value, $var)',
take_value_func => 'g_value_set_object ($value, $var)',
- convert_func => 'gimp_item_get_by_id ($var)',
headers => [ qw("core/gimpitem.h") ] },
layer => { name => 'LAYER',
@@ -203,10 +197,8 @@ package Gimp::CodeGen::pdb;
out_annotate => '(transfer none)',
get_value_func => '$var = g_value_get_object ($value)',
dup_value_func => '$var = g_value_get_object ($value)',
- dup_value_func_d=> '$var = gimp_item_get_id (g_value_get_object ($value))',
set_value_func => 'g_value_set_object ($value, $var)',
take_value_func => 'g_value_set_object ($value, $var)',
- convert_func => 'gimp_item_get_by_id ($var)',
headers => [ qw("core/gimplayer.h") ] },
channel => { name => 'CHANNEL',
@@ -218,10 +210,8 @@ package Gimp::CodeGen::pdb;
out_annotate => '(transfer none)',
get_value_func => '$var = g_value_get_object ($value)',
dup_value_func => '$var = g_value_get_object ($value)',
- dup_value_func_d=> '$var = gimp_item_get_id (g_value_get_object ($value))',
set_value_func => 'g_value_set_object ($value, $var)',
take_value_func => 'g_value_set_object ($value, $var)',
- convert_func => 'gimp_item_get_by_id ($var)',
headers => [ qw("core/gimpchannel.h") ] },
drawable => { name => 'DRAWABLE',
@@ -233,10 +223,8 @@ package Gimp::CodeGen::pdb;
out_annotate => '(transfer none)',
get_value_func => '$var = g_value_get_object ($value)',
dup_value_func => '$var = g_value_get_object ($value)',
- dup_value_func_d=> '$var = gimp_item_get_id (g_value_get_object ($value))',
set_value_func => 'g_value_set_object ($value, $var)',
take_value_func => 'g_value_set_object ($value, $var)',
- convert_func => 'gimp_item_get_by_id ($var)',
headers => [ qw("core/gimpdrawable.h") ] },
selection => { name => 'SELECTION',
@@ -248,10 +236,8 @@ package Gimp::CodeGen::pdb;
out_annotate => '(transfer none)',
get_value_func => '$var = g_value_get_object ($value)',
dup_value_func => '$var = g_value_get_object ($value)',
- dup_value_func_d=> '$var = gimp_item_get_id (g_value_get_object ($value))',
set_value_func => 'g_value_set_object ($value, $var)',
take_value_func => 'g_value_set_object ($value, $var)',
- convert_func => 'gimp_item_get_by_id ($var)',
headers => [ qw("core/gimpselection.h") ] },
layer_mask => { name => 'CHANNEL',
@@ -263,10 +249,8 @@ package Gimp::CodeGen::pdb;
out_annotate => '(transfer none)',
get_value_func => '$var = g_value_get_object ($value)',
dup_value_func => '$var = g_value_get_object ($value)',
- dup_value_func_d=> '$var = gimp_item_get_id (g_value_get_object ($value))',
set_value_func => 'g_value_set_object ($value, $var)',
take_value_func => 'g_value_set_object ($value, $var)',
- convert_func => 'gimp_item_get_by_id ($var)',
headers => [ qw("core/gimplayermask.h") ] },
vectors => { name => 'VECTORS',
@@ -278,10 +262,8 @@ package Gimp::CodeGen::pdb;
out_annotate => '(transfer none)',
get_value_func => '$var = g_value_get_object ($value)',
dup_value_func => '$var = g_value_get_object ($value)',
- dup_value_func_d=> '$var = gimp_item_get_id (g_value_get_object ($value))',
set_value_func => 'g_value_set_object ($value, $var)',
take_value_func => 'g_value_set_object ($value, $var)',
- convert_func => 'gimp_item_get_by_id ($var)',
headers => [ qw("vectors/gimpvectors.h") ] },
parasite => { name => 'PARASITE',
diff --git a/plug-ins/pygimp/Makefile.am b/plug-ins/pygimp/Makefile.am
index 3c04b8165e..be2da76c1e 100644
--- a/plug-ins/pygimp/Makefile.am
+++ b/plug-ins/pygimp/Makefile.am
@@ -22,7 +22,6 @@ endif
AM_CFLAGS = $(PYGIMP_EXTRA_CFLAGS)
AM_CPPFLAGS = \
- -DGIMP_DEPRECATED_REPLACE_NEW_API \
-I$(top_srcdir) \
$(PYTHON_INCLUDES) \
$(PYGTK_CFLAGS) \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]