<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
  <name>Export Layer Slices</name>
  <id>org.inkscape.output.export_slices</id>
  <param name="tab" type="notebook">
    <page name="slicer_tab" gui-text="Options">
      <param name="iconmode" type="bool" gui-text="Icon mode">false</param>
      <param name="sizes" type="string" gui-text="Sizes">128, 64, 48, 32, 24, 16</param>
      <param name="layer" type="string" gui-text="Layer with Slices:">slices</param>
      <param name="overwrite" type="bool" gui-text="Overwrite existing exports">true</param>
      <param name="directory" type="path" mode="folder" gui-text="Directory"></param>
      <param name="dpi" type="string" gui-text="DPI">300</param>
    </page>
    <page name="about_tab" gui-text="About">
      <label appearance="header">Layer Slicer</label>
      <label>If you create a layer (default name "slices") with rectangles in it, this extension will export a PNG file for each rectangle into the directory with the name of the {rectangle ID}.png (use Object Properties to set this).</label>
      <label>If the export already exists, it will skip it and color the rectangle GREY. If the "Overwrite existing exports" checkbox is selected, and the file was previously generated, it will color the rectangle RED. For new exports that did not previously exist, the rectangle will be GREEN.</label>
      <label>If you want to create (square) icons at different sizes, select "Icon mode". Icon mode will create a square export for each dimension in "Sizes".</label>

    </page>
  </param>


  <!-- Live preview doesn't make sense so we add this attribute to
       remove it -->
  <effect needs-live-preview="false">
    <object-type>all</object-type>
    <effects-menu>
      <submenu name="Export"/>
    </effects-menu>
  </effect>

  <script>
    <command location="inx" interpreter="python">layer2png.py</command>
  </script>
</inkscape-extension>
