<?xml version="1.0"?>
<page id="Gimp.SaveProcedure.new"
      type="topic"
      style="constructor"
      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.SaveProcedure" group="constructor" type="guide"/>
    <api:function>
      <api:returns>
        <api:type>Gimp.Procedure</api:type>
      </api:returns>
      <api:name>gimp_save_procedure_new</api:name>
      <api:arg>
        <api:type>Gimp.PlugIn</api:type>
        <api:name>plug_in</api:name>
      </api:arg>
      <api:arg>
        <api:type>String</api:type>
        <api:name>name</api:name>
      </api:arg>
      <api:arg>
        <api:type>Gimp.PDBProcType</api:type>
        <api:name>proc_type</api:name>
      </api:arg>
      <api:arg>
        <api:type>Boolean</api:type>
        <api:name>export_metadata</api:name>
      </api:arg>
      <api:arg>
        <api:type>Gimp.RunSaveFunc</api:type>
        <api:name>run_func</api:name>
      </api:arg>
    </api:function>
  </info>
  <title>Gimp.SaveProcedure.new</title>
  <synopsis><code mime="text/x-gjs">
function new(plug_in: <link xref="Gimp.PlugIn">Gimp.PlugIn</link>, name: String, proc_type: <link xref="Gimp.PDBProcType">Gimp.PDBProcType</link>, export_metadata: Boolean, run_func: <link xref="Gimp.RunSaveFunc">Gimp.RunSaveFunc</link>): <link xref="Gimp.Procedure">Gimp.Procedure</link> {
    // Gjs wrapper for gimp_save_procedure_new()
}
  </code></synopsis>
  <p>Creates a new save procedure named <code>name</code> which will call <code>run_func</code>
when invoked.</p>  <p>See <link xref="Gimp.Procedure.new"/> for information about <code>proc_type</code>.</p>  <p><link xref="Gimp.SaveProcedure"/> is a <link xref="Gimp.Procedure"/> subclass that makes it easier
to write file save procedures.</p>  <p>It automatically adds the standard</p>  <p>(<link xref="Gimp.RunMode"/>, <link xref="Gimp.Image"/>, <link xref="Gimp.Drawable"/>, <link href="../Gio-2.0/Gio.File.html">Gio.File</link>)</p>  <p>arguments of a save procedure. It is possible to add additional
arguments.</p>  <p>When invoked via <link xref="Gimp.Procedure.run"/>, it unpacks these standard
arguments and calls <code>run_func</code> which is a <link xref="Gimp.RunSaveFunc"/>. The
<link xref="Gimp.ProcedureConfig"/> of <link xref="Gimp.RunSaveFunc"/> only contains additionally added
arguments.</p>  <p>If <code>export_metadata</code> is TRUE, then the class will also handle the metadata
export if the format is supported by our backend. This requires you to also
set appropriate MimeType with <link xref="Gimp.FileProcedure.set_mime_types"/>.</p>
  <p>Since 3.0</p>
<terms>
<item>
<title><code>plug_in</code></title>
  <p>a <link xref="Gimp.PlugIn"/>.</p>
</item>
<item>
<title><code>name</code></title>
  <p>the new procedure's name.</p>
</item>
<item>
<title><code>proc_type</code></title>
  <p>the new procedure's <link xref="Gimp.PDBProcType"/>.</p>
</item>
<item>
<title><code>export_metadata</code></title>
  <p>whether GIMP should handle metadata exporting.</p>
</item>
<item>
<title><code>run_func</code></title>
  <p>the run function for the new procedure.</p>
</item>
<item>
<title><code>Returns</code></title>
  <p>a new <link xref="Gimp.Procedure"/>.</p>
</item>
</terms>

</page>
