From Compiz
monbasdomcn This page describes the Compiz API for use when writing plugins. The following information comes from compiz.h and experience.Example:
[edit] Plugin functions
Plugins are dynamic libraries which are loaded into Compiz using the function getCompPluginInfo() from the lib.
[edit] CompPluginVTable *getCompPluginInfo (void);
A function called by the compiz plugin loader which returns a VTable containing some properties of the plugin and references to functions that are called on different events.
[edit] struct CompPluginVTable
A struct containing essential information about the plugin.
- char *name the exact name of the plugin
- char *shortDesc a short description of the plugin
- char *longDesc a longer description of the plugin
- int getVersion(CompPlugin *plugin, int version) a function returning the ABI version (Compiz will fail to load plugin if this is not equal to version), compiz.h's version can be found in the ABIVERSION macro
- Bool init(CompPlugin *plugin) the initialisation function of the plugin, it is run when the plugin is loaded. Returns false on failure
- void fini(CompPlugin *plugin) the uninitialisation function of the plugin, it is run when the plugin is unloaded
- Bool initDisplay(CompPlugin *plugin, CompDisplay *display) a function run for every display when it is loaded. Returns false on failure
- void finiDisplay(CompPlugin *plugin, CompDisplay *display) a function run when the display is unloaded
- Bool initScreen(CompPlugin *plugin, CompScreen *screen) a function run for every screen when loaded. Returns false in failure
- void finiScreen(CompPlugin *plugin, CompScreen *screen) a function run when the screen is unloaded
- Bool initWindow(CompPlugin *plugin, CompWindow *window) a function run for every window when opened. Returns false on failure
- void finiWindow(CompPlugin *plugin, CompWindow *window) a function run when the window closes
- CompOption *getDisplayOptions(CompPlugin *plugin, CompDisplay *display, int *count) returns the options for the display and sets count to the numbers of options
- Bool setDisplayOption(CompPlugin *plugin, CompDisplay *display, char *name, CompOptionValue *value) a function to set a display option. Returns false on failure
- CompOption *getScreenOptions(CompPlugin *plugin, CompScreen *screen, int *count) returns the options for the screen and sets count to the number of options
- Bool setScreenOption(CompPlugin *plugin, CompScreen *screen, char *name, CompOptionValue *value) a function to set a screen option. Returns false on failure
- CompPluginDep *deps an array of dependencies, if a dependency fails the plugin is not loaded
- int nDeps the length of the deps array
1000 CompPluginFeature *features an array of features, basically an array of char arrays. I'm not sure what this does
- int nFeatures the length of the features array
