Difference between revisions of "Extension architecture proposals"

From Inkscape Wiki
Jump to navigation Jump to search
 
Line 17: Line 17:
* Access to currently loaded documents
* Access to currently loaded documents
* Ability to load/print/save/close documents
* Ability to load/print/save/close documents
*** SPDocument * sp_file_open (gchar * uri, Inkscape::Extension::Input * ext)
*** bool sp_file_save (SPDocument * doc, gchar * uri, Inkscape::Extension::Output * ext)
*** bool sp_print_doc (SPDOcument * doc)
* Access to the document's SVG object hierarchy
* Access to the document's SVG object hierarchy
** Get all SVG id's, retrieve object struct/hash corresponding to id
** Get all SVG id's, retrieve object struct/hash corresponding to id

Revision as of 06:09, 6 April 2004

Please place your extension architecture proposals here. Everyone will review them and we will decided a course of action after we release 0.38.


Terminology

  • Extension - An extension is something that extends the functionality of Inkscape without being directly part of the core. This implies that it shoule be easy to remove or add, and nothing in the core should depend on it directly.
  • Plug-in - An extension that is implemented through a loadable library. This is a .o file on Unix-like systems or a .dll on Win32. The libraries should not be loaded until they are used.
    • PlugIns discussion
  • Script - A script is a type of extension that is implemented through an external program that recieves and sets SVG data through files and pipes. This allows Inkscape to use programs that handle SVG but are targeted differently seemlessly inside of Inkscape.
    • ScriptingLanguages discussion
  • Module - As far as I am aware the only definition of this word in Inkscape is that it was previously used to describe an extension. The word is deprecated ;)

Inkscape Extension API

Describe things that one may want to use the API for:

  • Access to currently loaded documents
  • Ability to load/print/save/close documents
      • SPDocument * sp_file_open (gchar * uri, Inkscape::Extension::Input * ext)
      • bool sp_file_save (SPDocument * doc, gchar * uri, Inkscape::Extension::Output * ext)
      • bool sp_print_doc (SPDOcument * doc)
  • Access to the document's SVG object hierarchy
    • Get all SVG id's, retrieve object struct/hash corresponding to id
    • Getting/setting attributes
    • Getting/setting children
  • Access to all Inkscape verbs
  • Access to preferences
  • Access to global def's
    • Gradients
    • Markers
    • Patterns
  • Access to share resources (clipart, templates, etc.)
  • Extension based variables

These are the variables that control settings for the individual extension. Things that are held internally, but should be saved with the Inkscape preferences. These are:

      • get_param (gchar * name, [bool, int, gchar *] data)

This function gets the variable by the name 'name' with the data in 'data'. It can be a boolean, integer or a string.

      • set_param (gchar * name, [bool, int, gchar *] data)

This function sets the variable by the name 'name' with the data in 'data'. It can be a boolean, integer or a string. In the case of the string it is copied.



For examples of API functions, see the perl SVG, SVG::DOM, et al modules

Inkscape Extension Archive Network

Initially, distributing extensions with Inkscape itself will be okay but ultimately for them to truly be extensions they should exist external to the core Inkscape project, which means we need some way to receive and manage contributions. Perl's CPAN provides an excellent model for how this type of module-contribution system can be made to work. Some important characteristics of CPAN worth adopting here:

  * Indexes of best items are available (e.g. 'best of')
  * Redundant modules are tolerated
  * Automate testing of included test suites on various platforms
  * Naming requirements to be included in indexes
  * Removal of malicious items
  * Manual application for user id on the system
  * Documentation for each module is online and nicely formatted
  * Integrated bug tracking system
  * Need to divide 'development' and 'stable'
  * Need to identify poor style, over-complexity.
  * Feedback to author should be personal so avoids public ranting
  * Use of review forms instead of freeform feedback?
  * Use of per-module discussion forums?
  * Establish forum for thanks and positive feedback
  * Like freshmeat/sourceforge, report on # downloads, vitality, etc.


Proposals

Are there any proposals yet?