<?xml version="1.0"?>
<page id="Gimp.edit_paste"
      type="topic"
      style="function"
      xmlns="http://projectmallard.org/1.0/"
      xmlns:api="http://projectmallard.org/experimental/api/"
      xmlns:ui="http://projectmallard.org/1.0/ui/">
  <info>
    <link xref="index" group="function" type="guide"/>
    <api:function>
      <api:returns>
        <api:type>Array(Gimp.Layer)</api:type>
      </api:returns>
      <api:name>gimp_edit_paste</api:name>
      <api:arg>
        <api:type>Gimp.Drawable</api:type>
        <api:name>drawable</api:name>
      </api:arg>
      <api:arg>
        <api:type>Boolean</api:type>
        <api:name>paste_into</api:name>
      </api:arg>
    </api:function>
  </info>
  <title>Gimp.edit_paste</title>
  <synopsis><code mime="text/x-gjs">
function edit_paste(drawable: <link xref="Gimp.Drawable">Gimp.Drawable</link>, paste_into: Boolean): [return_value: Array(<link xref="Gimp.Layer">Gimp.Layer</link>), num_layers: Number(gint)] {
    // Gjs wrapper for gimp_edit_paste()
}
  </code></synopsis>
  <p>Paste buffer to the specified drawable.</p>  <p>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 <link xref="Gimp.edit_cut"/> or <link xref="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 data may be a floating selection when
relevant, layers otherwise. 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 layers (floating or not). If the
result is a floating selection, it will already be attached to the
specified drawable, and a subsequent call to floating_sel_attach is
not needed.</p>

<terms>
<item>
<title><code>drawable</code></title>
  <p>The drawable to paste to.</p>
</item>
<item>
<title><code>paste_into</code></title>
  <p>Clear selection, or paste behind it?</p>
</item>
<item>
<title><code>return_value</code></title>
  <p>
         The list of pasted layers.
         The returned value must be freed with g_free().</p>
</item>
<item>
<title><code>num_layers</code></title>
  <p>The newly pasted layers.</p>
</item>
</terms>

</page>
