[compiz] Plugin Library Interface
Mike Dransfield
mike at blueroot.co.uk
Wed Mar 7 07:59:40 PST 2007
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.
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?
More information about the compiz
mailing list