Page Tools

    Plugin Specific Control Parameter

    It is possible to associate _a_ specific control parameter file per plugin.

    Question: Is is enough?

    How to use it

    The ctrl file has a tag to associate a file to a plugin. For example, the following example associate the CCM control parameter ctrl-ccm.xml to the plugin CCM:

    <plugin name="CCM" file="tests/ctrl-ccm.xml"/>

    How to implement it

    The specific control parameter is handled as an XML file. This file is accessible from the plugin through the docs class member variable. Here is the steps to implement plugin specific control parameters.

    1. Create a XMLShema file specific to the plugin. Let call it ctrl-plugin.xsd
    2. Put it in the plugin directory
    3. Create a class that handles such XML file. Let call it ctrl_plug_t. This class must inherit from docs::xmlfile and should have a constructor with a xmlDocPtr argument (a pointer to the XML document in memory)
    4. From the plugin, the XML document is accessible through the docs class member variable (of type docs::dpl_info*):
      xmlDocPtr xml = docs->get_ctrlparams()->get_plugin_xml("CCM");
    5. Then, let construct an instance of the class that handles this document:
      ctrl_plug_t ctrl_plug  = new ctrl_plug(xml);

    Powered by Heliovista - Création site internet