Provide an plugin system

Registered by Rafal Wokacz

Plugin system should cover:
1. Tools (inc. brushes, shapes, selections, whatever else),
2. Filters

Plugin system should provide an unified process for implementing plugins, including customized plugin settings.

Blueprint information

Status:
Started
Approver:
None
Priority:
High
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
Review
Series goal:
Accepted for trunk
Implementation:
Beta Available
Milestone target:
milestone icon chihiro
Started by
janisozaur

Whiteboard

[2010-08-18] The proposal
Actual plugin system offers plugin types which are seem to be more like a tool specific types(brush, shape) along with tool specific features. But among them there is an filter type which does not fit to the others. In effect the Plugin becomes excessively narrowed and a little mashed.
Therefore the Plugin should be more general and should not constraint derivates in matter of types.
The basic core derivatives (provided by carto-core-plugin-system) would define a plugin type by it self and should provide more specific distinction if needed, including Plugin interface methods.

A sample class definition hierarchy:
Plugin definition provides an API for meta-data information.

Filter : Plugin provides a filter specific API including:
 * filter types if needed
 * filter settings API for implementing a filter specific settings (including UI)

Tool : Plugin provides a tool specific API including:
 * tool types if needed
 * tool settings API for implementing a tool specific settings (including UI)

Any other plugin type would appended as an derivative from Plugin
Tool or Filter (or other plugin) would be extended with new type along with corresponding interface.

----------------------------------------
rawo[2010-08-23] sample 'code'

Plugin{name,version, author,url, description}

Tool : Plugin {
  typedef enum ToolType{
    Brush = 0x0, //all type of drawing tools, including rubber
    Shape = 0x1, // tools allowing to draw a shapes, lines
    Select = 0x2, //any kind of selections, i.e. magic wand, square selection, elipse selection, etc.
    Fill = 0x4, // tools that fill the image, like bucket, gradient fill, etc.
    View = 0x8, //zoom, freehand - moving the image in scroll view.

  } ToolType;

  typedef enum ToolFeature{
    NoFeateure = 0x0,
    SizeChange = 0x1,
    ColorChange = 0x2,
    AlphaChange = 0x4,
    AntiAliasing = 0x8,
    AllFeatuers = 0xFFFFFF // everywhere 1
  } ToolFeature;

  //common events for all Tools
  onPressEvent(const QUuid &brush, QImage &image, QPainter &painter,QInputEvent *in)
  onMoveEvent(const QUuid &brush, QImage &image, QPainter &painter,QInputEvent *prev, QInputEvent *new)
  onReleaseEvent(const QUuid &brush, QImage &image, QPainter &painter,QInputEvent *in)

  //settings dialog should provide an container which could be freely filled with settings
  //specific for a given tool
  //a &container would be the container for qwidgets representing a bunch off settings
  getSettings(UiToolSettingsContainer &container)

}

Filter : Plugin {
   getSettings(UiFilterSettingsContainer &container)
   executeFilter(QImage &image)
}

What do you think about this?

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.