Well, as most of us probably agree, library plugins is quite a needed thing for beryl, and having a proper way to do that can remove code duplication in different plugins, and make a consistent plugin behavior (for example, consistent animation physics)...
In irc onestone told us that he has an idea how to do it... Its very simple and straightforward, and IMO its also very good... ;)
Here is the general idea (again, the credit is for onestone ;) )
Library plugin interface:
struct CompLibraryFunction {
CompLibraryFunction *next;
CompLibraryFunction *prev;
char *name;
void *function;
}
add
CompLibraryFunction *libFunctions to CompDisplay;
a additional vtable entry libraryFunctionUpdated(CompDisplay *d, char *name);
a function addLibraryFunction(CompDisplay *d, char *name, void *function);
and a function removeLibraryFunction(CompDisplay *d, char *name, void *function);
Both would call libraryFunctionUpdated to ensure other plugins know about loading/unloading of functions.
Of course, each plugin will save pointers to the function it will use, and update them in libraryFunctionUpdated.
One additional thing i'd like to add to this idea is wrapping / unwrapping library functions.
What do you think?
btw, i wrote this mail and not onestone because onestone doesn't like writing mails, and he didn't care if i write it... :p