[compiz] re-work option initialization

Mike Dransfield mike at blueroot.co.uk
Thu Mar 29 08:56:32 PDT 2007


David Reveman wrote:
> 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.
>   

Maybe we could create a whole library of extra helper
functions.  That way some people could do it without
the helpers, or you can use them for speed of development.

> 2. No convenient way to get the initial value of an option once it's
> been modified.
>   

No, this was my problem when writing ini.

The way I see it is that gconf should be able to revert to
the default easily, ini might need some work.

> 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);
>   


Are these to replace the current getOptions items
in the vtable?  Or are they more of a 'reset option' function?

Would it be possible to add a reference back to the plugin
as well so that plugin loaders can handle options for other
plugins?




More information about the compiz mailing list