Commit 71ccaa21 authored by Jehan's avatar Jehan

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.
parent a4637b0d
Pipeline #111059 passed with stages
in 14 minutes and 36 seconds
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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;
}
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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;
}