Commit 08849a58 authored by Jehan's avatar Jehan

libgimp: GimpItem now also belong to libgimp.

parent d15388c8
......@@ -327,7 +327,6 @@ gimp_aspect_preview_draw_buffer (GimpPreview *preview,
&w, &h, &bpp);
sel = gimp_drawable_get_thumbnail_data (GIMP_DRAWABLE (selection),
&w, &h, &bpp);
g_object_unref (selection);
gimp_preview_area_mask (GIMP_PREVIEW_AREA (area),
0, 0, width, height,
......
......@@ -60,7 +60,8 @@ gimp_channel_init (GimpChannel *channel)
* set with explicit procedure calls. The channel's contents are
* undefined initially.
*
* Returns: The newly created channel.
* Returns: (transfer none): The newly created channel.
* The object belongs to libgimp and you should not free it.
*/
GimpChannel *
gimp_channel_new (GimpImage *image,
......@@ -112,14 +113,9 @@ gimp_channel_new_deprecated (gint32 image_id,
const GimpRGB *color)
{
GimpChannel *channel;
gint32 channel_id;
channel = gimp_channel_new (gimp_image_get_by_id (image_id),
name, width, height,
opacity, color);
channel_id = gimp_item_get_id (GIMP_ITEM (channel));
g_object_unref (channel);
return channel_id;
return gimp_item_get_id (GIMP_ITEM (channel));
}
......@@ -53,7 +53,7 @@
* explicit procedure calls.
* The channel's contents are undefined initially.
*
* Returns: (transfer full): The newly created channel.
* Returns: (transfer none): The newly created channel.
**/
GimpChannel *
_gimp_channel_new (GimpImage *image,
......@@ -87,7 +87,7 @@ _gimp_channel_new (GimpImage *image,
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
channel = GIMP_CHANNEL (gimp_item_new_by_id (gimp_value_get_channel_id (gimp_value_array_index (return_vals, 1))));
channel = GIMP_CHANNEL (gimp_item_get_by_id (gimp_value_get_channel_id (gimp_value_array_index (return_vals, 1))));
gimp_value_array_unref (return_vals);
......@@ -108,7 +108,7 @@ _gimp_channel_new (GimpImage *image,
* Other attributes, such as channel visibility, should be set with
* explicit procedure calls.
*
* Returns: (transfer full): The newly created channel.
* Returns: (transfer none): The newly created channel.
*
* Since: 2.4
**/
......@@ -138,7 +138,7 @@ gimp_channel_new_from_component (GimpImage *image,
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
channel = GIMP_CHANNEL (gimp_item_new_by_id (gimp_value_get_channel_id (gimp_value_array_index (return_vals, 1))));
channel = GIMP_CHANNEL (gimp_item_get_by_id (gimp_value_get_channel_id (gimp_value_array_index (return_vals, 1))));
gimp_value_array_unref (return_vals);
......@@ -206,7 +206,7 @@ _gimp_channel_new_from_component (gint32 image_ID,
* 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: (transfer full): The newly copied channel.
* Returns: (transfer none): The newly copied channel.
**/
GimpChannel *
gimp_channel_copy (GimpChannel *channel)
......@@ -230,7 +230,7 @@ gimp_channel_copy (GimpChannel *channel)
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
channel_copy = GIMP_CHANNEL (gimp_item_new_by_id (gimp_value_get_channel_id (gimp_value_array_index (return_vals, 1))));
channel_copy = GIMP_CHANNEL (gimp_item_get_by_id (gimp_value_get_channel_id (gimp_value_array_index (return_vals, 1))));
gimp_value_array_unref (return_vals);
......
......@@ -369,7 +369,10 @@ gimp_drawable_get_thumbnail_format (GimpDrawable *drawable)
gchar *format_str = _gimp_drawable_get_thumbnail_format (drawable);
if (format_str)
format = babl_format (format_str);
{
format = babl_format (format_str);
g_free (format_str);
}
return format;
}
......@@ -388,7 +391,8 @@ gimp_drawable_get_thumbnail_format (GimpDrawable *drawable)
* Retrieves thumbnail data for the drawable identified by @drawable_ID.
* The thumbnail will be not larger than the requested size.
*
* Returns: (transfer full):
* Returns: (transfer full) (nullable): thumbnail data or %NULL if
* @drawable_ID is invalid.
**/
guchar *
gimp_drawable_get_thumbnail_data_deprecated (gint32 drawable_ID,
......@@ -396,17 +400,8 @@ gimp_drawable_get_thumbnail_data_deprecated (gint32 drawable_ID,
gint *height,
gint *bpp)
{
GimpDrawable *drawable;
guchar *data = NULL;
drawable = GIMP_DRAWABLE (gimp_item_new_by_id (drawable_ID));
g_return_val_if_fail (drawable, NULL);
data = gimp_drawable_get_thumbnail_data (drawable, width, height, bpp);
g_object_unref (drawable);
return data;
return gimp_drawable_get_thumbnail_data (GIMP_DRAWABLE (gimp_item_get_by_id (drawable_ID)),
width, height, bpp);
}
/**
......@@ -420,7 +415,8 @@ gimp_drawable_get_thumbnail_data_deprecated (gint32 drawable_ID,
* @drawable_ID. The thumbnail will be not larger than the requested
* size.
*
* Returns: (transfer full): a new #GdkPixbuf
* Returns: (transfer full) (nullable): a new #GdkPixbuf or %NULL if
* @drawable_ID is invalid.
*
* Since: 2.2
**/
......@@ -430,17 +426,8 @@ gimp_drawable_get_thumbnail_deprecated (gint32 drawable_ID,
gint height,
GimpPixbufTransparency alpha)
{
GimpDrawable *drawable;
GdkPixbuf *thumbnail = NULL;
drawable = GIMP_DRAWABLE (gimp_item_new_by_id (drawable_ID));
g_return_val_if_fail (drawable, NULL);
thumbnail = gimp_drawable_get_thumbnail (drawable, width, height, alpha);
g_object_unref (drawable);
return thumbnail;
return gimp_drawable_get_thumbnail (GIMP_DRAWABLE (gimp_item_get_by_id (drawable_ID)),
width, height, alpha);
}
guchar *
......@@ -453,19 +440,10 @@ gimp_drawable_get_sub_thumbnail_data_deprecated (gint32 drawable_ID,
gint *dest_height,
gint *bpp)
{
GimpDrawable *drawable;
guchar *data = NULL;
drawable = GIMP_DRAWABLE (gimp_item_new_by_id (drawable_ID));
g_return_val_if_fail (drawable, NULL);
data = gimp_drawable_get_sub_thumbnail_data (drawable, src_x, src_y,
return gimp_drawable_get_sub_thumbnail_data (GIMP_DRAWABLE (gimp_item_get_by_id (drawable_ID)),
src_x, src_y,
src_width, src_height,
dest_width, dest_height, bpp);
g_object_unref (drawable);
return data;
}
/**
......@@ -497,19 +475,10 @@ gimp_drawable_get_sub_thumbnail_deprecated (gint32 drawable_ID,
gint dest_height,
GimpPixbufTransparency alpha)
{
GimpDrawable *drawable;
GdkPixbuf *thumbnail = NULL;
drawable = GIMP_DRAWABLE (gimp_item_new_by_id (drawable_ID));
g_return_val_if_fail (drawable, NULL);
thumbnail = gimp_drawable_get_sub_thumbnail (drawable, src_x, src_y,
src_width, src_height,
dest_width, dest_height, alpha);
g_object_unref (drawable);
return thumbnail;
return gimp_drawable_get_sub_thumbnail (GIMP_DRAWABLE (gimp_item_get_by_id (drawable_ID)),
src_x, src_y,
src_width, src_height,
dest_width, dest_height, alpha);
}
/**
......@@ -530,17 +499,7 @@ gimp_drawable_get_sub_thumbnail_deprecated (gint32 drawable_ID,
GeglBuffer *
gimp_drawable_get_buffer_deprecated (gint32 drawable_ID)
{
GimpDrawable *drawable;
GeglBuffer *buffer = NULL;
drawable = GIMP_DRAWABLE (gimp_item_new_by_id (drawable_ID));
g_return_val_if_fail (drawable, NULL);
buffer = gimp_drawable_get_buffer (drawable);
g_object_unref (drawable);
return buffer;
return gimp_drawable_get_buffer (GIMP_DRAWABLE (gimp_item_get_by_id (drawable_ID)));
}
/**
......@@ -561,17 +520,7 @@ gimp_drawable_get_buffer_deprecated (gint32 drawable_ID)
GeglBuffer *
gimp_drawable_get_shadow_buffer_deprecated (gint32 drawable_ID)
{
GimpDrawable *drawable;
GeglBuffer *buffer = NULL;
drawable = GIMP_DRAWABLE (gimp_item_new_by_id (drawable_ID));
g_return_val_if_fail (drawable, NULL);
buffer = gimp_drawable_get_shadow_buffer (drawable);
g_object_unref (drawable);
return buffer;
return gimp_drawable_get_shadow_buffer (GIMP_DRAWABLE (gimp_item_get_by_id (drawable_ID)));
}
/**
......@@ -587,17 +536,7 @@ gimp_drawable_get_shadow_buffer_deprecated (gint32 drawable_ID)
const Babl *
gimp_drawable_get_format_deprecated (gint32 drawable_ID)
{
GimpDrawable *drawable;
const Babl *format = NULL;
drawable = GIMP_DRAWABLE (gimp_item_new_by_id (drawable_ID));
g_return_val_if_fail (drawable, NULL);
format = gimp_drawable_get_format (drawable);
g_object_unref (drawable);
return format;
return gimp_drawable_get_format (GIMP_DRAWABLE (gimp_item_get_by_id (drawable_ID)));
}
/**
* gimp_drawable_get_thumbnail_format_deprecated: (skip)
......@@ -612,15 +551,5 @@ gimp_drawable_get_format_deprecated (gint32 drawable_ID)
const Babl *
gimp_drawable_get_thumbnail_format_deprecated (gint32 drawable_ID)
{
GimpDrawable *drawable;
const Babl *format = NULL;
drawable = GIMP_DRAWABLE (gimp_item_new_by_id (drawable_ID));
g_return_val_if_fail (drawable, NULL);
format = gimp_drawable_get_thumbnail_format (drawable);
g_object_unref (drawable);
return format;
return gimp_drawable_get_thumbnail_format (GIMP_DRAWABLE (gimp_item_get_by_id (drawable_ID)));
}
......@@ -474,7 +474,6 @@ gimp_drawable_preview_draw_area (GimpDrawablePreview *preview,
draw_width, draw_height,
&s_w, &s_h,
&s_bpp);
g_object_unref (selection);
switch (d_bpp)
{
......
......@@ -333,7 +333,7 @@ _gimp_edit_copy_visible (gint32 image_ID)
* specified drawable, and a subsequent call to floating_sel_attach is
* not needed.
*
* Returns: (transfer full): The new floating selection.
* Returns: (transfer none): The new floating selection.
**/
GimpLayer *
gimp_edit_paste (GimpDrawable *drawable,
......@@ -359,7 +359,7 @@ gimp_edit_paste (GimpDrawable *drawable,
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
floating_sel = GIMP_LAYER (gimp_item_new_by_id (gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1))));
floating_sel = GIMP_LAYER (gimp_item_get_by_id (gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1))));
gimp_value_array_unref (return_vals);
......@@ -808,7 +808,7 @@ _gimp_edit_named_copy_visible (gint32 image_ID,
* This procedure works like gimp_edit_paste() but pastes a named
* buffer instead of the global buffer.
*
* Returns: (transfer full): The new floating selection.
* Returns: (transfer none): The new floating selection.
*
* Since: 2.4
**/
......@@ -838,7 +838,7 @@ gimp_edit_named_paste (GimpDrawable *drawable,
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
floating_sel = GIMP_LAYER (gimp_item_new_by_id (gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1))));
floating_sel = GIMP_LAYER (gimp_item_get_by_id (gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1))));
gimp_value_array_unref (return_vals);
......
......@@ -101,8 +101,6 @@ export_merge (GimpImage *image,
gimp_selection_none (image);
gimp_drawable_edit_clear (GIMP_DRAWABLE (transp));
nvisible++;
g_object_unref (transp);
}
if (nvisible > 1)
......@@ -121,7 +119,7 @@ export_merge (GimpImage *image,
return; /* shouldn't happen */
}
g_list_free_full (layers, g_object_unref);
g_list_free (layers);
layers = gimp_image_get_layers (image);
/* make sure that the merged drawable matches the image size */
......@@ -144,7 +142,7 @@ export_merge (GimpImage *image,
if (gimp_item_get_id (iter->data) != gimp_item_get_id (GIMP_ITEM (*drawable)))
gimp_image_remove_layer (image, iter->data);
}
g_list_free_full (layers, g_object_unref);
g_list_free (layers);
}
static void
......@@ -174,7 +172,7 @@ export_remove_alpha (GimpImage *image,
gimp_layer_flatten (iter->data);
}
g_list_free_full (layers, g_object_unref);
g_list_free (layers);
}
static void
......@@ -193,11 +191,9 @@ export_apply_masks (GimpImage *image,
mask = gimp_layer_get_mask (iter->data);
if (mask)
gimp_layer_remove_mask (iter->data, GIMP_MASK_APPLY);
g_clear_object (&mask);
}
g_list_free_full (layers, g_object_unref);
g_list_free (layers);
}
static void
......@@ -232,7 +228,7 @@ export_convert_indexed (GimpImage *image,
GIMP_CONVERT_DITHER_NONE,
GIMP_CONVERT_PALETTE_GENERATE,
256, FALSE, FALSE, "");
g_list_free_full (layers, g_object_unref);
g_list_free (layers);
}
static void
......@@ -261,7 +257,7 @@ export_add_alpha (GimpImage *image,
if (! gimp_drawable_has_alpha (GIMP_DRAWABLE (iter->data)))
gimp_layer_add_alpha (GIMP_LAYER (iter->data));
}
g_list_free_full (layers, g_object_unref);
g_list_free (layers);
}
static void
......@@ -839,14 +835,8 @@ gimp_export_image (GimpImage **image,
{
for (iter = layers; iter; iter = iter->next)
{
GimpLayer *layer = GIMP_LAYER (iter->data);
GimpLayerMask *mask;
mask = gimp_layer_get_mask (layer);
if (mask)
if (gimp_layer_get_mask (iter->data))
has_layer_masks = TRUE;
g_clear_object (&mask);
}
}
......@@ -924,7 +914,7 @@ gimp_export_image (GimpImage **image,
}
}
g_list_free_full (children, g_object_unref);
g_list_free (children);
/* check layer masks */
if (has_layer_masks &&
......@@ -932,7 +922,7 @@ gimp_export_image (GimpImage **image,
actions = g_slist_prepend (actions, &export_action_apply_masks);
}
g_list_free_full (layers, g_object_unref);
g_list_free (layers);
/* check the image type */
type = gimp_image_base_type (*image);
......@@ -1148,22 +1138,16 @@ gimp_export_image_deprecated (gint32 *image_ID,
{
GimpImage *image;
GimpDrawable *drawable;
GimpDrawable *new_drawable;
GimpExportReturn retval;
image = gimp_image_get_by_id (*image_ID);
drawable = GIMP_DRAWABLE (gimp_item_new_by_id (*drawable_ID));
new_drawable = drawable;
image = gimp_image_get_by_id (*image_ID);
drawable = GIMP_DRAWABLE (gimp_item_get_by_id (*drawable_ID));
retval = gimp_export_image (&image, &new_drawable,
retval = gimp_export_image (&image, &drawable,
format_name, capabilities);
*image_ID = gimp_image_get_id (image);
*drawable_ID = gimp_item_get_id (GIMP_ITEM (new_drawable));
if (retval == GIMP_EXPORT_EXPORT)
g_object_unref (new_drawable);
g_object_unref (drawable);
*drawable_ID = gimp_item_get_id (GIMP_ITEM (drawable));
return retval;
}
......@@ -149,7 +149,7 @@ _gimp_file_load (GimpRunMode run_mode,
* needs to be added to the existing image with
* gimp_image_insert_layer().
*
* Returns: (transfer full): The layer created when loading the image file.
* Returns: (transfer none): The layer created when loading the image file.
*
* Since: 2.4
**/
......@@ -179,7 +179,7 @@ gimp_file_load_layer (GimpRunMode run_mode,
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
layer = GIMP_LAYER (gimp_item_new_by_id (gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1))));
layer = GIMP_LAYER (gimp_item_get_by_id (gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1))));
gimp_value_array_unref (return_vals);
......
......@@ -220,10 +220,10 @@ gimp_image_list (void)
* This procedure returns the list of layers contained in the specified
* image. The order of layers is from topmost to bottommost.
*
* Returns: (element-type GimpImage) (transfer full):
* Returns: (element-type GimpImage) (transfer container):
* The list of layers contained in the image.
* The returned value must be freed with:
* g_list_free_full(list, g_object_unref);
* The returned value must be freed with g_list_free(). Layer
* elements belong to libgimp and must not be freed.
*
* Since: 3.0
**/
......@@ -237,13 +237,8 @@ gimp_image_get_layers (GimpImage *image)
ids = _gimp_image_get_layers (image, &num_layers);
for (i = 0; i < num_layers; i++)
{
GimpLayer *layer;
layer = GIMP_LAYER (gimp_item_new_by_id (ids[i]));
layers = g_list_prepend (layers, layer);
}
layers = g_list_prepend (layers,
GIMP_LAYER (gimp_item_get_by_id (ids[i])));
layers = g_list_reverse (layers);
g_free (ids);
......@@ -262,10 +257,10 @@ gimp_image_get_layers (GimpImage *image)
* \"channels\" are custom channels and do not include the image's
* color components.
*
* Returns: (element-type GimpChannel) (transfer full):
* Returns: (element-type GimpChannel) (transfer container):
* The list of channels contained in the image.
* The returned value must be freed with:
* g_list_free_full(list, g_object_unref);
* The returned value must be freed with g_list_free(). Channel
* elements belong to libgimp and must not be freed.
*
* Since: 3.0
**/
......@@ -279,13 +274,8 @@ gimp_image_get_channels (GimpImage *image)
ids = _gimp_image_get_channels (image, &num_channels);
for (i = 0; i < num_channels; i++)
{
GimpChannel *channel;
channel = GIMP_CHANNEL (gimp_item_new_by_id (ids[i]));
channels = g_list_prepend (channels, channel);
}
channels = g_list_prepend (channels,
GIMP_CHANNEL (gimp_item_get_by_id (ids[i])));
channels = g_list_reverse (channels);
g_free (ids);
......@@ -301,10 +291,10 @@ gimp_image_get_channels (GimpImage *image)
* This procedure returns the list of vectors contained in the
* specified image.
*
* Returns: (element-type GimpVectors) (transfer full):
* Returns: (element-type GimpVectors) (transfer container):
* The list of vectors contained in the image.
* The returned value must be freed with:
* g_list_free_full(list, g_object_unref);
* The returned value must be freed with g_list_free(). Vectors
* elements belong to libgimp and must not be freed.
*
* Since: 3.0
**/
......@@ -318,13 +308,8 @@ gimp_image_get_vectors (GimpImage *image)
ids = _gimp_image_get_vectors (image, &num_vectors);
for (i = 0; i < num_vectors; i++)
{
GimpVectors *path;
path = GIMP_VECTORS (gimp_item_new_by_id (ids[i]));
vectors = g_list_prepend (vectors, path);
}
vectors = g_list_prepend (vectors,
GIMP_VECTORS (gimp_item_get_by_id (ids[i])));
vectors = g_list_reverse (vectors);
g_free (ids);
......
......@@ -1115,7 +1115,7 @@ _gimp_image_get_vectors (GimpImage *image,
* layer mask and the layer mask is in edit mode, then the layer mask
* is the active drawable.
*
* Returns: (transfer full): The active drawable.
* Returns: (transfer none): The active drawable.
**/
GimpDrawable *
gimp_image_get_active_drawable (GimpImage *image)
......@@ -1139,7 +1139,7 @@ gimp_image_get_active_drawable (GimpImage *image)
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
drawable = GIMP_DRAWABLE (gimp_item_new_by_id (gimp_value_get_drawable_id (gimp_value_array_index (return_vals, 1))));
drawable = GIMP_DRAWABLE (gimp_item_get_by_id (gimp_value_get_drawable_id (gimp_value_array_index (return_vals, 1))));
gimp_value_array_unref (return_vals);
......@@ -1281,7 +1281,7 @@ _gimp_image_unset_active_channel (gint32 image_ID)
* 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 full): The image's floating selection.
* Returns: (transfer none): The image's floating selection.
**/
GimpLayer *
gimp_image_get_floating_sel (GimpImage *image)
......@@ -1305,7 +1305,7 @@ gimp_image_get_floating_sel (GimpImage *image)
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
floating_sel = GIMP_LAYER (gimp_item_new_by_id (gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1))));
floating_sel = GIMP_LAYER (gimp_item_get_by_id (gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1))));
gimp_value_array_unref (return_vals);
......@@ -1362,7 +1362,7 @@ _gimp_image_get_floating_sel (gint32 image_ID)
* is attached to, if it exists. If it doesn't exist, -1 is returned as
* the drawable ID.
*
* Returns: (transfer full):
* Returns: (transfer none):
* The drawable the floating selection is attached to.
**/
GimpDrawable *
......@@ -1387,7 +1387,7 @@ gimp_image_floating_sel_attached_to (GimpImage *image)
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
drawable = GIMP_DRAWABLE (gimp_item_new_by_id (gimp_value_get_drawable_id (gimp_value_array_index (return_vals, 1))));
drawable = GIMP_DRAWABLE (gimp_item_get_by_id (gimp_value_get_drawable_id (gimp_value_array_index (return_vals, 1))));
gimp_value_array_unref (return_vals);
......@@ -1591,7 +1591,7 @@ _gimp_image_pick_color (gint32 image_ID,
* at the specified coordinates. This procedure will return -1 if no
* layer is found.
*
* Returns: (transfer full): The layer found at the specified coordinates.
* Returns: (transfer none): The layer found at the specified coordinates.
**/
GimpLayer *
gimp_image_pick_correlate_layer (GimpImage *image,
......@@ -1619,7 +1619,7 @@ gimp_image_pick_correlate_layer (GimpImage *image,
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
layer = GIMP_LAYER (gimp_item_new_by_id (gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1))));
layer = GIMP_LAYER (gimp_item_get_by_id (gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1))));
gimp_value_array_unref (return_vals);
......@@ -3360,7 +3360,7 @@ _gimp_image_reorder_item (gint32 image_ID,
* merging with the CLIP_TO_IMAGE merge type. Non-visible layers are
* discarded, and the resulting image is stripped of its alpha channel.
*
* Returns: (transfer full): The resulting layer.
* Returns: (transfer none): The resulting layer.
**/
GimpLayer *
gimp_image_flatten (GimpImage *image)
......@@ -3384,7 +3384,7 @@ gimp_image_flatten (GimpImage *image)
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
layer = GIMP_LAYER (gimp_item_new_by_id (gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1))));
layer = GIMP_LAYER (gimp_item_get_by_id (gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1))));
gimp_value_array_unref (return_vals);
......@@ -3447,7 +3447,7 @@ _gimp_image_flatten (gint32 image_ID)
* extents of the image. A merge type of CLIP_TO_BOTTOM_LAYER clips the
* final layer to the size of the bottommost layer.
*
* Returns: (transfer full): The resulting layer.
* Returns: (transfer none): The resulting layer.
**/
GimpLayer *
gimp_image_merge_visible_layers (GimpImage *image,
......@@ -3473,7 +3473,7 @@ gimp_image_merge_visible_layers (GimpImage *image,
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
layer = GIMP_LAYER (gimp_item_new_by_id (gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1))));
layer = GIMP_LAYER (gimp_item_get_by_id (gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1))));
gimp_value_array_unref (return_vals);
......@@ -3543,7 +3543,7 @@ _gimp_image_merge_visible_layers (gint32 image_ID,
* CLIP_TO_BOTTOM_LAYER clips the final layer to the size of the
* bottommost layer.
*
* Returns: (transfer full): The resulting layer.
* Returns: (transfer none): The resulting layer.
**/
GimpLayer *
gimp_image_merge_down (GimpImage *image,
......@@ -3571,7 +3571,7 @@ gimp_image_merge_down (GimpImage *image,
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
layer = GIMP_LAYER (gimp_item_new_by_id (gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1))));
layer = GIMP_LAYER (gimp_item_get_by_id (gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1))));
gimp_value_array_unref (return_vals);
......@@ -4063,7 +4063,7 @@ _gimp_image_thumbnail (GimpImage *image,
* 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 full): The active layer.
* Returns: (transfer none): The active layer.
**/
GimpLayer *
gimp_image_get_active_layer (GimpImage *image)
......@@ -4087,7 +4087,7 @@ gimp_image_get_active_layer (GimpImage *image)
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
active_layer = GIMP_LAYER (gimp_item_new_by_id (gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1))));
active_layer = GIMP_LAYER (gimp_item_get_by_id (gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1))));
gimp_value_array_unref (return_vals);
......@@ -4232,7 +4232,7 @@ _gimp_image_set_active_layer (gint32 image_ID,
* If there is an active channel, this will return the channel ID,
* otherwise, -1.
*
* Returns: (transfer full): The active channel.
* Returns: (transfer none): The active channel.
**/
GimpChannel *
gimp_image_get_active_channel (GimpImage *image)
......@@ -4256,7 +4256,7 @@ gimp_image_get_active_channel (GimpImage *image)
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
active_channel = GIMP_CHANNEL (gimp_item_new_by_id (gimp_value_get_channel_id (gimp_value_array_index (return_vals, 1))));
active_channel = GIMP_CHANNEL (gimp_item_get_by_id (gimp_value_get_channel_id (gimp_value_array_index (return_vals, 1))));
gimp_value_array_unref (return_vals);
......@@ -4399,7 +4399,7 @@ _gimp_image_set_active_channel (gint32 image_ID,
*
* If there is an active path, its ID will be returned, otherwise, -1.
*
* Returns: (transfer full): The active vectors.
* Returns: (transfer none): The active vectors.
**/
GimpVectors *
gimp_image_get_active_vectors (GimpImage *image)
......@@ -4423,7 +4423,7 @@ gimp_image_get_active_vectors (GimpImage *image)
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
active_vectors = GIMP_VECTORS (gimp_item_new_by_id (gimp_value_get_vectors_id (gimp_value_array_index (return_vals, 1))));
active_vectors = GIMP_VECTORS (gimp_item_get_by_id (gimp_value_get_vectors_id (gimp_value_array_index (return_vals, 1))));
gimp_value_array_unref (return_vals);
......@@ -4560,7 +4560,7 @@ _gimp_image_set_active_vectors (gint32 image_ID,
* This will always return a valid ID for a selection -- which is
* represented as a channel internally.
*
* Returns: (transfer full): The selection channel.
* Returns: (transfer none): The selection channel.
**/
GimpSelection *
gimp_image_get_selection (GimpImage *image)
......@@ -4584,7 +4584,7 @@ gimp_image_get_selection (GimpImage *image)
gimp_value_array_unref (args);
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
selection = GIMP_SELECTION (gimp_item_new_by_id (gimp_value_get_selection_id (gimp_value_array_index (return_vals, 1))));
selection = GIMP_SELECTION (gimp_item_get_by_id (gimp_value_get_selection_id (gimp_value_array_index (return_vals, 1))));
gimp_value_array_unref (return_vals);
......@@ -6191,7 +6191,7 @@ _gimp_image_set_tattoo_state (gint32 image_ID,
* This procedure returns the layer with the given tattoo in the
* specified image.
*
* Returns: (transfer full): The layer with the specified tattoo.
* Returns: (transfer none): The layer with the specified tattoo.
**/
GimpLayer *
gimp_image_get_layer_by_tattoo (GimpImage *image,
......@@ -6217,7 +6217,7 @@ gimp_image_get_layer_by_tattoo (GimpImage *image,
gimp_value_array_unref (args);