On Wed, 2005-02-02 at 18:37 +0100, Robert Staudinger wrote:
> Hi,
>
> the attached patch against HEAD does the following:
> * Makes XAP_ModuleManager a subclass of XAP_ModuleFactory (previously
> introduced) [1]
> * Adds
> + bool XAP_ModuleManager::registerFactory (XAP_ModuleFactory *
> pFactory)
> + bool XAP_ModuleManager::unregisterFactory (XAP_ModuleFactory *
> pFactory)
> this methods can be used by plugins to hook in their own subclasses
> of XAP_ModuleFactory
> * Modifies XAP_Module, XAP_UnixModule so they can be instantiated by
> plugins
>
> The demo plugin "UserPluginLoader" is a (useless) sample of what a
> plugin loader can do. It hooks into the ModuleManager and loads plugins
> if the path starts with "/home/". This functionality is of course
> already present in abiword itself. The attached tarball can just be
> dropped into "abiword-plugins/wp/tools/" and unpacked.
> If the plugin "UserPluginLoader" is deactivated in the "Tools" ->
> "Plugins" dialog all plugins loaded by it are unloaded as well.
>
> An alternative (more useful) plugin would load all "its" plugins when it
> is itself loaded. This will be the next step if i get a "go ahead" from
> you.
>
Hi Robert,
This sound like it is just what I wanted for the GtkMathView
but let me see if I understand....
What I want is a way register a plugin that can then create a new class
linked to gtkMathView, without gtkmathview being linked to the plugin.
GtkMathView is quite a large program and I would really rather only load
it, if it is actually needed for some maths.
Right now I have a method..
GR_EmbedManager * GR_MathManager::create(GR_Graphics * pG)
{
return static_cast<GR_EmbedManager *>(new GR_MathManager(pG));
}
GR_MathManager is linked against GtkMathView.
With this new code is it possible to have a method..
GR_Embedmanager * GR_DummyMathManager::create(GR_Graphics * pG)
{
if(mathManagerUnloaded())
{
loadMathManager();
return static_cast<GR_EmbedManager *>(getMthManager()-
>create(pG));
}
return static_cast<GR_EmbedManager *>(getMathManager()->create(pG));
}
What would loadMathManager() look like?
My vision is that getMathManager() would return a GR_MathManager *
pointer cast to GR_EmbedManager.
Thanks!
Martin
> Best,
> - Rob
>
> [1] This can of course be reverted if the patch should be rejected.
Received on Thu Feb 3 04:49:32 2005
This archive was generated by hypermail 2.1.8 : Thu Feb 03 2005 - 04:49:32 CET