[compiz] Plugin Library Interface

Danny Baumann dannybaumann at web.de
Wed Mar 7 08:17:55 PST 2007


Hi,

> Other than being notified when it is added or removed I
> don't see how it is beneficial.  Using a library would mean
> that the functionality could always be guaranteed.

There might be functionality which isn't needed to be guaranteed. The
animation subplugins were an example, the text plugin is another. Some
person might think that he doesn't need text display, so he can simply
disable it.

> I also think that your symbol lookup table could get really
> slow if there were more than 20 functions loaded, have you
> done any benchmarks on this?

Why should it be slow? Of course, plugins using library plugin functions
shouldn't look them up everytime they use it, but instead store a
function pointer when their updateLibraryPlugin routine is called.

> > And in Beryl, the text plugin is not only used by group, but also by
> > switcher and scale. I could provide a patch which adds text display
> > support (on hovering) to scale, but that patch would need the text
> > plugin which is a bit problematic if scale is considered a core plugin
> > and text isn't ;-)
> >   
> It would be very simple if it were just a library, there would
> be no need to port from and to compiz because the same library
> would work without modifications on both.

In my example, I wasn't talking about porting which of course is no
problem at all. I was talking about one plugin being inside the
"distribution" and the other being outside that distribution.

> It looks like the major advantage is that functions can be loaded
> and unloaded at runtime.  The major disadvantages being slowness,
> possibility of crashes and incompatibility.

Can you please elaborate on your concerns about slowness (see my
argument above), possibility of crashes (a versioning scheme could be
used) and incompatibility?

> Is the text plugin still integrated into the fileFromImage hooks or are
> you only using it as a library plugin now?

In Beryl, it's now used as library plugin only. The usage of the
fileFromImage interface was a slight abuse of that interface because a
pointer to the text data structure was passed as a file name. The
library plugin interface is suited much better for that kind of thing.

Regards,

Danny



More information about the compiz mailing list