[compiz] re-work option initialization

Dennis Kasprzyk onestone at beryl-project.org
Thu Mar 29 08:23:35 PDT 2007


Am Donnerstag, 29. März 2007 11:02 schrieb David Reveman:
> Dennis Kasprzyk and I have been discussing some changes to how options
> are initialized.
>
> Problems with how options are currently initialized.
>
> 1. Helper functions are not used to initialize options, which means that
> if we make a change to the option structure, all option initialization
> code needs to be updated. Using helper functions will also reduces the
> amount of duplicate code.
>
> 2. No convenient way to get the initial value of an option once it's
> been modified.
>
> 3. An option can't be initialized without compiz running.
>
>
> 2 and 3 are of interest to configuration backends that like to be able
> to do offline readout of option information and some kind of standard
> default value. 3, might be hard to provide for all kind of plugins as
> some might rely on a unique plugin loader to be present so I'm not sure
> that I want to recommend a configuration backend to do this. However,
> it's easy to provide for plugins built as shared libraries and I don't
> want to prevent anyone from doing this if they wish to.
>
>
> Here's our current idea for how we can solve these issues:
>
> Add
>
> typedef Bool (*InitPlugin(Display|Screen)OptionProc) (CompOption *o,
>                                                       int        index);
>
> or
>
> typedef Bool (*InitPlugin(Display|Screen)OptionsProc) (CompOption **o);
>
> and the number of display and screen options to the plugin vTable. I
> prefer the function prototype with the index as it's a bit more
> flexible.
>
> We can add a set of option initialization macros to compiz.h or helper
> functions to a library, which will make the initPluginOption function in
> each plugin minimal.
>
> Action options will be changed to contain a string or KeySym instead of
> the current key-code.
>
> - David
>
> _______________________________________________
> compiz mailing list
> compiz at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/compiz

Currently there are two types of configuration tools. Some with fixed 
functionality and some autogenerated. To improve the quality of the 
autogenerated tools I would like to make this proposal about additional 
values in the CompOption struct and the plugin vtable.

Additions to the CompOption struct:
char * group/char * subgroup : Ability to group sets of options and to give 
this sets a name.

char *hints : A semicolon separated list of string that inform the 
configuration tool to handle this option in a special way. A string value 
could have a hint "image" or "file" to inform the configuration tool to open 
a file dialog when the user wants to set this option. We all could workout 
here a set of hints, that all configuration tools would understand.

Additions to the plugin vTable:
char* category: A plugin can define to belong to a category like "effects" 
or "accessibility", so that a configuration tool can group plugins together. 
We could workout possible categories later here.

All this values would be optional and could be exposed over the dbus plugin or 
any other configuration system.

Dennis




More information about the compiz mailing list