As of version 0.93, tkoutline supports loading a user-defined script at startup. With this script the opportunity exists to execute user-defined code at two different points in the startup process. First, after all the tkoutline code has been loaded, but before it has been executed. Second, after all the startup code has been executed.
Given the dynamic nature of the Tcl languange, these two points of leverage make it theoretically possible to change anything and everything about the way tkoutline behaves. In practice, none of it is documented yet and it may therefore be difficult to do some of the more extreme modifications.
So in version 0.93, it is possible to make modifications to your startup script and load some functionality that can be considered a "plugin". Having to modify a startup script is unacceptable as a manner to install plugins and so I plan to improve the architecture in the next release.
Intended features of the future plugin architecture
- Location of plugins will be configurable via the preferences file.
- It will be possible to wrap multi-file plugins into a single file (ala starkits).
- It will be possible to use/develop/test plugins extracted into the normal file system (i.e. not wrapped into a single file).
- It will be possible to wrap multiple plugins into a single file.
- It will be possible to wrap plugins into the single file tkoutline distribution without changing any of the plugin source code.
- It will be possible to disable plugins even if the source code for that plugin is still present.
Current status of plugin architecture - as of 11/26/2004
No friendly gui or api for adding and removing plugins exists, however via manual steps, all of the above features are available.
Placeholders for some notes on how it works
- Plugins are based on the standard Tcl package mechanism. A plugins is a Tcl packages whose name is prefixed by tkoutlineplugin::. (i.e. tkoutlineplugin::foo would represent plugin foo).
- If a plugin package is found by the normal Tcl package search mechanism, then it will be automatically loaded upon tkoutline startup
- A plugin's functions beforeInit and afterInit will be executed before and after tkoutline intitialization respectively (i.e. for plugin foo, the functions ::tkoutlineplugin::foo::beforeInit and ::tkoutlineplugin::foo::afterInit will be executed).
- An entry in the preferences file (*pluginPaths) lists directories or files. Each directory listed will be added to the Tcl package search path (::auto_path). Each file listed will be sourced. It is expected but not required that such a file is a starkit that when sourced will cause itself to be mounted and it will extend the Tcl package search path to include the internal libraries.
- An entry in the preferences file (*disablePlugins) lists the names of plugins packages not to automatically load at startup.
This documentation is just a start and much more is needed--both from the perspective of a plugin user and from the perspective of a plugin developer.