INX extension descriptor format

From Inkscape Wiki
Revision as of 13:48, 13 October 2006 by 12.47.42.226 (talk)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

How an extension must work and how to write an INX file.

It's only an working draft!

About the Inkscape Extension Interface

The inkscape call a program with some arguments and as the last argumet it tells to the extension program where is the temporay SVG file to do the work. The temporay SVG file represents the actual state of the working SVG.

After the extension program work it writes the modified SVG to the default output, the Inkscape get this and update the SVG for the user.

An Inkscape Developer can say it better...


How an Extension Must Work

  • Recive the inkscape arguments.
  • Clear temp files if it creates one.
  • Write full changed SVG to the default output.
  • Don't break an xml:space="preserve" area.
  • Send error text to the error output and help the user.

An Inkscape Developer can say more?


How to Write an INX File

Example:

 <inkscape-extension>
   <_name>{Friendly Extension Name}</_name>
   <id>{org.domain.sub-domain.extension-name}</id>
     <dependency type="executable"
                 location="[extensions|{location}]">program.ext</dependency>
     <param name="{argumentName}" type="[int|float|string]"
            min="{number}" max="{number}"
            _gui-text="{Friendly Argument Name}">{default value}</param>
   <effect>
     <object-type>[all|{element type}]</object-type>
       <effects-menu>
         <submenu _name="{Extension Group Name}"/>
       </effects-menu>
   </effect>
   <script>
     <command reldir="extensions"
              interpreter="[python|perl|bash|{some other}]">program.ext</command>
   </script>
 </inkscape-extension>

See Also

ScriptingHOWTO