Hi,
this is my proposal for the lazy loading abiword plugins.
For now i think i will only implement the first part (see xml sample),
but for Luca, Martin and the other math people it might be interesting
to extend that.
The whole proposal is very limited and there are quirks, but i'll fix
as i go.
+ Every menu (in the menubar) has a default positon where hooks are
inserted. The default default position is at the bottom of the menu,
but e.g. the Tools menu might insert hooks right above the first
separator.
+ I would no more clutter the popup menu with plugins by default. It
should however be possible to explicitely hook popups. An example where
that would be needed is
http://bugzilla.abisource.com/show_bug.cgi?id=8306
+ Toolbars can also be hooked, the problem ATM is when to (dis)activate
the items. This is also a problem when doing something more complicated
than simple entries in the Tools menu.
The plugin loader takes care of creating all the entries described in
the xml file and is a proxy for all the callbacks. So it can load the
shared lib when it's needed for the first time. The connection between
code and xml description is made by using the ID attributes. The ID of
the activated entry is passed on to the plugin so it can dispatch
correctly.
Sidenote to Martin: if we lazily load the math plugin all equations
would have to be rendered using the snapshot first. Is it feasible that
switching to edit mode is so smooth that the user doesn't "feel" it?
Problems, Limitations:
- For now icons will probably not be loaded.
- We have no means of l10n for plugins. That's not good if we're
starting to use them more and more.
- I don't know yet if i can come up with a general solution for
activating/deactivating entries depending on the current context. At
least for now the plugin probably has to do that itself.
Best,
- Rob
<?xml version="1.0" ?>
<abiplugin>
<!-- Add entries to the "Tools" menu -->
<hook type="ABI_HOOK_MENU" for="Tools">
<entry id="1" title="Google Search"
icon="google.png"/>
<!-- more entries here -->
</hook>
<!-- Add entries to the popup menu for images -->
<hook type="ABI_HOOK_POPUP" for="Image">
<entry id="2" title="Edit with GIMP" icon="gimp.png"/>
<!-- more entries here -->
</hook>
<!-- Add entries to a toolbar -->
<hook type="ABI_HOOK_TOOLBAR" for="Extra">
<entry id="3" title="Google Search"
icon="google.png"/>
<!-- more entries here -->
</hook>
<!-- what else could be done (later ...) -->
<!-- so ignore this for now ... -->
<!-- define a toolbar -->
<toolbar name="Math">
<entry id="1" title="New Equation"
icon="new-math.png"/>
<entry id="2" title="Edit Equation"
icon="edit-math.png"/>
<entry type="separator"/>
<entry id="3" title="Superscript"
icon="superscript.png"/>
<entry id="4" title="Subscript" icon="subscript.png"/>
<entry type="separator"/>
<entry id="5" title="Subscript" icon="subscript.png"/>
</toolbar>
<!-- define a (popup)menu -->
<menu name="MathPopup">
<standard-entry name="cut" show="true"/>
<standard-entry name="copy" show="false"/>
<standard-entry name="paste" show="true"/>
<entry type="separator"/>
<!-- custom menu entries go here -->
</menu>
</abiplugin>
Received on Fri Feb 4 23:21:34 2005
This archive was generated by hypermail 2.1.8 : Fri Feb 04 2005 - 23:21:34 CET