[Compcomm] Building and using the compiz-plugins-premerge stuff
Danny Baumann
dannybaumann at web.de
Tue Apr 24 08:13:21 EDT 2007
Hi,
> On 4/24/07, Guillaume Seguin <guillaume at segu.in> wrote:
> > 1) bcop is an option parser for specific files (it now just works with
> > the xml metadata files) which can output the appropriate header and
> > source for option stuff.
>
> Yes, I know that, but how do you use it? What does it ACTUALLY do? How
> do I write code for it? Is there anything else I as a developer and
> user should know about the usage? What tasks does it handle that makes
> the world a better place and saves kittens?
To shed a bit of light on that:
As you all may know, it recently was decided on the Compiz ML to split
out plugin and option metadata (names, rules, restirctions etc.) into
separate XML files.
As you also may know, dealing with options in Compiz sometimes is
annoying: If you want to add an option, you have to add the default
defines, have to add code that initializes the option, add a
get(Display|Screen)Option and set(Display|Screen)Option...all in all a
lot of code to write.
This is where BCOP gets its part:
It takes the XML file which always is present and uses it to generate
the option dealing code. For this, it generates functions for retrieving
the option value (e.g. for an int option this could be
pluginGetSomeIntOption(CompScreen *) ). For action options, it generates
functions which can be used to register the action callbacks. If your
option requires some special handling, this can still be done by
requesting a notify when an option is changed.
Additionally BCOP handles the boring standard stuff like
add/removeScreenAction, matchUpdate and so on and so forth.
Another advantage is that if some API dealing with options is changed in
Compiz, only one place has to be changed (which is BCOP) instead of
having to change each and every plugin's code.
When it comes to usage:
- bcop --source=<source_file_to_generate> <xmlfile> generates the source
for the option dealing code
- bcop --header=<header_file_to_generate> <xmlfile> generates the
matching header file
A big load of information on how to use BCOP can be retrieved from
plugins using it; such as group. Any attempts to bring that usage
information into a written form are highly appreciated ;-)
Regards,
Danny
More information about the CompComm
mailing list