[compiz] Plugin Library Interface
Dennis Kasprzyk
onestone at beryl-project.org
Wed Mar 7 08:12:53 PST 2007
Am Mittwoch, 7. März 2007 16:59 schrieb Mike Dransfield:
> Danny Baumann wrote:
> >> What are the major pros/cons of using this method over plain old
> >> libraries?
> >
> > They plug into the normal plugin infrastructure and don't add the need
> > for plugin writers to mess around with dlopen(), dlsym() and such.
> > Basically, they work like normal libraries and look like a plugin. A
> > large advantage is that every plugin gets a notify whenever a library
> > plugin is loaded or unloaded.
>
> The amount of code in the text library is very small and
> seems like it would do just as well as a normal c library.
>
> 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.
>
The idea behind this is, that no new dependencies are needed in a plugin, if
you use this system. Currently text depends on cairo and pango, but each
plugin that uses the library interface does not need to depend on it. If the
text plugin is not available the text is simply not rendered. There could
also be another text plugin that uses qt to render the text.
> 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?
>
> >> Do you have any other library plugins other than text? Or what do you
> >> plan for other types of library plugin? It seems like only text and
> >> group use this at the moment.
> >
> > 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.
>
> 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.
>
> I think we would all welcome libraries which make plugin developers
> lives easier, maybe you could write a library which has lots of
> compiz/beryl helper functions. I suspect something like that, combined
> with a patch which uses the functionality in some plugins would be very
> useful.
>
> Is the text plugin still integrated into the fileFromImage hooks or are
> you only using it as a library plugin now?
The text plugin now only uses the library interface.
>
> _______________________________________________
> compiz mailing list
> compiz at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/compiz
More information about the compiz
mailing list