## gimpitem

gimpitem — Functions to manipulate items.

## Synopsis

    gboolean            gimp_item_is_valid                  (gint32 item_ID);
    gint32              gimp_item_get_image                 (gint32 item_ID);
    gboolean            gimp_item_delete                    (gint32 item_ID);
    gboolean            gimp_item_is_drawable               (gint32 item_ID);
    gboolean            gimp_item_is_layer                  (gint32 item_ID);
    gboolean            gimp_item_is_text_layer             (gint32 item_ID);
    gboolean            gimp_item_is_channel                (gint32 item_ID);
    gboolean            gimp_item_is_layer_mask             (gint32 item_ID);
    gboolean            gimp_item_is_selection              (gint32 item_ID);
    gboolean            gimp_item_is_vectors                (gint32 item_ID);
    gboolean            gimp_item_is_group                  (gint32 item_ID);
    gint32              gimp_item_get_parent                (gint32 item_ID);
    gint *              gimp_item_get_children              (gint32 item_ID,
                                                             gint *num_children);
    gchar *             gimp_item_get_name                  (gint32 item_ID);
    gboolean            gimp_item_set_name                  (gint32 item_ID,
                                                             const gchar *name);
    gboolean            gimp_item_get_visible               (gint32 item_ID);
    gboolean            gimp_item_set_visible               (gint32 item_ID,
                                                             gboolean visible);
    gboolean            gimp_item_get_linked                (gint32 item_ID);
    gboolean            gimp_item_set_linked                (gint32 item_ID,
                                                             gboolean linked);
    gboolean            gimp_item_get_lock_content          (gint32 item_ID);
    gboolean            gimp_item_set_lock_content          (gint32 item_ID,
                                                             gboolean lock_content);
    gint                gimp_item_get_tattoo                (gint32 item_ID);
    gboolean            gimp_item_set_tattoo                (gint32 item_ID,
                                                             gint tattoo);
    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);

## Description

Functions to manipulate items.

## Details

### gimp_item_is_valid ()

    gboolean            gimp_item_is_valid                  (gint32 item_ID);

Returns TRUE if the item is valid.

This procedure checks if the given item ID is valid and refers to an existing item.

`item_ID` : | The item to check.
Returns : | Whether the item ID is valid.

Since GIMP 2.8

### gimp_item_get_image ()

    gint32              gimp_item_get_image                 (gint32 item_ID);

Returns the item's image.

This procedure returns the item's image.

`item_ID` : | The item.
Returns : | The item's image.

Since GIMP 2.8

### gimp_item_delete ()

    gboolean            gimp_item_delete                    (gint32 item_ID);

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.

`item_ID` : | The item to delete.
Returns : | TRUE on success.

Since GIMP 2.8

### gimp_item_is_drawable ()

    gboolean            gimp_item_is_drawable               (gint32 item_ID);

Returns whether the item is a drawable.

This procedure returns TRUE if the specified item is a drawable.

`item_ID` : | The item.
Returns : | TRUE if the item is a drawable, FALSE otherwise.

Since GIMP 2.8

### gimp_item_is_layer ()

    gboolean            gimp_item_is_layer                  (gint32 item_ID);

Returns whether the item is a layer.

This procedure returns TRUE if the specified item is a layer.

`item_ID` : | The item.
Returns : | TRUE if the item is a layer, FALSE otherwise.

Since GIMP 2.8

### gimp_item_is_text_layer ()

    gboolean            gimp_item_is_text_layer             (gint32 item_ID);

Returns whether the item is a text layer.

This procedure returns TRUE if the specified item is a text layer.

`item_ID` : | The item.
Returns : | TRUE if the item is a text layer, FALSE otherwise.

Since GIMP 2.8

### gimp_item_is_channel ()

    gboolean            gimp_item_is_channel                (gint32 item_ID);

Returns whether the item is a channel.

This procedure returns TRUE if the specified item is a channel.

`item_ID` : | The item.
Returns : | TRUE if the item is a channel, FALSE otherwise.

Since GIMP 2.8

### gimp_item_is_layer_mask ()

    gboolean            gimp_item_is_layer_mask             (gint32 item_ID);

Returns whether the item is a layer mask.

This procedure returns TRUE if the specified item is a layer mask.

`item_ID` : | The item.
Returns : | TRUE if the item is a layer mask, FALSE otherwise.

Since GIMP 2.8

### gimp_item_is_selection ()

    gboolean            gimp_item_is_selection              (gint32 item_ID);

Returns whether the item is a selection.

This procedure returns TRUE if the specified item is a selection.

`item_ID` : | The item.
Returns : | TRUE if the item is a selection, FALSE otherwise.

Since GIMP 2.8

### gimp_item_is_vectors ()

    gboolean            gimp_item_is_vectors                (gint32 item_ID);

Returns whether the item is a vectors.

This procedure returns TRUE if the specified item is a vectors.

`item_ID` : | The item.
Returns : | TRUE if the item is a vectors, FALSE otherwise.

Since GIMP 2.8

### gimp_item_is_group ()

    gboolean            gimp_item_is_group                  (gint32 item_ID);

Returns whether the item is a group item.

This procedure returns TRUE if the specified item is a group item which can have children.

