<?xml version="1.0"?>
<page id="Gimp.Image.insert_layer"
      type="topic"
      style="method"
      xmlns="http://projectmallard.org/1.0/"
      xmlns:api="http://projectmallard.org/experimental/api/"
      xmlns:ui="http://projectmallard.org/1.0/ui/">
  <info>
    <link xref="Gimp.Image" group="method" type="guide"/>
    <api:function>
      <api:returns>
        <api:type>Boolean</api:type>
      </api:returns>
      <api:name>gimp_image_insert_layer</api:name>
      <api:arg>
        <api:type>Gimp.Layer</api:type>
        <api:name>layer</api:name>
      </api:arg>
      <api:arg>
        <api:type>Gimp.Layer</api:type>
        <api:name>parent</api:name>
      </api:arg>
      <api:arg>
        <api:type>Number(gint)</api:type>
        <api:name>position</api:name>
      </api:arg>
    </api:function>
  </info>
  <title>Gimp.Image.prototype.insert_layer</title>
  <synopsis><code mime="text/x-gjs">
function insert_layer(layer: <link xref="Gimp.Layer">Gimp.Layer</link>, parent: <link xref="Gimp.Layer">Gimp.Layer</link>, position: Number(gint)): Boolean {
    // Gjs wrapper for gimp_image_insert_layer()
}
  </code></synopsis>
  <p>Add the specified layer to the image.</p>  <p>This procedure adds the specified layer to the image at the given
position. If the specified parent is a valid layer group (See
<link xref="Gimp.Item.is_group"/> and gimp_layer_group_new()) then the layer is
added inside the group. If the parent is 0, the layer is added
inside the main stack, outside of any group. The position argument
specifies the location of the layer inside the stack (or the group,
if a valid parent was supplied), starting from the top (0) and
increasing. If the position is specified as -1 and the parent is
specified as 0, then the layer is inserted above the active layer,
or inside the group if the active layer is a layer group. The layer
type must be compatible with the image base type.</p>

<terms>
<item>
<title><code>layer</code></title>
  <p>The layer.</p>
</item>
<item>
<title><code>parent</code></title>
  <p>The parent layer.</p>
</item>
<item>
<title><code>position</code></title>
  <p>The layer position.</p>
</item>
<item>
<title><code>Returns</code></title>
  <p>TRUE on success.</p>
</item>
</terms>

</page>
