Re: [anjuta-devel] Adding some filtering mechanism for plugin



Hi,


It takes quite some time but I'm still working on a way to load different set of plugins in anjuta. I have mostly done the following changes.


* You can specify a different profile on the command line by using -P profile_name. Anjuta will look for the file /usr/local/share/anjuta/profile/profile_name.profile instead of /usr/local/share/anjuta/profile/default.profile and will load all the plugins define here.


* All the plugins defined in the first profile as defined above, are tagged as core plugins and are not unloaded when a new profile is loaded (= when a new project is loaded).


* In the profile file, you can add a filter element to keep only plugins matching some attributes. If you don't have any filter element in your profile file, by default all plugins are enabled. It looks like the following:
<?xml version="1.0"?>
<anjuta>
    <plugin name="File Loader" url="http://anjuta.org/plugins/";>
<require group="Anjuta Plugin" attribute="Interfaces" value="IAnjutaFileLoader"/>
    </plugin>
    <plugin name="Document Manager" url="http://anjuta.org/plugins/";>
<require group="Anjuta Plugin" attribute="Interfaces" value="IAnjutaDocumentManager"/>
    </plugin>
    <filter>
        <require group="Anjuta Profile" attribute="Editor" value="yes"/>
    </filter>
</anjuta>
With such profile, only the plugins containing Editor=yes in the group Anjuta Profile in their description will be used. And at least both the file loader and the document manager need it.


* I plan to another set element in the profile file, in order to add attributes in the plugin description. This element can be put in any filter or plugin element and will affect all matching plugins. My goal is to be able to tune a plugin based on the profile. The main example, is to restrict the project wizard plugin to display only GNOME related templates if the profile is the GNOME IDE. So we can get something like:
<?xml version="1.0"?>
<anjuta>
    ...
    <filter>
        <require group="Anjuta Profile" attribute="GNOME" value="yes"/>
        <set group="Plugin" attribute="Group" value="GNOME"/>
    </filter>
</anjuta>

Each plugin has to check its own description to do something a bit different.


* All this requires some changes in libanjuta and it will probably break the backward compatibility. I think we have to put in place a different version number for libanjuta and Anjuta to be sure that incompatible changes are tagged correctly.


What do you think about this?

You can only select that you want with the filter element, you cannot remove plugins, do you think it is enough?

Do you think, I need to keep the backward compatibility in libanjuta?


Regards,

Sébastien


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]