`item_ID` : | The item.
Returns : | TRUE if the item is a group, FALSE otherwise.

Since GIMP 2.8

### gimp_item_get_parent ()

    gint32              gimp_item_get_parent                (gint32 item_ID);

Returns the item's parent item.

This procedure returns the item's parent item, if any.

`item_ID` : | The item.
Returns : | The item's parent item.

Since GIMP 2.8

### gimp_item_get_children ()

    gint *              gimp_item_get_children              (gint32 item_ID,
                                                             gint *num_children);

Returns the item's list of children.

This procedure returns the list of items which are children of the specified item. The order is topmost to bottommost.

`item_ID` : | The item.
`num_children` : | The item's number of children.
Returns : | The item's list of children.

Since GIMP 2.8

### gimp_item_get_name ()

    gchar *             gimp_item_get_name                  (gint32 item_ID);

Get the name of the specified item.

This procedure returns the specified item's name.

`item_ID` : | The item.
Returns : | The item name.

Since GIMP 2.8

### gimp_item_set_name ()

    gboolean            gimp_item_set_name                  (gint32 item_ID,
                                                             const gchar *name);

Set the name of the specified item.

This procedure sets the specified item's name.

`item_ID` : | The item.
`name` : | The new item name.
Returns : | TRUE on success.

Since GIMP 2.8

### gimp_item_get_visible ()

    gboolean            gimp_item_get_visible               (gint32 item_ID);

Get the visibility of the specified item.

This procedure returns the specified item's visibility.

`item_ID` : | The item.
Returns : | The item visibility.

Since GIMP 2.8

### gimp_item_set_visible ()

    gboolean            gimp_item_set_visible               (gint32 item_ID,
                                                             gboolean visible);

Set the visibility of the specified item.

This procedure sets the specified item's visibility.

`item_ID` : | The item.
`visible` : | The new item visibility.
Returns : | TRUE on success.

Since GIMP 2.8

### gimp_item_get_linked ()

    gboolean            gimp_item_get_linked                (gint32 item_ID);

Get the linked state of the specified item.

This procedure returns the specified item's linked state.

`item_ID` : | The item.
Returns : | The item linked state (for moves).

Since GIMP 2.8

### gimp_item_set_linked ()

    gboolean            gimp_item_set_linked                (gint32 item_ID,
                                                             gboolean linked);

Set the linked state of the specified item.

This procedure sets the specified item's linked state.

`item_ID` : | The item.
`linked` : | The new item linked state.
Returns : | TRUE on success.

Since GIMP 2.8

### gimp_item_get_lock_content ()

    gboolean            gimp_item_get_lock_content          (gint32 item_ID);

Get the 'lock content' state of the specified item.

This procedure returns the specified item's lock content state.

`item_ID` : | The item.
Returns : | Whether the item's contents are locked.

Since GIMP 2.8

### gimp_item_set_lock_content ()

    gboolean            gimp_item_set_lock_content          (gint32 item_ID,
                                                             gboolean lock_content);

Set the 'lock content' state of the specified item.

This procedure sets the specified item's lock content state.

`item_ID` : | The item.
`lock_content` : | The new item 'lock content' state.
Returns : | TRUE on success.

Since GIMP 2.8

### gimp_item_get_tattoo ()

    gint                gimp_item_get_tattoo                (gint32 item_ID);

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.

`item_ID` : | The item.
Returns : | The item tattoo.

Since GIMP 2.8

### gimp_item_set_tattoo ()

    gboolean            gimp_item_set_tattoo                (gint32 item_ID,
                                                             gint 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.

`item_ID` : | The item.
`tattoo` : | The new item tattoo.
Returns : | TRUE on success.

Since GIMP 2.8

### gimp_item_attach_parasite ()

    gboolean            gimp_item_attach_parasite           (gint32 item_ID,
                                                             const GimpParasite *parasite);

Add a parasite to an item.

This procedure attaches a parasite to an item. It has no return values.

`item_ID` : | The item.
`parasite` : | The parasite to attach to the item.
Returns : | TRUE on success.

Since GIMP 2.8

### gimp_item_detach_parasite ()

    gboolean            gimp_item_detach_parasite           (gint32 item_ID,
                                                             const gchar *name);

Removes a parasite from an item.

This procedure detaches a parasite from an item. It has no return values.

`item_ID` : | The item.
`name` : | The name of the parasite to detach from the item.
Returns : | TRUE on success.

Since GIMP 2.8

### gimp_item_get_parasite ()

    GimpParasite *      gimp_item_get_parasite              (gint32 item_ID,
                                                             const gchar *name);

Look up a parasite in an item

Finds and returns the parasite that is attached to an item.

`item_ID` : | The item.
`name` : | The name of the parasite to find.
Returns : | The found parasite.

Since GIMP 2.8

### gimp_item_get_parasite_list ()

    gchar **            gimp_item_get_parasite_list         (gint32 item_ID,
                                                             gint *num_parasites);

List all parasites.

Returns a list of all parasites currently attached the an item.

`item_ID` : | The item.
`num_parasites` : | The number of attached parasites.
Returns : | The names of currently attached parasites.

Since GIMP 2.8