• Diff for "Development/Compiz++Documentation/C++vTable"
  • Immutable Page
  • Info
  • Attachments
Differences between revisions 1 and 2
Revision 1 as of 2009-01-13 01:40:52
Size: 1339
Editor: CPE-58-161-137-105
Comment:
Revision 2 as of 2009-01-13 01:41:41
Size: 1363
Editor: CPE-58-161-137-105
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
A plugin has to implement a VTable class that derives from the CompPlugin::VTable, CompPlugin::VTableForScreen <[Plugin screen class name]> or CompPlugin::VTableForScreenAndWindow <[Plugin screen class name],[Plugin window class name]> class. The ForScreen[AndWindow] classes provide automatic initialisation of the plugin classes. A plugin has then also to implement the {{{bool init ();}}} function. A plugin can implement the {{{CompOption::Vector & getOptions ();}}} and {{{bool setOption (const char *name, CompOption::Value &value); }}} functions or use the {{{ PLUGIN_OPTION_HELPER ([Plugin screen name]) }}} macro if it has implemented the {{{ CompOption::Vector & getOptions (); }}} and {{{ bool setOption (const char *name, CompOption::Value &value); }}} functions in its screen class. A plugin has to implement a VTable class that derives from the {{{CompPlugin::VTable}}}, {{{CompPlugin::VTableForScreen <[Plugin screen class name]>}}} or {{{CompPlugin::VTableForScreenAndWindow <[Plugin screen class name],[Plugin window class name]>}}} class. The {{{ForScreen[AndWindow]}}} classes provide automatic initialisation of the plugin classes. A plugin has then also to implement the {{{bool init ();}}} function. A plugin can implement the {{{CompOption::Vector & getOptions ();}}} and {{{bool setOption (const char *name, CompOption::Value &value); }}} functions or use the {{{ PLUGIN_OPTION_HELPER ([Plugin screen name]) }}} macro if it has implemented the {{{ CompOption::Vector & getOptions (); }}} and {{{ bool setOption (const char *name, CompOption::Value &value); }}} functions in its screen class.

VTable

A plugin has to implement a VTable class that derives from the CompPlugin::VTable, CompPlugin::VTableForScreen <[Plugin screen class name]> or CompPlugin::VTableForScreenAndWindow <[Plugin screen class name],[Plugin window class name]> class. The ForScreen[AndWindow] classes provide automatic initialisation of the plugin classes. A plugin has then also to implement the bool init (); function. A plugin can implement the CompOption::Vector & getOptions (); and bool setOption (const char *name, CompOption::Value &value);  functions or use the  PLUGIN_OPTION_HELPER ([Plugin screen name])  macro if it has implemented the  CompOption::Vector & getOptions ();  and  bool setOption (const char *name, CompOption::Value &value);  functions in its screen class. A plugin also has to call call the COMPIZ_PLUGIN_20081216 ([plugin name], [plugin vtable name])  macro in its code.

Example:

class FooPluginVTable :
    public CompPlugin::VTableForScreenAndWindow<FooScreen, FooWindow>
{
    public:

        bool init ();

        PLUGIN_OPTION_HELPER (FooScreen);

};

COMPIZ_PLUGIN_20081216 (foo, FooPluginVTable)

This macro will also create a [plugin name]VTable * variable, that allows the access to the plugin metadata class within the plugin.

Development/Compiz++Documentation/C++vTable (last edited 2009-01-13 01:41:41 by CPE-58-161-137-105)