[Kst] Plugin Interface

George Staikos staikos at kde.org
Mon Feb 16 23:46:48 CET 2004

   Barth and I discussed the idea of moving the plugin system to use variable 
arguments as proposed by Jean Marc and Claude.  While it does sound nice, 
there is one problem that we think might negate the value of this.  Plugins 
[can] resize vectors, and they have to pass back the size of the vector to 
Kst so it knows if it has been reallocated.  Kst tracks the size of vectors, 
so it needs this information.  Plugins also need to know the size of incoming 
vectors.  The solution that I can think of would look like this:

int myPlug(double *array1, int insize1, double *array2, int insize2, double 
scalar1, double **output1, int *size1, double **output2, int *size2, void 

The size arguments above make this format almost as much of a pain as the old 
interface.  Is there a better solution?  Is this solution enough added value 
to justify breaking all existing plugins?

   Andrew: What do you think of the interface right now, and what do you think 
would be better?

   In addition, do you think it would be useful to have "constructors" and 
"destructors" for plugins?  For instance, there could be two symbols in 
each .so that are used for this, say "create()" and "destroy()".  This could 
also be specified in the XML file if you want different names.

   What are your thoughts?

George Staikos
KDE Developer				http://www.kde.org/
Staikos Computing Services Inc.		http://www.staikos.net/

More information about the Kst mailing list