I've pushed a simple plugin framework to

https://gitorious.org/~achadwick/mypaint/achadwick-mypaint/commits/plugins

temporarily. Can I get some quick code review / opinions about whether
this is the right approach? I figured based on what Maxy said that
plugins would hook objects and callbacks into the running app via API
calls, accessed via the app singleton, but suggestions about how to
expose the entire Python API as an importable thing in plugin code via
a nice module name would be most welcome :-)

Plugins should be fairly safe, and not bomb out the application due to
ImportErrors during plugin activation and deactivation. This means
that MyPaint itself doesn't need to depend on some random lib just to
get extra functionality with an optional core plugin - the plugin
activation will just be observed to fail to load. We could perhaps do
with more feedback for the user, but the little dialog in the above
branch seems to work for now.

One thing it might be nice to break out into our first set of core
plugins would be a file format mini-API, for filehandling.py. Consider
a layered .PSD loader done with PIL or something else:
http://stackoverflow.com/questions/6759459/python-psd-layers has a
quick HOWTO.

Fancy extra tool subwindows, actions, overlays and modes would be nice
to make pluggable eventually.

Selection buffers and other things that look like layers might be
tricky :) Still, we already have a couple of special layers; perhaps
somebody who understands that bit of the code could make a selection
tool for slicing and dicing.

Is there anything else that's sort of optional that could be stripped
out of the static code code and into a plugin module?

-- 
Andrew Chadwick

_______________________________________________
Mypaint-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/mypaint-discuss

Reply via email to