I repeat: I'm really not schizo, responding to my own emails! ;)
I cleaned up the example, and fixed the Makefile to work on both Linux and Win32. People can try it out if they want, to see a possible way(one of many good ones, I'm sure) that a plugin architecture for extensions might be implemented.
Bob Jamison wrote:
I made a small code example of loading dynamic extensions to something like Inkscape. I put a Zip file of the code here:
Basically this does plugin loading Netscape-style. It scans a directory for files beginning with a given prefix ("ix" in this case) and the proper suffix for a shared object (".so" on Unices, ".dll" on Win32).
It loads each object, finds a C function called CreateExtension. This is ---MUCH--- easier than linking to C++... Directly linking to a C++ resource on a shared object is fraught with DANGER!
It casts the resulting void * to an Extension object, which has virtual overloaded methods for any class extending it. It then calls a few methods on each one, just to show that it is honest.
The Makefile works on Linux. I'll make it work on Win32 later. It just needs to use the dlltool to make dll's instead of .so's. But it is Happy Hour right now, and I must keep my priorities straight!! ;-)
Hope this is helpful if considering methods of Inkscape extension.