[gobject-introspection] Multiple libraries in the 'shared-library' parameter


I'm just looking at generating bindings for .NET and I've hit an
issue. For the .NET bindings you need to supply the native library
name along with the function to invoke. I've noticed that the gir
format likes to specify multiple library names in the shared-library
parameter, for example in Gtk-3.0.gir I have:
shared-library="libgtk-x11-3.0.so.0,libgdk-x11-3.0.so.0". This is not
directly bindable for .NET. The only way to bind this would be two
generate two functions and try to call both of them and catch any
exceptions which are thrown. This is pretty undesirable. Three ways I
can think of solving this are:

1) Treat 'shared-library' exactly as it's named - a place to store one
library name. If any function/alias/whatever in the namespace is *not*
found in that shared library, then an override could be attached as an
attribute specifying the actual library name to use.

2) Generate two namespaces in the gir file each specifying that the
name of the namespace is 'Gtk'. One namespace would specify
libgtk-x11-3.0.so.0 and list only the functions found there. The other
namespace would specify libgdk-x11-3.0.so.0 and list only the
functions found there.

3) Use an xml namespace to make it easy to distinguish which
type/function/whatever comes from which shared library.

Are any of these ideas worth pursuing?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]