Once you have either a KStyle or KThemeStyle derived class completed it is very easy to make a plugin. Here we will go over the three things you need to do: provide a few routines to identify and load the plugin, make a theme config file that uses the new style, and make a automake for it.
extern "C" {
KStyle* allocate();
int minor_version();
int major_version();
const char *description();
}
KStyle* allocate()
{
return(new MosfetStyle);
}
int minor_version()
{
return(0);
}
int major_version()
{
return(1);
}
const char *description()
{
return(i18n("Mosfet's plugin"));
}
This is all you need to do to make KDE be able to resolve and load your new style.
As noted in previous sections, KDE uses the widgetStyle key to load a style. In order to use your new style you need to make a theme configuration that uses it. Using the example above, let's assume it's an unthemed style derived from KStyle. Then we only need to provide something like the following and install it in KDE's share/apps/kstyle/themes directory:
This will tell KDE what the name of the style is, a comment to use in KDE Control Center, and what library to dynamically load in order to use it. If you have a fully themed style derived from KThemeStyle then you would need to provide a full theme configuration as described in this tutorial while setting the widgetStyle key to your plugin name instead of basicstyle.la.