gimpedit

gimpedit — Edit menu functions (cut, copy, paste, clear, etc.)

Functions

Description

Edit menu functions (cut, copy, paste, clear, etc.)

Functions

gimp_edit_cut ()

gboolean
gimp_edit_cut (gint num_drawables,
               const GimpItem **drawables);

Cut from the specified drawables.

If there is a selection in the image, then the area specified by the selection is cut from the specified drawables and placed in an internal GIMP edit buffer. It can subsequently be retrieved using the gimp_edit_paste() command. If there is no selection and only one specified drawable, 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 drawables and there is nothing to cut from.

Parameters

num_drawables

The number of drawables.

 

drawables

The drawables to cut from.

[array length=num_drawables][element-type GimpItem]

Returns

TRUE if the cut was successful, FALSE if there was nothing to copy from.


gimp_edit_copy ()

gboolean
gimp_edit_copy (gint num_drawables,
                const GimpItem **drawables);

Copy from the specified drawables.

If there is a selection in the image, then the area specified by the selection is copied from the specified drawables 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 drawables' 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 drawables and there is nothing to copy from. All the drawables must belong to the same image.

Parameters

num_drawables

The number of drawables to save.

 

drawables

Drawables to copy from.

[array length=num_drawables][element-type GimpItem]

Returns

TRUE if the cut was successful, FALSE if there was nothing to copy from.


gimp_edit_copy_visible ()

gboolean
gimp_edit_copy_visible (GimpImage *image);

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.

Parameters

image

The image to copy from.

 

Returns

TRUE if the copy was successful.

Since: 2.2


gimp_edit_paste ()

GimpLayer *
gimp_edit_paste (GimpDrawable *drawable,
                 gboolean paste_into);

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.

Parameters

drawable

The drawable to paste to.

 

paste_into

Clear selection, or paste behind it?

 

Returns

The new floating selection.

[transfer none]


gimp_edit_paste_as_new_image ()

GimpImage *
gimp_edit_paste_as_new_image (void);

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.

[transfer none]

Since: 2.10


gimp_edit_named_cut ()

gchar *
gimp_edit_named_cut (gint num_drawables,
                     const GimpItem **drawables,
                     const gchar *buffer_name);

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.

Parameters

num_drawables

The number of drawables.

 

drawables

The drawables to cut from.

[array length=num_drawables][element-type GimpItem]

buffer_name

The name of the buffer to create.

 

Returns

The real name given to the buffer, or NULL if the cut failed. The returned value must be freed with g_free().

[transfer full]

Since: 2.4


gimp_edit_named_copy ()

gchar *
gimp_edit_named_copy (gint num_drawables,
                      const GimpItem **drawables,
                      const gchar *buffer_name);

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.

Parameters

num_drawables

The number of drawables.

 

drawables

The drawables to copy from.

[array length=num_drawables][element-type GimpItem]

buffer_name

The name of the buffer to create.

 

Returns

The real name given to the buffer, or NULL if the copy failed. The returned value must be freed with g_free().

[transfer full]

Since: 2.4


gimp_edit_named_copy_visible ()

gchar *
gimp_edit_named_copy_visible (GimpImage *image,
                              const gchar *buffer_name);

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.

Parameters

image

The image to copy from.

 

buffer_name

The name of the buffer to create.

 

Returns

The real name given to the buffer, or NULL if the copy failed. The returned value must be freed with g_free().

[transfer full]

Since: 2.4


gimp_edit_named_paste ()

GimpLayer *
gimp_edit_named_paste (GimpDrawable *drawable,
                       const gchar *buffer_name,
                       gboolean paste_into);

Paste named buffer to the specified drawable.

This procedure works like gimp_edit_paste() but pastes a named buffer instead of the global buffer.

Parameters

drawable

The drawable to paste to.

 

buffer_name

The name of the buffer to paste.

 

paste_into

Clear selection, or paste behind it?

 

Returns

The new floating selection.

[transfer none]

Since: 2.4


gimp_edit_named_paste_as_new_image ()

GimpImage *
gimp_edit_named_paste_as_new_image (const gchar *buffer_name);

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.

Parameters

buffer_name

The name of the buffer to paste.

 

Returns

The new image.

[transfer none]

Since: 2.10