gnc_plugins
David Hampton
hampton at employees.org
Fri Dec 31 14:05:48 EST 2004
On Fri, 2004-12-31 at 13:21 -0500, Derek Atkins wrote:
> Chris Shoemaker <c.shoemaker at cox.net> writes:
>
> > I noticed that there are (at least) two ways that GncPlugins are added
> > to the GncPluginManager:
> > 1) in gnc_gui_init() in top-level.c: gnc_plugin_manager_add_plugin
> > is called explictly. (with a comment about removing this usage)
> > 2) sometime before gnc_gui_init() is called, several other plugins
> > are added, e.g. stylesheets. I'm not really sure how, but I think it
> > comes from scheme-land, e.g. perhaps: (load-module
> > "gnucash/report/stylesheets" 0 #f) ? (which also has a comment about
> > eventually making modules loaded automatically instead of statically)
> >
> > So, what's the right way of adding plugins to the plugin manager.
> > Keep in mind I'm considering a plugin that doesn't (currently) have
> > any scm component.
There's a fair number of sections of gnucash that are initialized from
scheme land. This is a holdover from the direction of an earlier group
of developers. If you code is structured as a module, the best place to
call the plugin manager is from the module init routine.
> > And, while I'm asking about gui stuff... what about gncPlugins
> > vs. gnc_menu_extenstion_ stuff? All the Reports menu stuff uses
> > gnc_menu_extensions and no gncPlugin at all.
>
> gncPlugin is a new-in-g2 api; the gnc_menu_extension is the older
> interface. There's no reason to use one vs. the other as far as I
> know.
gncPlugin creates menu items that exist in all top level windows.
gncPluginPage creates menus that apply only to a particular page within
a window. Using the plugins (and underlying action objects) its easier
to enable/disable menu/toolbar items that it is with the
gnc_menu_extension interface.
David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20041231/89fdeb34/attachment.bin
More information about the gnucash-devel
mailing list